Month: March 2025

  • Express JS Full Course Passport Authentication and MongoDB Integration in Express

    Express JS Full Course Passport Authentication and MongoDB Integration in Express

    The provided text is a comprehensive guide to building a RESTful API using Node.js and the Express framework. It covers fundamental concepts like handling different HTTP request methods (GET, POST, PUT, PATCH, DELETE), setting up routes and middleware, managing request and response objects, and implementing user authentication using Express Session and Passport. The text further explains how to integrate with a MongoDB database using Mongoose for data persistence and introduces unit and integration testing with Jest.

    Express.js Study Guide

    Quiz

    1. Explain the purpose of package.json and describe the significance of the type: “module” property and the start script.
    2. What is the role of the express() function, and how is it used to create an Express application instance? Describe the app.listen() method.
    3. Define what a route is in the context of Express.js. Explain the difference between the base route and other specific routes.
    4. Describe HTTP verbs (methods) and provide at least three examples. How are they used in Express to handle different types of requests?
    5. Explain the purpose and syntax of app.get(). What are the two primary arguments it accepts, and what do they represent?
    6. What are route parameters, and how are they defined and accessed in Express routes? Provide a simple example of a route with a parameter.
    7. Explain the concept of middleware in Express.js. What are the arguments passed to a middleware function, and what is the significance of the next() function?
    8. Describe the two ways middleware can be registered in Express.js. How does the order of middleware registration matter?
    9. What is an Express Router, and why is it useful for organizing routes in a larger application? Briefly explain how to create and register a Router.
    10. Explain the purpose of HTTP cookies. How can you set a cookie in an Express response and access cookies in a request?

    Quiz Answer Key

    1. package.json is a manifest file for Node.js projects that contains metadata about the project, including its name, version, dependencies, and scripts. Setting type: “module” enables the use of ECMAScript Modules (ESM) with import and export statements. The start script defines a command to run the application in a production-like environment using the node command.
    2. The express() function, when called, creates a new instance of the Express application. This instance, typically assigned to the app variable, provides methods for defining routes, middleware, and other application settings. The app.listen() method starts the Express server on a specified port, making it listen for incoming HTTP requests. It takes the port number and an optional callback function that executes once the server has started.
    3. A route in Express.js is a specific path on the server that is associated with a particular handler function. The base route is the root path of the application (e.g., /), while other specific routes are defined by appending segments to the base URL (e.g., /users, /products). Each route is designed to handle requests to that specific path.
    4. HTTP verbs (or methods) indicate the type of action the client wants to perform on the server’s resource. Examples include GET (retrieve data), POST (create new data), PUT (update existing data), PATCH (partially update existing data), and DELETE (remove data). In Express, different methods like app.get(), app.post(), etc., are used to define route handlers for specific HTTP verbs.
    5. app.get() is used to define a route that handles HTTP GET requests to a specific path. The first argument is a string specifying the path (route) to match. The second argument is the request handler, which is a function that takes two arguments: the request object (containing information about the incoming request) and the response object (used to send a response back to the client).
    6. Route parameters are dynamic segments in a route path used to capture values from the URL. They are defined by prefixing a segment with a colon (e.g., /users/:id). These values can be accessed within the route handler function using req.params, which is an object containing the named parameters as properties (e.g., req.params.id).
    7. Middleware in Express.js are functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle. The next() function is a callback that, when invoked, passes control to the next middleware function. If next() is not called, the request-response cycle is halted.
    8. Middleware can be registered globally using app.use() without a specific path, in which case it will be executed for every incoming request. It can also be registered for a specific route by passing the middleware function as an argument (or multiple arguments) to route handling methods like app.get(), app.post(), etc. The order of middleware registration is crucial because middleware functions are executed sequentially in the order they are defined.
    9. An Express Router is an object that acts like a mini Express application, capable of handling routes and middleware. It’s useful for organizing API endpoints based on domains or features, preventing a single file from becoming too large and unmanageable. To create a Router, you use const router = express.Router(). To register the Router with the main application, you use app.use(‘/some/path’, router), where all routes defined on the router will be prefixed with /some/path.
    10. HTTP cookies are small pieces of data that a web server sends to the user’s web browser. The browser may store these cookies and send them back to the server with later requests. You can set a cookie in an Express response using the res.cookie(‘name’, ‘value’, [options]) method. You can access cookies sent by the browser in a request using the req.cookies object, provided you have used the cookie-parser middleware.

    Essay Format Questions

    1. Discuss the request-response lifecycle in Express.js, emphasizing the role and flow of control through middleware functions and route handlers.
    2. Compare and contrast the different HTTP methods (GET, POST, PUT, PATCH, DELETE) and explain how they are typically used in building RESTful APIs with Express.js, providing relevant examples.
    3. Explain the importance of modularity and organization in developing large-scale Express.js applications. Discuss how Express Routers can be effectively utilized to achieve this, providing a hypothetical scenario.
    4. Describe the concept of state management in web applications, particularly focusing on the stateless nature of HTTP. Discuss how cookies and sessions can be used in Express.js to maintain user-specific state across multiple requests.
    5. Explain the significance of input validation in web application development. Describe how middleware, such as those provided by Express Validator, can be implemented in Express.js to ensure data integrity and security.

    Glossary of Key Terms

    • Entry Point: The primary file that is executed to start an application (e.g., index.js or index.mjs).
    • Script (in package.json): A command-line instruction that can be executed using npm run <script-name>.
    • Watch Mode: A development mode (often using tools like Nodemon) that automatically restarts the server when code changes are detected.
    • Production: The environment where the final, deployed version of the application runs.
    • CommonJS: The module system traditionally used in Node.js, utilizing require() for importing and module.exports for exporting.
    • ECMAScript Modules (ESM): The standardized module system in JavaScript, using import and export statements.
    • Module System: A mechanism for organizing and sharing code in JavaScript.
    • File Extension (MJS): The file extension used to explicitly indicate that a JavaScript file should be treated as an ECMAScript Module.
    • Module: A reusable unit of code.
    • Package: A directory containing a package.json file and the associated code and resources.
    • Import: To bring in code or functionality from another module or package.
    • Export: To make code or functionality available for use by other modules or packages.
    • Express: A minimal and flexible Node.js web application framework.
    • Application Instance (app): An object created by calling the express() function, representing the Express application.
    • Method (on app object): A function associated with the Express application instance (e.g., app.get(), app.listen(), app.use()).
    • Property (on app object): A data value associated with the Express application instance.
    • Listen Method (app.listen()): A method that starts the Express server and makes it listen for incoming requests on a specified port.
    • Port: A virtual communication endpoint on a computer’s network interface used by processes to listen for or send data.
    • Callback Function: A function that is passed as an argument to another function and is executed at a later point in time.
    • Global (in Node.js): Objects or variables that are available throughout the Node.js environment without requiring explicit import (e.g., process).
    • Environment Variables (process.env): Dynamic named values that can affect the way running processes will behave on a computer.
    • Logical OR Operator (||): A binary operator that returns the right-hand operand if the left-hand operand is falsy, otherwise it returns the left-hand operand.
    • Start Script: A script defined in package.json that typically runs the main application.
    • Nodemon: A utility that automatically restarts Node.js applications when file changes in the directory are detected.
    • Localhost: The standard hostname for the loopback network interface (IP address 127.0.0.1) of a computer, often used for testing web applications locally.
    • Route: A defined path on the server that is associated with a handler function.
    • Base Route: The root path of a website or application, typically represented by /.
    • Resolver: A function or piece of code that determines how to respond to a request for a specific route.
    • Endpoint: Often used synonymously with “route,” referring to a specific URL on the server that the client can access.
    • Host Name: The label assigned to a device connected to a computer network that is used to identify the device in various forms of electronic communication.
    • HTTP Request: A message sent from a client (e.g., a web browser) to a server to request a resource or trigger an action.
    • HTTP Verbs (Methods): Indicate the type of action the client wants to perform on the server’s resource (e.g., GET, POST, PUT, DELETE).
    • Client: An application (e.g., web browser, mobile app) that makes requests to a server.
    • Backend Server: The part of a web application that runs on the server and handles data storage, logic, and API requests.
    • HTTP Request Methods: See HTTP Verbs.
    • GET Request: An HTTP method used to retrieve data from the server.
    • POST Request: An HTTP method used to send data to the server to create a new resource.
    • PUT Request: An HTTP method used to update an existing resource on the server.
    • PATCH Request: An HTTP method used to partially update an existing resource on the server.
    • DELETE Request: An HTTP method used to remove a resource from the server.
    • Request Handler: A function that is executed when the server receives a request matching a defined route. It receives the request and response objects as arguments.
    • Request Object (req): An object containing information about the incoming HTTP request, such as headers, parameters, body, and cookies.
    • Response Object (res): An object used by the server to send a response back to the client, allowing you to set headers, status codes, and the response body.
    • Send Method (res.send()): A method on the response object used to send the HTTP response back to the client. It can send strings, HTML, JSON objects, etc.
    • JSON Object: A lightweight data-interchange format consisting of key-value pairs.
    • Status Code: A three-digit number in an HTTP response that indicates the outcome of the request (e.g., 200 OK, 404 Not Found).
    • Status Method (res.status()): A method on the response object used to set the HTTP status code for the response.
    • Chaining (Methods): Calling multiple methods on an object in sequence, where each method returns the object itself.
    • API Prefix: A common practice of starting API route paths with /api/ or similar to distinguish them from other application routes.
    • Route Parameters: Dynamic segments in a route path used to capture values from the URL (e.g., /users/:id).
    • Dynamic Data: Data that can vary based on input or conditions.
    • Middleware: Functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle.
    • Request Handler (as Middleware): A middleware function that handles an incoming request.
    • Next Argument (next): A function passed to middleware that, when called, passes control to the next middleware function in the stack.
    • Global Middleware: Middleware registered using app.use() without a specific path, applied to all routes.
    • Endpoint-Specific Middleware: Middleware applied only to specific routes, either by passing them as arguments to route handlers or using app.use() with a specific path.
    • Sequential Order: Middleware functions are executed in the order they are registered in the application.
    • Authorization Token: A credential used to verify the identity and permissions of a client making a request.
    • Status Code 401 (Unauthorized): An HTTP status code indicating that the client is not authenticated and needs to provide valid credentials.
    • Mock Users: Sample or simulated user data used for development and testing purposes.
    • Splice Method (Array): A JavaScript array method that changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.
    • Delete Count (splice): The number of elements to remove from the array when using the splice() method.
    • Thunder Client: A lightweight HTTP client extension for VS Code used to make API requests.
    • Not Found (404): An HTTP status code indicating that the server cannot find the requested resource.
    • Mozilla Docs (MDN): The official web documentation provided by Mozilla.
    • HTTP Request Methods (MDN): Documentation on various HTTP request methods and their purposes.
    • Head Method: An HTTP method that requests the same response as a GET request, but without the response body.
    • Connect Method: An HTTP method that establishes a tunnel to the server identified by the target resource.
    • Options Method: An HTTP method that describes the communication options for the target resource.
    • Trace Method: An HTTP method that performs a message loop-back test along the path to the target resource.
    • Mid Process: An intermediate step or function in a sequence of operations.
    • Logging Middleware: Middleware used to record information about incoming requests, such as the method and URL.
    • app.use(): A method used to register middleware functions with the Express application.
    • Sequential Order (Middleware): Middleware functions are executed in the order they are registered.
    • Route (app.get, app.post, etc.): A specific path and HTTP method combination that is handled by the application.
    • app.post(): A method used to define a route that handles HTTP POST requests.
    • app.put(): A method used to define a route that handles HTTP PUT requests.
    • app.patch(): A method used to define a route that handles HTTP PATCH requests.
    • app.delete(): A method used to define a route that handles HTTP DELETE requests.
    • Domain (API): A logical grouping of API endpoints based on a specific area of functionality (e.g., users, products).
    • Express Router: An object that allows you to create modular, mountable route handlers.
    • Routes Folder: A common directory in Express applications to organize route definitions.
    • users.mjs: A file containing route definitions related to user resources.
    • Import (Router): Bringing the Router class from the express module into a file.
    • Router Instance: An object created by calling express.Router().
    • Method (on Router): Functions associated with a Router instance (e.g., router.get(), router.post()).
    • Register (Router): Making the routes defined in a Router instance available to the main Express application using app.use().
    • Export (default): Making a single value the primary export of a module.
    • Index.mjs (routes): A common file within a routes directory used to aggregate and export all defined routers.
    • Utils Folder: A directory to store utility functions and constants used throughout the application.
    • Constants File: A file (e.g., constants.mjs) to store constant values used in the application.
    • Named Export: Exporting specific variables or functions from a module using their names.
    • Middlewares File: A file (e.g., middlewares.mjs) to store reusable middleware functions.
    • Products Router: A Router instance specifically for handling product-related routes.
    • Barrel File: A module that re-exports other modules, providing a single point of import for a set of modules.
    • Prefix (for Routes): A base path added to all routes defined within a specific Router when it’s mounted using app.use().
    • HTTP Cookies: Small pieces of data that a web server sends to the user’s web browser, which may then be stored by the browser and sent back to the server with subsequent requests.
    • Thunder Client (Cookies Section): A part of the Thunder Client interface that allows you to view and manage cookies associated with a particular domain.
    • Response (Set-Cookie Header): When a server wants to set a cookie in a user’s browser, it includes a Set-Cookie header in its HTTP response.
    • Browser (Cookie Storage): Web browsers have a mechanism to store cookies received from servers, usually associated with the domain that set them.
    • Request (Cookie Header): When a browser makes a request to a server, it automatically includes any cookies associated with that server’s domain in the Cookie header of the HTTP request.
    • Stateless (HTTP): The property of the HTTP protocol where the server does not retain any information about past client requests. Each request is treated as independent.
    • E-commerce Website (Cart System): A common application where cookies are used to maintain a user’s shopping cart even if they close and revisit the website.
    • Authentication: The process of verifying the identity of a user.
    • Sessions: A mechanism to maintain state across multiple requests from the same user, typically using a session ID stored in a cookie.
    • Cookie Method (res.cookie()): An Express response object method used to set a cookie in the Set-Cookie header of the HTTP response. It takes the cookie name, value, and optional options as arguments.
    • Expiration (Cookie): The date and time at which a cookie will no longer be valid and will be discarded by the browser.
    • Max-Age (Cookie Option): A cookie option that specifies the lifespan of the cookie in seconds.
    • Domain (Cookie Option): A cookie option that specifies the domain for which the cookie is valid.
    • HTTPOnly (Cookie Option): A cookie option that, when set to true, prevents client-side scripts from accessing the cookie.
    • Secure (Cookie Option): A cookie option that, when set to true, ensures the cookie is only transmitted over HTTPS.
    • Request Object (req.headers.cookie): The Cookie header in the request object, which contains a string of all cookies sent by the browser for the current domain.
    • Parsing (Cookies): The process of converting the raw Cookie header string into a more usable format, typically an object where each cookie name is a key.
    • Cookie Parser Middleware (cookie-parser): An Express middleware that parses the Cookie header and populates req.cookies with an object containing the cookie names and values.
    • Third-Party Package: A module or library developed by someone other than the core framework developers.
    • npm (Node Package Manager): The default package manager for Node.js.
    • Install (npm install or npm i): The command used to download and install packages from npm.
    • Middleware (cookie-parser): The cookie-parser package provides a middleware function that needs to be registered with the Express application using app.use().
    • req.cookies: An object added to the request object by the cookie-parser middleware, containing the parsed cookies.
    • Conditional Logic: Using if statements or other control flow structures to execute different code based on certain conditions.
    • Status Code 403 (Forbidden): An HTTP status code indicating that the server understands the request but refuses to authorize it.
    • Status Code 401 (Unauthorized): An HTTP status code indicating that the client is not authenticated.
    • Signed Cookies: Cookies that have a digital signature to prevent tampering.
    • Secret (for Signed Cookies): A secret key used to generate and verify the signatures of signed cookies. This needs to be passed to the cookie-parser middleware.
    • res.cookie() (signed option): When the signed option is set to true in res.cookie(), a signed cookie is set.
    • req.signedCookies: An object added to the request object by the cookie-parser middleware (when configured with a secret), containing the parsed and verified signed cookies.
    • Session: A mechanism to maintain state for a user across multiple HTTP requests. It typically involves storing user-specific data on the server and associating it with a unique session ID that is usually stored in a cookie on the client’s browser.
    • express-session: An Express middleware that creates and manages session data.
    • Session ID: A unique identifier generated by the server for each user’s session. This ID is typically stored in a cookie sent to the user’s browser.
    • Session Store: The storage mechanism on the server where session data is persisted. By default, express-session uses an in-memory store, but for production environments, persistent stores like databases are recommended.
    • app.use(session(…)): How the express-session middleware is registered with the Express application.
    • secret (session option): A string used to sign the session ID cookie, preventing client-side tampering. This should be a complex, randomly generated string in a production environment.
    • saveUninitialized (session option): When set to true, a new but unmodified session will be saved to the store. Setting it to false is recommended to avoid storing unnecessary sessions.
    • resave (session option): When set to true, the session will be saved back to the session store on every request, even if it wasn’t modified. Setting it to false is often preferred to avoid unnecessary writes to the store.
    • cookie (session option): An object that allows you to configure the properties of the session ID cookie, such as maxAge, httpOnly, and secure.
    • req.session: An object attached to the request object by the express-session middleware. It is used to store and access session data specific to the current user.
    • Dynamic Property (on req.session): You can add custom properties to the req.session object to store user-specific data.
    • In-Memory Store (Session): The default session store used by express-session, which stores session data in the server’s memory. This is not suitable for production environments with multiple server instances or restarts.
    • Persistent Session Store: A session store that persists data across server restarts and can be shared between multiple server instances (e.g., using databases like Redis, MongoDB, or PostgreSQL).
    • req.session.destroy(): A method to end the current session and remove the associated session data from the store.
    • req.sessionStore: An object representing the underlying session storage mechanism.
    • req.sessionStore.get(sid, callback): A method on the session store to retrieve session data associated with a given session ID (sid).
    • npm install mongodb: The command to install the official MongoDB driver for Node.js.
    • MongoDB: A popular NoSQL database.
    • Database Connection: The process of establishing a link between an application and a database server.
    • Connection URI (MongoDB): A string that specifies how to connect to a MongoDB database, including the protocol, hostname, port, database name, and authentication credentials if required.
    • mongoose: A popular Object Data Modeling (ODM) library for MongoDB and Node.js. It provides a higher-level abstraction for interacting with MongoDB.
    • ODM (Object Data Modeling): A programming technique that maps objects to a database schema.
    • Schema (Mongoose): A blueprint for the structure of documents in a MongoDB collection, defining the data types, validators, and other properties of the fields.
    • Model (Mongoose): A class that represents a MongoDB collection and provides an interface for creating, querying, updating, and deleting documents. It is created from a Mongoose schema.
    • mongoose.Schema({…}): Used to define a new Mongoose schema.
    • Data Type (Mongoose): Specifies the type of data that a field in a Mongoose schema can hold (e.g., String, Number, Boolean).
    • Validator (Mongoose): Functions or objects that define rules for the values that can be saved in a field of a Mongoose schema (e.g., required, unique, minlength, maxlength).
    • required: true (Validator): Ensures that a field must have a value.
    • unique: true (Validator): Ensures that the values in a field are unique across all documents in the collection.
    • minlength and maxlength (Validators): Specify the minimum and maximum length for string fields.
    • mongoose.model(modelName, schema): Used to create a Mongoose model from a defined schema.
    • try…catch Block: A JavaScript construct used for error handling. Code that might throw an error is placed in the try block, and code to handle the error is placed in the catch block.
    • async and await: Keywords in JavaScript used to work with asynchronous operations in a more synchronous-like manner. async marks a function as asynchronous, and await pauses the execution of an async function until a Promise is resolved.
    • Asynchronous Operation: An operation that does not block the execution of the program while it is in progress. It typically relies on callbacks, Promises, or async/await to handle the result.
    • Promise: An object representing the eventual completion (or failure) of an asynchronous operation and its resulting value.
    • new Model({…}): Creating a new document instance of a Mongoose model.
    • Constructor (Class): A special method for creating and initializing an object created with a class.
    • document.save() (Mongoose): An asynchronous method on a Mongoose document instance that saves the document to the MongoDB database.
    • Status Code 201 (Created): An HTTP status code indicating that the request has succeeded and a new resource has been created as a result.
    • Status Code 400 (Bad Request): An HTTP status code indicating that the server could not understand the request due to invalid syntax or other client-side error.
    • Duplicate Key Error (MongoDB): An error thrown by MongoDB when trying to insert a document with a value for a field marked as unique that already exists in the collection.
    • Express Validator: A library for validating and sanitizing user input in Express.js applications.
    • checkSchema(schema): A function from Express Validator that creates a middleware to validate request data against a provided schema.
    • Validation Schema (Express Validator): An object that defines the validation rules for different fields of the request (e.g., body, query, params).
    • validationResult(req): A function from Express Validator that retrieves the validation errors that occurred during the schema check.
    • .isEmpty() (Validation Result): A method on the validation result object that returns true if there are no validation errors, and false otherwise.
    • .array() (Validation Result): A method on the validation result object that returns an array of validation errors.
    • matchedData(req): A function from Express Validator that extracts the validated data from the request, according to the validation schema.
    • bcrypt: A library for password hashing.
    • Password Hashing: The process of transforming a plain-text password into a fixed-size string of characters using a cryptographic hash function. This makes it computationally infeasible to retrieve the original password from the hash.
    • bcrypt.hashSync(password, salt): A synchronous function from bcrypt that hashes a password using a generated salt.
    • salt (bcrypt): A randomly generated string that is added to each password before it is hashed. This makes it more difficult for attackers to use pre-computed tables of hashes (rainbow tables).
    • saltRounds (bcrypt): A parameter that controls the computational cost of the hashing process. Higher rounds provide more security but take longer to compute.
    • bcrypt.compareSync(plainTextPassword, hashedPassword): A synchronous function from bcrypt that compares a plain-text password with a stored hash to see if they match.
    • Unit Testing: A software testing method by which individual units of source code (the smallest testable parts of an application) are tested to determine whether they are fit for use.
    • jest: A popular JavaScript testing framework.
    • Test Suite (describe): A block of code in a test file that groups together related tests, typically for a specific component or functionality.
    • Test Case (it or test): An individual test that focuses on a specific aspect or behavior of the code being tested.
    • Assertion (expect): A statement in a test that verifies a certain condition or outcome. If the assertion fails, the test is considered failed.
    • Mocking: Replacing dependencies of the code being tested with controlled test doubles (mocks) to isolate the unit under test and control its behavior.
    • Mock Request (mockRequest): A simulated request object used in unit tests, containing only the properties and methods relevant to the code being tested.
    • Mock Response (mockResponse): A simulated response object used in unit tests, providing mock implementations of methods like status() and send() to observe how the code under test interacts with the response.
    • jest.fn(): A Jest function that creates a mock function, which can be used to track calls, arguments, and return values.
    • mockResponse.status.mockReturnValue(value): Setting the return value of the mocked status() method.
    • mockResponse.send.mockImplementation(value): Setting the implementation of the mocked send() method, allowing you to observe what data is being sent.
    • expect(mockFunction).toHaveBeenCalled(): A Jest assertion that verifies if a mock function has been called.
    • expect(mockFunction).toHaveBeenCalledWith(…args): A Jest assertion that verifies if a mock function has been called with specific arguments.
    • expect(mockFunction).toHaveBeenCalledTimes(number): A Jest assertion that verifies how many times a mock function has been called.
    • expect(mockFunction).mock.calls: An array containing all the calls that were made to a mock function. Each call is represented by an array of arguments passed to the mock.
    • expect(value).toBe(expected): A Jest matcher that performs a strict equality check.
    • Dependency Injection: A software design pattern in which an object receives other objects that it depends on (dependencies) instead of creating them itself. This makes code more testable and modular.
    • Implementation Detail: A specific way in which a piece of code is implemented, which might not be relevant to the overall behavior being tested.
    • Behavioral Testing: A testing approach that focuses on verifying the observable behavior of the code under test, rather than its internal implementation details.
    • jest.mock(‘moduleName’, factory): A Jest function used to mock an entire module. The factory argument is a function that returns the mock implementation of the module’s exports.
    • clearMocks (Jest Config): A Jest configuration option that, when set to true, automatically resets the state of all mocked functions before each test.
    • beforeEach(() => {…}): A Jest hook that runs a provided function before each test within a describe block. It can be used to set up test data or reset mocks.
    • End-to-End (E2E) Testing: A testing methodology used to test an application’s workflow from start to finish, simulating real user scenarios and verifying that all integrated components work correctly together.
    • SuperTest: A library for testing web applications by making HTTP requests to them and asserting the responses.
    • Test Script (E2E): A script in package.json specifically for running end-to-end tests.
    • request(app) (SuperTest): A function from SuperTest that creates an agent for making requests to a given Express application instance.
    • .get(path) (SuperTest Agent): A method on the SuperTest agent to make an HTTP GET request to a specified path.
    • .expect(status) (SuperTest Response): A method on the SuperTest response object to assert the expected HTTP status code.
    • .expect(body) (SuperTest Response): A method on the SuperTest response object to assert the expected response body.
    • .end((err, res) => {…}) (SuperTest Request): A method to execute the HTTP request and receive the response in a callback function.
    • async and await (with SuperTest): Using async/await with SuperTest allows you to handle the asynchronous nature of HTTP requests in a more straightforward way, making it easier to work with the response.
    • Response Object (SuperTest): The object returned after making a request with SuperTest, containing properties like status, body, and headers.
    • .toStrictEqual(value) (Jest Matcher): A Jest matcher that performs a strict equality check on all levels, including object properties and array elements.
    • .toBeEmptyObject() (Jest Matcher): A Jest matcher that checks if a value is an empty object.
    • Test Environment (Node): Configuring Jest to run tests in a Node.js environment, suitable for server-side JavaScript code.
    • Transform (Jest Config): A Jest configuration option that specifies how to transform source files before running tests, often used to handle non-standard JavaScript syntax (e.g., ESM in a CommonJS environment).
    • @babel/preset-env: A Babel preset that allows you to use the latest JavaScript features without needing to micromanage which syntax transforms (plugins) are needed by your target environment(s).
    • targets: { node: ‘current’ } (Babel Config): A configuration in @babel/preset-env that tells Babel to transpile JavaScript to the version supported by the current Node.js environment where the tests are being run.
    • Babel (@babel/core, @babel/cli, etc.): A JavaScript transpiler that converts ECMAScript 2015+ code into a backwards compatible version of JavaScript that can be run by older JavaScript engines.
    • babel-jest: A Jest preprocessor that uses Babel to transform your test files.
    • Module File Extensions (Jest Config): A Jest configuration option that specifies the file extensions to consider as modules.
    • .babelrc: A configuration file for Babel, where you can specify presets and plugins to use for transpilation.
    • npm init -y: A command to quickly initialize a new Node.js project and create a package.json file with default settings.
    • @jest/globals: A package that provides global Jest functions like describe, it, expect, etc., for environments where they are not automatically available.
    • @types/jest: TypeScript type definitions for the Jest API, providing better type checking and autocompletion in editors.
    • jsconfig.json: A configuration file that specifies the root files and the options for the JavaScript language service provided by VS Code.
    • Type Acquisition (VS Code): A feature in VS Code that automatically downloads and configures type definition files (.d.ts) for JavaScript projects, improving IntelliSense.

    Express.js Web Server Development Fundamentals

    ## Briefing Document: Review of Provided Sources

    This document provides a detailed review of the main themes, important ideas, and facts presented in the provided excerpts from “01.pdf”. The source primarily focuses on setting up a basic web server using Express.js, defining routes, handling HTTP request methods, implementing middleware, organizing routes with Express Router, working with HTTP cookies and sessions, performing input validation, integrating with MongoDB, hashing and comparing passwords using bcrypt, and finally, introducing unit and end-to-end testing with Jest and SuperTest.

    ### Main Themes:

    1. **Express.js Fundamentals:** The initial sections detail the foundational steps for creating an Express.js application, including setting up the entry point, using `package.json` for script management and ES Modules, importing the Express module, creating an application instance, and starting the server with the `listen` method.

    2. **Route Definition and HTTP Methods:** A significant portion of the content explains how to define routes in Express using different HTTP verbs (GET, POST, PUT, PATCH, DELETE) and how to handle requests to these routes using request handler functions with `request` and `response` objects.

    3. **Middleware Implementation:** The concept of middleware in Express.js is introduced, demonstrating how to create and register middleware functions globally or for specific routes. The importance of the `next()` function in the middleware pipeline is emphasized.

    4. **Route Organization with Express Router:** The document illustrates how to use the Express Router to modularize and organize API endpoints based on domains (e.g., users, products), promoting better code structure and maintainability.

    5. **HTTP Cookies and Sessions:** The use of HTTP cookies for maintaining client-side state is explained, along with how to set, retrieve (using `cookie-parser` middleware), and manage cookie properties like expiration. Sessions are introduced as a server-side mechanism for tracking user activity, utilizing the `express-session` middleware.

    6. **Input Validation:** The importance of validating incoming request data is highlighted, demonstrating the use of `express-validator` for defining validation schemas and checking for validation errors within request handlers.

    7. **MongoDB Integration:** The excerpts cover the basic steps of connecting an Express.js application to a MongoDB database using Mongoose, defining schemas, creating models, and performing CRUD operations (specifically creation).

    8. **Password Hashing with Bcrypt:** The document explains the necessity of hashing passwords before storing them in a database for security reasons and demonstrates how to use the `bcrypt` library for generating password hashes and comparing them during login.

    9. **Unit and End-to-End Testing:** The final sections introduce the concepts of unit and end-to-end testing. Jest is presented as a testing framework for writing unit tests, focusing on testing individual functions in isolation by using mocks. SuperTest is introduced as a library for performing end-to-end tests, simulating HTTP requests to the application’s routes.

    ### Most Important Ideas and Facts:

    * **ES Modules:** Setting `”type”: “module”` in `package.json` enables the use of modern `import` and `export` statements, requiring `.mjs` file extensions.

    > “I’m going to go ahead and set this type property and you can see that there’s two values uh commonjs or module I’m going to set it to module and what this will allow me to do is use esm as my module system so that way I can use the modern import export statements instead of having to use require to import modules and module that exports to export stuff.”

    * **Express Application Instance:** The `express()` function returns an instance of an Express application, which is used to define routes and middleware.

    > “now the imported value of this Express name is actually a top level function and we need to call this function in order to create an express application so what I’m going to do is I’m going to first declare a variable […] I’ll call it app and then I’m just simply going to reference Express and then invoke that function by using parentheses and that’s all.”

    * **`app.listen()`:** This method starts the Express server on a specified port, allowing it to listen for incoming HTTP requests.

    > “the method that we need to call is the listen method and this pretty much allows you to listen to a port for incoming requests. This is actually what starts up the express server on a specific port and then you can begin receiving incoming HTTP requests.”

    * **Routes and Request Handlers:** Routes are paths defined on the server, and request handlers are callback functions that execute when a specific route is accessed with a particular HTTP method.

    > “a route in general is think of it like a path in your express application so determining which path you want to take gives you different outputs.”

    > “the request Handler is just a function but in this case it’s a callback function so it would look like this so I’ll pass a simple arrow function and this callback function has two arguments okay it has a request argument which is the request object itself […] now the second argument is the response object the response object is what you can use to modify the response and send it back to the user…”

    * **HTTP Verbs:** Different HTTP methods (GET, POST, PUT, PATCH, DELETE) indicate the desired action to be performed on a resource.

    > “these verbs pretty much are ways on how you can tell the server to perform some operation. So for example you don’t always want to just get data sometimes you might want to create data […] sometimes you want to update data sometimes you want to delete data…”

    * **Middleware:** Middleware functions have access to the `request`, `response`, and `next` function, allowing them to modify requests and responses, execute code, and pass control to the next middleware in the stack.

    > “in the context of expressjs a middleware is just a function that can have logic but the middleware function also is a request Handler as as well so that middleware function has the request response arguments as well and you can actually use the middleware function to return a response if you want to.”

    > “the middleware function or the request Handler function also has access to this next argument which is a function that you call when you are done with the middleware.”

    * **`app.use()`:** Used to register middleware functions globally or for specific routes. Order of registration matters.

    > “Let’s call app.use to register our middleware globally so all I do is I just pass in logging middleware as a function or as an argument like this.”

    > “middleware must be registered before a route if you’re using app.use register it.”

    * **Express Router:** Provides a way to create modular, mountable route handlers, allowing for better organization of API endpoints.

    > “we can use an Express router to do this and what I’ll do is I’ll create a new folder inside the source folder and I’ll call this routes and then I’m going to go ahead and create a new file and call it users. MJS and then inside users. MJS we’re going to import the router from Express…”

    * **HTTP Cookies:** Small pieces of data that the server sends to the client’s browser, which the browser can store and send back to the server with subsequent requests. Useful for maintaining state in a stateless HTTP environment.

    > “cookies or HTTP cookies they’re literally just small pieces of data that your web server sends to the browser…”

    > “remember that HTTP is stateless and using cookies enables the server to send a cookie to the web browser and that cookie typically is going to be some unique value so that way the server when they receive it they can distinguish whose cookie this belongs to and then they can send Dynamic data based on the cookie value.”

    * **`cookie-parser` Middleware:** Parses the `Cookie` header in the incoming request, populating `req.cookies` with an object keyed by the cookie names.

    > “we can actually use a third-party package called cookie parser to parse the cookies for us.”

    * **Signed Cookies:** Cookies that are cryptographically signed to prevent tampering. Require a secret key for signing and parsing.

    > “if you ever need to set sign cookies which like I said earlier it has a signature uh you can go ahead right over here and set signed to True Whenever you set the cookie but in order for you to actually uh parse cookies that are signed you must you must you must provide a secret…”

    * **`express-session` Middleware:** Creates and manages server-side sessions, typically using cookies to store a session identifier on the client.

    > “sessions represent the duration of a user on a website by default HTTP is stateless we don’t know who is making requests to our server so we need to be able to track requests and know where they are coming from. One common usage of sessions is to manage user authentication.”

    > “we’ll get started in implementing sessions using the express session Library…”

    * **Input Validation with `express-validator`:** A library for validating and sanitizing request data based on defined schemas.

    > “I want to show you all how we can use a very popular package called Express validator to make input validation a lot more easier.”

    > “this middleware does not actually throw an error we need to go inside the request Handler and actually check if there are any errors.”

    * **MongoDB and Mongoose:** Mongoose is an Object Data Modeling (ODM) library for MongoDB and Node.js, providing a higher-level abstraction for interacting with the database.

    > “Now I’m going to show you all how we can actually integrate our Express application with a real database in this case we’re going to be using mongodb…”

    > “Mongoose is an object data modeling library that provides a straightforward schema based solution to model your application data.”

    * **Password Hashing with `bcrypt`:** A library for securely hashing passwords using the bcrypt algorithm.

    > “you want to make sure you always hash your passwords before you save it to the database…”

    > “first let’s go ahead and install bcrypt…”

    * **Unit Testing with Jest:** A JavaScript testing framework used to test individual units of code in isolation. Involves mocking dependencies to avoid external interactions.

    > “the next topic that I want to talk about is testing and specifically unit testing so what exactly is unit testing well unit testing is a software testing method by which individual units of source code test for determining whether they are fit for use.”

    > “we’re going to install a couple of dependencies so I’m going to type npmi hyphen capital D CU I’m going to install these as Dev dependencies so the packages are at Babel slore Babel code at Babel slpre EnV so that’s it for Babel we then need to install just as well…”

    * **End-to-End Testing with SuperTest:** A library for testing HTTP endpoints by making actual requests to the application and asserting on the responses.

    > “for our end to end test we’re going to be using a very popular package called super test.”

    > “end to end testing is a methodology used to test an application flow from start to finish.”

    This briefing document summarizes the key concepts and procedures outlined in the provided source, offering a comprehensive overview of building a backend API with Node.js, Express.js, and related technologies, including database integration, security measures, and testing strategies.

    Express.js API Development Fundamentals

    1. What is the purpose of the package.json file configurations shown, specifically the type property and the start script?

    The package.json file is the manifest for the Node.js project. The type property is set to module, which enables the use of ECMAScript Modules (ESM) syntax (i.e., import and export) instead of the CommonJS require and module.exports. To use ESM, the file extension for JavaScript files needs to be .mjs. The scripts section defines executable commands. Here, a start script is created to run the application using the node command, typically used for production deployments where a file watcher (like Nodemon) is not needed.

    2. How is an Express application instance created and configured to listen for incoming requests?

    An Express application instance is created by first importing the express module and then invoking the imported Express function. This returns the application object, which is typically stored in a variable (e.g., app). To configure the application to listen for incoming HTTP requests, the app.listen() method is used. This method takes the port number as its first argument and optionally a callback function as its second argument. The callback function is executed once the server has started listening on the specified port, often used for logging or other post-startup operations. It’s best practice to configure the port using an environment variable (process.env.PORT) with a default value (e.g., 3000) for flexibility.

    3. What are routes in Express, and how are they defined for handling different types of HTTP requests?

    Routes in Express define how the application responds to client requests to specific endpoints (URIs) and HTTP request methods (verbs). A route is associated with a path (e.g., /, /api/users) and one or more handler functions. Routes are defined using methods on the Express application object that correspond to HTTP verbs, such as app.get() for handling GET requests, app.post() for POST requests, app.put() for PUT requests, app.patch() for PATCH requests, and app.delete() for DELETE requests. Each of these methods takes the route path as the first argument and a request handler function (or a series of middleware functions and a handler) as the subsequent argument(s). The request handler function receives request and response objects, allowing you to access request details and send responses back to the client.

    4. Explain the roles of the request and response objects within a route handler function in Express.

    The request object in a route handler function contains all the information about the incoming HTTP request from the client. This includes headers, the request body (if any), query parameters, route parameters, cookies, and metadata about the connection. You can access these details through various properties of the request object (e.g., request.headers, request.body, request.params, request.cookies).

    The response object is used to send data back to the client. It provides methods for controlling the response, such as setting the HTTP status code (response.status()), sending data as the response body (response.send(), response.json()), setting headers (response.set()), and setting cookies (response.cookie()). Route handlers must ultimately use the response object to end the request-response cycle by sending a response back to the client.

    5. What are route parameters in Express, and how are they used to handle dynamic data in URLs?

    Route parameters are named URL segments that are used to capture values specified at their position in the URL. They are defined in the route path by prefixing the parameter name with a colon (e.g., /api/users/:id). When a client makes a request to a URL that matches this pattern, the value in the parameter segment is captured and made available in the request.params object within the route handler function. This allows you to create dynamic routes where different data can be accessed based on the specific value in the URL. For example, /api/users/123 would make the value 123 accessible as request.params.id.

    6. What is middleware in Express, and how can it be used to handle tasks like logging, authentication, or data processing before route handlers?

    Middleware in Express are functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle. Middleware functions can perform various tasks such as logging requests, authenticating users, validating data, and modifying the request or response objects. They can terminate the request-response cycle by sending a response, or they can pass control to the next middleware function in the stack by calling next().

    Middleware can be registered globally for all routes using app.use() or locally for specific routes by passing the middleware function as an argument when defining a route (e.g., app.get(‘/path’, middlewareFunction, routeHandler)). The order in which middleware is registered is crucial, as they are executed in the order they are added to the application.

    7. How can Express Routers be used to organize API endpoints into logical groups and keep the main application file cleaner?

    Express Routers are isolated instances of middleware and routes. They allow you to group related API endpoints together and define their handlers within a separate file or module. To use a Router, you first create an instance using express.Router(). Then, you can define routes on this router instance using the same HTTP method functions (router.get(), router.post(), etc.) as you would on the main application object. Finally, you mount the router to a specific path in your main application using app.use(‘/api/resource’, resourceRouter). This will apply all the routes defined in resourceRouter under the /api/resource path. Using routers helps to modularize your application, making it easier to manage and understand as the number of endpoints grows.

    8. Explain the purpose and basic usage of HTTP cookies in Express for maintaining client-server state.

    HTTP cookies are small pieces of data that a web server sends to a user’s web browser. The browser may store these cookies and send them back to the server with subsequent requests made to the same server. Cookies are often used to remember information about the user, such as session tokens, preferences, or shopping cart contents, thus allowing the server to maintain state for otherwise stateless HTTP connections.

    In Express, you can set cookies on the response object using response.cookie(‘name’, ‘value’, [options]). The options argument can include properties like maxAge (in milliseconds), expires (a Date object), httpOnly, secure, and signed. To access cookies sent by the browser, you typically use the cookie-parser middleware. Once installed and used with app.use(cookieParser()), it populates the request.cookies object with the parsed cookies. For signed cookies (where the value is cryptographically signed), you would use response.signedCookie() to set them and request.signedCookies to access them, after configuring a secret with the cookie-parser middleware. Cookies are essential for implementing features like user sessions and persistent settings.

    Express.js and HTTP Request Methods

    The sources discuss several HTTP request methods used in building web APIs, particularly within the context of the Express.js framework. Here’s a breakdown of these methods based on the provided information:

    • GET:
    • Used to retrieve data from the server in a read-only format without manipulating any data on the server side.
    • Clients make GET requests to fetch resources. For example, an e-commerce website might use a GET request to display a list of products.
    • Data can be sent to the server through the URL using query strings or query parameters. These are key-value pairs appended to the URL after a question mark (?), separated by ampersands (&). Express.js parses the query string into a JSON object accessible via request.query. This can be used for filtering or sorting data on the server before sending it back.
    • In Express.js, GET requests are handled using app.get(). This method takes a route path and a request handler function as arguments. The request handler receives a request object (containing information about the incoming request) and a response object (used to send data back to the client).
    • The response.send() method is used to send back data, which can be plain text, JSON objects, or arrays. The response.status() method can be used to set the HTTP status code of the response (e.g., 200 for success).
    • POST:
    • Used to create new data or resources on the server.
    • When a client (e.g., a web form) wants to send data to the server to be stored (e.g., creating a new user), it makes a POST request.
    • The data to be sent is included in the request body or payload of the HTTP request.
    • Express.js, by default, does not parse request bodies. Middleware like express.json() needs to be used to parse JSON request bodies. This makes the data available in the request.body property of the request object.
    • In Express.js, POST requests are handled using app.post(). It takes a route path and a request handler function.
    • A successful POST request typically returns a 201 status code (Created). The server might also return the newly created resource in the response body.
    • PUT:
    • Used to update an existing resource on the server.
    • A PUT request is intended to replace the entire target resource with the data provided in the request body. If a field is not included in the request body during a PUT request, it might be removed or set to null on the server, depending on the backend implementation.
    • In Express.js, PUT requests are handled using app.put(), taking a route path (often including a route parameter to identify the resource to update, e.g., /api/users/:id) and a request handler.
    • PATCH:
    • Also used to update an existing resource on the server, but unlike PUT, it’s for partial updates.
    • With PATCH, you only need to send the specific fields that you want to modify in the request body, leaving the other fields untouched.
    • In Express.js, PATCH requests are handled using app.patch(), similar to PUT, often with a route parameter to specify the resource.
    • A successful PUT or PATCH request might return a 200 (OK) or 204 (No Content) status code.
    • DELETE:
    • Used to remove a resource from the server.
    • Typically, a DELETE request targets a specific resource identified by its URL, often including a route parameter (e.g., /api/users/:id).
    • While a request body can be sent with a DELETE request if additional data is needed, it’s not as common as with POST, PUT, or PATCH.
    • In Express.js, DELETE requests are handled using app.delete(), with a route path and a request handler.
    • A successful DELETE request might return a 200 (OK) or 204 (No Content) status code.
    • Other HTTP Request Methods:
    • The source briefly mentions other HTTP request methods like HEAD, CONNECT, OPTIONS, and TRACE, noting that they are sometimes used but less frequently than GET, POST, PUT, PATCH, and DELETE.

    In summary, these HTTP request methods define the action that a client wants to perform on the server, forming the foundation of communication in web APIs. Express.js provides methods like app.get(), app.post(), app.put(), app.patch(), and app.delete() to define how the server should handle requests made with these different HTTP verbs for specific routes.

    Express.js Application Routing Fundamentals

    Based on the sources, Express.js application routing is the mechanism that determines how an application responds to client requests to specific endpoints or URLs. It involves defining routes, which consist of a URL path (or pattern) and handler functions that will be executed when a request matches that path and a specific HTTP method.

    Here’s a breakdown of Express app routing:

    • Route Definition: In Express, routes are defined using methods of the app object (an instance of the Express application) that correspond to HTTP request methods. The basic structure for defining a route is:
    • app.METHOD(PATH, HANDLER_FUNCTION);
    • where:
    • app is the Express application instance.
    • METHOD is one of the HTTP request methods (verbs) like get, post, put, patch, delete, etc..
    • PATH is the URL path (or pattern) on the server. It starts with a forward slash (/) and can include static segments, route parameters, and other patterns.
    • HANDLER_FUNCTION is a function that will be executed when the route is matched. It receives two main arguments:
    • request (often abbreviated as req): An object containing information about the incoming HTTP request, such as headers, query parameters, route parameters, and the request body.
    • response (often abbreviated as res): An object used to send a response back to the client. It has methods like send(), status(), json(), etc..
    • Base Route: The simplest route is the base route, accessed by just the hostname and port (e.g., http://localhost:3000/). You can define a handler for the base route using app.get(‘/’), app.post(‘/’), etc.. If no route handler is defined for a requested path, Express will typically respond with a “Cannot GET /” or similar error.
    • Route Paths: Route paths can be simple strings, as seen in examples like /, /api/users, /api/products. They define the specific URL structure that the application will listen for.
    • Request Handlers: The request handler function contains the logic that will be executed when a client makes a request to a defined route. This function can:
    • Access data from the request object (e.g., query parameters using request.query, route parameters using request.params, request body using request.body after appropriate middleware is configured).
    • Perform business logic, such as retrieving data from a database.
    • Modify the response object to send data back to the client, set the status code, and control other aspects of the response. Examples include using response.send() to send text or JSON, response.status() to set the HTTP status code, and chaining methods like response.status(201).send().
    • HTTP Methods and Routing: The HTTP method used in the client’s request (e.g., GET, POST) determines which Express route handler will be invoked for a given path. For instance, app.get(‘/api/users’) will handle GET requests to /api/users to retrieve a list of users, while app.post(‘/api/users’) will handle POST requests to the same path to create a new user. Express allows you to define different handlers for the same route path based on the HTTP method.
    • Route Parameters: Express allows you to define dynamic segments within route paths called route parameters. These are denoted by a colon (:) followed by the parameter name (e.g., /api/users/:id). When a client makes a request to a URL matching this pattern (e.g., /api/users/123), Express captures the dynamic value (123 in this case) and makes it available in the request.params object under the name defined in the route path (request.params.id). This is useful for fetching or manipulating specific resources based on their identifiers.
    • Query Strings/Parameters: Clients can send additional data to the server in the URL after the route path using a query string. The query string starts with a question mark (?) and consists of key-value pairs separated by ampersands (&) (e.g., /api/users?filter=Anson&sort=username). Express.js automatically parses this query string and makes the key-value pairs accessible as properties of the request.query object (e.g., request.query.filter would be “Anson” and request.query.sort would be “username”). Query parameters are commonly used for filtering, sorting, and pagination of data.
    • Organizing Routes with Express Router: As an application grows, it’s good practice to organize routes into separate modules based on their functionality or domain (e.g., users, products). Express provides the Router class for this purpose.
    • You create a router instance using express.Router().
    • You can define routes on the router instance using the same HTTP method functions (router.get(), router.post(), etc.).
    • Once you’ve defined the routes for a specific domain on a router, you can then mount that router onto a specific path in your main Express application using app.use(‘/api/users’, usersRouter). This means that all routes defined in the usersRouter will be prefixed with /api/users in the application.
    • Using Router helps in keeping your main application file (index.mjs or similar) cleaner and makes it easier to manage and maintain routes for different parts of your API. You can even create an index.mjs file within your routes directory to act as a central place to import and register all your individual routers.

    In essence, Express.js routing provides a structured way to map incoming client requests to specific server-side logic, enabling you to build well-organized and scalable web applications and APIs.

    Express.js Request and Response Objects

    In Express.js, the request and response objects are fundamental to handling client interactions with your application. They are passed as arguments to every route handler and middleware function, playing crucial roles in receiving information from the client and sending data back.

    Here’s a breakdown of these objects based on the sources:

    1. The Request Object (request or req):

    • The request object contains all the information about the incoming HTTP request from the client.
    • It serves as a central repository for data sent by the client, allowing your server-side code to access and process it.

    Key properties and methods of the request object mentioned in the sources include:

    • request.headers: This property holds all the HTTP headers sent by the client. This can include information like the user-agent, content type, and importantly, cookies before they are parsed.
    • request.body: This property contains the data sent in the request body of HTTP methods like POST, PUT, and PATCH. By default, Express.js does not parse request bodies, so you need to use middleware like express.json() to parse JSON data into this object.
    • request.params: This object contains route parameters captured from the URL. When you define a route with placeholders (e.g., /api/users/:id), the values of those parameters are available in request.params (e.g., request.params.id).
    • request.query: This object holds the query parameters sent in the URL. These are key-value pairs that appear after the question mark (?) in the URL (e.g., /api/users?filter=name). Express.js automatically parses these into the request.query object (e.g., request.query.filter).
    • request.cookies: After using the cookie-parser middleware, this object will contain the parsed cookies sent by the client. Each cookie is available as a property of this object (e.g., request.cookies.hello).
    • request.signedCookies: If you are using signed cookies with cookie-parser, this object will contain the parsed and verified signed cookies.
    • request.session: After using the express-session middleware, this object represents the session associated with the client. It allows you to store and retrieve user-specific data across multiple requests.
    • request.user: After using Passport middleware for authentication, this property typically holds the authenticated user object.

    2. The Response Object (response or res):

    • The response object is used to send data back to the client and control various aspects of the HTTP response.
    • It provides methods to set headers, status codes, send data, and manage cookies.

    Key methods of the response object mentioned in the sources include:

    • response.send(body): This method sends the HTTP response to the client. The body argument can be a string, an HTML buffer, an object, or an array, and Express.js will automatically set the Content-Type header appropriately (e.g., text/html for strings, application/json for objects/arrays).
    • response.status(code): This method sets the HTTP status code for the response. It accepts a numeric status code as an argument (e.g., 200 for OK, 201 for Created, 404 for Not Found, 400 for Bad Request, 401 for Unauthorized, 403 for Forbidden). This method can be chained with other response methods like send().
    • response.sendStatus(code): This method sets the HTTP status code and sends the corresponding status text as the response body.
    • response.cookie(name, value, [options]): This method is used to set a cookie in the client’s browser. It takes the cookie name, the cookie value, and an optional options object to configure cookie attributes like maxAge, expires, domain, path, secure, httpOnly, and signed.
    • response.clearCookie(name, [options]): This method is used to clear a previously set cookie on the client by setting its value to an empty string and its maxAge to zero.
    • response.json(obj): This method sends a JSON response to the client. It automatically sets the Content-Type header to application/json and converts the JavaScript object or array to a JSON string.

    Interaction in Route Handlers:

    Within a route handler function, you typically use the request object to access data from the client’s request and the response object to send back the desired information or perform actions like setting cookies or redirecting the client.

    Example:

    Consider a GET request to /api/users/:id. The route handler might access the user’s ID using request.params.id, fetch the user data from a database, and then use response.json(user) to send the user data back to the client as a JSON object. If the user is not found, the handler might use response.sendStatus(404).

    Understanding the request and response objects and their properties and methods is crucial for building robust and interactive web applications with Express.js. They enable the server to effectively communicate with clients by receiving their requests and sending back appropriate responses.

    Express.js Middleware: Concepts and Usage

    Based on the sources, middleware functions in Express.js are functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle, commonly denoted as next.

    Here’s a more detailed breakdown of middleware functions:

    • Role and Functionality:
    • Middleware functions act as an intermediary between the server receiving a request and the final route handler processing that request.
    • They can execute any code.
    • They can make changes to the request and the response objects.
    • They can end the request-response cycle by sending a response to the client.
    • They can call the next middleware function in the stack.
    • Arguments: Each middleware function receives three arguments:
    • request (req): Contains information about the incoming HTTP request (as discussed previously).
    • response (res): Used to send a response back to the client (as discussed previously).
    • next: A function that, when invoked, passes control to the next middleware function in the application.
    • The next() Function:
    • Calling next() is crucial for allowing the request to proceed through the middleware stack and eventually reach the route handler (or the next middleware).
    • If next() is not called within a middleware function, the request will be left hanging, and the client will not receive a response.
    • The next() function can optionally take an error object as an argument. If an error is passed to next(err), Express will skip any remaining non-error-handling middleware functions and will proceed to an error-handling middleware (though this is not explicitly detailed in the provided source). If no argument or null is passed, Express assumes everything is successful and moves to the next middleware.
    • Registration of Middleware: Middleware functions can be registered at two levels:
    • Application-level middleware (Global): These are bound to the entire application instance using app.use(). Middleware registered this way will be executed for every request that comes to the application, in the order they are declared.
    • Route-level middleware (Specific Endpoints): These are bound to specific routes. You can pass middleware functions as arguments to route definition methods (app.get(), app.post(), etc.). They will only be executed for requests matching those specific routes, and they are invoked in the order they are listed.
    • Order of Execution: The order in which middleware functions are registered using app.use() and the order in which they are passed as arguments to route handlers matters significantly. Middleware functions are executed sequentially in the order they are added to the middleware stack. If a middleware function sends a response and does not call next(), the subsequent middleware functions for that route will not be executed.
    • Built-in Middleware: Express.js itself provides some built-in middleware functions. The source mentions express.json(), which is used to parse incoming requests with JSON payloads. When registered using app.use(express.json()), it populates the request.body with the parsed JSON data.
    • Third-party Middleware: Many third-party packages provide middleware functions that extend the functionality of your Express application. For example, express-validator provides middleware functions like query() and body() to validate request data. These middleware functions perform validation checks and attach validation results to the request object. You then use the validationResult() function to check for any validation errors within your route handler.
    • Custom Middleware: You can write your own middleware functions to encapsulate reusable logic that you want to execute before your route handlers. The source provides an example of a loggingMiddleware function that logs the request method and URL. Another custom middleware example is resolveIndexByUserID, which was created to find the index of a user in a mock array based on the ID from the route parameters and attach it to the request object for subsequent middleware to use.
    • Reusability: Middleware promotes code reusability. By extracting common logic into middleware functions, you can apply the same functionality to multiple routes without repeating code. For instance, the logic to resolve a user by ID was moved into a middleware function and reused across put, patch, delete, and get requests for user-related endpoints.

    In summary, middleware functions are a powerful feature of Express.js that allow you to intercept and process requests before they reach your main route handlers, enabling you to perform tasks like logging, authentication, data validation, and more in a modular and reusable way. The order of middleware registration and the proper use of the next() function are crucial for ensuring the correct flow of your application’s request-response cycle.

    Express.js User Authentication Methods and Strategies

    Based on the sources, user authentication in Express.js can be implemented using various methods, ranging from basic credential checks to more sophisticated approaches using sessions, cookies, and dedicated authentication libraries like Passport.js.

    Here’s a discussion of user authentication based on the provided material:

    1. Basic Username and Password Checking (Without Sessions):

    • Source demonstrates a simple login endpoint (/api/off) that receives a username and password in the request body.
    • It retrieves a user from a mock users array based on the provided username.
    • It then performs a direct comparison of the provided password with the password associated with the found user.
    • If the user is not found or the passwords do not match, it returns an “unauthenticated” status (401) with a “bad credentials” message.
    • This approach does not involve maintaining any session state, meaning the user would have to authenticate on every request to access protected resources.

    2. Authentication Using Sessions and Cookies:

    • Source expands on the basic check by introducing express-session to manage user sessions.
    • Upon successful username and password verification, it modifies the request.session object by attaching a user property to it, storing the authenticated user’s information.
    • Express session then automatically sets a cookie in the user’s browser containing a session ID.
    • On subsequent requests from the same client, the browser sends this cookie back to the server.
    • express-session middleware uses the session ID from the cookie to retrieve the corresponding session data stored on the server (initially in memory).
    • By checking for the presence of the user property on the request.session object, the server can determine if the user is authenticated for subsequent requests. Source creates a /api/status endpoint that checks request.session.user to determine the authentication status.
    • Source further illustrates this by showing how different clients (Thunder Client and Postman) can have different sessions and be authenticated as different users simultaneously, with the server managing multiple sessions.
    • Source introduces cookie-parser middleware, which parses cookies from the request.headers and makes them available in the request.cookies object. This is necessary for express-session to function correctly.
    • Source also briefly discusses using cookies for basic authentication checks, where the presence or value of a specific cookie determines the server’s response. However, the primary use of cookies in the context of these sources is for maintaining session IDs.
    • Source also touches upon signed cookies for added security, requiring a secret to be provided to cookie-parser.

    3. Authentication with Passport.js:

    • Sources through extensively cover using Passport.js, a popular authentication middleware for Node.js.
    • Passport supports various authentication strategies, including:
    • Local Strategy: Source details how to implement local authentication (username and password stored in the application’s database).
    • It requires installing passport and passport-local.
    • A Local Strategy is defined with a verify callback function. This function receives the username and password from the request and is responsible for:
    • Finding the user (e.g., in a database).
    • Verifying the password (comparing the provided password with the stored password, which should be hashed for security). Source introduces bcrypt for hashing passwords and bcrypt.compareSync for comparing them.
    • Calling the done function with an error if authentication fails, or with the user object if authentication succeeds.
    • Serialization (serializeUser) and Deserialization (deserializeUser): Passport uses these functions to manage the user’s identity within the session.
    • serializeUser determines which data from the user object should be stored in the session. Typically, only a unique identifier (like the user’s ID) is stored.
    • deserializeUser is responsible for retrieving the full user object from the stored identifier in the session on subsequent requests. This user object is then typically attached to the request.user property.
    • Passport Middleware: app.use(passport.initialize()) initializes Passport, and app.use(passport.session()) integrates Passport with express-session.
    • The passport.authenticate(‘local’, …) middleware is used on the login route to trigger the local authentication process.
    • OAuth 2 Strategy (Discord as an Example): Sources explain how to implement authentication using a third-party provider like Discord via OAuth 2.
    • It requires installing the specific Passport strategy (e.g., passport-discord).
    • An OAuth 2 Strategy is configured with details obtained from the third-party provider’s developer portal, such as client ID, client secret, and redirect URL (callback URL).
    • The strategy also defines a verify callback. In the OAuth 2 flow, after the user authorizes the application with the third-party provider, the provider redirects the user back to the application’s redirect URL with an authorization code. The verify callback receives access tokens, refresh tokens, the user’s profile information from the provider, and a done function. It’s responsible for:
    • Checking if the user from the third-party provider exists in the application’s database.
    • If not, creating a new user record (often linking it to the third-party account’s ID).
    • Calling the done function with the user object.
    • Similar to local strategy, serializeUser and deserializeUser are crucial for managing the user’s session after successful OAuth 2 authentication.
    • Specific routes are set up to initiate the OAuth 2 flow (e.g., /api/oth/discord) using passport.authenticate(‘discord’, …) and to handle the callback from the provider (e.g., /api/oth/discord/redirect) also using passport.authenticate(‘discord’, …).
    • Scope: When setting up the OAuth 2 strategy, you can specify the scopes (permissions) your application requests from the third-party provider (e.g., ‘identify’, ‘guilds’, ’email’ for Discord).

    4. Session Stores for Persistence:

    • Source addresses the issue of session data being lost when the server restarts (as it’s stored in memory by default with express-session).
    • It introduces session stores (e.g., using the connect-mongo package for MongoDB) to persist session data in a database.
    • By configuring express-session with a session store, session data is saved to the database, allowing sessions to be restored even after server restarts.

    5. Logging Out:

    • Source shows how to implement a logout endpoint (/api/oth/logout).
    • It uses the request.logout() function (provided by Passport) to clear the user’s session.
    • After logging out, subsequent requests to protected resources will fail authentication.

    In summary, the sources demonstrate a progression of user authentication methods in Express.js, starting from basic checks to utilizing sessions and the comprehensive Passport.js library for both local username/password authentication and integration with third-party OAuth 2 providers. The importance of secure password handling (hashing) and persistent session storage is also highlighted.

    Express JS Full Course

    The Original Text

    hello everyone my name is Anon and in this tutorial I will teach you how to build a web API using the expressjs framework Express is the most popular server sided web framework in the node.js ecosystem it is widely used by many developers it’s in over 20 million projects according to GitHub it has over 27 million weekly downloads according to npm and it is used by a lot of companies ranging from startups all the way to Fortune 500 companies but why is it so popular though well mainly because expressjs is very easy to learn it makes it very easy for you to set up an API in less than 30 seconds it’s unated which means there’s not much if not there’s really not any overhead at all you don’t have to worry about configuring a bunch of different properties in your application before you can actually use it all you have to do is just in install the package instantiate the express app and then listen to a port and then begin listening to requests that’s it there’s no right or wrong answer when it comes to building web apis using a framework that is unopinionated like expressjs and because of that that is why till this day over the past perhaps 10 years now Express is still the dominant framework that many people choose to use whenever they want to build their next project now for those of you who are not really familiar with how web apis interact with other applications I have a simple diagram over here that we’re going to go over right now expressjs remember is a serers sided application so pretend that right over here on the right hand side this server is our is where our express application is going to live and then we have our clients so these are typically just regular users that will use your application either on a mobile device such as a phone or a tablet or they’ll use it on a computer either via the web browser or a desktop client now let’s say for example we have an e-commerce website and that e-commerce website when you visit it it displays a list of products those products needs to come from somewhere they don’t just randomly appear when you click on those products you can see more information about it but where does that information come from where does all the data come from well most of the time it comes from a server comes from a web API but the client doesn’t just automatically receive that data from the server the client needs to make what is called an HTTP request HTTP stands for hyper text transfer protocol it pretty much just means hey this is how I want to exchange data with you okay there are many different types of protocols but HTTP is one of the most popular ones out there so let’s go back to our example of the e-commerce app the moment that you visit the homepage of the e-commerce app what happens is the code on the client side will make an HTTP request to the server side application okay in our case it will be the express API the express API will receive that request and it will say okay I just received receive the request to send back a list of products for the client I don’t care how the client uses it I don’t know what they’re going to do with it but my responsibility is just to get that list of products and send it back to the client so what the server will do is it’ll perform some business logic and then it will produce an output okay in this case the output is retrieving the list of products and the client itself never actually sees this operation going on so think of it like this let’s say you’re at a restaurant and you sit down you’re at a table the waiter comes to you the waiter in this case is the server the waiter asks you what you want you request the waiter hey this is what I want to eat the waiter will send that request back to the kitchen back to where all the chefs are working so you can think of the kitchen like the server you never actually see what’s going on in the kitchen all you know is that after a certain amount of time the waiter will come back with a response in this case that response is going to be your food in our case for our e-commerce application the response that we are getting from the server is going to be a list of products hopefully that makes sense and now we are finally ready to dive into setting up our expressjs project and writing some code so let’s go ahead and get started so right inside my windows Powershell I’m going to go ahead and create a new directory and I’m going to call this expressjs tutorial I’m going to go ahead and CD into that directory and let me just clear up my console I’m currently using using node.js version 2.4.0 as of right now the time of recording this video however there hasn’t really been any major breaking changes with expressjs between different node.js versions so even if you’re using an earlier version or a later version you really won’t run into any issues at all so don’t worry about that so let’s go ahead and type npm init hyphen y to initialize this folder as an npm repository and this will give us a package.json file that’s generated for us and and let’s go ahead and open up visual studio code or whatever text editor you prefer to use and let’s just take a look at this package Json file and there’s nothing in here uh for the dependencies just yet we need to install it so let’s go ahead and install Express so I’m going to type npm I or install I is short for install and then Express and just hit enter and now this will install Express for you and that’s it that’s the only package that we need to install it’s that simple let’s go ahead and install actually one more tool for development I’m going to install nodemon and what nodemon allows you to do is run your application in watch mode so as you’re saving changes to your source code the process will automatically restart based on file changes so you don’t have to manually exit out of the process and restart it again so I’m going to install nodon as a Dev dependency so I’m going to use the hyphen D flag as you can see right down over here let me zoom in a little bit more and I’ll type nodemon okay and what I’m going to do is I’m going to set up uh a script so right inside the scripts object I’m going to set up a start colon Dev script and this will use nodemon to run our our main Javascript file so that file doesn’t exist yet we need to create it but I’m going to go ahead and create a folder called Source in just a bit and the main file will be called index.js so this will be the entry point to our application I’ll create one more script called start and this will just be a simple script to just use a regular node command to run our application so not in watch mode so this will typically be for production when you’re ready to deploy the API now there’s one more thing that I want to do inside this p package.json file I’m going to go ahead and set this type property and you can see that there’s two values uh commonjs or module I’m going to set it to module and what this will allow me to do is use esm as my module system so that way I can use the modern import export statements instead of having to use require to import modules and module that exports to export stuff because I’m using uh esm modules I need to actually change the file extension to MJS in order for this to work so let’s go ahead and do that and don’t worry everything will still work fine it really doesn’t make much of a difference except for you have the latest um modern versions of importing and exporting modules that’s really all it is for let’s go ahead and continue I’m going to go ahead and create a new folder called Source SRC and I’ll create a new file called index. MJS and now what we’re going to do is we’re going to import Express from Express just like that so I’m basically importing the entire Express module from this Express package now the imported value of this Express name is actually a top level function and we need to call this function in order to create an express application so what I’m going to do is I’m going to first declare a variable let me zoom in a little bit more I’ll call it app and then I’m just simply going to reference Express and then invoke that function by using parentheses and that’s all and that’s all you have to do now that we have our Express app I can reference the app variable and whenever I use the dot operator you can see that there are a bunch of different methods and properties that I can reference now it might be a little bit overwhelming at first but don’t worry the method that we need to call is the listen method and this pretty much allows you to listen to a port for incoming requests this is actually what starts up the express server on a specific port and then you can begin receiving incoming HTTP requests so let’s go ahead and set a port Port uh you can pass in really any port you want I’m going to go ahe and pass in Port 3000 but instead of just passing in a hardcoded number for the port for best practice it’s best to assign your port to a variable called port in this case and then you can reference process which is a global in node.js and then process has an object called EnV and from here you can access your environment variables so we would assume that there is going to be an environment variable for ports but if the environment variable for Port is undefined then we can have it assign this leftand value with our logical or operator right over here let’s go ahead and reference app now and call. listen and pass in Port and then I’m going to go ahead and pass in a callback function so you can use this to perform post-processing operations once your server has uh started up so maybe if you want to send an event to some centralized logging system so that way they know that the server was just started up at this time you can do that inside this callback function however I’ll simply write a console log and I’ll use string interpolation um and then I’ll go ahead and write running on Port and then I’ll log the port okay so let’s go ahead and start up our application and make sure that it works so I’ll go into the terminal now and I’m going to run that start Dev script so let’s type npm Run start colon Dev and now you’re going to see that nodemon will start up this application and you can see that now it says running on Port 3000 now if you want to test this out you can simply just go to your web browser and just type Local Host colon and then the port number that you are listening to requests on since I’m listening to requests on Port 3000 I would type Local Host colon Port 3000 right now you can see that it says cannot get and this is because we don’t have anything registered just yet okay we need to actually register what’s called a route in order for us to start requesting something from the server and then receiving a response so hope hopefully this all makes sense so now that you finally know how to set up a simple web server using expressjs I’m going to show you how we can Define routes and access those routes to receive different responses but first of all what exactly is a route well think of it like this currently we were trying to access Local Host Port 3000 okay and this was the base route and we actually don’t have anything set up up to be returned from the base route so whenever we try to access it that’s the reason why it said cannot get slash because we didn’t have any resolver to map a response back to that route but a route in general is think of it like a path in your express application so determining which path you want to take gives you different outputs so for example if you go to let’s say the users route let’s say if I have a users route defined on my server this will give me a list of users if I wanted to get a list of products I would access the products route and all you do is just you just add this forward slash and then the name of the route at the end of the host name and the port in actual real uh applications that are deployed you typically don’t have the port uh exposed like this so it would just be after the host name like something like Local Host test.com products okay so you define these routes on your Express server and then you allow your clients to make requests to those routes now remember how in the introduction I mentioned in order to request data from the client to the backend server you need to make an HTTP request well there are actually different types of HTTP requests and these are known as HTTP verbs so these verbs pretty much are ways on how you can tell the server to perform some operation so for example you don’t always want to just get data sometimes you might want to create data by saving it to the database once it’s reach the server sometimes you want to update data sometimes you want to delete data there are different types of request methods that we use to handle these operations and you’ll learn that later on but first let’s go ahead and set up a simple get request so let’s go ahead and reference the app and we’re going to go ahead and call this get method right over here and and it’s going to take in an argument which is going to be a string as the first argument and right over here is where you can specify what route you want to register in your Express app So currently I don’t have any route handling the base SL route so I’m going to go ahead and configure a route for that so whenever the user visits this route They will receive a response but we actually need another piece in order for this whole thing to work we need what is called a request Handler and that is actually the second argument to app.get so the request Handler is just a function but in this case it’s a callback function so it would look like this so I’ll pass a simple arrow function and this callback function has two arguments okay it has a request argument which is the request object itself this contain contains everything related to the incoming HTTP request so for example if you passed in HTTP headers from the client side to the server side that would be inside the header property in the request object if you were to send data in the request body that would be accessed by grabbing it from the request body property if you wanted to access cookies if you wanted to access the IP address all of this stuff comes from the request object okay now the second argument is the response object the response object is what you can use to modify the response and send it back to the user so you can set the status code as an example you can send back uh data you can send back text you can send send back HTML you can send back text you can send back HTML you can send back a Json object whatever it is that you want so let’s go ahead and reference the response object to to send back a response so I can reference response and call the send method and I’ll just send back a simple hello world string just simple plain text so now if I visit the Local Host Port 3000 and if I go to just the base route you can see it says hello world okay pretty simple I can go ahead and also send back a Json object I’ll say hello I refresh I now see it is parsed in this Json format right over here uh I can also set the status code as well so I can do that very easily by referencing response. status and this is a method so you can just pass in whatever status code you want I’ll set it to just for a demonstration purposes I’ll set it to 2011 2011 is actually used for post requests whenever you create a resource but I just want to show you that this is what the status code is because by default the status code whenever it is successful is a 200 status code okay and after you set the status code you can actually chain these methods together so after I call status I can also just call do send and then just pass in a requ a response body so now if I refresh and let me open up the uh let’s see the network tab right over here you can see that now the status code says 2011 let’s let’s go ahead and Define a few more routes so that way you all get the hang of this so I’ll go ahead and Define a route uh called slash users now whenever you are building apis you typically want to prefix all of your endpoints with a slash API prefix and this is industry standard a lot of companies that have apis do this it’s just good practice so I would highly recommend you all to follow this approach okay so/ API SL users so this is now our route so whenever we access this in our browser we don’t visit SL users we’re visiting SL API users okay so as a second argument we need our request Handler of course so let’s pass in the request and response object and what I’ll do is I’ll simply just send back an array of fake users so I’m just going to pass in an array in the send method as an argument and in my array I’ll just provide some users so I’ll set the ID to one username ansen display name Anson we’ll keep it simple I will just copy and paste this a few more times and just change up the values so let’s do Jack and then Adam now let’s save okay and now whenever I go to the browser and let me just kind of like move this over to the to the side a bit when I go to slash API users this is the route or the endpoint I’m going to use those terms synonymously route and endpoint this is the route that I am going to be making a request to from the browser in this case the browser is our client okay we’re making a request to SL API users and then when I hit enter you can see as a response this is what I get back I get back this array and this array has three users okay and if you were getting this data let’s say on your react code you would render this out to the client so they can actually see all the users okay let’s go ahead and create one more Let’s do app.get let’s do uh SL API SL uh products request and response so now you should get the hang of doing all of this and the whole reason why I’m showing you multiple examples is that way so you are familiar with this so once again we have our endpoint our route name defined right over here/ API products and then we also have our request Handler and I’m going to go ahead and send back a response now so I will reference the response object and I’m going to go ahead and call do send and then what I’ll do is I’ll just send back an OB uh a Json object which is this in this case is going to be an array and I’ll do the same thing ID of let’s do one two 3 username or what am I doing not username uh let’s do name let’s do chicken breast and then price let’s do $12.99 okay and now if I go to the browser and if I visit SL API product I’m making a request to this route it’s going to give me that array of products and I can see this stuff right over here so now what I will do is I’ll show you how we can use route parameters to be able to dynamically pass data to the server in the route and this can actually make it so that we we can receive Dynamic data based on whatever the value of that parameter is so I’ll give you an example right now we are only able to receive all of the users let’s just pretend that this users array comes from a database we are receiving all of the users in an array but what if I wanted to actually receive only one user based on some unique identifier such as the username or the ID how would I do that well this is where route parameters come into play you can use route parameters to pass in a dynamic value in the route path and then the server would receive that request it would check what the route parameter is and then since we know that we’re going to be dealing with users because we would be visiting SL API users and then the route parameter would be placed after that we would go ahead and grab the correct user from our database in this case we’re going to grab it from our array so the way that you define a route parameter is like this so right underneath uh my AP API SL users route I’ll go ahead and set up another one but this time we will be using a route parameter so I’ll call app.get and then SL API SL users and then slash and then here’s where I want to Define my route parameter what I can do is I can use the Colin symbol and then give my route parameter a name I’m going to go ahead and give the name ID and then we’re going to pass in a request Handler so the same that we’ve been doing so far and now whenever I visit SL API SL users and then slash and then the ID whatever I pass in it’s going to go ahead and hit this endpoint so I have one endpoint or one route defined to give me all the users and then I have another route that has a route parameter that gives me a single user record based on the route parameter ID let’s go ahead and do this I’m going to show you first first how I can grab that route parameter and we do that by referencing it from the request object so I can go ahead and console log this right now if I reference request. prams this is an object that gives you all of the route parameters because you can have multiple you don’t need to only necessarily have one you might have more than one you might have an ID maybe you might have a username but typically in our in this situation we we really only need one so what I’ll do is I’ll console log this and I’ll go back to my browser and I’ll show you what happens when I visit SL API users and then slash1 and then let me show you the console you can see that right over here the console logged an object and that object contained that route parameter as a field ID and then it mapped to this value of one so hopefully that makes sense so I again like I said I can pass in literally any value I want I can pass in 500 and then whenever the server receives that request it will log uh this object ID as a field of 500 so what I’ll do is I’m going to go ahead and grab the user from the array by its ID so let me just First Take This array and I’m going to move it up top over here so that way I can reference it all throughout my code const uh mock users and I’ll sign it to this array and then let me just send back that mock users array and then what I’ll do is a couple things one notice how if you looked at the logs the value of ID is actually a string but in our case our users have a numeric ID so we want to convert that into an actual number and this is kind of like a brief little intro to how you can perform valid ation for your incoming get requests okay so what I’ll do is I will create a variable called par ID and I’m going to use the parse in method and I’m just simply going to pass in request. prrams do ID but here’s the other problem though we don’t know if uh the user even provided an ID at all well if they didn’t then it would go to the API users route like for example if I didn’t pass in an ID it would just go to/ API users so in because this is the case we don’t really need to check if ID is defined because we know that it’s going to be there but we do need to make sure that the value is valid in our case we want to make sure it’s a valid numeric value so what I can do is I can parse this uh pam. ID value and if it is a valid numeric string then it’ll convert it over to the actual integer itself if it’s some regular non-numeric string then it will be not a number so if I were to conso log par ID and then if I go to the browser and if I refresh and I just pass in some invalid numeric or some non-numeric ID and the console it will log not a number Nan which stands for not a number for the par ID value so we can use uh an if condition and we can use this is not a number function and then I can just pass in par ID okay and in this case since we’re passing in an invalid ID is Nan would return true so if it is not a number then what I want to do is I want to return perhaps a status code that indicates that this is an invalid response or this is an invalid request so what I’ll I’ll do is I will return response and I’m going to go ahead and call the status method and I’ll pass in for the code the number 400 which means bad request and then I’ll just simply call send and then maybe an error message bad request okay and I can even add additional additional notes invalid ID all right so now if it is in fact a valid number then we can perform some operations we can interact with our mock users array so I’m going to go ahead and now write the logic to find a user so const user or find user equals mock users and I’ll just simply use the find method and I’ll pass my predicate so we’re going to search based on the ID so we’re going to pass in this callback function or predicate function and we we’re going to have access to the user object that is currently in the array and we’ll check to see if user. ID matches so triple equals pars oh whoops did I oh you know I forgot this is actually par ID sorry about this it’s pars ID not parse ID so pars ID okay and now uh if the user does exist well let’s do if the user does not exist then I’ll just return response so we’re going to do the same thing that we did above on line 29 right over here so this is the point where you have different paths that your controllers or that your request handlers can take so in our case we have three different outputs and later on around the end of this tutorial you’ll learn how to unit test these these uh these functions but you can see right over here that currently I have three different outputs whether the ID that I passed was invalid so it sends back a 400 or if the user is not found then we want to send back a 404 because that indicates not found so I’ll return response. status and pass in 404 or you know there’s also the uh I think there’s a send status method so that way I can just send the status and I don’t have to send I don’t have to call do send again at the end um and then if the user is found then we’ll just return response dot send find user just like this so we have three different possibilities for this endpoint okay so hopefully that makes sense now let’s go ahead back into our app if I refresh you can see it says bad request invalid ID if I pass in let’s say an ID of a user that does not exist it says not found and you can see on the console it gives us that 44 if I pass in an ID of one it finds the user and I can see it right over over here and same thing if I pass in two and three I get all of the users that are in that array so hopefully that shows you how to use route parameters so now I’m going to go ahead and talk about query strings and query parameters and how they are used in backend development and now we can actually use them ourselves so many of you may have seen something at the end of the website address so in the browser address URL you might see this question mark and then you might see something like key equals value and then you might see an ENT symbol and you might see another key equals value this is known as a query string so right over here this question mark symbol denotes that we have a query string and they go at the end of our uh defined route over here okay so you have the domain and then the route the path and then the query string at the end and then after the question mark you basically just pass in whatever key value pairs you want so for example I have uh a key called key and I use the equals operator to assign a value to it so it’s kind of like assigning a value to a variable but only we’re doing it in the address bar so key equals value and if I wanted more query parameters in the query string I can just simply use this ersan as a delim so ersan and then the next key value pair so key 2 equals value 2 I can have as many query parameters as I want now there are different ways that you can use Query parameters in web development you can send query parameters from a page to another page on the client side so that way you can send data uh across different pages so let’s say if one page needs data from another page when you’re navigating then you can grab the the values from the query query string if you’re sending it from the client side to the serice side typically you would send a query string to uh add additional data to the request that you normally wouldn’t add in a request body we haven’t gotone to post requests just yet but I’ll stick to a get request as an example so when you make a get request remember that you are performing a request an HTTP request to get data in readon format you’re not manipulating any data at all on the server side so sometimes you might need to retrieve the data but you also want to have that data already um manipulated in a certain way on the server side so for example up top over here I added a couple more user objects so let’s say I have this users array and let’s pretend it’s from the database and let’s say I want all of these users returned back but I wanted it sorted in alphabetical order based on the username or you can also have it sorted based on the display name maybe you might also want it sorted in um from least to greatest based on the ID value since these IDs are integers so you would use a query string to do that let’s say if you also want to filter out some results from the users itself maybe you don’t want to get every single user from the database you only want to get only specific users that match whether their user matches a substring so maybe I only want to get all the users that have an A in their username field so hopefully that makes sense with query parameters and how they can be used so let’s go ahead and see how we can actually send query strings and query parameters to our server so inside my/ API users route inside the request Handler function I’m going to go ahead and consol log this request. query object remember how I said earlier the request object has everything that you can possibly get in regards to the request itself so earlier we referenced request. prams to get the route parameter so to get the query parameters from the query string we just reference request. query so let’s go ahead and send a query string when we are making this request to the SL users end point so I’m going to use the question mark symbol and then provide some key value pairs I can literally pass any key value pair I want so let’s do something like filter and we’ll assume the filter is going to be based on username um so I’ll do filter uh Anson and I’ll go into my console uh let me actually just rerun the request so you see how whenever I send a request a get request to that endpoint in the console it logs that request query object and it has the filter which is the key that I passed in the query parameter filter it is showing up as a field in that object that query object and we have the uh string Anon as the value so the query string gets parsed into a Json object by Express so we can very easily grab the values let’s go ahead and actually do something realistic with the filtering so what I’ll do is this I want to make it so that I can filter based on sub some substring so I want to go ahead and also make it so that I can also set which field in this mock users array in in these objects I want to make sure I can set which field I want to filter on so maybe I want to alternate between filtering by username or display name so for the filter value we can expect it to only be two possible values username or display name and this will tell us what uh key in the user object what field to filter by or yeah what what field to filter and then we will add an additional query parameter can call it whatever you want but I guess we can call it a value just to keep things simple and then this this value will basically be the uh the text the substring that you want to have that username contain so if I want to filter everything where it contains the an substring so a an substring then we would have to search for that okay so I’m going to send these two query parameters to the server okay so now I’m going to go into go back to the request Handler for the users endpoint and what I’ll do is this I’m going to destructure that query object from the request object and then I also want to destructure from the query object the two query parameters filter and value and I can do that all in one go like this so I can use so after query I can additionally destructure properties from query so let’s do filter and value and so what I want to do is I want to make sure that both of these query parameters exist because of course if they don’t exist then we’re not going to do any filtering at all so the easiest case that we can handle is we check to see if both of these values are undefined because if they are then we don’t need to do any filtering we just return mock users as is so we’ll you write an if case if there’s no filter and there’s no value then we will just simply return response. send and then call or not call uh pass and mock users in this do send method call okay that’s the easiest case I’ll write a simple comment when filter and and value are undefined okay and we always want to make sure that both of these query parameters are defined because you need both of them of course you can’t have a value and not know what field in the user object you want to filter by and if you have the filter query parameter defined you need to make sure you have an actual text that you want to filter uh that you want to filter based on so we need to make sure that both of these are defined so we’ll do if filter and value if filter and value we will return and we’ll call response. send and from here I should just be able to write a simple filter function so mock users I can use the filter function on the array and pass in a predicate so what we’re going to do is we’re going to pass in this callback function also known as a predicate function and this will this call function has uh the user as an argument and then what we want to do is we want to filter out all of the we want to filter all the user objects that match that have that value as a substring so it’s pretty easy we can do user. username because remember we’re filtering by by the username or actually it would be user square brackets filter okay and this is assuming that filter would either be display name or username so user filter so this would grab the correct field and then we would want to so this is a this is going to be a string so we would want to make sure we check to see if the string contains that substring so we actually have this um includes and this method returns true if search string appears as a substring of the result of converting this object to a string okay so I can pretty much call do includes and I’ll pass in the value so this will filter all of this will basically grab all of the user objects that pass this predicate so if the user and whether we are filtering by username or display name if let’s say for example let’s stick with username if the username includes the value that we’re trying to filter then it’s going to return that into a new array and then once all of the filtering is done we’re going to send the entire array back so let’s go ahead and test this out so right now if I let’s do this if I don’t have any of the query parameters at all you can see that it will just return the array as is okay it doesn’t uh it doesn’t do anything we have everything sorted we have everything the way it is nothing is sorted nothing is done let’s go ahead and add a filter so filter let’s filter by username and now notice how if I were to only have the filter but no value you’ll see how it doesn’t return anything yet the request is still pending that’s because we need both filter and value okay we’ll handle these cases as well so let’s go ahead and handle a case where we have both filter and value as a query parameter so for the value query parameter I will set this to be a n and now you’ll see this will grab me all of the user objects where the username has a n as a substring and if you look right over here it seems to be filtering correctly uh I can go ahead and do another simple case where let’s filter the username where it includes e as a substring and you can see that seems like the only username that I have that has an e as a substring is Henry okay uh let’s see what else let’s try um let’s try a I have 1 two 3 4 five so it’s missing uh this object Henry so our filtering is working great okay so let’s just finish this out um so let’s make sure we handle all the other cases where if we don’t have both of these um both of these defined then we return the same mock users that is in memory so we don’t do any filtering at all so I think the easy thing to do is actually this instead of uh doing this if check right up here where we check both a filter and where we check if there’s no filter and there’s no value what we’ll do is we’ll check if there’s fil filter and if there’s a value and if this condition fails that means it only has one or the other defined or both are undefined so then we’ll just return response. send mock users so I just realized that I’m going to fix that real quick and now when I go back to the browser if I only have one query parameter it won’t do any filtering at all okay hopefully this makes sense now that you all know how to retrieve data from the express API using get requests I’m going to show you how you can create data using what is called a post request now let’s say for example you want to create a resource on the backend and that backend will save it to a database or save it to a file or save it just somewhere doesn’t matter where it is you want to create let’s say a user so your client your front-end application will have a user form they fill out their username password email and other additional Fields once they are ready they will click that signup button when you click that sign up button it will make an API request to the backend doesn’t have to be necessarily an Express API server it can be really any API server that’s running that handles that post request okay so the front end the client side would make an HTTP request a post request to the server okay okay once the server receives that request the server needs to obviously be able to grab the data that we’re trying to send from the client side to the backend and that data that you’re sending is known as a request body so whenever you make post requests the data that you want to send to the backend server you send it via a payload or a request body you use those terms synonymously so payload request body are interchangeable terms the backend will then take that data and it will perform the necessary operations in need so typically validation if it needs to do additional parsing if it needs to make sure that it has the proper Fields it will do all that stuff before it can proceed with either saving it to a database or saving it to some external API Source whatever it is I needs to do once it’s done saving that record to the database or somewhere it will return a 2011 response which or 2011 status code which typically just means that the resource was created sometimes it might also return the new record that was created so that way if you need to use it on the client side for whatever reason you can do so now before we actually can make any post requests we do need an htgp client to actually uh make those requests and also be able to send a request body to our Express API because on the browser there’s no built-in tool that enables you to send request bodies unless if to write the code in the JavaScript console but we’re not going to do that um so there are different uh clients that you can use to interact with your API So currently we’ve just been using the browser which we limited to just making get requests by simply typing in the address in the address bar we want to be able to make post requests where we can send actual data okay so you can use tools like Postman there’s also Hopscotch which is an alternative to postman for this tutorial I’m going to keep things simple I’m going to keep everything inside vs code and we’re going to install this extension so on the left hand side or um wherever you have this extensions icon just click on extensions and you want to search for an extension called Thunder client and thunder client is a very lightweight rest API tool for VSS code it’s integrated in there you just have to install it and it allows you to make API calls to your Express server so I’ll go ahead and click install Okay and then I’m going to go just close this and then let’s go ahead on the left hand side you should see the Thunder client appear right over here as an icon that’s the Thunder client and I’ll click on it and now what I can do is I can create a new request by clicking on the new request button and you can see now it looks it it looks kind of identical to post man if you’ve used it before or really any other rest client but we have an address bar where we can uh type in the address or the URL that we want to make requests to so I’ll type in Local Host Port 3000 API users I’ll make a get request so I can select this drop down and select get and I’ll click Send and you can see that it gives us back the data just like that okay and we’re going to use this client to switch between different types of HTTP requests that we want to make so we’ll switch from get to post and then in later videos when I show you how to handle put requests or delete requests we will switch to these HTTP requests as well okay so let’s close this out just wanted to show you all how to set up thunder client so now what I’m going to do is set up our post request to be able to create a brand new user so what I’m going to do is right underneath my uh API user users route I’ll go ahead and reference the app variable and since I want to register a post request I’m going to go ahead and call the Post method so this method is very similar to all the other HTTP verb methods such as get put delete uh it takes in a path so over here I’m going to go and pass in/ API users now you’re probably wondering well should we be able to reuse the path and the answer is yes because you have a different HTTP request type being used so this is for post request and the one over here is for get requests okay when your HTP client is making requests the server knows if it’s making a get or a post request so that way there’s no confliction between these two different types of requests despite the route being the same so we’ll also pass in a request and response or we’ll pass in the request Handler function which will have these two arguments request and response and then for now I will just return a response. send I’ll just pass in a 200 status code or I’ll just pass in 200 and I’ll just console log the request body just so that we can see what our data is looking like when we send it from the client so let’s go back to thunder clients I’ll click on the Thunderbolt icon I’ll click on new request and up top where you see gets just click on that drop down and select post and we’re going to change the url and we’re going to type in Local Host Port 3000 API users okay so once again we have uh we have two different types of HTTP uh methods but they both use the same path okay so whenever I call a post request to SL API users I don’t even need to send any data for now it’s just going to give me back a 200 status code now I can go into the body tab in my thunder client and I can select Json if I want to send Json so if I try to send a request body let’s see what happens let’s click Send so in the console log for our in our terminal you can see that right now it’s actually logging undefined when I try to send it again it still logs and you’re probably wondering well what’s going on with this why is it undefined well the reason why it’s undefined is because right now by default Express is not parsing those request bodies that are coming in so whenever I am sending Json to the express server the headers set the content type to application Json Express doesn’t parse those payloads by default so we need to tell Express to do so now this is going to require us to use a middleware so this is kind of like a brief little intro to middlewares but don’t worry so much about it once we actually get into the topic of middlewares you’ll better understand how they work but all middleware is is just a function that is going to be invoked before uh certain API requests are being handled so in my case I want to make sure that right before my post request is being received I want to make sure that that middleware that parses the Json payload accordingly is being invoked so you typically want to register your middleware as early as possible so the best way to do it is doing it up top after you create your Express app instance so I’m going to go ahead and reference app and I’m going to call the use method and this is the method that you use to register middleware and the middleware that we’re going to register is actually already built into Express so I can just reference Express and call this Json method okay so now you can even read over here it looks at requests where the cont type header matches the type option so in this case this is express. Json there’s also other um uh there’s also other things that you can uh parse to like let’s say if you’re trying to send text or if you’re trying to send uh URL encoded or raw data so hopefully that makes sense so in our case we’ll keep it as Json and let’s go ahead and see what happens if I send the request again so let’s go back into our under client I’ll click Send I’ll just click it again and now watch this you can see that in the console it is logging that request that that request body that I am sending to the express server and I can literally add as many fields as I want I can add a display name let’s do Anon the dev click Send again and you can see that it is being logged right over here okay perfect Perfect all right cool now let’s go ahead and actually do something with the data so like I said right now we don’t have an actual database so all I’m going to do is just push this user to the array so uh to do that what we’ll do is we’ll assume that the request body is valid but then in the next section I’m going to show you how we can actually validate the request body so I’m going to go ahead and create a variable called new user equals so we need to actually grab all of the fields from the request body but we also need to attach an ID to the request body and once again since we don’t have a database to manage our uh IDs because typically the database is responsible for generating those IDs all I’m going to do is just take uh the last element the last user in the mock user array uh take the ID of that last user add one to it and assign that to the new user the new new user’s ID okay so what I’ll do is I’ll first do this mock users so I’m just going to reference mock users um and then I’m going to want to get the last element so mock users. length minus one okay so the length of our array is going to be seven and I want to reference the last element so that’s going to be at index six because remember arrays are indexed at arrays are zero indexed and then we’re going to reference ID and just add one I know this is kind of like a hacky way to do it but I just want I’m just doing it just for a very simple example and then what I’ll do is I’m just going to sign uh or I’m going to destructure the request body so I’m going to destructure body from the request object and then I’ll just simply use the spreader operator on the body object to take all the fields from the body object and unpack it into this new object that I am creating that is assigned to new user and then I’m just then going to uh reference mock users. push new user and then I’m going to go and just return the new user and remember we want to send back a status code of 200 or I’m sorry 2011 because if I were to send this right now you you can see that I do get back the user but it sends back sends me back a 200 and for good practice you want to make sure the post request sends a 2011 so I can just set response. status call the status method and pass into a one and then call do send so we did this in an earlier part of the tutorial where we were making get requests right over here okay so let’s go ahead and test this out click Send all right so you can see whenever I click Send it will just keep creating a new user and it’ll send it back to uh the client which is this uh Thunder client as a response and it has the ID Auto incremented so that’s pretty cool all right so aside from get requests and post requests there are also a bunch of other HTTP request methods that you can use to handle in your Express API however you don’t need to know all of them but there are three others that I think is worth knowing about okay because you will be seeing them everywhere in documentation when you’re working with apis and you yourself will need to use as well so let’s talk about it so the other three are the put request patch request and delete request methods okay put and Patch request both are used to update data but they are technically different on how you update data so to better understand put requests let’s first talk about patch request first so let’s say for example you want to update some data on the backend using our users example let’s say I want to update one of my users uh username so maybe I want to change my username from anen to Anon 123 I would do that using a patch request okay a patch request updates a record but it updates it partially and what that means is you’re not updating the entire user itself you’re only updating a partial field you’re only updating a portion of that entire user record so instead of updating everything of that user record you’re only updating username you’re not updating username and display name okay so hopefully that part makes sense now with put request you’re not actually just updating a partial entity of that record you’re updating the entire resource okay so whenever you make a request to update something on the database using a put request you’re including every single field in that request body even if not updating it because if you don’t include that field then those fields will pretty much be removed or if you’re using like a SQL database those fields will be null so the next time you fetch the data those fields will always be null of course if you’re using mongodb they’ll just be updated in the document and they won’t even appear at all so hopefully that makes sense so so think of it like this put is for updating the entire record okay so even if you only care about updating username but you don’t want to update display name then what you need to do is when you update the username to whatever it is that you want you need to make sure that you include the current value of whatever display name is otherwise it will be overridden with patch you can pretty much just update only a portion of that user record so you don’t need to include anything that you’re not trying to update so if you update only the display name you only include the display name in the request body you don’t need to include the username and if you only want to update the username then you don’t include the display name so hopefully that helps you better understand the difference between put and Patch delete is pretty straightforward it’s used to pretty much just delete records from the database okay so you only really use it if you need to delete a resource SCE whether you’re deleting a user or if you’re deleting a product or an order whatever it is okay so hopefully that explanation makes sense so let’s go ahead and set up a put request for updating a user by its ID so we’re going to reference app and call the put method and for the path I’m going to reuse the path that we used earlier for our get users by ID request so I’ll just copy this up top over here and paste this over here and like I said before we can use the same path but as long as we have different request methods it will still work fine okay and we’ll now pass in the request Handler function as a second argument in the put method call so now we also need to make sure we are uh grabbing the route parameter from the request body or from the request object and we also want to make sure we’re grabbing the request body as well from the request object so let’s do some destructuring so I’ll go ahead and from the request object I will go ahead and the structure body so I’m going to get the request body because we need that because that is what is to contain the data that we’re using to update the current user object and I’m also going to destructure the prams object and then um from the primes object right over here I’m going to destructure ID just like like that now let’s go ahead and parse the ID uh convert it into an integer and check to see if is not a number so that way we ensure that we’re only passing in numeric strings and then we can convert them accordingly so const par ID equals parse ins ID just like that and then we’ll use the uh is not a number function to check if par ID is not a number so if this condition is true if par ID is not a number then we want to return response. send status and we’ll just do 400 which just means invalid um bad request okay uh and now we can continue so what we’ll do next is we want to find the user that we’re trying to update but we want to get the user’s index though we don’t actually need to get the user object just the user index and even with the index itself we can use the index to um retrieve the user by referencing it using the square bracket operator on the array itself so I’ll show you what I mean by that so first let’s grab the index uh of where the user is located so I’ll call this const um find user index and then we’ll reference mock user users and I’ll call find index so now we’ll pass in a predicate function and we want to search for the user by its ID so I’m going to reference user which is this argument in the predicate callback function and then we’ll search for the user byes ID so user. ID is equal to par ID okay not ID but par ID because we just converted it from a numeric string into an actual string so now what we’ll do is we do need to check to make sure that the the index is not negative 1 because if we actually don’t find this user if this predicate returns false then that means the return value of find index is actually negative -1 which means that that user is not found by its ID so we’ll check if find user index is equal to1 and we’ll return a stat status code of 404 so response. send status 404 if find user index is equal to1 so if find user index is not negative 1 that means we actually were able to get the index of the user based on the predicate function right over here so that means we can use find user index to access the user that we’re trying to update okay so hopefully that makes sense now let’s go ahead and do this let’s go ahead and reference mock users and then we’ll use the square bracket operator and pass in fine user index in between the square brackets just like this so this allows me to access the element at the mock users array by the by its index and remember we’re updating this entire user object so I can just simply assign this user object to whatever this object is now keep in mind that since we are using a put request remember we are updating the entire um object itself we’re not updating only one or two Fields we’re updating the entire thing okay and we’re updating the entire thing based on whatever the request body is so let’s say for example if the request body is missing certain properties but those properties are currently existing on that user we’re trying to update then that means those properties will no longer be on the user once we update it but there are some properties though that you never will update at all so for example if you’re using a database and once we do get to it you’ll see that we’re never going to actually modify um the ID at all because the ID is autogenerated by the database server so let’s leave the ID alone so I’ll keep the ID as pars ID just like this but everything else all the other fields will come from the request body object which is this body object right over here so I’m going to just destructure body so that will take all of the field all the fields from the body object unpack it and put it into this new object right over here okay and since we are not going to be passing in the ID in the request body that’s also okay as well okay so what we just did was we kept the ID the same and whatever the user passed in the request body is going to be used to update the user okay so if there were values that we did not include in a request body well they are now gone assuming that the user had those values defined so let’s go ahead and finally return a response um let’s send a status code send status of let’s just do 200 you can send 200 or 204 but I’ll just keep it simple and send 200 and now let’s go ahead and click new request let’s select put and let’s change this to Local Host Port 3000 API users and now we’re going to go ahead and update the user using a put request by the ID So currently we only have seven users let’s update uh let’s update Jack so the ID is two so for the route parameter we’re we’re going to pass to and remember make sure you have put request selected we’re going to go ahead and select select the body Tab and let’s pass a request payload or request body so remember this okay we are trying to update Jack this user object that has the ID of two username Jack and display name Jack if I want to only update uh let’s say the username but I don’t want to update display name with a put request then I must include all of the uh current values as well okay so for example let’s update uh username so let’s update it from Jack to Jackie or Jackson and let’s keep the display name as Jack so we’ll assume that we’re using the same value which we are click Send and you can see we get a 200 okay let’s go ahead and make a get request so let’s do new request get the user by ID of two you can see now we updated the username but we also did override the display name because we passed that in as the request object we passed it in the request object as well but now watch this if I omit display name and then I click Send now watch this when I request the user by ID of two you can see that it only gives me uh it gives me the correct user but we only have username now okay that’s because we omitted the display name and so that just pretty much gets uh removed okay it’s pretty much just taking the request body and using that request body to update the entire user object as a whole of course we’re never updating the ID as well now watch this if I remove username and I click Send and if I try to to get the user of id2 it just gives me this object with only the ID field so hopefully you’re starting to understand what exactly the put request is now of course if this is not what you’re trying to do and you only want to update a partial uh the a a partial part of the user object so you only want to update the username field without having to uh worrying about passing in the display name or other fields because your user field can have your user can have a lot of different fields and it can be a nuisance to pass all of those fields in the request body so this is where patch comes in okay so we’ll work on the patch request next but I just wanted to show you this as well if I were to just pass in a invalid ID it’s going to give me a bad request if I pass in a valid numeric value but that ID did not exist in the array or that user cannot be found in the array it’s going to give me four for not found so that is good okay cool yeah so hopefully that makes sense all right so let’s go ahead and set up a Pat request so patch request basically allows us to update an entity or a resource or a record whatever you want to call it partially okay so in the put request example we are updating the entire resource based on whatever we provide in the request body so everything just gets updated as a whole for the pass request we only want to be able to update either one or two or just a partial amount of fields without having to include every single field in the record that we’re trying to update okay because it can become annoying if you have let’s say a user with 10 different fields and you don’t want to include that all the time so let’s go ahead and set up a patch request so app. patch SL API users so we’re going to reuse the same path of course because we can since we’re using a different request method and then let’s go ahead and pass in the request Handler function in the as a second argument for the patch call and since we’re going to do the same thing um with the check for the ID for the route ID sorry the route parameter ID I’m just going to go ahead and copy um actually most of the stuff up over here but I will explain again for those of you who are watching just the segmented part of the entire expressjs tutorial cuz I have this in a one hour about like a 1 hour to one and a half hour long video and also in its own individual videos as well so in case you uh are not watching the entire tutorial Series so what we’re doing here is is we are destructuring the request body object as well as the route parameter object and then from the route parameter object I’m destructuring the ID all from the request object okay then I’m going to parse the ID so I’m basically taking the ID which I’m expecting it to be a numeric value so I use the parse int function to ensure that when I passing the ID the return value of pars int or of par int with that ID gives me a valid numeric value so we use the is Nan function to check to make sure that parse ID was parsed correctly and is not a number because if you were to pass in a string let’s say you know just random name instead of a number then parse ID would resolve into Nan which is not a number so we would return response. send status then what we’re doing over here on this line which is identical to what we did up here in the put request is we’re just simply searching for the user in the mock users array based on the ID and that’s where this whole line comes in we pretty much just check if user. ID is equal to parse ID okay and additionally if uh find user index if its value is negative one that means find index the method call uh was not able to find that user um by the ID so that predicate failed so it was not able to find the user so it returns negative 1 but if it returns anything but negative 1 then that means it was able to find the user so hopefully that makes sense so we do this check right over here if find user index equals -1 then we return a status code of 404 because that means the user was not found so hopefully that makes sense I didn’t want to have to rewrite that whole thing again but I hope it is straightforward so and if it is a little bit confusing just re-watch the previous video on the put request so that that way you understand but that I only did that for people who are watching these segments AP part okay so now the major difference here is the way that we update the user record in the pull request we updated the entire thing you can see the only thing that we did not update of course was the ID but we took the entire request body and we pretty much just uh put it into took all the field values and put it into this new object and took that object and assigned it to well we override we overrided current existing user okay in the patch request we’re not going to override every single field so the body itself the request body might only contain let’s say one field that we’re trying to update so any current field

    values that are in that user record must not be touched at all so they must stay the same so the way we can do that is first let’s reference mock users and pass in the square brackets find user index so that way this is the user that we’re trying to update date and what we’re going to do is this we’re going to go ahead and take we’re going to copy this mock users uh fine user index I’m going to reference it I’m going to use the spreader operator on this mock users reference at fine user index okay so I’m going to take all of the current field value Pairs and put it into this new object so all of the current values will be inside this new object and then I am going to take all of the field value pairs from the request body use the spreader operator on it and put it into this new object so basically what I’m doing is this I’m taking the existing user currently that we’re trying to update taking all of its key value pairs putting it into a new object then I want to take the request body and all of its key value pairs that we are using to update the actual user and unpack it and put it into this new object so that way it will override those current values okay so imagine if you had the current user um let’s see for example right over here the current user is currently ID of have three username atom display name atom I’m taking all of this data right over here putting it in that new object and then the request body would uh have whatever key value pairs that we were send sending over to the server so if we sent username it would override uh it would use the request body’s username field and override it with the current username field so Adam would get overridden with whatever we passed in for the request body okay and if we didn’t pass in a display name that’s okay because display name would not be touched at all and it would stay the same so hopefully that makes sense and let’s go ahead and just return uh let’s do send status of 200 because we can also send either 200 or 204 as a status code for patch as well so let’s actually try to use the patch request so first let’s grab all the users let’s make sure everything is okay so I’ll go ahead and update Jack but this time we’ll use a patch request so I’ll just change it from put to patch uh the ID is going to be number two okay so now watch this when I use the patch request I’m going to update the name the username from Jack to Jackson okay we got a 200 okay status now watch this when I make a get request you’ll see that username is updated and display name stays the same now remember in the put request if I don’t include the display name the display name will be overridden okay with the patch request I can only update what I just want to update I don’t have to include display name and put a value for it I can just update username and then only username gets updated if I only wanted to update display name let’s do display name to Jackson I can just update the display name if I want to update both so let’s update both back to Jack not password uh display name Jack Okay click Send and you can see now both Fields get updated so hopefully this helps you understand the difference between put and Patch requests you use both of them to update data but the way that you update the data is different remember put is used to update the entire resource in our case we would use put to update the entire user object patch is used to update only certain fields on that user object okay so hopefully that makes sense all right so now we will take a look at the delete request method so it’s pretty easy to use delete and it’s pretty straightforward you just use it to delete stuff on the backend server and the backend server typically deletes it from a data source like a SQL server or mongod DB uh any general database so what we’ll do is we’ll reference app and call the delete method and I’m going to reuse the same path because it doesn’t make sense to to not reuse it so now we have/ API users slon ID for the route parameter and we have this path registered with a delete method we’ll pass in the request Handler callback function now with delete requests you actually typically don’t need to pass a request body you can if you need to perhaps you might need to provide extra data in the request body so just wanted to point that out as well but typically if you’re just deleting stuff it’s pretty straightforward so you don’t really need to provide you know like a payload but if there’s other things that you would like to do on the server side and you it requires data in the payload then you can definitely pass a request body so we’ll do the same thing we’ll go ahead and grab the route parameter so I’m going to do the same thing that I did earlier for the patch request and the put request I’ll simply just D structure uh request. prams I’ll destructure the ID from request. prams um actually I’ll do it like this prams ID just like that it looks more cleaner and then what I’ll do is I’ll parse the ID to make sure it is a valid numeric ID so cons parse ID equals parse parse ins ID and then we’ll do the if is Nan check we want to make sure that parse ID is if it is not a number then we want to return a response with a status code of 400 which means invalid which just means bad request which is because of the invalid ID okay so now we want to of course just remove the user from the array itself or if again if you’re using a database once we get to that we would actually remove the user from the database in our case we have to remove the user from the inmemory array so what we can do is this so I’ll go ahead and use the splice method and uh what I need to do is I need to get the index of the user that we’re trying to remove so let’s do that so we want to get the index and then we’ll pass into splice and I’ll just remove the user from from the array so let’s do this const find user index mock users find index and I’m going to go ahead and pass the predicate function which is just going to um find the user by its ID and remember find index will return negative 1 if we’re not able to actually find the user at all in the array so we need to do a check to see if F user index is equal to1 and if it is we’ll do the same that we did in our patch input request we’ll return response. send status and we’ll do 404 because we can’t find the user all right so now that we were able to uh handle this case at this point we know that the user uh we we have the user index of where of where they are located so what I can do is I can call mock users. splice pass in uh starts and I I don’t think we need the leete count because it will just remove the element from the array um so we and I think it’ll just remove only one I think okay uh hopefully that makes sense and now uh what I can do is I’ll just return response. send status 200 and let’s see what happens so let’s go into our Thunder client let’s click new request we’ll make a request we’ll make a delete request so I’m going to select the delete method and let’s do localhost API users um I want to delete user with ID number two so I’m going to use I’m going to pass number two as the route parameter and we’re not going to put any request body we’re not going to send any request body uh let’s see parse is not Define that I messed something up let’s see oh whoops I forgot to change this to I forgot to write the rest out it’s pared ID not parse ID or parse y sorry about that um yeah this is kind of reason this is one of the downsides of JavaScript I do need a linter though I agree with needing a linter to detect these issues but it’s okay we fixed it and let’s go and run our app again so going back to vs code in the Thunder clim I’m going to go ahead and click Send and let’s just see if I can get the user by its ID so it says four for not found let’s make sure the users array is valid um let’s see so it seems like um okay so I know what the problem is so it seems like it’s sliced it spliced everything starting at the index so we actually only need to delete we need to do spec we need to specify the delete count cuz I think it removes everything after that index so let me actually fix that so so we have all of our users let’s try to delete the user so delete okay and let’s try to get all the users again okay so all of our users are here I’m not sure why though it is returning as gray this time that’s kind of weird if you ask me um but if I try to get the user by its ID it’s not found but I but I can grab the other users Okay so so um that works so um that’s pretty cool and you can see that in the browser I don’t have the user by its ID anymore so let’s just delete a couple more let’s delete three if I refresh I don’t have user of ID3 anymore let’s delete user number one okay so now I’m only down to four users left so that is pretty much how you can use the delete method okay so hopefully this makes sense and hopefully you now better understand how to use all five of these HTTP request methods we have went over get requests post requests we went over put requests and Patch requests and then finally we went over delete requests now if you want to see a list of more HTTP request methods you can go over to the Mozilla docs over here you just Google this uh HTTP request methods you can see that there are get requests there’s also a head method as well but um you know you don’t really use these that much but sometimes you will use them there’s also the connect method options Trace I personally have never really used these that much but there might come a case where you do need it but in that case you can just read up about it and you know see what you’re supposed to do with these methods and use it accordingly all right so now I’m going to go ahead and teach you all about how middleware Works in expressjs keep in mind that middleware can be defined differently in different environment but in the general sense it really just means one thing and that means it’s just a mid process between one or two or many different functions or other processes so in the context of expressjs a middleware is just a function that can have logic but the middleware function also is a request Handler as as well so that middleware function has the request response arguments as well and you can actually use the middleware function to return a response if you want to so I’ll show you a simple example of what a middleware function could look like so I’ll create a simple function I’ll call this logging middleware and remember this middleware function will have access to the request and response objects as arguments okay and additionally the middleware function or the request Handler function also has access to this next argument which is a function that you call when you are done with the middleware okay so what I’ll do in this simple example is I’ll console log two things I will consol log the request method and then I’ll conso log the request URL okay and then once I’m done with logging that to the console I’m just going to call next and that’s it in order to now use my middleware there’s two ways I can enable it globally so all of my routes will have this middleware be invoked right before its request Handler is called or I can enable it for each specific endpoint so I’ll show you both examples so let’s call app.use to register our middleware globally so all I do is I just pass in logging middleware as a function or as an argument like this okay now if I were to go into let’s say my browser if I visit the base URL of our application you can see that in the console it now logs the request type so gets what o it logs get and then the URL that we’re trying to visit if I go to SL API users it will go ahead and log that as well if I were to make any request to any endpoint it’s going to log that okay so it is enabled globally if I only want this middleware to occur for only certain endpoints so instead of logging it globally or instead of um registering globally I want to take this middle let’s say I only want to do it for this uh base URL so what I can do is I can pass that middleware function as an argument like this okay so now if I go back to let’s let’s just go to/ API users and you’ll see that nothing is being logged however the moment I go to the base URL and make a request there it logs it to the console so that is good now one more thing to mention is that uh you don’t even need to assign it to a variable and pass it in like this you can just pass it in like this if you really wanted to and then pass in the arguments request response next okay now one thing to mention is that if you don’t have the next function and if you don’t call it it’s not going to go ahead and call the next middleware so in this situation right over here I have two middleware functions uh let’s call this one middleware a okay uh middleware a will be called first and then after middle middleware a is called it has the option notice how I said option to call the next middleware the reason why I say it has the option is because in this middleware you can control the request and send back the response if you need to so this allows you to uh write additional logic that you can reuse for different endpoints that might share that same logic and let’s say for example if the incoming request is missing some kind of authorization token you don’t want to continue to the next middleware or the next request Handler so you want to reject that request by sending back uh maybe like a status code of 401 okay so for example what I’ll do is I’ll just simply log base URL and I’m not going to call the next function now watch what happens if I refresh you’ll see how it is stuck in this pending State and it it does log base URL but the client never receives a response back that’s because we’re not calling the next function so you need to make sure you call the next function in order for it to call the next middleware down the chain okay you can have as many middlewares as you want called in sequential order so I can even add two more like this and then I’ll just call next after each one and if I refresh and if I look at the logs you can see every single middleware was called and let me add one two and three so you can see that it is called in sequential order base URL 1 2 and three all being logged in sequential order hopefully that makes sense another thing that I also want to mention is middleware must be registered before a route if you’re using app.use register it so what I mean by that is if if you want a middleware to be registered for all of your routes you need to make sure that you call app.use right before you call you know app.get app.st app. put Etc okay if you were to register the middleware let’s say after you called those app. poost and app.get methods your middleware is not going to be registered for those routes so order matters in this case so I’ll show you an example let’s say I’m going to go after SL API users I’m going to go ahead and and uh call uh app.use right over here on line 44 and pass the logging middleware so what I’m doing is I’m registering the middleware for all of the endpoints that are registered after I’m calling this app.use so these two endpoints right over here will not have the logging middleware registered so I go into the browser and if I go to the base URL you’ll see that the console does not log anything if I go to SL users or/ API users you’ll see that the console doesn’t lock anything but if I were to go ahead and make a post request or a get request to this endpoint so let’s make a get request to/ API users1 uh you will see that it now logs uh it now logs in the console the request type or the request method and the URL okay so we’re remember order matters and one more thing that I do want to talk about is in the app.use uh method call you can also pass in as many uh middlewares as you want and they will also be called in sequential order as well so just one more quick example I’ll pass another middleware function and I’ll just write a console log and I’ll say uh finished logging and I’ll call next and Let me refresh and you should see that it says uh so it first it logs uh the first thing which comes from the logging middleware and then once that middleware is done it calls the next middleware okay and then the logs finished logging and now once we are done with this next middleware remember we call the next function and then it’ll just go down to the endpoint level so remember the request and response Handler is also a middleware as well so it also takes in the next function and then you can also call next in here as well but if you don’t have any additional middlewares after it then there’s no point to add that argument in the function signature okay so hopefully that makes sense okay so let’s go ahead and take what we just learned and put it into uh work so what I’ll do is since I have a lot of reusable Logic for a lot of my endpoints so notice how in this app dop put uh endpoint I have a lot of the same logic right over here that is written in the app. patch method and the app. delete method okay so what I’m going to do is I’m going to take all of this right over here I’m going to copy it and I’m going to go ahead and create a function up top over here and I’ll call this handle user by ID or maybe I should call it resolve user by ID okay because the goal of this logic is to really get that um index by the user ID so maybe I should call this resolve index by user ID yeah let me call it this instead okay so this will be an arrow function I’m going to paste the logic in here and remember because it is a middleware and the middleware is also a request Handler we have the request response and we need the next argument as well so three arguments Al together and now here’s the thing though what I want to do is I want to use this middleware right before I uh let’s see I want to use this middleware right before I call this uh request Handler because remember this middleware that I’m cre right now the purpose of this is to um grab that user index where it is located in the mock users and we want to be able to um uh have the next middleware that is called use it but in order for the next middleware to actually be able to use that information we need to be able to pass it somehow now there’s no direct way to passing uh data from one middleware to the other but but what you can do is you can attach properties to the request object since we’re using JavaScript we can dynamically attach properties very easily to the object so I can reference request and I’m going to go ahead and reference find user index so this obviously does not exist on the request object but I’m just going to assign it to this just like that okay so now in the next middleware and all of the uh succeeding middlewares that are being called assuming that we don’t ever delete F user index from the request object they will have access to this F user index property which is going to be a numeric value so once we are done we’re just going to call next okay and now one more thing that I also did not mention is that uh next actually does take an argument but it expects an error object or null so if you do pass an error object or an eror an error instance such as like this like new error this will actually throw an error at the express level if you don’t pass in anything then it won’t throw any error at all and it will just assume that everything is successful okay but we are handling errors though with uh these checks and sending back the correct status based on whatever data that we send to the server so we should be fine okay and since we’re not referencing the request body in this middleware at all because we actually referenc the request body at the final request Handler function we’re just going to remove that the structure of the request body right there so let’s actually use this for one of our endpoints first just so you all can see how this works so what I’ll do is I’ll use it for my put request to update the user by ID so we just pretty much take that middleware and we pass it as an argument right before our final request Handler which is this request and response or which is this request and response Handler over here here now since all the logic that we have inside resolve index by user resolve index by user ID um we all this logic that we see over here was moved into that middleware function so I can just delete all of this okay so I’m going to just remove all this I still will need the request body though so I will remove at least the destructuring of the request prams but I’ll leave the the structuring of the request body right over here and remember we never modified the request body at all now we do need a reference to find user index in this request Handler scope so I will need to destructure that and I can now that in the resolve index by user ID middleware function I got the index and I attached it to the request object okay so at this point if we hit this part right over here we can assume that fine user index is in fact defined because if it was not defined um then we actually wouldn’t even be uh in this in this uh final middleware at all okay so now I can access find user index from the request object but now I also need to fix this par ID because that was something from that we had before but we no longer have that but that’s fine because I can still reference mock users use f user index to uh reference the exact element at the position in the mock us array and then just simply reference. ID like this okay let’s go ahead and just test this out before we modify the other end points and see how this works all right so back into our Thunder client let’s make a put request so put and then logo host uh Slash API users so I guess we’ll update user uh with ID3 which will be adom so let’s send the request body so let’s do username let’s change this to Jackie so if I click send everything works fine if I were to get that user again the username was updated and since we didn’t provide a display name that was um pretty much just overrided okay so that is working just fine so let’s just update the other um the other uh end points as well but before let’s just recap of what’s going on so whenever I make a put request to/ API users and then the route parameter we provide which was number three it’s going to go ahead and first call the first middleware well first it will call all of its uh Global middlewares if there are any that are registered before that route in our case we only have express. Json which we need to parse that Json um into that Json into natural Json object so that is invoked first obviously then we don’t have any other Global middlewares invoked so we invoke the resolve index by user ID middleware and then it will go through this logic basically the same thing that we’ve been doing already just moved into a separate function uh the only difference is that we attach this fine user index property or we add this property to the request object and assign it a value which is the index of where the user is in the mock users array and we call next so once next is called it will now call this final request Handler which is also middleware and then from here we just simply uh update the mock users or update the user in the mock us array and then we return a status code of 200 that’s it let’s go ahead and update uh our patch request let me just copy this middleware function name pass that in there uh same thing just remove that prams destructure I don’t need all of this anymore uh and then let’s see let’s the structure find user index and I think that’s it for patch let’s just test that out make sure that patch works so I’m going to go ahead and update user number three so since we restarted the server um the username should be back to Adam and so the display didn’t be there as well I’ll just update the username using the patch request there we go and if I click send you can see the username was updated okay so the patch request is working good and of course if I were to provide an invalid value the middleware will pick that up for us you can see it says bad request invalid ID and that is handled right over let’s see should be handled somewhere over here um oh you know what we haven’t did it for we haven’t done it for the get request it we’ll do that later okay but at least uh let me do this if I make a put request to this you can see that this part gets handled by the middleware for the put request and same thing for the patch request as well we get a bad request if I were to pass in a valid numeric ID but it doesn’t there’s no user with that ID then it’ll just give us a four for and that is all being handled by the middleware that we just created okay cool let’s go ahead and do the same thing for delete uh so let’s pass in resolve index by user ID let me remove all of this stuff right over here yep and for this part we just need to uh grab the fine index user just like that so that way we know where to splice or I’m sorry it’s fine user index okay now let’s go ahead and try to delete a user so I’ll will uh delete user with ID3 if I tried to get that User it’s not there anymore okay see how user of ID3 is not here anymore okay let’s just go ahead and fix up the last one which is the get request um so let’s see uh we need to um so the way that we are actually returning the user in the get request is done different because we’re using the find method and not find index to actually get the user object itself and we’re just returning that as a response but what I could do is I could still use the same middleware resolve index by user ID and I can grab the uh find user index value from the request object and then I can just use that to reference the mock users array to return the correct user so let’s just do that just so that everything is consistent with each other so let me remove all of this and I’ll go ahead and the structure find user index um and I’ll just do this Con find User it’s always good to just double check just to make sure even though we know that find user index does 100% resolve to a user in that array but it’s always good to check just to be safe so mock users find user index and if there’s no user we’ll just return to 404 and if there is we’ll just return find user okay so we’re still using we’re still utilizing our middleware for all of our um endpoints that we’re using the user ID to search or perform operations on so now if I try to uh get the user by ID uh it says mock users oh let me fix that I think it’s mock I uh misspelled that it’s case sensitive let’s try again okay there we go so that is pretty much it with middleware I know it’s a lot but middleware is very powerful and understanding how it works is very worth it when you’re using expressjs because everything in expressjs that you’re going to be using has to do with middleware in some way shape or form so it’s good to learn how middleware Works learn the ins and outs of it and understand how you can use it to your advantage okay so hopefully all of this made sense all right everyone in this part of the tutorial I’m going to teach you all how to use express validator to validate incoming data for our Express API the reason why this is important is because sometimes the data that you expect is not the data that you receive let’s say you want to create a user and save it to a database so you obviously need a post request to to a user’s endpoint to create that user so that post request will expect a request body and we want to make sure that the username is not over 32 characters of length now we are expecting that but that doesn’t mean that the client will send a username that matches our constraints so you want to make sure that you check to see if the username is 32 characters or less now some of you might be wondering well if I’m validating on the client side let’s say if I have a react or angular project and that project has a form and when I click on the form button it will send a post request to my server well if I’m validating that form before I click that button before I submit that API request why do I still need to validate on the server side the reason why is because the API your express application does not know where that data is coming from you can literally go into the web app open up the network Tab and inspect where that post request is being sent to which endpoint it’s being sent to take that URL and throw it in something like Postman or even the Thunder client that we’ve been using to make API calls and send whatever you want and bypass the client side validation so you don’t know where the data is coming from so you always need to make sure you are validating it on the server side in my opinion I think the server side validation is the most important more important than the client side because the server side is where you’re actually going to process that data save it to a database submit it to another external API or do whatever you want with it okay so you must always validate on the server side no matter what so let’s go ahead and install Express validator so I’m going to type npmi Express hyphen validator just like this and then I’ll run my Express server let’s go into our code and we’re going to go ahead and import a function from the Express validator package just like this whoops so import and then pair of curly braces so I’ll I’ll import the query function and this is used for validating query parameters okay so there are a bunch of different middleware functions that you can import from Express validator and in case if I didn’t mention earlier yes these functions that you are importing you are using them as middleware so what that means is that we’re going to be calling them uh by passing it as an argument to our request methods such as app.get for example and then we want to make make sure we’re calling them right before our final request Handler which is also a middleware as well in case if you didn’t see the middleware section of this tutorial definitely check that part out either in the previous video if you’re watching just this Express validation tutorial or if you’re watching the entire thing just go a few minutes back to where we talked about middleware okay but what I want to do is I want to pass this query function call as if it was a middle wear so we’re going to pass as an argument right before I passed this request Handler function so it’s pretty easy we’re just going to go ahead and call query and then comma so we now have three Arguments for this app.get endpoint right over here and now what I want to do is I want to specify the query parameter that I want to validate so I’ll just do a simple one we’ll do filter okay and when you call the these functions okay in this case we’re calling query it creates a validation chain so basically it just basically means that when you call this function it returns an instance of validation chain and from here on you have access to a bunch of methods that you can use to determine what you want to validate so if you want to validate that filter is a string you can call this is string method and this returns an instance of validation chain so you can call literally the same method as many times as you want obviously you don’t want to do that but the whole point is that you can use this validation chain to perform more validations in order or it doesn’t really matter in this point but the point is is that you can use this validation chain to keep on calling more methods to validate on that single filter field so let’s say you want to validate that filter is a string and then you also want to make sure uh let’s see that is not empty okay so this will ensure that it is a string and it is also not empty now I will mention that with query parameters in expressjs they are always parsed as strings so even if you pass in a numeric value in the address bar as the query parameter for our filter or really any query parameter it’s it’s going to be parsed as a string and you’ll see in just a second so what I’ll do right now is um this so I’ll make a request so let me go into my thunder client right over here and let’s make a get request to the users endpoint and for now we’re not going to pass in the query parameter for filter I’ll click Send and you’ll see right over here that nothing happens although we are expecting an error to occur why is that the case well here’s the thing these functions don’t actually throw an error they don’t reject the request you actually have to handle that yourself so how do we handle that well remember middlewares are called in sequential order so this query function that I’m calling this is going to be the first middleware that we’re calling and then it’s going to call the next middleware so it’ll call this request Handler which remember it is also a middleware as well so inside our request Handler in the function body we need to take care of the error handling part because the query function won’t throw any errors for you it will validate the fields but it just won’t throw any errors so you as developer needs to handle that yourself so just very quickly I want to consol log this request object because I want to show you what happens under the hood I know some of you might not be concerned about it but I want you to also get full context with what is going on instead of just telling you to call all these functions so what I’ll do is I’ll make a get request to this endpoint and uh I’m logging that request object but I want to show you that you can see right over here in the request object we have this new property that is attached to that request object and express validator attach that themselves okay and it’s attached when we call this query function middleware and then now we can actually see that it’s right over here okay and I’ll go even further further let me just copy this part over here and access that direct field and show you even further what that looks like so you can see we have this context array uh or this array of context it’s an object and it has a bunch of metadata about uh the validation you can see we have Fields locations um errors okay a bunch of different stuff obviously you don’t have to worry about this but underneath the hood what happens is when we call this query middleware function it’s going to go ahead and validate um the field for you and then it’ll attach the data to this request object okay and from here what you want to do is you want to call this validation result function so let me import that from Express validator so validation result that’s a function and you want to call that function and let’s assign the return value to a variable called result so we’re going to call this validation result function and we want to pass in the request object okay just like that and what this will do is it’ll grab that field and it will extract pretty much the validation errors and you can handle that yourself so instead of having to manually do that yourself you can use this validation result to do it for you that’s why they provide this function so let’s go ahead and send a request again and now you can see that when I log that result object I now have everything in a proper format you can see that we have this errors property which is an array of errors and you can see that we have two errors one we have an invalid value which I guess makes sense because we are trying to validate if it is a string and then we’re also trying to validate if it is not empty so we have two different things we’re trying to validate so we have two errors total so invalid value and an invalid value as well but if I go ahead and pass in that filter query parameter and then let’s just give it a random value let’s just do Anson and now you can see that that errors array is no longer populated with errors because we don’t have any errors anymore because we just pass in that filter value right over here of course if I don’t pass in a value we still will get an error it says invalid value because we have this not empty call right over here and you can also take a look at the documentation or in your vs code if you just uh use the dot operator after this not empty call you can look at all the other methods that you can use to validate your Fe Fields so let’s do a validation on the length of the value for filter so let’s use is length and then this will take in options so let’s do uh Min character length we will go ahead and do three characters and then for Max will do 10 characters so now I’m going to go back to my code or my uh vender client so if I pass in let’s just leave it empty like this let’s see we should get two errors okay um if I remove the entire query parameter we should get three because now we’re calling three functions we’re chaining three functions let’s go ahead and pass in the filter and let’s do do a n so n if I click Send you’ll see that we get this error and now if you actually look at these errors you’re probably starting to feel confused on what is what you know so we can actually use this method after we call is length called with message you can actually pass in a custom error message and you can see over here it says it sets the error message for the previous validator so this with message call is going to uh the the message itself that you pass in here will relate for this validator okay so we’ll do um must be between must be at least 3 to 10 characters uh and let’s add a custom with message call for not empty so must not be empty uh okay let’s try it out so if I click Send and look at the console you can see now we have that custom ER error message okay hopefully that makes sense and if I leave this empty you can see that we have both of our errors must not be empty and must be at least 3 to 10 characters so that is good okay so now if I were to pass in just let’s say five characters now we shouldn’t get that error anymore and we don’t but if I exceed uh 10 characters it now it gives me this error must be at least 3 to 10 characters so hopefully this makes sense so this is how you can validate query parameters now let me go ahead and show you how we can validate request bodies because that’s also very important as well so similar to query parameter uh we have this query function for quate parameters but we also have a function to validate request bodies and that is the body function and you import that from Express validator just like this and it is used the same exact way so if you understand how to validate the query parameter you then can validate very easily the request body so here’s what we’ll do we’ll go down to uh our post request for the API users endpoint and right before our final request Handler we’ll go ahead and call the body function and pass that as an argument into appost so it’s going to go ahead and call this body middleware function first and then perform the validation and then it’s going to go ahead and call that next middleware that final request Handler function right over here and then similar to what we did with the query parameter in that request Handler function we want to actually uh use that validation result function to see if there were any errors at all okay so here’s what we’ll do so now we’ll go ahead and specify what field that we want to validate on the request body so for the request body I want to validate the username and then I also want to verify that is not empty by calling the not empty function and I’ll use with message username cannot be empty and then I want to make sure that the max is let’s do 32 characters so is length we’ll do a Min of five characters and Max of uh 32 and then with message username must be at least five to five characters with a Max of 32 characters and then um let’s see oh let’s also make sure it’s a string username must be a string all right and let’s go ahead and try to make a request a post request to this endpoint uh whoops let me see oh let me go ahead and do this before we do the post request I forgot that we need to go ahead and call that validation result function so let’s do that validation result result okay so cons result equals validation result and then let’s conso log result and see what happens so I’ll send this request uh oh whoops I’m sorry I was supposed to pass in request not result for the validation result sorry about that okay there we go that works okay so let’s see what the problem is okay so now we can see that username cannot be empty uh username must be at least five characters with a Max of 32 two characters so we do have our errors so that’s good okay now here’s the thing though I want to validate not just one field but I want to validate multiple Fields as well I don’t want to just validate the username field okay so what we can do is we can actually pass an array of body function calls so instead of having to pass it in like this and then uh you know pass in another middleware function let’s say if I wanted to just very quickly validate display name and do not empty like this okay let me make a request and you can see now let me zoom out a little bit you can see now I have four errors all like this instead of just passing it uh individually like different arguments we can actually just pass it as array like this so we pass in one array and then it’ll call all of these not that it will matter all that much because in the end it will still validate everything for you so let’s go back to thunder client and we’ll send some requests now with some valid data so let’s go to Local Host Port 2000 API users username Anon display name Anon the dev and if I look at my console you can see that we have no errors the moment that I omit any one of these values I’m going to get an error in that errors array right over there so if I omit username you can see that uh yep we get the errors for username okay that’s good so let’s go ahead and customize our logic now because we obviously don’t want to do anything at all when there are errors in our case we don’t so we want to make sure that we can actually check to see if there are errors or not on this result object and to do that there’s actually this is empty function and this returns true or false and it returns true if there are no errors and if there are errors it will return false so what I can do is I can useing if statement and I’ll just do if there are no errors so if result is not empty then I’m going to go ahead and return response I’m going to set the status to 400 the status code to 400 and I want to send back the errors so I’ll just send an object or yeah an object with the errors property and to actually get the errors you can reference result and then you can just call this array method and this will just give you all the validation errors as an array as it says over here gets the validation errors as an array you can map it if you want if you want to alter what is sent back uh based on that errors array you can do that if you want let’s go ahead and try this out okay so let’s omit the display name and you can see now I get that 400 status code which means bad request and that’s typical whenever you send an invalid payload so in this case we’re sending a payload with no display name and you can see I get the error uh invalid value path display name location body now of course ideally you would want to clean this up because you want to have something that is more um understanding to the client so that they understand it very easily but I’ll let you all take care of that and if I omit the username you can see now all of the errors let me zoom on a little bit whoops you can see now all of the errors appear right over here okay so hopefully that makes sense so we’re not quite done yet because we still need to actually save the valid data to our uh quote unquote database or our array in this case of users right now we’re still using this body object that comes from the request object and this data can be either valid or invalid we don’t know okay but since we are using Express validator we want to make sure that we are using the validated data of course there are different ways that you can handle this since at this point we are throwing an error or returning a status code of 400 we can safely assume that the data is valid by just referencing body Dot and then whatever field name we want but instead what we can do is we can actually use this function called matched data so let me import that up there so match data is imported from Express validator and then I’m going to go back down here and what I can do is I can simply just call let’s do this const data equals matched data okay and just pass in the request object like this and then what this will do is it’ll grab you all of that data that has been validated needed so I’ll console log this so you all can see so let’s get the username and let’s pass in a display name so now I can see that I have username and display name right over here okay and this object that is being logged is the Matched data return value which is pretty much the validated data so I would recommend you to to use this data object instead of the request body so let’s just fix that real quick so let’s remove uh this these two lines and then let’s see we’re going to replace this reference of body with data and I think that’s all we need to do all right and that is pretty much it that is how you can validate request bodies for your post requests and you can do the same thing for put request for patch request and really any request method that takes a request body and since you know how to validate uh validate request bodies and also validate query parameters you should now know how to validate other things too such as headers cookies route parameters it’s all the same thing now very quickly I wanted to show you all how you can use a schema in Express validator to make make your code look a lot more cleaner because right now if I look at this part right over here um I have a bunch of validation going on and this is just for only two fields and you can imagine if you have a lot of different fields that is being sent to uh the the server this can start to look more and more cluttered so we can use a schema to make things look a lot more cleaner and a schema really just is an object that has all of your validators defined so instead of having to have all of this being chained after calling each function all you do is you use this check schema function and you pass in the schema which is just an object and then what that function will do is it’ll create a list of validation chains so that way it can just save you a couple lines of code and make it look a lot more readable so what I’ll do is I’ll create a new folder called utils and I’ll create a new folder inside this folder or not not inside uh I’ll create not a folder I’ll create a new file called validation schemas because I want to keep everything separate and then what I’ll do is I’ll create a variable called create user validation schema I always like to be verose with my variable names but it’s up to you and then now what I want to do is I want to define the field that I want to validate so in this case I want to validate the username field so I’m going to use that as a field inside this object create user validation schema and then for username this will be an object and inside this object is where you will specify what you want to validate so if I wanted to validate the length so what you would do is you would just take the name of this method they’re going to it’s going to be the same exact thing so whatever the name of the method is is going to be the name of the field field that you’re going to configure inside this object so for example is length I’m going to go ahead and type is length just like this and so this is going to be an object and you want to pass in these options so options and then it’s going to be the same exact thing you can pass in Min and Max for options so Min of five so this will be a minimum of five characters Max of 32 characters so this is how you can validate the username and its length let’s do the same thing for uh the not empty validator so again you take the same method name not empty you can even just copy and paste it uh whoops not there right over here now since not empty does not have any options we can just set this to true but of course if we did provide options we could just map this to an object and do the same thing like this options like that same thing for the is string validator we don’t have any options configured for that so I can just take the same exact method name and then set it set its value to true however if you did have an error message like a custom error message like we have over here we can also specify that as well so for is length inside the is length object right over here I can go ahead and specify this error message field like this and I’ll just go ahead and copy this whole string and paste this right over here like that now since uh not empty does have a custom error message instead of setting this true what I’ll do is I will provide an object like this error message and then that okay and then what we’ll also do same thing for is string let’s copy that and do this and of course since you have this object over here it pretty much implies that you are going to obviously check for these two validators so you don’t need to worry about the Boolean value anymore and uh let’s see what else um okay yeah that’s pretty much all we need for this so now to actually use the schema what we’ll do is let’s remove all of this let me just make sure we have everything uh username oh whoops that was only for username uh let’s do display name I forgot about that display name and I think the only validation we had was not empty so let’s do not empty and then let’s just we’ll just do true for now okay let me go ahead and remove this whole array and then now we’re just going to call this check schem of function so let me go up top over here and import check schema just like this and let me go back to the post request so right over here we’re going to go ahead and call check schema and then now you’re going to pass in that schema definition which is just this object that we created so let’s import that so up top over here we’ll import from utils validation schemas create user validation schema just like that and I’ll pass that object in here and let’s actually see what happens so if I go into Thunder client let’s make a new request to Local Host Port 3000 okay so I am getting an error in the console and I think it’s complaining about the import uh I think it’s because I’m missing the extension at the end tojs but I realized that I uh am supposed to use MJS so let me just quickly fix this and add that MJS extension at the end because if I don’t have that extension it’s going to throw this error but if I add that extension at the end the error will be fixed okay so I just wanted to mention that very quickly but now if I were to go back into the Thunder client and let’s try to make a post request now you can see that now I get the errors right over here it’s complaining about the display name the username and all of the different errors are that’s going on with it if I pass in let’s say username and let’s let’s do let’s say if I pass in just two characters for username you can see that it’s going to complain about username must be at least five characters with a Max of 32 characters and the other two validator errors are not there because we actually provided a value and it is not undefined so yeah it’s a string and it’s not empty okay and then you can see that since we don’t have display name that is not uh since we didn’t provide that in the request body the error appears right over here okay so hopefully that makes sense and hopefully you can start to understand how using schemas to validate your request bodies is a lot more easier than just having all of your validators in the same uh in the same uh file and just chaining them after each call okay so I would encourage you to do the same thing for this query validation that we did earlier for this get request I’ll let you all take care of that yourself just for exual practice so hopefully this all made sense so now what I want to do is I want to show you all how we can organize all of our requests using an Express router the problem right now is even though we only have a few routes to find as our application grows we could have 50 routes 100 routes a whole bunch and you obviously don’t want all of it to be in one single file you want to group together your API endpoints based on what is known as a domain so what I mean by that is for example we have a bunch of user endpoints and all of this handles different operations so that is known as the user domain the user domain is everything related to the user itself so when you create a user when you grab all the users from the database when you update a user that is all part of the user domain if you see right over here I have another products endpoint that doesn’t really have any other endpoints to do much with such as creating a product and this would be the products domain so anything related to operating with the product domain would be things such as creating a new product updating a product deleting a product things like that okay that’s what I mean by domain and what I want to do is I want to be able to group together all of my users endpoints separate from the products endpoint because it doesn’t make sense to keep everything all together okay the products endpoint should be grouped with everything related to products users endpoint should be grouped together with everything related to users if you have endpoints that handle Payment Processing maybe you’re talking to let’s say uh the stripe API or some other Payment Processing API then you would have a payments domain and you want to group all of your payments and points together so we can use use an Express router to do this and what I’ll do is I’ll create a new folder inside the source folder and I’ll call this routes and then I’m going to go ahead and create a new file and call it users. MJS and then inside users. MJS we’re going to import the router from Express okay and this is a function that we can call to create an instance of an Express router it’s it’s the same way of how we imported Express like this and then we called the express function the router import is also a function so I’m going to declare a variable and we’ll assign the return value of the router function call to this router variable which is in which has a lowercase R okay so these two are different obviously so now we have our router and the nice thing about this router is it has pretty pretty much almost all the same exact methods and properties that the express app instance has so you can see that I can reference the get method the post method delete all that kind of stuff okay the router itself is pretty much like a mini application in your entire Express app that can group together all of your requests so you can register requests on the router but then you also need to register that router to express okay so hopefully that makes sense so the same way that I am registering let’s say this get request right over here for/ API users I can do it do it on the router so let me go ahead and copy uh let’s say this right over here it takes the same exact method arguments you can see it takes a path so let me paste the path right over there so/ API users and then it takes uh as many handlers as you want to pass or middleware functions so we can literally pass this exact same these exact same arguments right over here like this okay let’s just import that query function from Express validator and this is something that we did in the previous section where we talked about validation in Express okay so next thing we need to do is export this router and then we need to import it into our our main index. MJS file where we have the express app instance because we need to register our router with the main Express app in order for the main Express app to actually have these routes mapped out so users can actually visit it or clients can actually visit it so I’ll export uh I’ll actually export this as a default so export default router just like that and then next thing thing that we’ll do is we’ll go into our index. MJS file and we want to import that router that user router so import user users router from uh and then the folder is routes and then users. MJS let’s make sure we don’t have any errors in the console okay everything’s good with the import so we can register this router now so that way um we can actually access the endpoint defined at the router level over here by simply just using app.use just like this and then you pass the user router like that and since we have the same endpoint defined at the router level we want to make sure we remove this endpoint definition over here so let’s just remove that okay so now let’s go ahead and try to access that endpoint using the Thunder client so we’re going to try and make a get request to/ API users so let’s do that and it says validation result is not defined oh whoops I need to also import validation result as well and let’s try to make a request mock users uh is not defined oh that’s right because um yeah we’re using mocku okay let me quick do this I need to move this mock users array into a separate file so I can export it from that file and import it everywhere else I need it so I’ll just create a new file I’ll call this constants whoops MJS and I’ll export this mock users constant and I’m going to remove this right over here and let me just quickly uh do this this let me import it inside the index. MJS file because we are using it here so up top I’ll import and this is a named export so mock users from utils constant. MJS and we’ll do the same thing inside the users. MJS file so import mock users from and then the pathway over here okay so no more errors so that’s good let’s just try to call this endpoint okay so you can see that it works and that’s good so we know that it is working and if I were to remove this app. use call and passing in the user’s router and save now if I try to make a get request it’s going to say four for not found because we did not register that router so hopefully this makes sense so now what I can do is I can take all of my end points that are relevant into users and place it inside this users. MJS file and then register those endpoints at the router level so let’s do that so let’s go ahead and do the same thing for app. poost API users so I’m going to go down here and I’m going to reference router. poost and I’m going to pass in those same exact arguments that I had passed in to app dopost so you can see right over here we pass in for the first argument the path and then all of our middleware functions let’s just make sure we have all of our Imports so we need to import uh check schema from Express validator we need to import the create user validation schema as well so let me import that create user validation schema okay and then uh let’s also we already have validation result imported we are using the match data function that comes from Express validator so let’s import that and this should work so now let me just go back to the index. MJS file remove this app. poost because it’s redundant and uh let’s go ahead and try to make a post request and you can see that it’s working just fine let me pass in a request body and then let’s see the result and you can see that we get a response back and of course if I were to just remove this it would say four for not found Okay and like I said you could do the same thing for all of our end points for the users domain so uh what I’ll do is I’ll move uh the get user by ID in there so let me just copy all of this and let me just delete this so let’s go up here I’ll put this right underneath here okay and then we do need to resolve index by user ID middleware function and since that is defined inside the index. MJS file we need to uh we need to of course export it or whoops not this one this one right over here let me do this let me create a new file inside utils I’ll call this middle mware middlewares MJS and let me export this and let me make sure I am importing mock users from constants MJS okay this is good so now we can import well first let me remove this and uh I’ll import that middleware first from utils middle wees resolve index user by ID because this index file is still using it and then what I’ll do is I’m going to go ahead and import this inside the users. MJS file so that gets imported right up top over here as you can see resolve index by user ID for this middleware um and I think we are good for uh this end point right over here and I did I did remove it so that’s good so now let me go ahead and just make sure my other endpoints work okay uh let’s do three okay so our end points are working so that’s good uh What else let’s go ahead and move these three end points into users. MJS as well so I’m just going to paste them all over here and just change app to router just like that and we’re using the same resolve index by user ID which like I said we imported up top over here from that new middlewares MJS file that I just created okay and uh there’s nothing else that we need to import because it’s using mock users which we already imported already um and the request and response object comes from this callback function so we’re good to go with the rest of our endpoints so look at our main file now look at all the this now we have cleaned up our index. MJS file and anything relevant to users I can just go into the routes users. MJS file and look for the the corresponding endpoint that I need to look for okay let’s just make sure let’s just make sure our other endpoints work okay that’s good okay and if I take a look at this I have successfully updated the data and Patch should work just fine as well okay patch is working just fine I was able to update my data using put and patch and let’s try delete so I just deleted the user of ID3 so if I try to get that User it’s going to say four for not found and if I call users it’s not going to show that user in the array okay so that’s good so hopefully this all makes sense so now I can easily just clean up my index. MJS code so let me remove all all of the Imports that we’re not using anymore so all of this stuff we’re not using anymore all of this stuff over here um I’m going to delete logging middleware because we’re not using that anymore let me remove these coms down here okay let’s go ahead and create another router for products so I’m going to create a new file and I’ll call this products. MJS and it’s going to follow the same a structure that we did for our users router we’re going to import the router from Express we’re going to go ahead and create the router instance by calling the router function and assigning that return value to the router variable and then we want to also make sure we export the router as a default export and since products only had we only had one endpoint for products I’m just going to go ahead and copy all of this let me remove that and we’ll call router. getet paste this there and since we’re not using any other Imports or we’re not referencing anything else aside from just this response argument in the function we don’t need to worry about importing anything okay and the last thing that we need to do is import the products router like this so import products router from uh and then the path to that products MJS file and then we need to call app.use and pass in products router like this so now if I try to make a request to products I can get the list of products and of course if I were to remove this app.use uh with the products router being passed as an argument we’re not registering that products end point or that products router so we can’t access that products endpoint so hopefully this makes sense now one more thing that I will do and I’m only going to do this because I want to structure this entire project in a way for future videos for future tutorial videos what I’m going to do is I’m going to actually create a new file called index. MJS and what I’m going to do is I’m going to import the router as well and I’m going to create an instance of this and you don’t have to do this if you don’t want to but personally for me I prefer organizing everything like this because it makes it so much easier I’m going to also export this router as a default export and what I’ll do is instead of having all of my routers being imported in the index. MJS file because you might have a lot what I’ll do is inside this index. MJS file in the r folder I will import all of my routers in here so you can kind of think of this like a barrel file if you’ve ever heard of that before so let me import users router from users. MJS and then we’ll do the same thing for products router import that from products MJS and then what you can do here is you can use router and then call do use and in case if I I mention earlier you can also register middlewares the same way that you would register middlewares on the express app on the router itself and that would of course register middleware at the router layer so not for all of your routes but for all of the routes for your router specifically okay so you can register middleware only for your users routes and it won’t have anything to do with the products rout at all okay but I’m going to go ahead and pass in the users router like this and I’ll do the same thing but for products router like that and then I export the router as a default export from this index. MJS file and then I can now go into my index. MJS file in the root Source folder right over here remove these two Imports import um let’s do this import routes from and we’re going to import this from index. MJS so we’re importing this root router that we’re using to register all the other routers okay and then I can go ahead and pass routes into app.use so I only need to do this one time because I already have all of my routers registered with this root router right over here and I’m registering that root router with the main Express app so it’s still going to work the same exact way it doesn’t matter whichever one you prefer to do but I just prefer doing it this way because I think it makes it a lot more cleaner for the index file itself okay and one one more thing that I will do though is you can also set um a prefix for all of your routes because notice how right now I am I need to prefix everything with/ API okay SL API products SL API users Etc so hopefully all of this makes sense and you can now see how or how much more organized your entire application looks so you can you can go ahead and add add more endpoints for products you can add more endpoints for users and you will know where every single thing is without having to scroll through one file try to look for it all right everyone so the next topic that we’re going to talk about are HTTP cookies so cookies are pretty much a simple concept but a lot of people tend to get confused about it they get confused on what it is how to use it how it’s used in realc ations but most importantly they kind of don’t quite understand what’s the purpose of it so I’ll do my best to explain it to you all in a simple way so cookies or HTTP cookies they’re literally just small pieces of data that your web server sends to the browser in our case since we’re using Thunder client you can pretend that this is our web browser so whenever I make a request to this URL it will send me back a cookie but currently our server is not sending any cookies but you can see over here I can whenever I uh make make a request I can go ahead and click on this response section over here and then select cookies and see if there were any cookies sent back from the server so the server sends a cookie to the user’s web browser or the client or whatever and then the web browser or in this case our Thunder client can store the cookie if you actually go into your browser right now and if you were to open up the dev tools so let me actually do this let me go to Local Host Port 3000 and let me Zoom a little bit and let me open up my Dev tool so right over here and if you actually were to go to uh this Chevron this this double Chevron arrow and click on application you can see this section where it says cookies now currently I don’t have any cookie stored on this domain but we can change that we can make our web server send the cookie back to the web browser the web browser can store that cookie and then what happens next is the web browser can actually send that cookie back to the server on any request you need to make now you’re probably wondering well why is this important well it’s important because by default h HTTP is stateless and what that means is that whenever you make a request the server doesn’t know who that request is coming from it doesn’t know who the user is and knows nothing so if you wanted to build let’s say an e-commerce website and you wanted to implement some kind of cart system where you can add items to a cart and delete them from a cart and you want it to make it functional where when the user adds items to the cart and they close a website and go back on the website that those items are still in the cart after they leave and come back you need to use something like cookies because the server doesn’t know who the user is it doesn’t know what items they added but when you use cookies you can send the cookie back to the server and the server will then know who that user is and so the next time the user comes back the user can have all of their items on the cart displayed so they don’t have to re everything all over again now most of the time in realistic large applications where you have authentication you use cookies alongside with sessions but we’re not going to

    get into sessions just yet we’re primarily only going to focus on cookies right now okay but hopefully that explanation makes sense just remember that HTTP is stateless and using cookies enables the server to send a cookie to the web browser and that cookie typically is going to be some unique value so that way the server when they receive it they can distinguish whose cookie this belongs to and then they can send Dynamic data based on the cookie value so I’ll show you an example so let’s go into our code and what I’ll do is inside the base URL I’m going to go ahead and set the cookie whenever the user visits this endpoint to do that we have to modify the response object by calling this cookie method on the response object and this takes in uh a total of three arguments options is optional but you can pass in a name for the cookie so I’m going to call this hello and and then I’m going to set the value of this cookie to be world and then you can pass in options so let’s say if you want to have the cookie expire after a minute then you have to specify that in milliseconds so 60,000 M milliseconds is 1 minute and let’s go ahead and test this out so I’m going to go into the browser and if I refresh you can see that I now have this cookie and I can see that every time I refresh you can see the number just jumps up to 49 50 well now 51 53 54 so it’s going to expire after 1 minute okay I can have it expire after an hour so let’s do 1 minute time 60 so that’s 1 hour right there so notice have I refresh you’re going to see that let me kind of zoom in a little bit right over here so you’ll notice if I refresh it goes from uh I guess the 14th hour to the 15th hour this is in uh 24hour time clock and uh I think it’s in UTC time currently it’s 7:24 so I think plus 7 hours gets you um I think 15 is what 3:00 I think so plus 7 hours yeah yep that’s right plus 7 hours yep okay and if I were to multiply this by two so expires in 2 hours if I refresh you’ll see now it expires at the 16th hour which is 4:00 p.m. 400 p.m. so hopefully this makes sense okay and let me just also go into my thunder client and if I click Send uh let’s see uh oh I’m visiting I’m visiting the wrong endpoint let me visit the slash endpoint and see how now I can see that I have a cookie right over here and you can see that it shows you the domain the cookie name the value all the stuff okay so hopefully this shows you how the browser and how your clients can store cookies but now let’s actually see how it’s being used like how do we actually make sure that we are sending the cookie back to the server because right now we’re only receiving the cookie that is stored in the browser but we’re not really doing anything to actually reuse that cookie so the next thing that we’re going to do is this what I’m going to do is I will go into um any endpoint so let’s just use the products endpoint because we haven’t really done much with this and what I’ll do is I want to go ahead and grab the cookie from the request object okay so I’ll console log this right now and I’m going to visit SL API products so let’s go to the browser and since our cookie uh expires in 2 hours we’re going to be fine so we’ll still have the cookie if it expires though and your browser doesn’t have the cookie then of course that cookie is not going to be sent but let me go ahead and close this and let’s go to whoops didn’t mean to open that let’s go to SL API products and let’s look at the console and you can see right now uh whenever I visit that endpoint it says undefined now you’re probably wondering well why is that the case are there really no cookies well let me show you this okay if I were to log it from the headers and if I refresh that page you can see now we actually have the cookies and this is access through the headers but the problem here is that it’s not pars okay we have it in this string format so we have two options we would have to parse it ourselves manually or we can actually use a third-party package called cookie parser to parse the cookies for us so just to confirm with you all the cookies are in fact being sent to the server it’s just that they are not being parsed the way that we expected it to so let’s go into let’s see our terminal we’re going to install cookie parser so cookie hyphen parser and you can see that it has literally like almost 3 million downloads so it is a very popular package in the node.js ecosystem and let’s install cookie hyphen parser and then what we’ll do is we’ll run our server again and now we need to actually enable cookie parer remember that a lot of things that you’re going to be installing as third party packages in Express is going to be middleware okay so in this case cookie parer is also middleware as well so we’ll import that middleware so import cookie parser from cookie parser and then this is a default export so what we’ll do next is we’ll simply just enable it but we want to make sure we enable it before all of our routes are being registered so you see how over here where I have app.use and then I pass in uh that router that router from this file over here and this is what registers all of our routes we want to make sure that we register it before otherwise it won’t parse the cookies for those routes and then we won’t be able to use it so right before um we’ll do app.use and then cookie parser it’s a function and you can also pass in additional arguments into the cookie parser function call if you need them so for example let’s say if you needed to uh parse a signed cookie which is really just a cookie that has a signature then you can pass in a secret and this secret is used to actually parse the signed cookie so that would just be like a regular string like this or whatever the secret is but we’ll leave it alone for now cuz we don’t have any signed cookies okay so now that we’ve enabled the middleware let’s go back to products. MJS inside our routes folder and I’ll go ahead and console log both request. headers do cookies and request. cookies like this and you can see there’s also a sign cookies property as well for sign cookies so let’s go into Postman or not Postman what I’m talking about thunder client and let’s go to API products so we still have that cookie because it has not expired I wonder if there’s a way to actually see the expiration date of these cookies on the Thunder client perhaps not I don’t know but it’s okay we know that it is not expired though so I’m going to go ahead and do this I’m going to send the request okay and let’s look at the server and or let’s look at the console and you can see that we log both the header cookies and the parsed cookies right over here and you can see that it was correctly parsed hello is the field name and then world is the value so that is how we can use cookie parsers to parse the cookie let’s say for example I wanted to check the value I wanted to check the field and the value of a cookie and based on that field and the value of that field I can determine the response that I want to give back to the user so let’s just very quickly pretend like this hello world Cookie is required in order to actually retrieve all the products so what you would do is something like this you would check to see if request. cookies Dot and then the field name which would be hello and then you so you want to make sure this is defined and then you would want to make sure that hello is equal to some certain value in in our case since we set the cookie on the server side and the value that we set was world we can have it check to see if it’s equal to world and if it is then we’ll send back the response of all the cook of all the products and if it’s not then what we’ll do let me actually use the return keyword and if it’s not I’ll just return a response that says message sorry you need the correct cookie and this is just to show you how you can use cookies okay or how you can use cookies to determine the output of your server response so if I click Send right now okay nothing special but now watch this I’m going to go ahead and uh let’s see I’m going to remove this cookie right over here and I’m going to go ahead and click Send and watch what happens you see how now since I don’t have that cookie it says sorry you need the correct cookie now if I go back to the browser the browser is a different client okay so right now we’re using two different clients we’re using the web browser and we’re using our Thunder client so since the browser still has a valid cookie I can still get this data but let me go back into my browsers Dev tools and let me clear the Cookie by simply just deleting it and watch this if I refresh the page you see how now it says sorry you need the correct cookie so this is how you can start to understand how authentication begins to work the server sends a cookie back to the client so that’s basically saying hey when I send this cookie back to you you need to send this back to me in order for you to make future requests to access any data or any endpoint at all the browser stores that cookie and then any future request that you want to make from the browser or the client from Thunder client you need to pass the cookies from the browser or the client or wherever when you send the cookies the server will check for the cookies if you have the cookies and it’s a valid value then you will send the data back to the user if the request does not have the cookie or if they do but it’s not a valid value then you’re going to send them a different response so hopefully you can start to see how cookies can change the output of your application and how you can use it for you know authentication and authorization so one more thing that I will show you is this I’m going to go ahead and set the max age of the cookie to 10 seconds and so what I’ll do is this so since this route is the route that actually sets the cookie itself you can pretend like this is the route that you must visit first in order for you to kind of like authenticate have the cookies set on the server side and sent back to the browser and then be able to access the quote unquote protected route hopefully that makes sense okay so right now if I try to go to API products I cannot access uh the resource over here and you know what let me do one one more thing I’ll also send a 403 which means unauthorized or you can send a 401 back so you see 403 Forbidden okay so now let’s do this let’s go back to the base route and kind of like quote unquote authenticate because this is what gives us the cookie we can we we can see the cookie sent back and now watch this if I try to go to slash API products I can get this I can get this response back but notice how after that 10 seconds pass it says sorry you need the correct cookie so the cookie expires after 10 seconds and you can see that we don’t even have any cookies anymore CU it automatically clears it for us so I can go back to the base route reauthenticate call the API products route and I can make as many requests as I want to this endpoint until once the cookie has expired and once it expires it gives me the alternate response okay so hopefully this makes sense now since we are already talking about cookie parser and using cookies I might as well just talk about this as well if you ever need to set sign cookies which like I said earlier it has a signature uh you can go ahead right over here and set signed to True Whenever you set the cookie but in order for you to actually uh parse cookies that are signed you must you must you must provide a secret like right now if I try to refresh or if I try to go to the base URL you’ll see that it says cookie parser secret required for signed cookies so let’s go ahead and pass a secret right over here let’s just do Hello World literally it can just be any string value you want that is just going to be used for signing cookies okay so now watch this okay before we added this signed property in the options when we set the cookie we were just able to see the Value World so let me just show you this real quick let me just kind of delete this and delete that and just show you very quickly see how the value is just World okay now let me go back and set sign to true and put in that secret so now watch this let me just delete this and if I refresh the page you see how now the value isn’t just world you can actually see the value is here but because now it’s signed it has the signature and in order for you to actually use the sign cookie well because we already are enabling the middle already it will just parse the cookies for us but remember how earlier we took a look at the request object and there were two properties related to cookies there was cookies and then sign cookies right over here so we want to reference sign cookies so watch this let me just Refresh on this page let me change the max age of the cookie to 30 seconds so three so 30,000 milliseconds and let me go back here so now let me go to/ API products you see how now it says sorry you need the correct cookie this is because we are checking just the cookies and not sign cookies if I look at the console right now you’ll see that this is the raw cookie over here that comes from the headers that is not parsed into an object so you see you have the key and then the value right over here exactly what you saw in the browser then you have this object an empty object which is the request. cookies property so an unsigned cookie but because now we have signed cookies all of those parsed sign cookies will go into um that sign cookies object in the request object so you have this object right over here okay so you can actually just reference hello on the sign cookie like that so if I refresh this page uh well we don’t have a cookie so we need to go back to the base URL quote unquote reauthenticate get the cookie set and then now let’s go back to the API products route and if you look at the logs you can see that whenever I reference the sign cookies object and reference hello it gives me this value of world so we can just very easily modify um this part over here if request. cookies instead of that we can just do if request. sign cookies. hello and of course you would need to keep track of what cookies are signed and what cookies are not signed so that will indicate which property whether cookies or signed cookies that you would that you would reference so if request. sign cookies. hello and request. sign cookies. hello is equal to world then we’ll send back this response so let’s save and now our cookie likely likely expired by now so let’s go back to the base URL get that cookie again go back to API products and now we have access to the resource so hopefully this all makes sense in this part of our tutorial we are going to talk about sessions and Implement them in our Express server sessions represent the duration of a user on a website by default HTTP is stateless we don’t know who is making requests to our server so we need to be able to track requests and know where they are coming from one common usage of sessions is to manage user authentication sessions are created on the server by generating an object with a session ID when an HTTP request is sent to the server from the web browser the response can return with instructions to set a cookie with the session ID so that it can be saved in the browser this allows the browser to send the cookie on subsequent requests to the server the the server can then parse the cookies from text to Json then verify the session ID was sent from the client and determine who the request was sent from whenever the browser sends the cookies on each request the server can look up which user pertains to the session as the server maintains a mapping of each session ID to the user we’ll get started in implementing sessions using the express session Library so the first thing that we’re going to do is install the express session package so in my project terminal I’m going to type npmi Express hyphen session and then we need to go into our index. MJS file or whatever root file you have where you create the app instance or the express instance and then you’re going to import session and then from Express pyph session like that so this session import is a middleware function and we can register it by simply just using app.use so app.use and then session just like this and you want to make sure that you are calling app.use right before you are registering any endpoints in your application so remember that I using this router that is imported from uh routes right over here and this file over here has all of my individual routers for products and users okay so what I’m making sure is I’m making sure I’m calling the session middle work function before my routes are being registered so now the next thing that we want to do is configure some options for Express session so the first thing that we will do is set a secret so I’m going to pass in an object and so for the secret this is going to be a string now ideally you would want this to be something that is sophisticated because it is used to actually sign the cookie and if you have it something guessable someone can easily use that value to decode signed cookies for now just for development purposes I’m just going to use anev but just keep in mind you would want this to be something more complicated and not guessable kind of like a password I’m going to set this property called save uninitialized now this property alongside with the next property I’m going to set called resave both of these have to do with session stores we currently don’t have any session stores configured by default Express session does use an inmemory store but you want save uninitialized sets of false when you don’t want to save unmodified session data to the session store so what that means is by default if you have every single user visiting your website and they’re not doing anything they’re just visiting it it will if you have save initialized set to true it will actually save a session object to the store even if the session object has nothing at all and that can actually take up memory and you probably won’t want to have a bunch of random session object objects living in your session store so ideally you would want this set to be set to false and it’s recommended if you’re building something like uh user authentication managing user sessions things like that the other property that we want to set is resave okay and this really has to do with um forcing a session to be saved back to the session store even if the session itself was never modified at all you’ll better understand what I mean by modifying the session once I show you how to actually do it and what it affects how it how it affects the actual session itself but for now don’t worry about these two properties just set to false the other property that I want to set is this cookie property and this is where we can actually configure how long we want the cookie to live because in case if you didn’t know cookies can actually expire so this is good if you have a user login system where let’s say you want the user to be logged in to your website a Max of 24 hours so you can set the this Max H property and uh the value is a number and it’s measured in milliseconds um so for example 60,000 milliseconds that is 60 seconds uh times let’s see 60 so that’s 1 hour so let’s say if I only wanted the user to be logged in for exactly 1 hour then the cookie will expire after 1 hour and that cookie will no longer be valid and so whenever they send it back to the server the server will see that the cookie is not a valid one at all and remember that the cookie that is sent from the browser to the server is what is being used by the server to identify who the user is so I’ll keep everything simple and use my base URL endpoint and what I want to do is inside the request Handler and you can use any endpoint you want I’m just going to go ahead and console log request. session and I want to conso log the session ID as well so you can either reference session ID or you can reference session. ID and I’m going to go and make one API request to this endpoint and you’ll see that when I make a request I can see the session object as well as the session ID being logged and you can see the session object has this cookie property which is an object and you can see that the expiration date is over here so it’s in UTC time currently it’s 2:44 a.m. so uh I think I’m 7 hours behind that time zone so that would be 9:44 and then expires in 1 hour so the date the expiration date time is correct but let’s focus on this session ID right over here okay so I’m going to make another request and notice how when I make another request you can actually see that not only does the expiration date update but also this session ID is regenerated I can create another one one and another one so every single time I click Send it’s going to pretty much like create a new cookie and also create a new session and this is actually not necessarily good because we never can actually track who the user is that’s using our application so this is where you need to modify the session data object when you modify the session data object Express session will create a cook or it will set the cookie and then that cookie will be sent to the browser or the client side the client side will store that cookie and then on subsequent requests or future requests that cookie will be sent to the server assuming it has not been expired okay the server of course will go through the express session middleware because remember Express session is a middleware so it’ll go through this whole session middleware and then it’ll validate that cookie make sure it’s not an invalid cookie so if the cookie is not expired or if it’s not invalid then Express session actually won’t generate a new session or session ID at all okay so hopefully that part makes sense because by modifying the session data object we can begin tracking users that are using our website our API if we don’t then we’ll just always have generated sessions all the time brand new sessions all the time okay and remember if you had save uninitialized set to true it would save all of these sessions even if it’s not modified to the session store so that would use up a lot of memory for no no good reason whatsoever so what I’ll do right now is I’m going to modify the session object by just simply referencing request. session and I can attach Dynamic properties onto this session object so let’s do a simple one I’m going to go ahead and reference visited and I’ll set this to true and I’m just going to remove uh I’m just gonna remove the session oh I’ll leave I’ll leave everything alone for now and now watch this okay let me go into my thunder client and I want you to take a look at what happens now when I make my first request so the server just restarted because we’re using node modon so whenever I make changes it’ll restart the server but I just made one request and you can see this is my cookie and this is my session ID notice how now when I make a new request every single time you see how now the session ID is the same every single time okay every single time I make a request session ID is the same and the reason why this is good is because now I can actually track the user you can see that we have this visited property on the session object and since the ID is not going to be generated every every single time the server itself knows what the session ID is they can look up the session ID and attach the correct session data to the incoming request object so we’ll know who which which user is so let me show you an example okay so what I’ll do is I’m going to go ahead into any endpoint right now I can go into any endpoint and what I want to show you is if I go into let’s it’s let’s do SL API users so this endpoint gets a list of all the users and I’ll just console log request. session and request. session ID and I’m going to go back into my thunder client so remember the server just restarted so because we are not using a persistent data store for our sessions everything gets wiped out because everything is currently in memory so I’m going to go ahead and click Send for our base URL I’m going to make a request to the base URL first because that is the endpoint that will actually set the cookie for us okay it’ll it’ll modify the session data which will set the cookie and then send it back to the client so if I click Send okay you can see that I have my cookie generator right over here and also if I click on cookies on Thunder client and if if you’re using the browser or if you’re using Postman you can also look at the cookies yourself but you see how I have this cookie right over here and you’ll notice how uh everything after these let me see if I can zoom in a little bit you’ll see that everything after these first four characters all the way up until this dot so this whole thing right over here is actually our session ID you can see that they match if I put them side by side you can see that they match right over here and then and of course everything over here is the signature of the cookie because it’s signed All right so now that we have our cookie from the server now I want to show you what happens when I visit a completely different endpoint so let’s go to API users because that’s where we’re also logging the session data as well okay so right now we have a cookie we’re sending that cookie to the server the server is going to make sure that cookie is a valid cookie and if there’s any data for that session ID that was retrieved from the cookie that was sent to the server if there’s any any data in the session store it’s going to map it to that incoming request object okay so basically this session object comes from the session store essentially it get it kind of gets restored but let me make a request so I just made a request just now and notice how when I made that request okay I get the same exact cookie right over here okay you see how I have the same session ID same session ID in a completely different endpoint you see how this object now logs visited true whereas before the previous one didn’t obviously because we didn’t have a cookie set properly when we visited this base URL okay but when I visit this base URL we modify the session object so then that will set the cookie and send it to the browser we make another request to the user’s API so so when we do make that request request. session now has that visited true property set and it has the same exact session ID so it’s important to understand this because now we can actually build out some kind of authentication system and know who each user is one more thing that I do want to show you is I want to show you the session store currently so remember that by default the session store is in memory so it saves everything in some data structure and it lives on the server and of course this is not good because when it’s volatile so if the server goes down and you may have seen this already we have to visit the website again and have a new session created for us so I just want to show you this real quick so let me reference console.log request. session store and I’m going to call this get method and I can pass in uh any session ID okay and then uh let’s see we have to pass in a callback function so that’s okay let me actually do this instead so I’m going to pass in request. session. ID and a callback function so let’s see error and session data and I’ll just do if error throw error and and then I want to console log the session data just so you all can see what this looks like all right so now let me do this in my browser okay so I have these cookies set which are not going to be valid anymore because we just cleared we just uh restarted database so now if I go to the base URL first we have have the cookie set and let me just kind of go to my console and scroll down okay so this is our session ID now if I’ll go to the user Point okay same cookies but notice how this is coming from this part right over here line 29 so notice how when I called request. session store.get I can pass in any session ID and of course if it exists then it’ll give it to us which I’m logging it right over here on line 29 so that’s where it’s coming from okay so that is how the session store stores these session object data so I hope that makes sense because I really want you all to see this visually because just by saying it it kind of doesn’t really help you understand how things are being saved underneath the hood but at least it helps you better understand that now we can see that this session data is stored in some data structure on the server in memory but in later parts of this tutorial I’m going to show you how to use an actual database to store the session data so that way when your server goes down the session data gets restored so I did want to provide another example with how to use sessions and express so what I’m going to do is show you all how to set up this fake authentication system it’s not like a real authentication mechanism but the goal of this is to help you understand how we can map a single session ID to a realistic user in our application so I’m going to go into my main index file and I’ll just set up the route inside here instead of having to create like a new router and such because I want to keep this simple so I’m going to reference app and whoops sorry about that I’m going to reference app and I’m going to call the Post method to set a post request and the endpoint for this will be/ AP SLO and then we will need a request Handler I’m not going to do any validation on the request body um just because like I said I want to keep it simple we’ll just assume that the payload that we’re sending the request body that we’re sending to this endpoint is correct all right so let’s go ahead and grab the request body and then what we we want to do next is uh let’s go into our constants MJS file if you don’t have uh a list of mock users then you could just simply create one or like I said you can just pull the code from GitHub but I did actually do this earlier I provided a bunch of passwords for each user object so that way we can actually use this example so go ahead and make sure you have a username and a password these two are important okay so what I’m going to do is whenever we we make a request to this endpoint we’re going to go ahead and look up the user by the username and we can assume that the username will be unique which is pretty standard in applications so I’m going to go ahead and destructure from the request body and I’ll do this all on this one single line I’ll D structure username and password and of course we are assuming that these fields do exist okay again I I would recommend you yourself uh validate your actual uh request bodies and if you don’t know how to do that check out the section where we talked about validating post requests or validation in general and you’ll learn about that so what I’m going to do is now I’m going to reference mock users but I do need to import that into this index. MJS file so let me go up top here and import mock users from utils consents JS and then I’ll simply just do a search on the user so const find user equals mock users find and then we’re going to pass in the predicate so we want to search for the user by username so I’m going to pass in this predicate function and that the argument for that function is going to be the user object so I’m going to reference user. username and compare it to the username that we’re sending to this post request so this will search for the user by the username and if it does not return a user fine user will be undefined so from here let’s set this up so what we’ll do is we’ll check to see if find user is undefined so if if not find user okay then what will happen is we’ll return a 401 return response that’s status 41 which just stands for uh unauthenticated so let’s just do send message you can also just send the message as bad credentials like that so of course if the user is found then this whole if statement would not be executed but if it is not found then it would return a 401 next check that we want to perform is checking the passwords making sure that they match and like I said we are checking raw passwords that’s okay for now later on you’ll learn how to actually hash the passwords and save it to the database and then also be able to compare hash passwords so I’m going to go ahead and write another if so if find user do username oops sorry not using password I’m going to do if it’s not equal to password then I’m going to return the same exact response right over here um okay let’s see okay that’s fine and then I could probably also just you know what I could probably just combine this into one single statement so if there’s no user or if the passwords don’t match then we’ll just send this back I guess that can work fine now remember the main purpose of this endpoint is to modify the session object because we want to stop generating new session IDs every single time we want to be able to allow Express session to generate that session ID once set the cookie and then send that cookie back to the browser or the client so that way when the client sends another request we can use that session ID and look up the session data and from the session data we can see which user actually belongs to this session ID so what I’ll do here is whoops what I’ll do here is I’m going to reference request. session and then I’m going to attach this Dynamic Property called user and I’m going to attach the fine user value to this user property so remember we can attach Dynamic properties to objects in JavaScript so I’m going to do that right over here and then this should modify the session object and that will have Express session set a cookie and send it back to the browser or the client as a response okay and then the browser will have that cookie and now they can use that cookie to send it to the server and the server will know who that user is so watch this uh let me go ahead and return response. status I guess 200 would be fine for logging in and then send let’s send back the user that was authenticated okay so this endpoint should work let’s just test it out so let me go ahead and make a new request post request Local Host port th/ / o and we’ll pass in a username so let’s actually uh let me go into my mock users array so I’ll do Anson and then the password for Anson is hello 123 so Anson and then password okay so now you can see that right over here I have logged in okay obviously you wouldn’t want to return the password back but like I said just a simple example if I look at the cookies I can see that I have my cookie right over here okay this is my session ID right over here so now that I have logged in and I have a cookie set on this client side right over here I can now make requests to the server and the server will receive that cookie it’s going to parse it and it’s going to take that session ID that I got from the cookie and then map the session data object to that session ID itself so what I’m what I’m going to do now is this I’m going to go ahead and set up one more endpoint app.get API status and this is just going to show the authenticated status of the user so whether the user is authenticated or not in in this context we can tell if the user is authenticated by checking to see if request. session. users defined because remember this right over here is what actually indicates that the user is quote unquote logged in the moment that we modify the session and we’re only doing it when we find the user and the passwords match okay so what I can do is I can just Che simply check uh let’s do this I can use a turn operator so return request. session if user is defined at all then what I’ll do is I’ll returnal response status code of 200 and I’ll just send back request. session. user and then if the user is not defined on the session object then I’ll just send back a 401 so I’m just going to copy what I have up here but I’ll just simply say un uh not authenticated okay hopefully this get request that I’m setting up makes sense so we have one endpoint that actually does the core authentication the other endpoint gets the authentication status hence why I call this endpoint uh SL API status so our server just restarted so again everything is in memory so it gets cleared so we do need to reauthenticate again so I’ll just show you real quick let me delete all the cookies okay me just okay so let’s click send to the same endpoint for/ API we’re going to send this username and password payload okay so I just got back a cookie right over here and now watch this if I were to now visit the status endpoint API status endpoint and make a get request to it you’re going to see that the response is going to be the actual off user okay the response is the actual off user watch what happens if I clear my cookie okay so if I clear my cookie right now and if I try to access this endpoint you see how it gives me a 401 unauthorized error see not authenticated right over here and remember that I cleared the cookie from my client so the server received the request and received this get request without any valid cookie okay and since there was no valid cookie there was no mapping between that session ID from the cookie to a user that’s in the session store so hopefully that makes sense and additionally what I’ll do is let me just quickly reference request. session store get and let me call the get method and let me pass in that session ID session ID and then error session I’m just going to log the session just to show you all how everything again is stored in memory so let’s go ahead and do this let’s make a post request to SL API of course if I pass an invalid password it’ll say bad credentials if the user is not found same thing so let’s log in okay I have my cookie right over here and now let’s visit the status endpoint for SL API status okay we’re good to go with that and if we look at the console I want to show you that right over here we are logging the user in the session store okay right over here so if I go back and click Send you’ll see that it’s logged every single time we’re grabbing the session data from the session store and the session data object that we retrieve by that session ID has this cookie property that gives us information about the cookie and then it has this user property which is the user object itself so that is how the session ID maps to a user on the server side so I hope I really hope this makes sense because if you understand this then you can understand really anything with sessions and I really hope that all of this makes sense because I can understand sessions are kind of a little bit difficult to understand but by seeing how the data is saved on the server side and how we can actually retrieve it so easily like this and map it to the session ID that can help you understand sessions a lot better now what I’ll do is I will authenticate on Thunder client with this set of credentials and then I’m also going to authenticate on Postman with a different set of credentials just so that you can see how with different clients we can authenticate with different credentials and we can see the status of our authentication and then you’ll actually see how the server manages multiple different sessions so let’s just very quickly uh let’s see okay so we’re not authenticated so let’s make a post request to SL API with uh username Anson and the password hello 123 okay so we’re authenticated here uh let me grab another set of credentials so Jack and hello 124 so let me go into post man make a post request HTTP Local Host Port 3000 API off let’s click on body Tab and then select raw and then make sure it’s set to Json whoops and then so now set username to Jack and the password was hello 12 4 okay and remember we’re in a completely different client right now Postman is its own environment obviously and just to show you this we don’t have any cookies set right now so the moment that I click uh send right over here so I just made a request and you can see it’s right over here if I click cookies now you’ll notice how on my Postman client I now have this cookie and of course this cookie is different than the cookie that we have on Thunder client because we’re two different users now that’s the thing that I’m trying to show you we’re two different users you can see that the cookies are different okay so if I were to visit this API status endpoint with a get request you can see that uh it tells me um let me see here we go I don’t know why that was formatted like that okay so you can see that in on Postman I am logged in as Jack and then on the Thunder client I am logged in as Anson see uh whoops right over here look at the response I’m logged in as Anson so now we have two users that are quote unquote logged in and you can see that the session store contains both users they contain Jack and and Anson so hopefully this also helps you understand how the server can manage not only one but many sessions and map each session to different users now I’ll show you even one more example where we can set up a virtual cart system for authenticated users so to keep things simple I’ll set up a simple post request and then the end point will be SL API SLC cart pass in our request Handler and then we only want the user to be able to add items to a cart if they are authenticated so if let’s say request if there’s no request. session. user return response I’ll just send status of 401 okay however the user is authenticated the next thing that we want to do is of course check to see if the cart already exists on the session object because if it doesn’t we need to add it if it does we can just simply add the item to the session cart now of course the request body itself will just pretty much be data relating to an item that we’re adding to the cart so just to keep things simple the request body for this endpoint will just have a name for the item and the price for the item that’s it so let me just destructure the request body from the request object and I’m going to rename this to item and we’re going to assume that the field and all the the values for our request body are valid but I encourage you to practice and actually validate your request bodies so first thing we need to do is check to see if the cart exists on the session object and that’s pretty easy to do I’m going to go ahead and destructure the cart property from the session object so cons cart and then inside these curly braces where the cart variable goes equals request. session so if C is already defined I could just simply do cart. push item and this should be able to just modify the cart and then if the cart doesn’t exist then what I can do is I can reference request. session. cart equals an array and then pass in that item as the first element in this card array just like that and once we’re done we can just return a response status of 2011 and I’ll just send back the original request body so let’s test out this logic let me go into Postman so I’m currently not authenticated that’s okay if I try to make a post request to API slart it’s going to give me unauthorized that’s perfectly fine so let’s first authorize so make a post request with our credentials to SL API off so we are authenticated and now let’s go ahead and add items to our cart so name orange and then price let’s do oops that should be a number let’s do 199 click Send okay so that’s our cart okay so now I can see that this was the item that was returned so that’s good so what I want to do now is I want to actually see the cart so what we can do is make a get request to off SL status and this should return I guess only the user but we want to get the cart so let me do this uh let me set up a quick app.get route for the cart itself so I’m just simply setting up a get request for/ apsc cart and then I’m going to do the same thing up top over here if there’s no user defined in the session object then they are unauthorized so we’re going to return a 401 and then I’m just simply going to return response. send request. session. cart and if cart is undefined we’ll just return an empty array like this using this double double question mark operator okay so if cart is undefined will return empty array so let’s test this out again so we need to reauthenticate so let me do do this okay so make a post request to the Au end point so now we are logged in and now I can verify I am logged in so that’s good so if I try to get my cart you can see that I have this empty array but if I try to add items to the cart and if I make a get request you can see that I actually have items in the cart so pretend like this is the API that your front is calling and then as you want to add items to the cart for the user you would just pretty much add it to the session data and then whenever you want to get all the users items in the cart you can just grab it from the back end like this and I can add more items let’s do uh Gatorade and 299 and let’s make a get request and you can see now I have two items in my cart and let’s go back to postman and authenticate as Jack So currently on Postman we are unauthenticated I’m going to make a post request to the/ API SL off endpoint and pass my credentials so now we are authenticated so that’s good and if I try to get my cart for Jack you can see it’s just an empty array because we don’t have any items in our cart so let’s fix that let’s add some items to the cart so let’s do name broccoli and then $4.99 okay so now I added broccoli to my cart as Jack when I make a get request this is my virtual cart that comes from the back end and then on Thunder client where I am authenticated as anen this is my own virtual card so each user each session has their own data okay each session maps to its own user and then it maps to its own virtual cart for that user and whatever other session data that we need to add we can just very easily attach it to the session object itself so I hope all this makes sense and like I said I wanted to give you all multiple examples because I understand sessions can be a little bit tricky to understand sometimes but what we’re going to do is move on to actually learning how to set up authentication with a library such as passportjs in this part of our tutorial I’m going to teach you how to use passportjs to integrate authentication for your express application we’re going to be using a local strategy for passport which just means that instead of using a thirdparty provider like Google Facebook Twitter we’re actually going to be using credentials that are saved on the actual applications database in our case we don’t have a database so it’ll be saved in an array but the idea is for local authentication the application saves that information compared to using just a third party provider to log into their application I’ll show you how to use local authentication and then in later parts of the tutorial I’ll show you how to use OA 2 so that you can learn how to integrate thirdparty providers to log into your application using something like Discord or GitHub or Twitter so let’s go ahead and get started the first thing that we’re going to do is install passport so I’ll type npmi passport and since we’re using a local strategy we need to make sure we install the correct strategy package so aside from passport we need to also install passport hyphen local again if you were using using let’s say Facebook as the way to authenticate users to your platform then you would have to install passport hyphen Facebook as the strategy and all it is is just a package that you install with passport so let’s go ahead and hit enter and this will install the packages for us and let me just go ahead and run my server and now we’ll go ahead and configure everything in our application so what I need to do is I first need to import passport so import passport from passport now passport integrates really well with Express session and many times you will actually use express session with passport or vice versa passport with Express session you don’t need Express session with passport but it is highly recommended and many people do in fact use both of them together because passport will take care of mapping that user that was just logging in with the session ID if you need to recap on sessions check out the previous section of the tutorial where I actually showed you multiple examples of how to use express session so what I’m going to do after importing passport is I’m going to enable it so where I am registering the session middleware which is right over here I want to make sure I’m registering passport after I enable the session middleware because that needs to be done before and then we also need to make sure we enable password before we register our routes so in between the session middleware being registered and where we are registering our routes I’m going to go ahead and call app.use and I’m going to reference passport and call the initialize method just like that okay and then since we are using sessions I’m going to call app values again and pass passport. session primarily this will take care of actually attaching a dynamic user property to the request object called user and then you can actually access that user object by simply just referencing it from the user or from the from the request object and then you can know who the actual user is that is making the request I’ll show you how that works later on so that’s all we need to do inside our index. MJS file so next thing I will do is I’m going to go into my source folder I’ll create a new folder and I’ll call it strategies so this is where I will have all of my strategies so right now we currently will only have a local strategy so I’ll create a file called local strategy. MJS and what I’m going to do is import passport let me zoom in a little bit so import passport from passport and then we want to import this strategy class and it comes from the passport local package now all of the strategies will have this strategy class so if you installed the passport Facebook package it would have its own strategy class just wanted to mention that and then what I’m going to do is I’m going to call passport. use and this is where we tell passport to actually use our strategy okay so we need to pass in an instance of this local strategy right over here of this strategy class so I just need to Simply create a new instance so new strategy like this now the strategy Constructor can take in uh actually two arguments I don’t know if you saw right over here you can pass in options or you can pass in this verify function for now I’m going to just ignore the options cuz you won’t really need this and later on on in the video I’ll explain when you’ll actually need this options but I’m just going to specify this verify function so that’s just going to be this callback function right over here and this callback function takes in three arguments it takes in the username password and it takes in this done function now since my application takes in a username and a password this works perfectly the way that these arguments get passed to this callback function is whenever you make a post request to your endpoint that takes care of of handling authentication the passport will look for the username and the password inside the request body that was sent to that post request endpoint and then they will it will pass it in as arguments to this callback function so this is assuming that we do in fact use a username to authenticate now sometimes you might not use a username you might use something like an email or maybe the username might be named differently so that is where you actually need to pass in this options right over here because you need to tell passport that we’re actually not using a username field but we’re using let’s let’s say the email address field so what you would do is you would specify this username field and then you’ll tell passport okay the actual username field is the email field like that then passport will look for the email field in the request body and then send that as the argument for username so I just wanted to mention that I’m going to leave this out for now and then once we finish implementing this strategy I’ll show you how it actually works so what we’ll do is inside here this verify function think of it like this this is the function that is responsible for doing a couple things but the main thing is to validate the user so you need to make sure that the user actually exists and then you need to check to see if the passwords are the same the password that we sent to the server and then the password that was attached to the user object itself from the database or in our case an array so those are the two main checks of course there might be additional checks that you would want to perform but generally those are the two major ones so again the first thing that we need to do is search for the actual user right now I don’t have a database set up set up but if for some reason you might have one already configured then what you need to do is just use whatever database module you’re using to to interact with the database search for the user by the username in this case find the user and then once you find the user check the passwords so let’s do that so I’ll go ahead and declare a variable called find user and I’m going to import that mock users array so this array just has a bunch of users right over here with a user Name ID display name and password and I’m going to use the find method to search for the user by the username so user. username is equal to username okay so this will search for the user by the username if the user is not found then we actually want to throw an error but before we throw any errors let me actually wrap all this inside a TR catch just like this so so that way now when I throw my error right over here and I’ll say for the message user not found that error will be caught inside this catch right over here okay now let me go ahead and do this if the user is not found we’ll throw an error I’ll handle the error case in just a bit but I want to move on so let’s say if the user is found we want to check the password so if find user. password is not equal to the password that was sent to the server then we’re going to throw another error we’ll just say user or password I’ll say invalid credentials okay okay so now let’s handle the errors that that could be thrown so we’re going to catch those errors inside this catch block right over here and what we want to do is we want to go ahead and call this done function when we handle the error so notice how this done function it takes in two arguments it takes in an error and it also takes in a user which could be a falsy value so of course when an error happens that means the user itself uh was not validated correctly okay so that could be either the user was not found or the passwords did not match so in this case we want to make sure we do pass in that error object and for the user we can just pass in null like that and then this will just pretty much move on from this verify function into the next step which we will get into okay so that’s what we have to do for the catch of course when we are done validating the user if both of these uh cases are false so if the user actually is found and the passwords are actually correct they do actually match then we want to make sure we also call the done function but this time there are no errors so we’ll pass in null and then for the user we’ll pass in the US user that we found like this and that’s it for the verify function okay so like I said for the database you would query the database find the user check the password if the user exists of course and then any errors that are that could be thrown would be caught inside this catch block right over here hence why we’re using try and catch and then if everything is good you’ll call the done function passing null for the error cuz there were no errors and then passing that user instance any errors would be caught with this catch block and then you would call done passing that error instance and then uh passport would take care of handling that error for us okay so the next thing that we need to do is we need to actually register our middleware our passport middleware because right now all this does is it validates the user but there’s still a whole bunch of things that we have to do especially since we are using passport with Express session okay so we need to import this uh local strategy file into our index file but first let’s actually export this password. use call so I’m going to do export default password. use and I’ll import it right over here like this so import and then the path to the file so this will literally import this whole thing right over here into our index file okay and then now we need to set up an endpoint that we can actually use as our authentication endpoint where users will make a request to or the HTT client will make a request to it’ll pass in the user and password in the request body and then that endpoint will take care of invoking our passport middleware so it’ll actually invoke this verifi function let me just quickly log out the username and password let me just do this username and let me do the same thing for password so that you all can actually see what’s happening underneath the hood okay so let’s go ahead and set up our endpoint I’ll just do this inside the index. MJS file um just to keep it everything simple if you’ve been following along the entire series I recommend you put everything in its own router but let’s go inside our index file and let’s set up let’s do this app. poost so the path will be SL API sloth and then we need to pass in passport. authenticate like this and we’re going to call the function like that and then we want to also pass in our final request Handler so let’s do that request and response and then uh let’s go ahead inside this authenticate function call we need to specify what strategy we want to use and it’s literally just going to be the name of our strategy in our case the strategy for Loc local is just local so we’re just going to pass in local like this okay that’s literally all we have to do of course if you’re using Discord strategy you would pass in Discord for GitHub you would pass in GitHub for Google you would pass on Google like that and vice versa so hopefully that makes sense okay so now what I’m going to do is I’m going to go ahead and make a request to uh SL API o making a post request to it and you’ll see how it’s going to go ahead and invoke this passport. authenticate middleware function and then it will call this verify function so let’s do that let me go to Thunder client Let’s do let’s do this okay so post request to our API off endpoint that we just set up click Send okay so ignore this error for now I’ll address that in just a bit but let’s take a look at the console and let’s see what’s going on you can see right over here username and password are being logged so that verifies that we are actually inside this callback function so passport actually called this callback function right over here and then all of this logic is being performed okay so it’s going to go ahead and search for the user if the user not found it’ll throw a user not found error so let me type in a username that doesn’t exist in our array so when I pass in this username an nansen you see how it says user not found that’s the error that I manually throw the that L thrown over here and then it gets caught right over here and it calls the done function okay notice how if I actually don’t even pass in if I pass in a null value for error we actually won’t even get an error this is a completely different error I’m not sure why it says 41 unauthorized but um yeah see it doesn’t throw that error but it gives us that instead okay but of course let me pass the error back click Send and pass in invalid username it will say user not found let’s say if the user is found but the credentials are invalid and so I’m going to pass in the wrong password it’ll say invalid credentials so before I move on let me just show you real quick about the username field that I mentioned earlier so let’s say for example you are expecting the user to provide the email address as their username so let’s say the we have email let’s just do an@ gmail.com as an example so watch this what we need to do is we need to pass in that options right over here and then we need to pass in this username field and just specify the field that’s going to be our username which in this case it’s going to be email and if I click Send you’ll see now I can actually use the email field as my username and if you look at the logs let’s show you right over here okay right over here username an@ gmail.com okay you can of course change in you can change up the arguments change the email like that if you want to so hopefully that makes sense and that shows you how you can use the username field if let’s say the username field was something else let’s say if it was something like user uncore name for whatever reason then you can just specify that okay and of course if I try to send this this one no longer work if I try to use username like this that will not work I have to explicitly say user uncore name so that way passport knows which field to look for so I hope that part makes sense okay let me just remove this part part okay so now the other thing that I wanted to talk about was this error that I just that I just encountered so you see how it says fail to serialize user intercession so here’s the thing we actually successfully were able to authenticate by checking all these credentials and verifying that it was correct but because passport needs to actually serialize the user into the session we need to actually Implement two functions okay because right now we don’t have have those functions implemented that is why we are getting this error so what we need to do is inside our strategy file I’m going to go ahead and reference passport and I’m going to go ahead and look for this serialized user function so I’m going to call that and this function takes in an argument which is a callback function like this and this callback function takes in two arguments this first argument is going to be the actual whoops the actual user that we are trying to see iiz okay so first of all what exactly does this function do well this function is responsible for actually taking that user object that we just validated and then storing it in the session okay and that’s the reason why I mentioned earlier that passport integrates very well with Express session so it takes that user that we just found from this verify function and it’ll take care of storing it in the session data okay the second argument is going to be the this done function so inside this serialized user function you don’t really need to do anything but just call this done function and it takes in two arguments it takes in an error in this case we’re not really doing anything so we just pass a null for the error and you’ll notice that right over here the suggested uh name for the field it says ID you can actually pass in whatever you want for this second argument that relates to the user so for example I can just pass in user like this okay now

    depending on what you pass in to this second argument actually ends up being the argument that will be passed into a call function for this the serialized user function don’t worry about that right now I’m going to implement it in just a second but what what I want to do instead of passing just the user object I want to pass in the ID of the user like this you want to pass in something that is unique okay so either the ID or a username something that is unique that can be used to search for the user either in our array or a database okay so now let’s move on to the next function that we need to implement so deserialized user is the next function and this also takes in a callback function and this C function takes in two arguments it takes in whatever it was that you passed in to the done function for serialized user so notice how I pass in the ID so this actually gets passed into this callback function for deserialized user okay and let me actually show you this stack Overflow post because I think this post is very helpful for a lot of people so I want to show it to you all so right over here they kind of give you like an explanation to how all this stuff works but I want you to pay attention over here they have they were able to provide the user was able to provide a visual flow so you can see over here we have both our serialized and deserialized user functions so whatever they pass into that done function for serialized user that pretty much gets saved to the session okay and I’ll show you later how that looks like um in as an object but it gets saved and it gets passed right over here okay well it doesn’t really get passed per se it’s just it’s just that we the deserialized user will use the ID to actually search for the user inside that function that we’re going to implement okay if we were to pass in the username then it would look up the username in the session data and it would use that to search for the user in the database okay but I just wanted to show you this very quickly because I think this is extremely helpful for a lot of people instead of just not mentioning it at all so the second argument for the call back function for deserialized user will be the done function as well but this time inside der serialized user we actually need to search for the user itself now again serialized user is to tell passport how to serialize that user data into the session so in other words it’s going to store that user ID into the session data okay and that’s really all you need deserialized user is how we can take that ID and kind of like unpack reveal who the actual user is and then what happens is it takes that user object that we were able to retrieve via the ID and it stores that user object into the request object itself okay so later on you’ll see how we can reference request. user when we make requests but what we need to do inside der serialized user is search for the user either in our database or in our array so what I’ll do is let me use a TR catch and first I’ll search for the user so cons find user equals mock users and I’m going to search by the ID this time so user ID is equal to ID if the user is not found I’ll throw an error and we’ll catch the error inside this catch block right over here and then we’ll call the done function and we’ll pass in an error we’ll pass in the error that we caught and then we’ll pass in null for the user because the user was not found and then if the user is found we will call done passing null for the error and then passing the user instance like this okay so again we’re searching for the user if it’s found then we will call done and then password will take care of taking this user object and attaching it to the request object itself if the user is not found then it will just call the done function inside this catch block with the error and then password will handle the error for us okay so now let me go ahead and write some logs real quick because I I really want to show you all how this all works and I want to show you the order of operations okay because it’s very important it’s it’s one thing to actually write the code but it’s another thing to actually understand how this all works CU When I first was trying to understand all this I never I didn’t know anything about this at all until I really dug deep into researching how all this stuff works okay so let me write some logs okay um okay so let’s go ahead and do this let’s make a post request to SL API off so notice how right now it’s it’s still processing the request it’s not going to send a response back don’t worry about that yet but let me just show you what happens right over here let me going me go down over here restart oops let me just restart my server you kind of saw the logs up there but let me just resend the request okay so you can see right over here uh first we’re inside the verify function because that’s where we are logging the username and password and then after everything is successful okay cuz we did pass in the correct credentials you can see how we’re inside serialized user and it logs that user object right over here okay so then you’ll notice that nothing else happens don’t worry the reason why nothing happens currently is because after we call serialized user what happens is it’s going to go ahead and call this next middleware fun function which is going to be our request Handler function so we aren’t doing anything inside here so why don’t we actually just send a response back okay and let’s try this again okay so we’re good and everything is good whoops let me do send status sorry about that send status okay okay so everything is good uh what’s going on here user is not defined uh seems like we got okay don’t worry about that I will have to address that oh whoops I’m sorry let me fix this real quick I passed in user instead of fine user let me fix that I apologize hopefully you all caught the error yourself very quickly okay so let me do this again so first I’m I’m going to click Send good and that error just happened earlier because when I made a second request it actually tried to call the deserialized user function so I’ll explain that so the first thing that happens is when we first log in we call serialized user once that’s all we need to do is call it once this function this call function needs to be called when we log in and we’re only going to log in one time obviously until we log out and then we log back in okay once we have logged in any request that we make later on what happens is passport will then call the Callback function for deserialized user so this callback function is going to get called if I make another request okay so let’s see what happens I’m going to click click Send see how now uh let’s see okay yeah right over here see how right now it’s going to go ahead and call deserialize user inside deserializer and it says deserializing user ID of one okay and uh again we’re it’s calling uh serialized user because we’re actually trying to call the login endpoint but you’ll notice that if I try to call another endpoint it’s not going to call serialized user okay but you can see the order of how things are working let me go ahead and Implement another endpoint let me do this let me Implement app.get API let’s Implement a status endpoint and this endpoint is responsible for checking to see if the user is authenticated or not okay so remember how earlier I said that the user object will be attached to the request object so if I were to console log request. user and let me just go ahead and write inside because we have a bunch of logs everywhere so I want to label everything and then what I’ll do is this so I’m not going to send the response back I’ll just log this right now okay so let’s redo everything let’s log in so let’s go ahead and call this endpoint so it goes ahead and we log in it calls serialize user and then inside serialize user we log the user that’s fine now let’s make a get request so let’s let me hit new request okay I’m going to make a get request to that new endpoint sl/ status and now inside this status endpoint uh we want to make sure that we are only sending a response back the user response back if the user object actually exists on the request object and that’s a good indicator to let you know if the user is authenticated or not so if request. user I’ll return a response with the user object U and of course if the user is not defined if this property is not defined and it’s there’s no value then we’ll just simply return response uh let’s do send status 401 and let me actually just quickly use I’m going to use a turn operator instead return request. user so let me just copy that and then response then status 41 so now I can remove this okay hopefully that makes sense uh oh whoops sorry about that okay should have been colon so this is a turning operator over here all right so let’s go ahead and do this let’s log in right now so I’m going to make a post request to my authentication endpoint click Send okay we’re good now let’s go ahead and make a get request to the status endpoint uh let’s see user is not the find I might have an error somewhere else [Music] um what’s going on over here oh whoops I forgot it’s not User it’s request. user okay um let’s re log in so you’ll see that when I log in we are inside serialized user so that gets called that’s fine so now we don’t need to log in anymore because we’ve already logged in one time so we should be logged in so if I click this right over here you can see that I can access my user reference because I’m logged in as ansen and notice how when I make a request to this endpoint it’s going to go ahead and call the deserialized user function you can see the logs are right over here and again what happens is the deserialized user function will use that ID from the session store okay CU that’s where the data is really being saved inside the session store and also the session object itself and then it will use that to search for the user in this case we’re only saving the ID let me also show you one more thing that was also mentioned in that stack Overflow post as well let me console log rec. session and let me just do this oh whoops it’s whoops sorry about that it’s request. session yep okay all right so let me do this again and let me go down here okay you notice how right over here and the reason why I’m showing this because again I want you to understand how all this works notice how now the session object has this passport property and if you saw the part where we talked about Express sessions you’ll remember that as soon as you modify the session object it sets the cookie and sends it to the front end or the client so if you see right over here if I look at cookies I actually have this cookie right over here and this is my session ID on the server okay so as soon as it as soon as we modify that session which passport is modifying the session for us so it attaches this passport object to it and then it notice how it takes this ID and then Maps it to the user like that and that’s assigned to the passport object and now watch this if I were to go back to serialize user and if I were to change this to let’s say username so let me do that real quick so let me change it to username I’ll just remove this log right over here so let’s search by the username okay and now I want you to see what happens so I’m going to log in right now okay so I’ve just logged in and I’m going to make a request to that off/ status endpoint and now if you look at the logs you can see that we are we serialized the user by using that username field now some of you might wonder well why can’t we just pass in the whole user object so let’s say for example instead of just passing in the ID or just the username I pass in the entire user object right over here so since we have the user object I probably don’t even need to search for it so you know what let me just comment all this out and I’ll pass in I’ll just replace all this for now I wouldn’t recommend this but I’ll just show you what happens so let’s reog in and you can see how now passport. user has the entire user record populated okay so let me explain to you why you probably don’t want to do this because your session data you don’t wanted to have a bunch of information that could possibly go stale okay because think of it like this right something like the ID is never going to change okay the username might change every once in a while but the ID is never going to change if let’s say the display name changes and then you deserialize the user by simply grabbing that user from the session data and then you grab everything including that stale display name that’s going to be returned back to the client if they request it okay so if you make changes to the database it’s not going to be synced up with your session data you’ll have to manually update that yourself and that is going to be an additional uh you know scope of work that you’ll have to take care of and you also don’t want to just store a bunch of properties inside the session data that you don’t really need because it’s just going to take up a lot of memory and you’re going to you know clog up your entire database with all of the stuff that you don’t need all you really need is just some unique identifier such as the ID or the username and then you’re good you don’t need anything else aside from that okay the Der serialized user function is responsible for finding that user and then attaching it to that request. user object that’s all it is okay so again you could do it but should you probably not all right so I’m just going to change everything back to using the ID and then let’s go ahead and take a look at this so I’m going to log in I’m good here I can log in as any other user I want so watch this uh oh and one more thing I’m going to show you notice how if I delete my cookies and if I try to call this endon again is going to give me a 401 unauthorized cuz I don’t have that cookie anymore okay which of course makes sense but let’s try to log in as a different user so let’s log in as Adam so the password is hello hello so I am logged in as Adam okay so now if I make a get request to the status endpoint my credentials will be Adam adom so now you’ll see in the log that this is what we have okay so I hope all this makes sense and I hope you better understand how to use passport now um and what I’ll do in the next part of our tutorial is we’re going to go ahead and actually set up a database and then you’re going to learn how to use the database to create the user and also save the user to the database and then we have a fullon login logout mechanism before I end this part of the tutorial though I do want to show you one more thing on how to log the user out in other words just destroy the session okay so what I’ll do is WR over here so I’m going to set up an endpoint it’ll be a post request so app. poost apith logout let’s pass our callback function and then first let’s just check to see if there is uh no user defined which means the user is not actually logged in then I’ll return a response and I’ll send a status of 401 which means not authenticated and then if they are logged in we’ll just reference the request object and then we can just call this logout function and then we do need to pass in a callback function for this okay and then all I’ll do is this if there’s any error I’ll just return response send status 400 I guess and uh I think there that’s really all we need to do but if there’s no errors I’ll just send a response back of 200 okay let’s test this out now so let’s log in and then let’s see our status so we are logged in let me go ahead and make a new request so it’s a post request so SL API SL SL logout and you can see now we are logged out and uh okay so our cookies are still going to be present on our client but if I try to make a request to the status endpoint it’s going to say 401 unauthorized because even though we are sending cookies to the server the server knows that that cookie is not valid okay so even if I try to uh well now if I actually try to send a post request to here you can see that it gives a 41 unauthorized because we are not logged in okay so it doesn’t matter if we have the cookie this cookie is no longer valid so it’s going to give us a 401 okay so hopefully uh this makes sense and in the next part of this whole tutorial series I’m going to actually set up a database and then we’ll actually convert everything over and then you’ll learn how to actually encrypt the password as well instead of just comparing raw passwords right now which is what you don’t want to do so I’ll see you in the the next part of this tutorial all right so now in this part of our tutorial I’m going to show you how we can actually connect to a mongodb database using uh mongodb as well as so what we’re going to do is first obviously make sure you have mongodb installed on your local system I do already and I’m going to go ahead and install mongus which is is a node module so let me go into my terminal and let’s do npmi whoops Mongoose like this okay so we’re good with that so now what we want to do is let’s just go ahead into our code and we want to actually connect to our database so it’s pretty easy so all we have to do is first import so let’s do import from and I’m inside my index file right over here okay and then what I’ll do is write down over I guess write over here I’ll go ahead and do doc connect and I’m going to pass in the URI so mongodb is the protocol and then the host name so Local Host and then Port 27017 you don’t have to provide the port if this is the port that you use because by default it will use port 27017 but let’s say if your mongod DB is running on a different port then you must specify that Port because the package uses this port by default okay so I’m going to Omit that but then I’m going to specify the database name so I’ll just call this Express uh tutorial and then what I’ll do is disconnect function actually returns a promise so I’ll just use then and I’ll conso log connected to database and then I’ll also use a catch if there are any errors I’ll just simply whoops write a log error and then I’ll log the error so let’s start up our server let’s make sure everything is working fine okay so you can see right over here it says connected to database all right cool so let me go ahead and open up my mongodb GUI my graphical user interface let me just zoom in a little bit so this is mongodb compass you can use whatever you want I’m just going to use this for now so I’m going to connect to my mongodb database I’ll click connect okay so we are successfully connected to to the database so that’s great so now let’s go ahead and set up our very first schema now some people might wonder well why are we using Mongoose and not using like the regular mongodb package for example let me just show you this one over here some people might wonder why we’re not using this node.js driver to interact with our mongodb database the reason why is because realistically in projects you’re not actually going to be uh writing actual query like they do over here you’re going to be using an OM for many realistic projects because they are very safe to use for your codebase it’s the same reason why many people use orms for SQL because it just takes care of a lot of things for you and it also takes care of structuring your data it makes it a lot more easier okay so I just wanted to mention that in case some of you might wonder why we’re not using the regular mongod DB driver but instead we’re using mongus okay and Mongoose is very popular many people use Mongoose if you look at the node module on the website you see there’s 2 million downloads so it’s not going anywhere anytime soon okay anyways let’s go ahead and create our schema so we’re going to create a new folder and I’ll call this I guess mongus and really what a schema is is it’s just a way for you to Define your database uh collection you want to you want to actually sh sh how your data is going to look like and we do that using a schema so I’m going to create a folder called and I have my folder called schemas and inside that schemas folder I’m going to create a new file and I’m going to call this user.js okay and this is where I’m going to create my user schema because what I’m going to do is I’m going to replace uh my endpoint where I create a user so right over here I’m going to replace this so instead of actually saving it to the array we’re going to to just fix this to actually save it to the database okay and then I’m going to show you how we can replace how we can actually use our database to perform the uh authentication validation instead of using the array so the first thing that we need to do is we need to go ahead and of course create our schema so I’m going to go ahead and import schema from like this and then I’m going to go ahead and create a variable I’ll call this us user schema equals new schema just like that and over here we can Define our Fields so what does our user look like so we have a username a display name and a password so let’s set up the username field and we need to specify the data type okay now obviously we’re using JavaScript so there’s no data types in JavaScript or there’s no explicit typings in JavaScript is what I meant to say not data types there’s no explicit typing that we can set to this username field so there’s actually there’s one thing that we can use so let me actually do this import uh let me actually do this instead let me import mongus and do mongus do schema instead and then to set the field for username to basically tell mongus what data type this is we’re going to use mongus do schema. types and here we can reference which data type we want to Define our username as so your our username is going to be a string so I’m going to Define as a string like this and then we’re going to set the display name same exact thing oh whoops this should be comma sorry about that and then the last thing was uh password okay let’s do that password okay great now additionally let’s say some of your Fields might be required ired so what you can do is instead of assigning this type to your field you can actually assign an object to that field and then you can specify type the field type on that object and set it to that mango. schema. types. string and then you can set this uh field called required like this and set it true true like that so I’ll do the same thing for our password as well uh let me just go ahead and I’ll just copy and paste this okay another thing that we can do is for our username we can mark this field as unique by simply just using this unique field and set this a true so that way if there is already an existing user document in the user collection that has this username let’s say ansen and if we try to save another document to the user collection with username set to Anon it’s going to throw an error okay so that’s hopefully that makes sense okay so we’re pretty much done with our schema this is a pretty simple schema so now what we need to actually do after we create this schema instance is we need to actually uh compile it into a model and that’s actually pretty easy so what I can do is I can uh create a variable I’ll call this user and then we just need to reference mongus and then we just call model and then we need to give a name so I’m just call this user and you pass in the schema so user schema like this okay and you use this model to actually perform operations for that user collection for the database so if you want to search for a user you would reference this user model and you would call this find one method like that okay but let’s go ahead and just export this model so we’re pretty much done with our schema and our model all right so now we can go ahead and save data to a database save a user to a database and we’ll go ahead into our user endpoint so I already have one set up right over here already and you can see I’m inside my user router uh right over here so I’m going to just use reuse this endpoint but I would encourage you if you don’t if you are not using routers I would encourage you to do so but if you don’t have it set up just create your own uh / API us endpoint or whatever endpoint you want to create the user I’m going to remove all this stuff out over here and I’m also going to just remove this validation check because I don’t want to combine too much stuff because some I know some of you may have not watched the previous parts of this tutorial and I want to make sure you at least understand the purpose of what we’re trying to do instead of just adding all of these dependencies on top of it but if you have been following along then I encourage you to perform the validation check yourself so that way it’s better practice for you okay but we’re going to pretty much start as if we’re doing it from scratch so don’t worry so what we want to do is we’re going to send the post request to this endpoint and we’re going to send the username password and um the display name okay so const body we’re going to destructure the request body from the request object and since we’re not doing validation right now I’m just going to assume that the validation uh has happened so that means that I’m going to assume that the request body is correct but of course like I said you want to always make sure you are validating everything okay but we we’ll assume just for tutorial purposes we’ll assume that the request body is valid and then what I’ll do is I’ll just go ahead and do this I need to First import that let me remove that I need to First import that user model so import user uh import user from schemas user okay so I just imported the user model and then what I need to do is I need to create an instance of that user model it’s very easy all we do is first declare variable I’ll call this new user equals new user like this and then this Constructor the user Constructor I can pass in the object the body object which contains all the fields that we want to save to the database for the user so once I do that I need to then actually save that user to the database so what I’ll do is I will do this declare variable called saved user now to save the user to the database we just simply call the save method on this new user variable because that’s the user instance but this method is asynchronous so we need to make sure we are using a weight behind this new user. save call but of course to do to do that we need to add the Asing keyword in front of our callback function okay and then let’s also make sure we are handling errors accordingly so what I’ll do is this I’m going to go ahead and since this function can likely throw an error I’m going to wrap it inside the try catch like this because this is just creating the instance it’s not going to throw an error I don’t think the Constructor the Constructor will actually error out it’s only when you try to save then mongodb could failed to save the user maybe because uh the username that we’re trying to save for that new user already exists in the entire user collection so it could error out so first if there are no errors at all and we’re good then I’ll just return a response so let’s set the status code to be 2011 whoops it’s response. status 2011 and then send back the new user like this and if an error does happen uh I’ll just log the error and I’ll just send back a status code of 400 which just means bad request oh whoops should be return misspelled that okay let’s test this out let’s go into Thunder client let’s make a post request to our users endpoint okay and let’s pass in the username anen password let’s do hello one 123 and then display name click Send uh is our server up oh well I forgot to name this user. MJS not user.js so let me rename that um um and I guess I will click yes to update the import so inside my routes file yep yeah so the problem was that I needed to actually add user do MJS here as well okay um all right so now our server should be up and running click Send okay and now you can see the data was saved to the database let’s go into mongodb let’s refresh see how the express tutorial database appears over here and we have our users collection and I can now see my user in the users collection so that’s wonderful and watch what happens if I try to click Send again it’s going to say bad request and the reason why is because uh you can see over here it complains about a duplicate key error and that’s because I marked the username as a unique field okay so if we try to save that same username to the database again it’s going to throw an error so hopefully that makes sense now additionally what I’m going to do and this is really just for the people who are in fact wanting to validate their schemas I will add the schema check right now so what I’ll do is right before we call this request Handler function I’m going to call that check schema function and I’m going to pass in the create user validation schema and like I said all the code is going to be in the description so if you do want to do some of the things that you may have missed from earlier just go to the GI up link and grab the code and you can see everything from there but I’m just using this validation schema and I have this password uh that I didn’t have this before but I just added this just now so I have this password field right over here and then I am making sure that password is not empty and you can see that I’m making sure that the username has all these validators that are applied to that username field same thing for the display name okay so by calling this this will make sure it checks the request body and performs the necessary validation on it this middleware does not actually throw an error we need to go inside the request Handler and actually check if there are any errors so the way we do that is we just simply declare a variable called result and we call this validation result function I think that is imported yep it’s imported right up top over here from Express validator and we pass in the request object into validation result and what this will do is it’ll actually grab that um this Dynamic Property that was attached to the request object that Express validator does for us and it’ll give us the information about what the statuses of the request body it’ll tell us if there are any errors it’ll tell us if everything is good if there are no errors so what we can do is I can just simply say if result uh dot let’s see is empty so this just basically means if there are no errors then we can proceed but I’ll make sure I do this if there are errors so if the result is not empty that means there are errors I’ll return a response and I’ll just simply do this return response. send and I’m going to go ahead and send results. array and this actually gives me all the errors so it will tell us okay what fields are missing or what fields are invalid okay so just very quickly I’ll show you how this works so notice how if I omit display name it’s going to complain about display name not being there if I omit password it’s going to complain about the password and if I omit username username will not it’ll complain about the username over here so hopefully that makes sense with how this works so now of course if there are no errors at all then we can proceed with the rest of our um our logic but ideally you don’t want to use the actual request body object from the request object itself like we’re doing over here you want to actually use this function so let me first declare a variable I’ll call this data equals and then we’re going to call this matched data function which is imported up top over here from Express validator and then I’m going to pass in the request object and so what this match data function will do is it’ll grab all the validated fields for you so it’ll grab username password and display name for us okay so let me remove this and let me place this with data instead and I’ll also just console log data as well and let’s try this again so this time let’s make a post request uh for the username I’ll do Anon one and that was created and if you look at the console you can see that that object is being logged right over there and of course if we did omit any data at all then it would just return that response right over here let me set the status to uh 400 okay there we go perfect so like I said I just wanted to show you how to perform validation if that was something that you also additionally wanted to do but I also wanted to show you a very easy way just to save records to the database okay and everything is going to be similar to how we just did this okay so we have one user schema if you wanted to save products to your database cuz we have endpoint for product s then you would have to make sure you create a product schema compile that schema into a model by using this model function right over here or this model method on the Mongoose import and then now you can just easily create products in your database that’s literally all you have to do all right so now in the previous parts of the tutorial where we covered authentication with passport I was actually using users that were in an array and what I want to do is I want to go back to the authentication part and I want to show you how we can replace all this stuff with using the actual database itself CU I know many of you want to actually see an example of how to do that and that’s what I’m going to do and then after we finish this I’m going to show you how we can encrypt or hash out our passwords because you obviously never want to save raw passwords raw text passwords like this in your database because if someone hacks into your database they can see everything they can see the username the password and that’s not good you want to actually hash it so I’ll show you that after we just replace all this stuff over here okay so first let’s go ahead and do this I’m going to go ahead and go into my verify function right here so this is where we are searching for the user in a database and then we’re going to compare the passwords okay so I’m going to pretty much just remove this Mock usind and let me just remove this whole let me just remove all this okay move all this so we need to First import the user model from our user MJS file inside the schemas folder and then we need to search for the user so I’ll show you how to do that so conine user equals so first we need to make sure we reference the user model and we’re going to call this find one method and this is where we need to actually specify a filter so you’re going to pass in an object and you’re going to specify what you want to search the user by so in this case we’re searching the user by the username so I’m going to set username like this okay since the username argument is the same as the username field I don’t have to do this like username callon username I can just do username like that now this fin one method is asynchronous so we do need to make sure that we await this call and then we also need to make sure we add the acing keyword in front of our verify function okay and of course if there are any errors at all it will just be it will be thrown by let’s say the fine one method and then we’re catching it so that will be handled accordingly so that’s already set up just fine so now let’s first check to see if fine user is actually defined because this fine one method could return null which means that the user was not found so if there’s no fine user then I’ll throw a new error and I’ll just call I’ll just say uh user not found and then the error will be caught right down over here in this catch block which we’ll call the done function with the error instance now the user is found and we can verify that the user is defined so now we want to check to see if the passwords are valid so if find user. password so I can reference the property directly on this instance that I just searched for if it’s not equal to password then we’re going to throw an error as well and we’ll just say bad credentials literally the same exact thing only difference is that we are replacing the array um with referencing the actual user model and calling the f one method okay same exact thing let me just remove these two console logs and we need to go into our deserialized user method and then we need to make sure we remove this mock us that fine and uh instead let me remove all this instead we’re going to go ahead and call user. find one but this time we’re going to actually search by the ID but the nice thing is though there’s actually this method called find by ID and I think this should return just one user record let me just double check yep finds a single document so it doesn’t return an array just wanted to double check so this is good because remember our mongodb database it autog generates these object IDs right over here so we can use that to search in a database okay so I I’ll just pass in ID like that and let’s just make sure we add the Asing keyword in front of our callback function for der serialized user and the rest of the logic stays the same if the user is not found throw an error if the user is found then it’s going to ignore this part and then we’re going to call the done function okay and I think that should be it um let me just make sure that everything else is good uh we can ignore the other parts of our application that are still using the mock users that’s fine okay so let’s test out our login and log out feature using the actual database to search for the user and see what happens so we have two users we have Anson and we have we have our password set to one 12 hello 123 for that so let’s go into let me see okay let’s go into Postman uh so I’m going to pass in Anson and then I’m going to pass in the password hello 123 um oh whoops I made the post request to the wrong endpoint okay so it’s still processing I wonder what’s going on uh let’s see let me try let me restart my server let’s try again uh okay so for some reason it’s still processing I think I may have forgot may have forgotten something let’s see find by ID uh oh yeah that’s right I forgot to call the done function down here silly me so let’s just pass in null for the error and pass in the user my apology click Send okay so we are logged in let’s verify that we’re logged in by making a call to the status endpoint so we’re making a get request so I am logged in you can see now my actual ID that’s in the database is right there okay and I have my username my display name my password all that stuff that’s from the database okay so we are a ble to log in using records that are in the database so hopefully that makes sense okay so now I’m going to show you how to Hash passwords for your users when you’re creating them before you actually save it to the database because right now if you were to look right over here in the database you can see all of the users and their passwords and that’s obviously not good and that’s obviously a huge red flag for any application that that saves the passwords raw like this because if a hacker gets access to your database they can literally see all your users and all of their passwords and that’s not good so you want to make sure you always hash your passwords before you save it to the database and then once we hash the passwords I’ll show you how when we log in how we can actually compare the hash passwords so that way we can validate that the user is actually passing in the correct password so first let’s go ahead and install bcrypt so let me go into my terminal npmi so I’m going to type npmi bcrypt like this and once we’re done let’s just rerun our server again and now what I’m going to do is let’s go into our utils folder I’ll create a new file called uh because we want to keep this logic separate from the rest of our codebase so inside here I’m going to go ahead and import bcrypt from bcrypt like this and what I want to do is I simply just want to create a function that will take care of hashing the password so I’ll create a function and I’ll export it I’ll call this function hash password and this function is going to take in the actual password itself so password and the way that we actually begin hashing the password in bcrypt is very simple the first thing that we need is obviously the plain text password and then the other thing that we need is a what it’s called a salt round okay and basically the salt round just pretty much means uh you know how much time is needed to calculate the hash for for bcrypt so of course the more rounds you you want that it’s going to increase complexity uh the documentation recommends 10 so I’ll create a variable I’ll call this salt rounds equals 10 like that and then uh what we can do is we first want to actually generate a salt so this is the rounds but we want to still generate the salt so I’m going to go ahead and call bcrypt and then I’m going to go ahead and call this gen salt method like this and then you can just simply pass in the rounds so salt rounds like that and then this is asynchronous but there’s also a gen salt sync function that is synchronous so if you don’t want to use async A8 then you could just use this function so it it really doesn’t matter all that much because we’re going to do we’re going to be doing everything in order anyways so first we want to generate the salt so let me store this in a variable so bcrypt do gen salt sync and then pass inst rounds next what you’re going to do is you’re going to go ahead and call bcrypt and then you’re going to call Hash so again this is asynchronous as well so this will return a promise with the data in this case our password hashed now there’s also hash sync which is the same function it just does it synchronously so it doesn’t return a promise but it will call this function and then it return the string so I’ll just use hash sync since I’m using gen salt sync as well so you call this function and you pass in the text password that you want to hash and then you want to pass in the salt okay so I’ll just pass in this salt right over here just like that and then I’m done and then I can just return this so whenever I call Hash password this will hash the password for me so let me actually console log salt as well cuz I want to actually show you what this value looks like so now what we want to do is before we actually create our user we want to make sure we hash the password so I’m going to go into my users. MJS file in the routes folder so I’m going to go back to my users endpoint where I’m creating an actual user so this one right over here and you can see uh right over here on line 61 I’m creating a new instance of my user and then I’m saving it right inside this Tri catch or inside this Tri block so before I actually pass the data into the user Constructor what I want to do is I want to reference data. password because remember this data is the request body that is being sent to this endpoint and we expect there to be a password field and since we are doing validation after this point the password field will be there so I want to basically reassign a new value or assign new value to the password field to the data object itself okay so when I pass the data object to the Constructor of user it will contain the hashed password not the raw password so what I’m going to do is I’m going to call Hash password and that’s going to be imported up top over here from our helpers file that we just created from the utils folder uh where am I okay right over here now remember the hash password function is synchronous because we’re not using any async A8 in here and we’re not returning any promises we’re just returning the string so we don’t need to use async A8 but if you did use the asynchronous methods like gen Sal and then hash then of course you would need to First await this and then you would need to add async like that and then you would need to add async in front of this hash password call so I just wanted to mention that for those of you who choose to use the asynchronous versions of the functions so I’m going to call hash password and I’ll pass in data. password so this will take the raw password hash it and then store it back to the password field for data so I’ll console log I’m already conso logging data up here but I’ll console log it after we assigned the new value for password so let’s go ahead and see how this all works so let’s go into Thunder client let’s make a post request to API users and we need to send a username password and display name let’s change it let’s do uh John and username will be John because we already have Anson as username already in the database going to click Send uh is our server up and running oh whoops I forgot one more thing I think I yep I forgot to name helpers JS to MJS let me rename that and then inside the users. MJS file we need to make sure we are adding that MJS extension that was the main problem over there I keep forgetting so I apologize for that but let’s test this out again so our server is up and running I go back to thunder client click Send uh let’s see password oh username must be at least five characters let’s do Johnny Okay click Send okay and now you can see that the password is hashed let’s go into my database and you can see Johnny is saved in the database and it has the hash password okay wonderful we now know how to Hash passwords and save it to the database now the next problem that we have since we have authentication is we need to be able to actually compare the hashed password with a value that we’re sending to the server because right now let’s say if I try to log in as Johnny let’s do this with our current logic right now if I try to log in as Johnny and I and I provide my password like this it’s going to throw an error it’s going to say bad credentials okay that’s because we’re trying to compare uh this password hello 123 with the hashed text and obviously hello 123 is not equal to this entire thing so here’s what we need to do we need to go back into our strategy file right over here inside our verify function okay right over here what we need to do right before we compare the password instead of uh just comparing the raw password that is sent from the client side with the hash password now we need to actually hash that password that was sent from the client so what I’m saying is when I send hello123 as a password to the server I need to Hash hello 123 and then we’re going to compare that hash to the hash value that’s in the database hopefully that makes sense okay and actually there’s a built-in function that we can use to compare hash passwords and I’ll show you what that field is so let me go back into helpers MJS so there’s this function called uh bcrypt do compare or compare sync I’ll use compare sync and what you do is you pass in the plain text password and then you pass in the encrypted which is the hash password so this will be the actual hash password that is saved to the user in the database so first let me just actually create a helper function so I’ll do compare password equals password uh let me do this plane hashed like this okay and then uh this bcrypt compare sync function will return a booing so I’ll just return that Boolean only pass in plane and then the second argument for compare sync will be encrypted which is just going to be the hashed password and so this will return a Boolean value so if it if these two values are equal to each other then it will return true if it’s not then it will return false so we don’t actually need to rehash anything because this compare sync function will take care of it for us okay so let’s go over to here and then all I need to do is just simply instead of doing this check like this I can just call compare sync or I’m sorry not compare sync compare password and then just pass in the plain password so that’s password right over here so this is the value sent from the client the raw text password and then we’re going to pass in the hashed password so find user. password like that okay and then of course if this returns uh we want to negate the value because if it returns true that means the passwords do match but if the password uh don’t does not match it would return false so if not false then we’ll throw a new error so let’s go ahead and try and reauthenticate and now you see we’re good to go and notice how if I try to log in as ansen because currently ansen has the raw text password save in the database it should actually error out because now we’re trying to compare uh the plain text to a hashed value which obviously is not going to work so yeah that is how you can save the hashed password instead of the text based password to the database and then you can and that’s how you can compare them as well so I hope this part of hashing passwords and how you can save the hash password to the database and compare it makes sense so in the next section of the tutorial we’re going to go ahead and talk about session stores something that will help us tremendously because right now whenever we keep on restarting our server our sessions keep getting dropped from the memory store because it’s volatile so I’ll show you how we can actually use session stores to save the session data to the database so that way when we drop the server and then restart it our session will be restored and you’ll see that we remain logged in okay so now let’s go ahead and move on to session stores so this is something that you very likely will need especially when you want to persist session data for the user because sometimes your server may go down for unknown reasons and they might restart and when that happens all of your session data will be gone because by default Express session stores it in memory so what you want to do is you want to store this in a database so that way it can be persisted whenever your server Goes Down And if it goes back up the session store will have that session data there and express session will look in that session store in the database to grab the session data and restore it for the user so earlier I actually did show you how the inmemory session store looks like and how it stores data I’ll show you again so inside my API users endpoint is where I have this being uh logged so what this does is it looks for the session ID and uh if there are an errors so just throw in error but then we pretty much just log the session data right over here so right now I’m not logged into the application at all I’m not authenticated so I don’t have a cookie or anything but if I make a request to API users and if I show the logs you can see that right over here uh inside session store get that’s where I’m logging this right over here you can see that the session data is undefined okay that’s fine let me go ahead and log in first cuz we haven’t actually U modified the session data at all we haven’t actually logged in yet so let me go ahead and log in so let’s do this API SLO log in oh whoops did I forget yep sorry about that uh bad credentials uh oh wait you know what it is it’s because I’m still comparing the old the raw based the raw text password in database let me use uh Johnny instead and then the password is I think it was hello 1 123 as well okay so I just successfully logged in let’s verify let’s go to the status endpoint and you can see that I’m logged in obviously you don’t want to return the password but that’s something for a separate part of this tutorial but now watch this when I go to/ API users you can see see that in the console so we’re inside session store get so we’re logging it right over here and then you can see that this is the session data and you see how the session data I have the cookie and then I have the passport and then I have the user okay so every single time we make a request to the server um Express session will take care of looking for the session data in the inmemory store and then it will know who the user is okay and then right over here we have the user ID uh inside passport okay and then passport will take care of calling the serialized user with the ID and then it’ll search for the user in the database and then that’s how it’ll grab that user from the database and attach it to the request object okay so if the server goes down so let’s say right now if I restart the server and if I try to visit uh let’s say if I visit the previous endpoint let’s do au/ status you see how it says unauthorized so we’re not even logged in anymore okay all of our session data is gone if I were to go back to SL API users you can see that now the session store does not have our data it says undefined so obviously that’s a problem so what we can do is we can use a session store to save the session data and it’s actually not that difficult to use because all we really need to do is just have a database connection which we already do already so in earlier parts of the tutorial I showed you how to connect to a mongodb database using so that’s this right over here and then what we can do is we can reuse that connection to connect our session store to that database so we’re going to use this package called connect and pretty much this is just a mongod DB session store for Express now let’s say for example if you’re using some other database there are a bunch of different session stores right over here so this is the express session documentation if you just scroll all the way down and you scroll down to compatible session stores you can see that let’s see there is one for couchbase DB there’s one for uh mcash yep connect right over here there’s one for SQL this is the Microsoft SQL Server neo4j redis Firebase there are a bunch okay so you just have to look for this look in this list and find the one that you want to use we’re just going to use connect mango for now so let’s just first install connect so inside my terminal I’ll type npmi connect and of course you must make sure you have already a database connection so in this case since we’re using I can actually just reuse this database connection so now that we’ve installed connect we can import that and into our index file so I’ll import store from connect just like that and then we need to go down into our session middleware and we need to set this store property so where you’re pretty much calling this session function and then you want to reference store. create and since we are using we can actually reuse that connection so there’s this property called client in the connect options like this and then you can reference which which we have imported up top over here and then you can reference connection and then you can call this gets client method just like that okay and this says Returns the mongodb driver client instance that this connection uses to talk to mongod DB okay so let’s go ahead and start up the server again and let’s just make sure everything is good okay so we’re connected to the database and let’s actually try to authenticate now because that’s what actually modifies the session so let’s go ahead and make an API request to API let’s send the username Johnny and then password l123 so we are logged in successfully no errors in the console okay that’s good now let’s go into our database and let’s see what happens okay so I’m going to refresh and you notice how now there is this sessions collection okay notice how now there’s a sessions collection let me expand this real quick and you can kind of see how we have uh let me see if I can kind of do this so you can see it better okay so you see how we have this sessions collection right of here so now we’re actually storing the session data in mongod DB in our database so then what happens is now I’m logged in okay I just logged in I’m going to make a get request to the o/ status endpoint to verify that I am logged in which I am okay so we’re good now watch this the problem that I mentioned earlier was that if I were to close the server so I’m going to exit the server and if I restart it it would log us out because all of the session data was saved in memory but because now that we actually have a session store that is a database it will use the database to restore the session data so watch this okay so I have my session data stored in the database and notice how if I make a get request to the off/ status endpoint notice how I am still logged in okay if I remove this store completely it’s going to use the memory store by default okay and let’s go ahead and restart the server click send notice how now I am unauthorized because my session data is not found in memory because it’s using the inmemory stored by default so I I really hope this makes sense and I I hope this showcases how important a session store is because now instead of having your session data stored on stored in memory it stores it in a database which is great for persistence okay so you can restart your server how many times as you want want the session data will always be restored so notice how now if I just call this endpoint again after just uncommenting out this part the store options now we see our data so what happens underneath the hood is by configuring that session store it will basically look inside the sessions document or inside the sessions collection and it’ll search for uh this session ID right over here so if you look right over here wrg K if I kind of show you the cookies right over here let me see if I can find it you see how this is my session ID right over here and I can even log it too I think I may be logging already nope let me log it right over let’s see let me go into let me go back to to the status endpoint and let me just log request session ID okay and if I make a request again you’re going see that we have that that’s our session ID right there and notice how that session ID is the same ID that’s in the our document right over here so what happens underneath the hood is when we send the request to the server remember we’re sending the cookie back to the server right our cookie is right over here so that gets pars on the server and then what happens is instead of looking for the session data in the memory store it’ll look in our mongodb database which is persistent and that’s how it will take care of looking for the session data sorry about clicking all this stuff let me click over here and show you the the mongodb compass client so it’ll look for the ID okay and then it looks for the session property and it will basically take this whole string of ified object parse into Json and then attach this object to that request. session object which is what you see right over here okay and notice how we have the password data right over here that’s right over here and those how this is right over here as well the user ID so everything is in the database now which is great so now since we’re on the topic of session stores I want to revisit these two properties save uninitialized and resave for uh the session configuration because I mentioned this and I told you all not to worry about it so much until we got to session stores so right now we have the sets of false okay so what this means is uh only when you modify that session data object then it will actually save this to the session store okay so in our case right now when we authenticate using passport passport will modify the session data object for us which means that it will also save it to the session store which is actually what you see happening right over here okay so when you set save an initialize true it’s going to save every single session object to your session store even if you didn’t modify the session at all so I’ll show you I’ll show you an example okay so right now what I’ll do let me just delete this session from the database so that means I’m no longer authenticated you can see right now if I try to make the get request it’s going to say I’m unauthorized okay CU I don’t have that session data stored on the service side now but what I’m going to do is I’m going to go ahead and set save uninitialized the true and I’ll just visit any random endpoint so I can visit uh let’s see I’ll visit SL API off/ status and let me also clear my cookies as well before I do this just so that we are at a clean state so I’m going to make a request to API status okay and notice how it gives us back a cookie and notice how now in the session store you see how it’s saving this session data to the database to the session store even though we never modified the session data at all and you can tell because uh let me show you the logs okay you can see that we have the session data and we have this cookie so it’s going to send us that cookie back but we don’t have anything related to the user at all so if I try to revisit this endpoint again if I refresh I’m still going to use this but notice how if I clear the cookies now if I click if I send a request again it’s going to create another session uh data in the database and then I can go ahead and just clear the cookie again and it’s going to create one again so even though I’m not doing anything but just trying to visit an endpoint it creates a session record for us okay and this really depends on how you want to implement your application sometimes this might be useful but you can start to see that this is not necessarily a good thing because um it’s it’s just going to save a bunch of unmodified session data to your database and that could use up a lot of storage so it’s better to only save the session data when it’s been modified so in cases where the user logs in passport will actually modify that session data and then it will save the session data to the database so let’s take a look at the resave option now so currently it sets a false uh so I’m going to set it to true and currently I have dropped all of my sessions in the database but what I’ll do is I’ll make a request a get request to this status endpoint okay that’s fine we do get back a cookie though which is which is fine as well if I refresh I can see that my session data is over here so what save really does is it pretty much just forces this cookie to be resaved every single time so you notice how right now let’s pay attention to this date right over here this date string okay notice how every time I make a request it’s going to go ahead and update this time right over here okay so if I keep refreshing it’s basically just going to keep updating that expiration date okay so it Reaves it every single time if I set it back to false and let’s go ahead and let me just refresh real quick so pay attention to this time so 14 43 39 so you’ll notice how if I click Send again and I if I refresh notice how the date does not actually get modified because we’re not forcing that cookie to be updated to be resaved every single time even though there’s no changes happening at all now if I actually try to log in so watch this I’m going to go ahead and try to log in now so I am logged in and I think I am using the same cookie as well uh let’s see maybe not let me refresh oh okay so here’s what happened okay so it actually replaced that session ID that we previously had with this one so notice how when I refreshed we have this session ID and you’ll notice that now everything got updated and it modified the session so typically when you do modify the session it will actually update the cookie as well which is what you see over here you can see that I don’t have the same cookie anymore as before okay um let me see yep that’s fine so yeah hopefully the resave part makes sense now typically ideally you would want this set to false and you would also want save an initialized set to false as well but it also could depend on when it’s useful like for example if you have it set to true that could mean that someone just visited your website they’re performing some kind of uh operations maybe they’re adding products to a cart but then once they log in you want to persist that session data as well so that way it’s not gone so once they log in they have their cart all set up already even though they did that when they were a guest on the application so hopefully that makes sense all right so in this part of the expressjs tutorial I’m going to show you how to set up ooth 2 using passportjs so this will allow you to use third-party providers such as Discord or Facebook to log into your application rather than logging in using just local username and password so I will be using Discord as my third party provider to allow myself to log into my application using Discord but as long as you understand what I am doing throughout this tutorial and I will be explaining everything that is going on you should have no problem following along using whatever third party provider you want so even though I’m using Discord you can use literally any other provider such as GitHub or Facebook the only difference is that you just need to make sure you figure out where to create the actual ooth application and you can easily find that out by just going to the developer documentation they typically provide links where you can read up on how to create an actual oo app but like I said as long as you understand what is going on with setting up our Discord oath application and grabbing the required values then everything should be fine and you should be able to integrate this with any third party provider so the first thing that I am going to do is go to my thirdparty providers website so discord.com so and I’m going to go ahead and scroll down to the developer documentation section so if you’re using Twitter for example you would go to twitter.com and search for the developer section okay I’m going to click on get started now and so now I want to look for the section where it says application so right over here applications you want to make sure you create a new application so I’m going to go ahead and call this let’s do ooth to Discord oh whoops o I guess let’s do Anon oo 2 so I’ve just created my application and whatever provider you’re using will prompt you to do the same so now what I’ll do is I’m going to go to the oath 2 section and there’s a couple of fields that we need to get we need the client ID and then we also need the client secret and let me just enter my tofa code real quick and get back to you all all right so I was just able to get my client secret you want to make sure that you keep this client secret private you do not want anyone to know what this secret is so I’m going to copy that and just for now I’m going to just paste this right over here now just for tutorial purposes it’s okay that you are seeing this client secret cuz I’m going to reset it anyways and let me just go ahead and copy the client ID now this client ID is not something that you need to worry about anyone can have it doesn’t really do anything other than just identify the actual applications ID so it’s okay if someone else sees the client ID now the other thing that we need is we need to add a redirect so this redirect is important because the way that the flow is going to work is we need to make a request to an endpoint that’s going to take care of uh redirecting us to the third party provider that we’re trying to authenticate with in our case we need to set up an endpoint later on that will take care of calling passport to redirect us to the Discord platform and then once the Discord platform shows up that authorization page and it shows us all the different permissions and the Scopes that we want to allow we click authorize and then Discord needs to redirect us to this redirect URL so hopefully that makes sense so that’s why we need this redirect URL cuz we need to tell Discord hey once we’re done authorizing send us back to this URL so I’m going to go ahead and just pass in Local Host 43000 because that’s what my server is running on SL API sloth let’s do Discord and then redirect now keep in mind this endpoint has not been implemented yet but we will implement it later on now you can add another redirect URL if you want this is useful if you want to use the same app in different environments such as let’s say uh right now we’re currently in development mode but let’s say you want to use this for production as well then you can add your production URL which is your domain name and then same endpoint I’m going to go ahead and just click save changes and let me also copy this redirect URL cuz we will need this as well so we just finished setting up up the ooff 2 app for Discord so the next thing that we can do is install our strategy package so since I’m using Discord I want to make sure that I install the correct strategy module for my project so remember that there are plenty of strategies to choose from depending on which third party provider you want to use so if you’re using Facebook there’s a passport Facebook library that you can install if you want to use Twitter there’s passport Twitter there’s a bunch you just have to go on this website passport js. org and just search for these strategies so obviously I’m using Discord so I’m going to install passport Discord so I’m going to go into my windows Powershell and I’ll type npmi passport hyphen Discord now make sure that if you don’t have passport the base passport package you install passport because you need passport itself as well I already have it already because I did a tutorial earlier with this passport itself with the local strategy so I’m not going to reinstall it I’m going to go ahead and hit enter and install passport Discord okay we’re good to go with that now let me just run my server again okay there we go so now what we’re going to do is this so in earlier parts of the tutorial I did set a passport with a local strategy however I don’t want to I don’t want to make this tutorial super complex so what I’m going to do is just temporarily I’m going to kind of like disable the local strategy cuz we really don’t want to have these two conflict

    with each other and that’s kind of like something that is for a different video to solve and I don’t want to make this whole section super complicated I’m just going to go ahead and comment out the local strategy the local strategy file import up top here and I’m going to leave the rest of these routes alone for now now so what I mentioned earlier is if you didn’t see the part where we set a passport you need to make sure you first import passport like this from the passport package and then right down over here you want to make sure you initialize passport by calling app.use and then passing in passport. initialize like this and then you also want want to configure passport to work with Express session so we just call app.use and pass and passport. session and that’s literally all you need to do the rest of the things that we’ll do for our Discord strategy will be pretty straightforward and doesn’t depend on anything else okay so now that we got that out of the way let’s go ahead and create our Discord strategy much similar to how we created our local strategy so I’m going to go ahead and create a new file and I’ll call this Discord hyen strategy. MJS and I’m going to import inside this file passport from passport and I’m going to import this strategy class and the strategy class actually comes from passport Discord now of course if you’re using a different passport strategy all the passport strategies have this strategy class so if you’re using passport Facebook you can still import this strategy class it’s going to be in every single strategy module it’s standard so now what we need to do we need to go ahead and call passport. use and pass in an instance of this strategy class like this and now we need to pass in options for strategy and we also need to pass in the verify function so I’ll handle the strategy options first so since we are using oo 2 we need to make sure we configure the oo 2 to have it point to our Discord application that we just created so remember how earlier I grabbed the client Seeker the client ID and the redirect URL well all that is going to be passed into this object right over here for the strategy options so first we’ll set up the client ID so you can see there’s this property that I can assign a value and I’m going to go ahead and assign it the value of my client ID and of course like I said if you’re using Facebook or Twitter or whatever the oath app that you create on those platforms will have a client ID it’s standard across any platform that implements o 2 okay and then it’ll also have the client secret so I’m going to grab my client secret and paste it over here keep in mind that just for tutorial purposes I am hardcoding all this ideally you would want to place these values in an environment variable so I’ll recommend doing that but just for tutorial purposes it’s okay I’m going to go ahead and now copy the redirect URL cuz we will need that and the field name is actually callback URL so when I say callback URL or redirect URL I use those terms synonymously okay so we’re going to paste that URL this is the Callback URL that Discord or whatever provider will make a request too upon success upon authorization success now there’s one more field that we need to configure and that’s the scope field and this is important because we need to actually State what permissions that we want to have what Fields what type of information that we want to access and that’s defined all in the scope so by default if you don’t leave the scope at all then you won’t have really any access at all to the user’s information but if you wanted the users’s let’s say username or their Discord ID then you would need to use this identify scope now the Scopes are defined differently on each platform so for example Discord has this identify scope let me see if I can kind of show you all through the documentation let me see right over here okay you see how over here at o off two Scopes and you can see that we have this identity scope and it tells you that what it allows you to access is allows you to make a request to this uh let me zoom in a little bit it allows you to access this users at me end point so if I click on that it pretty much gives you the user itself okay the user that authenticated so we need the authentify scope to get at least the basic stuff like the username the ID of the user stuff like that now it also does mention that it does not give you the email so in order to grab the email you need to use the email scope so notice how over here there is this me scroll up here there’s an email scope and it tells you right over here in the description it enables the same endpoint at users at me to return an email so if you want an email then you would provide that in the scope over here if you wanted to grab all the users servers all their guilds that they are in then you can use the guild scope okay so I’ll just do identify and I’ll do guilds for now so we’re done with our configuration for the strategy options this verif function is responsible for performing validation on the user that’s trying to to authenticate now since we are using oo 2 and there’s no need to worry about a password because they’re using a third party platform they’re not going to be logging in with a password what you would need to do is actually check to see if the user exists in the database and if they don’t you can save that record to the database okay so the reason why you would want to save a third party uh user account to your database is sometimes you might have certain types of data that you want to relate to that user so sometimes you might have uh like a one: one or one to many relationship that you need to associate with the user on your platform so it’s definitely a good idea to save that user to a database so that way the next time they log in they can see all of their relations with other types of data for example the user can see all of your posts all of their messages all of their um current activity things like that okay so it’s always a good idea to save the user now this verif function takes in four arguments the first two arguments are both tokens so access token and refresh token the third argument is the profile so the profile itself is going to be pretty much the user object and it’s going to also have the email if you have the email scope enabled and it’s also going to have all the guilds the servers that the user in so that’s what the profile is and like I said if you’re using Google or Twitter then the profile would contain Google details of the user same thing with Twitter and that would contain stuff like the username email address ID stuff like that and the last argument is the done function which we’re going to go ahead and call when we’re done performing the logic that we need so that way passport can then move on and then take care of the seriation part serialization part which I will explain how that works so the access token and the refresh token these are just uh tokens that you’re going to be using primarily for making uh requests to the API on behalf of the user so the access token is what you would actually use to make API calls so for example for Discord in order for you to actually even call these endpoints such as uh users at me uh users me guilds you need a an an authentication token so that’s kind of like some type of think of it like an API key but it’s not an API key it’s an access token and you use that access token to be able to access the data that you want to retrieve on behalf of the authenticated user so for example if let’s say you want wanted to fetch I don’t know all of the guilds then you would need that access token in our case passport actually takes care of that for us the passport Discord strategy so we would need to manually do it ourselves but if there comes up time where you do need to do it you need that access token the refresh token is just used for literally refreshing the access token so your access token is actually short-lived usually it lasts for about I think I don’t remember the exact time but it is a lot shorter than the refresh token and the refresh token is usually a lot it lasts a lot longer I think usually about 6 months it really depends but what you would do is you would store these tokens in your database somewhere and then you would pretty much use the access token to make requests on behalf of the user and then when it’s time to get a new token you would use the refresh token to kind of like refresh the access token so that way you would not need to require the user to re log in you just use the refresh token to get a new access token and then that new access token can be used to retrieve data from the API on behalf of the user so hopefully that makes sense we’re not going to be using these two tokens though but I just wanted to mention it just so that if you’re using a whatever third party provider you are and then you need to actually make API calls then you know what value you need to be using which is primarily the access token I’m just going to go ahead right now and console log the profile object because I want you to see what this looks like after we actually get redirected to Discord and click authorize but let’s go ahead and actually export our passport. use call like this export default and I’m going to go ahead into my index. MJS file and I’m going to go ahead and import that strategy like this so import strategies Discord strategy. MJS okay so that will load up the strategy into our entire application and now we need to set up an endpoint that the user is going to be visiting in order for them to get redirected to the Discord platform so they can authorize themselves with our application using Discord so ignore all of this stuff right now don’t worry about any of this we’re just going to go down over here and I’m going to set up a simple app.get request and then we’re going to name this NPO API SL o Discord and then we need to pass in that passport. authenticate call and then we need to specify the strategy name which in this case we’re using Discord so I’m going to pass in Discord like that okay now let me show you what’s going to happen once I go to this endpoint so let me go to my browser move this over here okay so let me go to SL API Discord notice how now when I visit that URL it redirects us to the Discord platform and we can see right over here it tells us okay this is the external application wants to access your Discord account and this is what the application wants to access and again all this is based on the scope so if I go into my strategy you can see that I currently have identify in Guilds and it says okay identify relates to the username Avatar and banner and guilds is know what servers you’re in if I were to add email and let’s kind of like go back and go back here I guess I have to revisit the actual endpoint notice how now it says access your email address okay so hopefully that makes sense for now I’ll just do identify which will just give me the basics but like I said if you wanted to get the guilds or email address just add those in the scope and then you’ll be good so let me go back and let’s go ahead and make a call to the endpoint and now it only asks for the username Avatar and banner and then we’ll click on authorize and now we get this cannot gets and notice how the endpoint is our redirect URL so we don’t have this endpoint set up yet so we need to set that up so I’m going to go back to the index. MJS file and I’ll set it up right here so it’ll also be a get request as well so it’ll be SL API othis Discord redirect SL redirect and then you’re going to call passport. authenticate and and pass in Discord strategy like this and then you can pass in the request Handler at the end so after passport is finished logging the user in it’s going to go ahead and call this next middle function which is the request Handler and then we can just send back a response of a status code of 200 okay now I actually forgot to show you the console real quick so that way you can see what happened when we try to authenticate so let me just reauth Kate again and show you what happens okay so let’s go to the endpoint click authorize and now watch this okay so now you can see that when I make a request so what happened is this okay I made an API request to SL API Discord we invoked the passport to authenticate function the first time when that happens it redirects us to the Discord platform okay when you click on the authorized button on the Discord platform what happens is it actually redirects you back to this redirect URL that we set up just now and you’ll notice how uh I don’t know if you can see this now but before when it tried to redirect us there was actually this query parameter up there let me comment this out and show you again okay so you see right over here how we have this query parameter called code okay and then it has this code over here so we actually use that code to exchange it with the Discord API to get the access token and the refresh token okay that’s what the code is used for in order to actually grab the access token refresh token we must implement this redirect URL so the flow works like this it goes to the first endpoint soapi Discord and then we use password to authenticate pass in that Discord strategy name that’ll redirect us to the third party platform once we click click on authorized it’s going to redirect us back to the Callback URL which which is this redirect or over here when you do this when you call passport. authenticate the second time so it’s calling this passport. authenticate middleware the second time it’s going to take that code query parameter and it’s going to exchange it for an access token and a refresh token and then what happens in the end is it goes ahead and calls verify function after it calls this passport. authenticate function the second time now the reason why I didn’t return a response back was simply because we need to continue implementing the rest of this verify function so here’s what we’re going to do I’m going to go ahead and create a Discord user schema for our mongodb database and we’re going to go ahead and save the user to our database so I’ll create a new file inside the schemas folder and I’ll call this file Discord user. MJS and I’m pretty much just going to do the same thing that I’m doing here I’ll just copy this and paste it here here and I’m just going to rename this to Discord user schema and we’re going to have of course we’re going to have a username we don’t need display name we don’t need password uh I’ll also just store the Discord ID I guess so that’ll be a string and then we want it to be required and also unique and then what I’ll do is I’ll take this Discord user schema I’ll pass into this mango. model call as a second argument and I’ll change this from user to Discord user and same thing for this model name right here so this is my Discord user schema and this is my Discord user model and now I’m going to go ahead and inside the verifi function in our Discord strategy this is where I am going to search for the user in the database so we want to search by a unique value that will never change the Discord ID will never change at all so we can use the Discord ID to search for the user safely because of course if you search by the username that could potentially change so not a good idea but better to search with the those ID so let’s go ahead and create a variable let’s call this find user and then we need to use async and A8 so I’m going to add async in front of this callback function inside this or in front of this verify function and inside the verify function I’m going to use the awake keyword and then I’m going to import the Discord user model let me do that real quick I’m going to import that from mongus schemas Discord user like that MJS so we’re going to go ahead and do await Discord user find find one and then for the filter I’m just going to pass in the field that I want to search by so I want to search by the Discord ID like that and then I need to pass in the actual Discord ID as a value so to grab the Discord ID from the profile object you just reference profile. ID like this that’ll give you the Discord ID or if you’re using a different platform like Twitter or Google it’ll give you their respective IDs okay so what we’ll do is if the user is not found we’ll create it so if no find user we’ll create the user and save it to the database so this is a two-step process we first need to create an instance of the new user so cons new user and all we need to do is use the new keyword to create an instance of Discord user like this and you just want to pass in an object that contains the fields that you want to set for this new user that’s going to be saved to database so we only have two fields to worry about that’s username and the Discord ID so I’ll do this username profile. username Discord ID profile so this is the first step with creating the actual user instance and then we have to save it to the database so I’m going to go ahead and call this variable new saved user equals await and then new user so reference that instance and call the save method and the save method is asynchronous it returns to promise so we need to await it and once we are done with this we’re going to go ahead and call the done function and pass a null for the error and then pass in the new saved user so once you call this done function it’s then going to need to call the serialize user function for passport which I’ll show you how to do that as well so don’t worry so I definitely want to add some error handling inside this logic because our fine one method could throw an error and so can this do save method and we want to make sure we’re also handling these method calls and their errors separate because if I just wrap everything inside a TR catch block like this and then I catch the arrow down here it would kind of be like difficult to figure out which method CES the problem is it to find one or to save so here’s what I recommend is first we can declare a variable called Fine user like this and then let me just remove this const find user declaration let me copy this whole line over here where we’re calling a wait Discord user. find1 and I’ll try catch and wrap this method called the find one method called inside the try and then I’m going to sign the return value to find user and if this F web method called errors out for whatever reason then we’ll catch that error down inside this catch block and so here what I’ll do is I’ll return done passing the error and then null for the user however if there is no error then it’ll just go down to here and then I’ll have another try catch so try catch and then right down over here we are still checking to see if user find user is under so if it’s not undefined then we will go ahead and create an instance of the user and then we’re going to go ahead and call this save method which could throw an error and we want to make sure we’re handling it so that error will be caught inside this will be caught by this catch block right here and then now we have handled errors for both possible methods that could throw an error okay so I wanted to just mention that real quick because it’s not good to just write code that doesn’t have any error handling so let me go ahead and return done if there is an error we’ll pass error and then null for the user okay and if everything is successful then we will just call done right over here so we’re not done yet we s it to handle the case where fine user is defined so that means the user already exists in the database so that means they’ve already logged in at least once first let me just add this return keyword in front of this done function call and then right outside over here if the user if F user is in fact defined then we’ll just return done and then pass a n for the error and then pass in that find user object as a second argument so let’s go ahead and try to hit the API so let me just go into my database right now you can see I have this Discord users collection there’s no data in here currently when I go to this Discord endpoint it’s going to go ahead and prompt me to click authorize don’t worry about this error the reason why this error is out right now is because we don’t have the serialized user and deserialized user methods implemented yet but what I want to do is I want to show you in the database if I refresh you can see that my Discord user was created right over here in the database and you can see I have the username and the Discord ID right over here all right so now let’s go ahead and fix this fail to serialize user intercession issue so as I mentioned earlier already uh we went over a lot of these basic stuff such as serialized user and deserialized user with the local strategy I highly recommend you rewatch that section or watch it if you missed that part but what I’ll do is I’ll copy all this stuff from the local strategy file and don’t worry I’ll explain what I’m doing and I’ll explain everything that’s going on so I’m going to copy all of this and I’m going to paste this inside my Discord strategy file so let me explain one by one what’s going on and you know what let me remove this Des serialized user and let’s just focus on serialized user first so inside this verify function whenever we call the done function and assume that there’s no errors so we pass in null for the error and then we pass in this user object okay so what really happen happens when we call this done function is we’re passing in this user object and we’re telling passport that we want to serialize this user object into the session data okay remember passport works well with Express session so this user object right over here is going to be passed into this callback function as an argument right here so whenever we first log in and once that done function is called in the verif function it will call this callback function that is passed to serialize user so whatever you pass in right over here as the second argument to the done function while error is set to null will be passed over to this user argument over here okay so watch this I’m going to leave the console logs alone and I’m going to reauthenticate and you’re going to see what’s going to happen Okay so let’s go ahead and click authorize okay now you see how the error goes away the fail to serialize user inter session error goes away that’s because we were able to successfully serialize user into to the session object because we implemented this function right over here and all you really need to do is just call the done function that is the second argument to this call back when you call the done function you pass in null as the error and then you pass in some unique ID that can be used to identify the user so you can use either an ID or if you want to use the username though even though that is unique it can be changed so you would have to just be responsible for updating the session data cuz the session data could go stale but what we’re doing is we are saying okay I want want to serialize this ID of the user into the session object now remember when we went over sessions I explained how all that stuff works so I’ll show you right now what will happen if right over uh let’s see right over here inside the redirect endpoint I’m going to go inside this request handle and I will log console.log request. session and then you’ll also see that we now have this request. user object so let me go ahead and show you what happens okay so let’s reauthenticate uh whoops okay this is this is the reason why we’re having this errors because we are already logged in and it’s trying to deserialize user because we already have a cookie so what I can do is very quickly I’ll go ahead and just clear the cookie and Let me refresh click authorize now I want to show you the logs you see how now the session object so this session object is being logged right over here inside the request Handler for our redirect endpoint so when Discord redirects us to the endpoint it’s going to go ahead and eventually call this request Handler function and you can see now the session object has that passport property which is an object and notice how we have this user property inside this password object and that is the users’s ID okay and then we also have the request. user object being logged and then you can see that this is the actual user object ID okay that’s the object ID of the user document we have the username and then we have the Discord ID this is the user object itself so that’s the responsibility of the serialize user function it pretty much allows us to say okay how do we want to serialize our user data into the session if I pass in something else let’s just say if I pass the in just the entire user object then what you’ll see is this user property will map to the entire user object okay so let me just go ahead and clear my cookies once again because it’ll throw an error because we are passing a valid cookie but when we do that we actually need the Der serialize user function and I’ll explain a little bit a little bit about that in just a second but let me try to reauthenticate now and now if you look at the logs you’ll see how that user object is is now in the session data like I said all this stuff I’ve went over in early parts of the tutorial when we over passport and session so if you need a recap with a full in-depth coverage of everything of how it works I definitely recommend you to revisit that section okay and it’ll clear up a lot of confusion but let’s go ahead and change this back to passing the user ID and this is the uh the actual document object ID not the Discord ID okay so now let’s go ahead and implement the Der serialized user method so we’re going to go ahead and call passport. deserialize user pass in a callback function as well now this function is important because when we first log in we call serialized user because we’re basically taking the user object we are storing it in the session store and then we’re setting a cookie and sending it to the browser when the browser has that cookie stored it’s then going to send the cookie upon subsequent requests now that cookie is sent to the server and our middle Wares such as Express session passport will take care of everything for us so what it does underne the hood is it’ll grab that session ID from the cookie and it’ll look inside the session store for that session ID and the data that it maps to okay so I actually already have the session store implemented so if I go into sessions you can see that we have a bunch of session data right over here so what happens is it goes inside the session store looks for the session ID so for example these are session IDs and then it references this session property right over here and currently this is a string but what it does is it parses this into a Json object and then it attaches it to the request. session property okay hence why when I showed you when I logged request. session you saw how we had that cookie property and then you also saw that we had that password property and we had the user property all that kind of stuff what these serial user takes care of is it pretty much takes that serialized data so in our case it’s just the session data that’s all uh pars into a string and then it kind of like un undoes it it converts it back from a string to ajason object and restores it by attaching it to the request object so we can access it very easily so we know who the user is and we can get the user session data okay so the first argument for deserialized user is going to be the ID which is really whatever it is that you passed in right over here so if it’s user ID right over here then this argument is going to be that user ID if you passed in user. username like this then this argument is going to be the username if you passed in the user object itself then this argument would be the user itself okay let’s keep it as user ID and the second argument for this callback function is done similar to serialized users call function now inside the serialized user we actually need to to search for the user by the ID so the first thing that we’re going to do is I’m going to use a TR catch always handle your errors and what I’ll do is I’ll search for the user so const find user equals and since we’re searching for the Discord user I’m going to import the Discord user model I think I already had that up top over yep I had it up top over here so Discord user. find one and we’re going to actually search not by the Discord ID but by the object ID so the object ID the object ID are the this is this ID right over here not the Discord ID it’s the autogenerated ID that mongodb generates for each document in the collection so I can actually just use this find one or is finded by ID method and pass in that object ID so this will search for that user by the ID and I need to make sure I await this call because it is a synchronous so let me add the Asing keyword in front of our call call function okay so now if the user is found so I’m I’m going to use a turn operator so if the user is found I’m going to call done pass null for the error and pass find user however if the user is whoops sorry about this find user Mark okay so if find user is defined it’s going to go ahead and call done and then if find user is undefined we’ll call done but pass in uh null for the error and null for the user okay so there’s no error but there’s also no user so now inside the catch we will just simply call done passing the error and null for the user okay so now you’ll see that the Der serialized user function error will go away now to test everything out we’re going to go ahead and make that request to the o/ Discord endpoint which will eventually redirect us back to this endpoint over here and then what I’ll do is I’ll I’ll visit this API off/ status endpoint that I had implemented already from previous parts of the tutorial but it still works just fine because the responsibility of this endpoint is just return the user object that’s on the request object itself and we already configured passport to do that for us okay specifically for the Discord user so let’s go ahead and go back to the browser let’s go ahead and try to let me clear my cookies first because we’re still technically logged in so I want to do a completely new login so let’s do that okay so I’m going to click authorize so I’ve have successfully logged in and now notice how if I go to the console you can see that all of my session data is right over here and then if I go to API status you see how now it returns to me the Discord user that I am logged in as if I were logging in as a different Discord user it would go through that verifi fun function logic and then it would end up ser realizing that other user into the session and then when we visit this endpoint we can see our record that’s saved in the database so I hope all this makes sense all right everyone so in this part of our expressjs tutorial I’m going to show you how to set up just and use just to write unit tests and run them for your express application so just is a testing framework for JavaScript it’s very popular it’s made by Facebook or now known as meta and it’s been around for a very long time and you can use just to write tests and run them for really any JavaScript application many people use it to test no JS server side apps you can use it also to test react apps or angular apps it’s very versatile so let’s go ahead and get started so inside my project one thing that I do want to mention is that remember that we are using ES modules so if you recall inside our package.json file you can see that I have the type set to module and all of my my file extensions are ending with MJS now there’s nothing wrong with using ES modules and it is the way to go in the future with developing surver side with no. JS however as of right now just they currently do support es modules however it requires experimental Flags so you need to enable an environment variable and while that might work out of the box there are some things that don’t necessarily work and after doing some research on stack Overflow and some of the GitHub issues I’ve came to the conclusion that some of the things that I was trying to get to work just wasn’t simply working to say the least so the options that we have are we can either revert our entire project to Common JS so what that means is we remove this type let’s everything back to commonjs because that’s what the default system is and then we would have to remove all of our import statements and replace them with require statements so instead of import Express from Express we would have to do const Express equals require Express like this and then we would have to change all of our export stat stat as well so instead of export cons mock users I would have to do module. export and then pass and mock users like this and obviously that’s not something that is possible for many projects because you might have already written so much code and you can’t just go through every single file and change all those lines just doesn’t really make sense so I figured out a solution where we can actually configure Babble which is a transpiler and we can use Babel to actually take all of our MJS files and kind of like transform them from es modules into commonjs so that we just can actually execute them correctly so we’re going to leave our type set to module we’re going to leave all of our code the way it is we’re not going to change anything at all we’re not going to modify the import statements nothing and I’m going to show you how this is going to work now if you’re someone that is just trying to learn how to write unit tests and you might already have Babble or typescript set up then just actually has documentation on how to configure just with the right environment if you go to the their docs they actually show you right over here if you’re using Babel webpack typescript all this stuff so for example if you’re using typescript you can use tsj right over here even mentions over here and it’s basically just a pre-processor so you can actually use just to test your project right in the typescript so to get started we need to install a couple of dependencies so I’m going to type npmi hyphen capital D CU I’m going to install these as Dev dependencies so the packages are at Babel slore Babel code at Babel slpre EnV so that’s it for Babel we then need to install just as well and then let’s go ahead and hit enter so while this is happening I’m going to go ahead and go into my project folder and I’m going to go ahead and just set up the Babel RC configuration file so you’re going to go ahead and create a new file I’m going to call it Babble RC like this and then I’m going to go ahead and pass an object like that and then we need this presets field and this is going to be an array and inside this array we’re actually going to pass an array and then inside this inner array we’re going to pass a string and we’re going to type at Babel SL preset hyphen EnV and then we’re going to pass a second argument or second element inside this inner array so we have this object right over here and this object is going to have this targets proper property which is going to map to an object and in that object we’re going to have node set to current okay so we’re just configuring the preset EnV for Babel okay so that’s pretty much it for the Babel stuff now let’s go ahead and close that so our packages have finish installing and let’s go ahead and type npm init just at latest so we want to configure just and what this will do is set up a just config file for us so I’m going to hit enter and then it’s going to ask ask us some questions so it’s going to say would you like to use just when running test so this will just create a test script for us so I’m going to hit yes would you like to use typescript if you’re using typescript then press yes but I’m going to press no uh choose the test environment so we are testing a server sided noj application so we’re going to hit enter for node but if you’re testing like a frontend application for react and You’ want to hit jsom do you want just add coverage reports we’ll hit no for that we’ll just select it as V8 and then for this one you want to hit yes automatically clear mock calls instances context and result before every test this will ensure that whenever you run your next test there won’t be any leftover uh mock calls or mock data from the previous test and it’s actually very important so you can see that it modifi the package Json file and then we create this just. config.js file okay so we’re not done yet because there’s one more thing that we need to do inside our just .c config.js file so right over here we need to go to this transform property currently it is commented out but we want to uncomment this part and we want to set this to be an object and now what this transform property will take care of is it will look for those source files that match a regular expression and transform the source code into something that Jess can actually run which is pretty much plain JavaScript so what I’m going to do inside this object is I’m going to use this regular expression right over here I’m going to copy it and you all can just copy this as well so this will just look for our MJS files inside our directory and what I’m going to do is map this value to babble justest so this is going to be the tool that it’s going to use to deal with a transformation and now we actually didn’t install Babel justest but when you install just it actually does install Babble justest for you as of right now if you look at your node modules you can see that there should be this dable just package right over here so that’s how we can verify that that package was installed for us okay so we’re done with this part and let’s just also go into uh right [Music] over let me go over here uh module file extensions so we’ll just uncomment that and we’ll just you can remove the ones that you don’t need so I’m not going to be using TSX or jsx or TS uh so I’m just going to move all that and I’m just going to close this out so we should be done with our setup uh we do need to actually go into our package Json file and for some reason uh when we ran the just configuration it did not override this test script so let’s go ahead and do that real quick whoops let’s go ahead and do that so all we have to do is just have this test script and then have execute this just binary so this will look inside your node modules inside this bin folder and it will look for this just binary right over here and it’ll just run that command and that’s what will actually run your test for you when you are ready so let’s go ahead and write a very very simple test and kind of like explore the just API so what we’re going to do inside our source folder we’re going to create a new folder and I’m going to name it uncore testscore and this is industry standard and this is where you’re going to place all of your tests so you need to create a file and then you want to name the file of your test ideally something that resembles the actual file name so for example if I were testing let’s say something inside my users. MJS file inside the routes folder then I would want to name the test file something like users Dot and then the extension here is where you want to name it either dopc or test and then end it with JS like this so if you were using typescript it would be dope. TS or test.ts since we’re just using JavaScript I’m going to name it dope. JS or. test.js doesn’t matter which extension either test or spec that you want to use I personally like to use spec so I’m just going to go ahead and do that and now it’s going to go ahead and create this file for me okay let’s just explore the just API very quickly and then I’ll get to actually testing some of our express route handlers so we have this described function and now you’ll notice that right now it isn’t going to be imported from anywhere by default just actually so the very first function that you’re going to be using that comes from the just API is this describe function right over here now one thing that I do want to mention is that you could actually import this describe function from @jg globals like this and then you can just use it accordingly like this the thing is though just typically is configured globally but you can see right now for some reason it is not configured globally so I’ll show you very quickly how we can actually configure just to have this describe function and other functions like it test before all for each which are hooks these two are hook functions I’m going to show you how to configure this so that it it’s actually Global so we don’t have to manually import it in our files so what you need to do is you need to First create a new file inside your root directory called JSC config.js and then you’re going to set this object and have this type acquisition property which is an object and then you’re going to add this include property which is an array and then you’re going to want to add just okay now we don’t actually have any any types installed I believe let me just double check yep we don’t have types for just installed is what I meant to say so we need to actually we need to actually install those types in order for us to get it to work so what I’ll do and you can kind of see that now it actually recognizes uh just. describe globally but just to be safe make sure you install the at types slj package like that okay even though we’re not using typescript you can still use this package to have types set up globally like this okay so now you can see that the whoops right over here we have the just types over here and it should recognize them globally without any issues so going back to our users. spc. JS file I’m going to call this just describe function like this and again no no need to import it and this describe function is used used to create test Suites and basically all that means is it allows you to group together your tests into collections so you can better organize and understand what’s going on so typically you want to give your test Suite a generic name that represents what you’re trying to actually test for so for example if I want to let’s see if I wanted to test for a basic I’m trying to look for something that we can actually test uh let’s try let’s do this endpoint so let’s say for example if I wanted to test this endpoint where I wanted to get a user by ID then I would just first name the test Suite something like uh get users and then pass in this callback function so inside this callback function is where you will actually create your test closures and those are basically just going to be what’s actually going to run your test and you’re going to implement the test logic in there so to create a test closure you can use either the it function or the test function they both work the exact same way so I’m just going to use it and then you want to give the test name so I’ll just say something like should get user by ID and then you want to pass in a callback function and inside the Callback function of your test closure so the second argument for this it function this is where you’re actually going to to invoke the function that you want to test and then you want to actually write assertions and verify that certain things occurred okay so here’s the next part though we need to actually write a test for some of our functions so for example let’s say I wanted to test this router. getet API users ID endpoint so this is getting a user by ID and this is actually one common confusion that many developers begin to have when it comes to running tests they look at this and they’re like well how do I actually test this whole endpoint because there’s so many things that are going on do I need to actually make an HTTP post request or get request to the actual endpoint that I’m trying to test so first of all when it comes to unit testing you want to actually test only a single piece of your code look for individual functions that might be calling other functions maybe they are calling a database maybe they are calling an external API whatever it is you want to test that single function and you want to make sure that the function does what it’s supposed to do so ideally you want to verify that the function is hitting the right IFL statements the conditions correctly and then based on those conditions that are being executed you want to make sure that it is returning the correct response so to give you a very simple example let’s take a look at uh this function right of here okay so you can see that this function is our request Handler and it first takes this F user index property from from request and this comes from our resolve index by user ID middleware so don’t worry so much about that right now but we grab this property from the request object and then we try to reference mock us array and Index this user so we can grab the user with its index so if the user is not found in this mock users array it’s going to go ahead and return a response and send a status of 404 if the user is in fact found then it’s going to go ahead and call response. send find user so what you need to understand is this function is pretty simple it doesn’t really do too much stuff but the point is is that we want to make sure that we understand what are the possible outcomes of our function in this situation there are two possible outcomes only only two either the user is not found and we return a status of 404 or the user is found and then we just send back the user that was found there’s only two outcomes sometimes your functions might have many different outcomes it might output many different types of results based on the condition and there are some general principles when it comes to writing your code in a way that makes it easily testable because writing tests also depends on the code quality as well if you have a bunch of spaghetti code you’re making it really difficult to actually write tests okay the purpose is not to actually write the most complex code but to separate concerns and make sure that you have each function doing the main responsibility and anything else you turn it into a dependency function is what we like to call it and that basically just means that you’re invoking another function and letting that function take care of the work and then once that function is done it’ll return back the result and then you can proceed so we’ll start off with a very easy example we’ll use this call function over here but now here’s the other problem though okay when we actually want to write tests we want to be able to import the function or class or whatever it is that we’re try trying to test into our test file so how do we import this Anonymous function there’s no way so what we need to do is we need to copy this function and we need to move it into uh we we need to turn it into a named function so what I’ll do is I’m going I’m going to actually create a new folder called handlers and then I’m going to create a new file and I’m going to call this users. MJS and then what I’m going to do is I’m going to paste this function right here and then right before the parenthesis I’m going to do export con and since this request handler was trying to get the user by ID I’m going to go ahead and call the function get user by ID Handler and let’s make sure that we are importing the correct value so we need mock users so I’m going to import that up here and and I think that’s all we need so let’s go ahead and copy this function and we want to make sure that we pass it as an argument to our router. getet method call so at the end like this and then we’re going to make sure we import that up top over there as well and then now we have our function being passed as an argument it’s still going to work the same exact way the only difference now is that we can actually import it wherever we want so I’m going to go into my users. spc. Js and what I’m going to do is first I’m going to import that function so get user by ID Handler and so this is going to be our system under test or function under test and now we want to actually call this function okay but we need to also remember that this function does take in two arguments it takes in a request and a response so this is where you start to learn how to actually create fake data or mocks so that way you can use them for your test subjects in this case are get user by ID handle function so when it comes to creating mocks there are ways to be smart with it so what we’ll do is we’ll create two simple objects let’s call this mock request and then mock response and remember this the request that response object resembles the actual request type in expressjs okay so if you were to actually look at let me go over to here because we’re using JavaScript okay so if I were to actually rightclick the type definition of this request you can see that we have this interface and you can see that there are a lot of properties on the request object itself okay you can see that we have uh host cookies method prams these were similar methods or properties that we looked at earlier signed cookies as well now you’re probably wondering well when I create my mock object like my mock my mock request do I need to also include all of those fields and the answer to that question is actually no so what you can do is you can only Define the fields that you need okay and again this works because we’re using JavaScript if you’re using typescript then you can use uh casting for example you can type annotate the request and force it to be an actual request type even though it is missing all of its Fields but since we’re using JavaScript we can do literally whatever we want so for our mock request we want to include the necessary properties that our code is actually referencing on the request object so this is where you need to actually look at your code look look at the function that’s being tested and you need to see okay what is actually being referenced on the request object so I can see right over here one property is being destructured from the request object so we need to make sure that this whatever this fine user index is we know that it’s a number but whatever it is we need to make sure we Define that in the mock request object um and it seems like that’s the only property that we are referencing so I know that this is a number because in case of you didn’t watch the early parts of the tutorial this resolve index by user ID middleware function what it does is it will go ahead and grab the ID from the route parameter and it’ll take care of parsing it to an actual integer and then it’ll attach it to the request object so what I’ll do is inside my mock request I’m going to go ahead and Define find or what was it called again uh find user index yep find user index and then you can give it literally any number you want you can give it 1 2 3 100 literally anything you want but here’s the thing though we want to give it an actual meaningful value that is going to correlate with our code so if you look at the rest of your code you can see that fine user index is being used to retrieve an element from this mock users array and this is our mock users array right over here here and if I were so for example if I were to just give like just some bizarre number like 100 it’s pretty obvious that that number would not actually give us back anything inside mock users because there is no element at subscript 100 that would give us back a user okay so let’s just do something simple for now let’s just do one so that way I know that it’ll give me back the user Jack okay all right so we’re done with the mock request object now let’s go into the mock response so this is going to be our response object and now we have again we have to do the same thing we have to look at our code and look at what response uh is and we have to also see what is being referenced on response so right over here I can see that response is being referenced right over here and the send status this is a method on the response object is being called okay so I know that send status is method so that means that inside the mock response object we should set this send status property and have it mapped to a function so you might think that it would look something like this right well no so it is going to be a function but it’s not going to be a regular function it’s going to be a mock function so what we can do in just is we can use this just namespace and I can reference just. FN like this and what this will do is it’ll create a mock function for me so this is where we actually want to call a mocked function of send status on the response object and not the actual send status method itself okay so we use just. FN to apply this mock function to S status and then we’ll do the same thing for the send method as well so let’s do send and then this will be just. FN okay all right so now what we want to do is we want to actually take both of our objects mock request and mock response and pass them as arguments to get user by ID Handler so let’s do that so mock request and mock response okay so now if I run my test right now the test actually should just pass because we’re not actually testing for anything so in our terminal we’ll run npm run test and this will execute that just binary and you can see that our test runs and it passes and just very quickly I want to show you what would happen if I were to go over here and just kind of like remove this part entirely and you’ll see that it’s going to go ahead and complain about all the stuff so that’s the reason why we needed this transform part okay and again we can also run our application completely separate from our tests like this and it still would work just fine okay so hopefully the setup with Babel and everything else wasn’t too complex and we can still proceed to use es modules and write tests okay you can see it’s currently running without any issues well awesome so let’s go ahead and go back to our test and let’s actually write our first assertion so again let’s look at our code again okay and what we can see is there’s two outputs there or two things that could happen either we send a status of 404 or we send the user back so this is where we need to understand okay well what should happen inside this test is whatever it is that we wanted to happen Okay so we have to figure out what it is that we’re trying to test for so in my situation let’s say I want to test to ensure that a user was actually sent back okay and and so we already set up our mock request to have F user index to be a value of one so when the function is called it’s going to use one as the index and search for that mock users so let’s actually write our first assertion so again we need to understand what it is that we’re trying to test in my situation right now I want to test to make sure that the user was actually found and sent back with the response if I look at the code okay how can I verify that the user was sent back well what I can do is I can write an assertion that verifies that this response. send method was called and it was passed it passed this find user object as an argument and I can also write another assertion to verify that send status was not called because send status would only be called if fine user is undefined and since we are setting fine user index to be one it’s going to use that as the index to reference the user at that position and mock users is just this constant array that we have over here so we can just reuse this data because it’s not like it’s coming from a database or some external API so we can use this as mock data so let’s go back into our test and here’s what we’ll do we’re going to use this expect function like this and we use the expect function to actually test a value so for example I want to test that mock response. send like this I want to test this specific function and then at the end of expect at the end of the uh parenthesis we can use these just matchers and the one that I want to use is to have been called so what this means is we are expecting mock response. send we’re expecting this function to have been called okay so that asserts that the function was called when we called this get user by ID Handler so let’s actually test this out and see what happens so let’s run npm run test okay and you see that it passes okay so again this it takes some time to really you know get used to some of these matchers and knowing how to use uh expect but as long as you just keep practicing it’s going to come in it’s going to come in handy and you’re going to develop an intuition behind it so you can see that we definitely wrote an assertion on this send function and we asserted that this function was called and you’ll notice that right now if I were to try to negate this matcher so if I actually use doot do to have been called that basically just asserts the opposite so it’s going to assert that mock response.end was not called so if I run the test it should fail because the function itself was actually called okay hopefully that makes sense and then it’s sometimes good to do that because it it helps you assure that you’re not having your test pass falsely if that makes sense so you don’t have any false positives cuz sometimes your tests may pass when they actually shouldn’t so let’s actually be more specific with our test so what I’ll do is I’ll duplicate this line and I’m going to use the matcher to have whoops to have been called with and this is what what I want to use whenever I want to verify that a function was called with specific parameters so the send function is called with only one argument and this argument is a user itself now again since we are using a mock array I can very easily just reference the array at the subscript of whatever fine user index is which is one so I can just go ahead and import this mock users right over here so let’s import that and that gets import up top here and then I’m just going to access it like this okay or if you wanted to you just literally copy this whole thing and paste it in like this either one will work the same way cuz they’re both going to be the same object and the contents are the same let’s go ahead and run our test now and you can see that it still passes and you’ll notice that if I tried to let’s say if I tried to pass in this direct object and let’s just say say if I tried to change some property values right of here let’s change it let’s change the username you’re going to see that the test actually fails because the value that was actually passed as an argument to the send function is not the same as what we were asserting it to be so you can see that the expected value we expected uh username of Jack without the K so jaac but then the actual received value was username of Jack so again this is good to make sure that your tests are actually passing correctly okay so let’s run the test again and it should just pass just like that all right so hopefully this makes sense and there’s also one more assertion that I want to show you so we can also check to see the amount of times this send function was called so I can do to have been called times and I can specify the expected amount so if I want to verify that this send function was called once then I can just pass one and it should only be called once especially in Express because if you try to call it twice that will actually throw an error so let’s run the test again and of course if I try to pass in like two it’ll throw an error or the test will fail you can see over here the actual received number of calls was one okay so hopefully that makes sense and one more thing as well that I forgot to mention is that with this two have been called with matcher you can actually pass in the number of arguments that the function is called with so we only have one over here but if you had a function that was called with like multiple arguments you can pass in the exact amount okay so let’s go ahead and move on let’s write another test to handle the second scenario of our function so the other scenario would be where fine user is not found and it sends back a status code of 404 so I’m going to write another test using the it function and I’m going to goe and say it should uh call send status with 44 when user not found okay you want to keep your test names short and simple and we’re going to go ahead and write our test so now here’s the thing though okay if I were to call get user by ID Handler again and then if I were to pass in the same mock objects it’s going to actually give us this same response that we have up over here but the problem is now we want to actually get it so that we can set up our code to ensure that the send status function is called instead of the send function okay if I were to just leave mock request alone you can see that it’s still using the same value for fine user index and in the code it’ll actually look for a user and return that user so it would never hit this part at all line six so we need to actually modify the mock request object so what we need to do is there there are a couple ways that you can do this if you prefer to not modify the object directly like this and set it to a value like this you can always just create like a copy of it so you can do something like const and then you can do mock request or let’s just do copy mock request equals and then you can do something like find user index is equal to 100 and then of course you can also destructure mock request because there might be some properties that you want to uh copy over to the copy of the mock request so you can do something like this and then passing copy mock request to here for mock response we don’t really have anything that we need to change because we still have the same functions so it doesn’t really matter so we can leave that alone okay so we’re going to call get user by ID Handler with a new request object but we’re going to set the find user index property to a value that I know that will not give us back a user in this case we’ll set it to 100 okay so when we call this function we now want to write some assertions so what I can do is I can write an assertion to verify that this send status function was called so let’s do expect mock response send status to have been called and then let’s run the test and you can see our second test passes without any issues let’s write a few more assertions so let’s do expect mock response send status to have been called with 404 let’s run the test again pass passes and I can just throw in a value that I know is actually not going to pass you can see that it fails so that’s good because it shouldn’t be sending a 400 it should be sending a 404 and I can also do to let’s do to have been called times let’s do one let’s TR the test again and let’s also write an assertion where we verify that mock response not send was not called so expect mock response send not to have been called let’s run the test wonderful so all of our assertions are good now one more thing that I do want to do though is if you go inside your just config file and if you look for Clear mock you want to make sure this is set true early ear when we were configuring just we had pressed yes when it asked us if we wanted to configure um our test to clear all mock calls instances and context and results before every test because what happens is if this is false the next test will actually carry over data from the previous test so if I actually try to run my test now you’re going to see now our second test actually fails and it’s actually failing because right over here on line 32 where I have this assertion expect mock response. send not to have been called you can see that it’s failing because it says receive number of calls one so it in fact was called but if you think about it your code itself says otherwise because I know for a fact that in my code response. send should not be called because we are returning response. send status so this code doesn’t get executed when F user is uh not defined Okay the reason why it’s failing this test right over here and it’s treating it as if sen was actually called is because in the previous test the sen function was called and it was called one time okay so since it was called one time and we didn’t clear the mock it carried over to the next test right over here inside this second test over here so there’s several ways they can do this the first thing that you can do is obviously what we already had was having clear MOX set to true instead of false the other thing that you can do is you can use this before each hook and this takes in a callback function and basically you can execute some logic that happens before each one of your tests so you can initialize a variable you can connect to a database whatever is that you want so you can actually use this just. clear all MOX function call and now if I run my test it passes okay so this is manually clearing all the mod before each test sometimes you might not want to clear all the mocks because you might want to depend on previous function calls from the previous test so you might want to turn off clear Mock and set it to false sometimes you just want to manually clear the mock so you can use this before each it’s up to you but I just wanted to mention that as well so I’m just going to remove this before each and I’m going to set clear MOX back to true so hopefully these two tests that we wrote makes sense now I have one more example where we can write a unit test for another one of our endpoints but this one’s this one’s going to be a little bit longer so I just wanted to warn you all but I’ll try my best to keep it as concise as possible and I want to do this one because there’s a lot of stuff going on inside this function and I think it would be really great for you all to learn how to test different scenarios okay so what I’m going to do is for my post endpoint for API users this request Handler creates the user and saves it to a database so you’re going to learn how to mock functions that come from modules you’re going to learn how to to mock uh classes es6 classes you’re going to learn how to mock the database call so that way we don’t actually hit the actual database because when it comes to unit tests you don’t want to actually invoke your database or call an external API so you’re going to learn how to do a lot of stuff with this next test so we need to make sure we get this function um out of this uh out of this format we don’t want it to be an anonymous function so I’m going to just copy that and I’m going to go inside uh let’s see not here but inside my handlers file or the users. MJS file inside handlers and I’m going to go ahead and paste this here and I’ll name this function create user Handler like this and uh before I import all of the necessary functions into this file let me just take this and let me just paste it here and import it up top over here okay and now let’s go ahead and go back to our users. MJS file inside the handlist folder and we need to make sure we import all of the necessary functions that we imported that were in the other files so validation result comes from Express validator that’s a validation library that can validate post requests um request bodies query parameters all that kind of stuff we need to also import match data that’s also a function from Express validator hash password is a function that we wrote Our elves let’s import that right over here uh user is the model so this is what actually allows us to interact with our database but we’re not actually going to call the database we’re going to mock out this as well um and I think that should be it okay so now let’s go ahead and go into our users. spc. JS file and then now I’m going to create a new test Suite so outside of this describe get users I’m going to go ahead and create another describe and I’m going to call this create users so you can think of these individual it functions these individual tests as your scenarios okay so inside the create users test Suite I’m going to go ahead and create a simple test and I’ll just say it should let’s see let’s go back into our function okay so this is a pretty big function it does a lot so I take this step by step so that way you all don’t get confused first let me just remove these console logs cuz we’re not going to need them whoops so we want to take this step by step because there are a lot of things that are going on so let’s hand let’s take a look at our code and understand what’s going on so when we call this create user Handler um when Express calls this function to handle the uh create user endpoint it’s going to go ahead and call validation result so when you’re looking at the code the important part is not to really worry about what your what these functions these external functions cuz we don’t know what these functions let’s just pretend we don’t know what it does you don’t have to care about what this function does you have to care about what it returns because we’re going to mock the function anyways we’re going to mock the implementation we’re going to mock the return value of the function so in the end it doesn’t really matter okay what I care about is what it returns so result you might not know what it is you might think it’s an object it’s a number it’s a string you might not know but you can very easily tell if you just look at the rest of the code and look at where result is being referenced so you can see right over here that result has this is empty method that’s being called on it and I immediately know that this is an object okay uh there’s also this array method on result as well so what I can do is I can go ahead and actually mock out validation result because this is known as a dependency it’s a function that that can perform some kind of side effect and we don’t want to actually have any side effects in our unit test we want to make sure that we mock them all out and we only want to test the function itself we only care about the possible paths our function that we’re trying to test and take so again you can see right over here this is our first if condition if result uh dot is empty if it is uh let’s say if this results to false and then we negate that value so if it is not empty then we’re going to return this response status of 400 and then send back whatever this value is again I know it’s an array cuz we wrote this out ourselves but we’re just pretending that we don’t know okay so this is the first thing that it could do the second thing that could happen is right down over here so you can see that we have this new user. saave being called and then it sends back a status of 2011 and it sends the user okay so this is the second scenario the third scenario is that an error could be thrown inside this Tri block so then the save method could have been could have thrown an error and then we catch it down over here and then we send back a status of 400 okay now there actually should be another scenario where the hashing password uh failed and we actually should have added this inside the try catch but we’re just going to leave it the way it is right now okay so hopefully all of this makes sense so now if I were to go back up top over here again the validation result is one dependency Okay so what we want to do right now is we want to test our function to handle this first scenario first because instead of just having to do everything all at once we’re going to take it step by step okay so what I’m going to do is I’m going to write a test that is going to mock out this validation result function call we’re going to have it return uh literally whatever object we want but that object specifically needs to have this is empty method as well as this result uh as well as this array method on the result object cuz they are both going to be call okay so we need to make sure that whatever is empty is going to return it returns false for this case because I can see that we negate the value of result. is empty so for example if there are no errors that’s what this isempty method means if there are no errors you can see right of here it returns true if there are no errors so if this is true the negation of this would uh not execute this line and it would just go down over here which means that there are no errors however is however if is empty is false then result that is empty would return false which means that we negate that which means it would return this part over here so for our first scenario we want is empty to return false just so that we can Target this line over here so what I’m going to do inside my users. spc. Js file is this so I actually already have some mock data defined up there um just to keep things simple I’m actually just going to Define it inside test Suite so const mock request and then const mock response and then it’ll be within the closure of this callback function so we don’t have to really worry about the ones defined up there so what I’ll do is for the test scenario I will say it should return a status of 400 when there are errors and we’ll pass on our callback function okay so now we need to go ahead and set up our mocks our our mock request and mock response to actually get this to work so again we have to look at our request object and we want to see Within These two lines where is our request object being referenced you can see that it’s being passed as an argument to validation result however it’s not going to really matter because we’re going to mock validation result so we actually aren’t really going to need to do anything with the mock request for this specific scenario okay so let’s look at response I can see that response is referencing this status method right over here so right over here we’re going to go ahead and do status just. FN and you know what I actually could just reuse mock response up top over here because we’re going to be using some of these similar methods anyways so you know what what I’ll do is I’m just going to remove this and I’ll just reuse the mock response up here and it shouldn’t matter because we are clearing all of the mocks uh anyways before every test so we won’t have any leftover data from the previous test okay so let’s go ahead and implement the status method and this is also going to be a mock function so we’ll use just. FN okay now one more thing that I do want to point out is that after we call the status method we actually are calling the send method as well because when you call this status method it actually Returns the instance of the response itself and you can actually call the stat status method on it as many times you want because it just Returns the response instance itself so in order for us to actually detect calls on the send function inside uh status over here inside just. FN for status we actually want to pass a callback function and we want to actually return mock response so basically returning itself so that way by returning itself mock response would then have access to all these other methods as well and if we don’t do this we wouldn’t be able to actually test to see if send was called after status and I’ll show you that when we actually write the test okay so we’re not done yet we’re done with setting up our mock request and our mock response we need to now mock this validation result function and you’re probably wondering well how do I do that this is a function that comes from a thirdparty module Express validator well I’ll show you so you can mock modules and what that basically means is you can override the implementation and the functionality that that module that module’s API provides so for example inside the express validator module we have a bunch of functions we have a bunch of different things that we can import that we can use in our application however we want now for our case we only are using validation result currently so we want to mock validation results specifically so all the way up top over here what I can do is I can reference jmck and then I want to specify the name of the module so I’m going to go ahead and say Express validator

    like this so This Will Mock that mpm module you can also mock your own modules that you create as well so for example uh later on when we need to mock uh the hash password function we’re also going to mock this helpers module as well okay and that’s our local module so as a second argument after we pass Express validator for the first one the second argument whoops the second argument is going to be a factory so this is where you’re going to return an object because if you think about it your modules are kind of like objects and those objects have um the named exports okay if it assuming it does so what we want to do is we want to return this object like this so notice how I have the parenthesis wrapped around the curly brace so that just allows me to do it shorthand instead of having to do something like this okay so what I’ll do is inside the object I want to mock the validation result function so I’m going to type validation result like that and I’m going to do just. FN like that so now I have successfully mocked the validation result function for the express validator module and now this mock function we want it to actually return something so that way we can actually uh have this result value be something that is defined with the correct is empty and array methods so we can do that inside our Justa FN function we can pass in a call back that also returns an object as well and I can go ahead and Define the is empty method so is empty is going to be a mock function as well but this mock function remember we’re going to have it return uh false okay so passing that call back return false like this and then we also want to implement this array method on the return value of validation result so this is a method and uh it does return an array so we will have it return an array like this and then what you can do is you can add some random object with random Fields so you can just say message invalid username just like an example you can literally put whatever you want like invalid field whatever it is okay because we can always actually modify uh we can always override the return value of validation result and I’ll show you how to do that as well okay so I think we’re good to go let’s actually go ahead and test everything out okay so what I’m going to do is I’m going to go ahead and call create user Handler so let’s go ahead and import that up top over here oh whoops I can just import that from right over here wonderful cuz we’re in it’s from it’s coming from the same file okay so let’s go ahead and call create user Handler let’s pass in the mock request and notice how we’re referencing this local mock request cuz this is the closure we’re inside this closure over here and then we’re going to reference the mock response which is all the way up there so we are reusing that same mock resp responds object from earlier okay and remember that this function is asynchronous so we should also await the call and we need to make sure we add the Asing keyword in front of this callback function for the it function okay all right so let’s just make sure everything is okay so if I run npm run test the test does pass but we aren’t writing any assertion so that’s okay and you’ll notice how now if I actually try to kind of like remove all this all the mocks that we just did you’ll start to notice that a lot of stuff uh starts to error out and you can see that um it’s actually trying to go to line seems like like line8 over here inside the helpers MJS so it’s actually without mocking anything it actually tries to call the actual uh Express validator uh Library so it’s actually calling the functions okay and then it’s going to try to execute everything the way it is but you can see over here it tries to throw this error right over here because we don’t have a value for password but we’ll get to that because right now our request body has uh nothing okay and we also aren’t mocking match data yet so don’t worry step by step just wanted to show you what would happen if we removed the mock stuff okay so let’s add that back in and you can see that everything will work the same way all right so now let’s actually write an assertion so the first thing that I want to do is this so when it comes to testing there are different ways that you can approach testing there is there’s implementation testing and that’s where you’re actually testing the actual implementation so you’re trying to verify that certain functions are called certain functions are called with certain parameters that’s known as implementation testing there’s also behavioral testing where you just give it some input you don’t care what it does as long as it gives you an output so there’s different ways on how you can test this with backend you can’t really go wrong with either either one usually on the front end like if you’re testing apps and react you would want to use behavioral driven testing because you want to test based on output and you don’t care about what actually happens underneath the hood with all of the state and all of the uh you know form fields and whatever is being called to the API stuff like that so I just wanted to point that out okay but since we’re just getting started I’m just going to show you very basic how to write assertions so what I want to do is I want to verify that validation result was called with the request object okay so the question is how do I actually write the assertion for validation result because in my whole test file I don’t have any access to validation result well I’ll show you so the first thing that we can do and I’ll import this over here on line one is I’m going to import the entire Express validated library but I’m going to import it as like a default import like this so import validator from Express validator like this and then now down over here in our test after I call the create user Handler function I can write an assertion and I can reference validator do validation result to have been called times one and let’s run our test and you can see that it passes and if I were to set this to zero to see if it actually fails and it should fail you can see that it was actually called once so that verifies that it was actually called and if I were to actually remove uh if I were to actually just kind of like remove this whole thing right over here you can see that our test begins to fail and it’s not recognizing validation result as a function if I remove this whole just. Mock and if I try to run the test again you’re going to see that other stuff starts to fail as well okay so hopefully this helps you understand the importance of mocking out your modules and hopefully this helps understand how to how to mock out uh these functions that come from the Express validator package or just any package in general okay let’s go ahead and continue so I’ll do validator dot validation results so I’m going to write an assertion to say that to have been called with mock request because if you look right over here we are passing whatever request object this is to validation result so we’ll write the assertion there it passes and let me just change this to two have been called instead of two I’ve been called times one okay that’s a lot more better because this basically implies it’s going to be called once or two have been called at least once okay so now uh we want to also write an assertion that response. status was called with a status code of 400 so let’s do that so expect response dot I think it was status and it’s mock response to have been called with a 400 mock response okay let’s run our test okay it passes good and let’s go ahead and write a search to verify that the do send method was was called so we can do expect mock response and this will be mock response. send not mock response. status. send because remember that when we call the send method we’re still calling it on the instance of the response method so we would have to reference mock response so to have been called with and then we want to verify that it was called with this array and that’s whatever we had mocked over here so I’m just going to take that copy and paste it down over here let’s run the test again and it passes and again I can go ahead and just change everything up and make sure that our test is passing correctly and you can see it throws an error when I pass in the invalid expected argument okay so that’s pretty good let’s go ahead and move on now because we’ve covered this whole part over here so now we have to cover the next few lines over here everything up until down over here so we are calling this match data function but we aren’t mocking it okay so it’s going to actually call the actual match data function which comes from Express validator so we want to mock it because what I want to do is I want to mock this function to return uh some object which is going to be the actual user data so again to give you context uh what this function does is it takes the request body and it gets you it gives you the validation result okay so if there are no errors then what happens over here with match data is match data will extract all of the valid fields in the request body and store inside this data object so all we really need to do is just mock match data to return a user a valid user object so let’s do this okay so going back up over here I’m going to do match data just. FN and we’re going to have it return an object and keep in mind that whatever the return value of matched data is is actually just going to be an object so there’s no methods on it that we would need to worry about because we’re not referencing anything except for just the password field so let’s just do uh let’s see username let’s do test password uh password and then I think the other field was uh I think it was display name if I remember correctly let me check if I go inside my validation schema so we have username display name and password yep so display name just do test name now some of you might be asking well what’s the point of doing all this mocking because doesn’t that kind of defeat the whole purpose of test testing well no not for unit testing because remember our goal is not to actually test to make sure that you know Express validat Works our goal is to test create user handle Works our own function this is a unit test okay when you want to actually test the entire application that is where you want to actually set up an integration test or an end to end test which you will learn about it later okay so hopefully that kind of clarifies the confusion between uh mocking and actually testing the entire thing with without mocking it okay all right so now that we’ve mocked match data this function to return a mocked result so we can safely uh run the rest of our code and then we want to make sure that this match data function is going to be called but we also want to make sure that we don’t hit this if condition and make this true so we need to actually make is empty return true this time which means that there are no errors but the thing is though I mocked it up top over here to return false so what if I changed it to true but then that would break my first test over here so we can’t do that so I’ll show you what we can do to actually change the return value for our specific tests okay because we want this is empty function to return uh true for whenever we call it validation result so that way this if condition results to false and then it’ll go down over here and call match data okay so let me just make sure that we have our match data function mocked properly okay this is good let’s go down over here and let’s rate our next test and I’m going to go ahead and call this test uh let’s see so I guess the overall thing that we are trying to test for is making sure that the response. status is sending back a 2011 and it’s sending back the user that was created so essentially we’re we’re testing for success for creating user so I’ll just say it should return status of to1 and the user created okay and let me actually go up here and let me fix this should return status of 400 okay so let’s add the Asing keyword in front of our callback function for this test and now we’re going to go ahead and call create user Handler so after we call our function we want to actually mock out the is empty method to return true so that way goes to the match data function call so inside our test here’s what we’re going to do we’re going to use just. spyon and I’m going to go and reference um this import up here validator so that’s the entire Express validator package and then we’re going to spy on on uh this function right over here it’s validation result like this okay and then what I can do is I can use this mock implementation once and then in here this is where I can actually mock the actual implementation of the function and I can have a return an object so the same result object but this time that object will have this is empty function so this is also going to be a mock function and it will return true like that okay so hopefully that makes sense so this is how I can override the mocked value of validation result into something else so now what will happen is create user Handler will be called it’s going to go ahead and call validation result and then result that is empty will be called and we can see that’s going to a result to true and then negating that will cause this whole if condition to be false and then it’ll go down over here so what I can do is I can write an assertion to verify that matched data is called so let’s do expect so remember match data is a function that comes from the Express validator package so I’m going to reference validator do matched data to have been called and let’s save and let’s run our test and let’s make sure that it passes okay so it actually is um let’s see okay yeah don’t worry about this so it is actually supposed to pass but the reason why it’s failing is because right now it’s actually trying to uh call the next few functions it’s trying to call Hash password and then it’s also trying to call the database by Saving this new user to the database so don’t worry uh it is working it’s just that um we’re it’s trying to connect to the database and you can see that it actually timed out because we don’t actually have a database connection so don’t worry we actually did the right thing we just need to mock the rest of our function okay so we know that match data is being called and you know what let me just comment all this out and run the test again because I just want to show you all that it passes great so now let’s go ahead and mock hash password because again we don’t want to actually call these functions because remember these functions these dependencies produce side effects okay so we’re going to go up top over here and now I want to mock this hash password function that comes from my helpers module so what I’m going to do is I’m going to call just. Mock and I want to pass the path to that module so we’re in the test folder so we need to go out one folder into utils helpers MJS like this okay and what I want to do is I want to have hash password um I want to I want to mock the implementation so let me pass in the factory and return an object and just overwrite hash password and so this will be a mock function but I I actually want to have it return some custom logic and all I want to make it do is takeing an argument so I’ll just do password so inside this callback function I can pass in this argument password and all I’m going to do is just concatenate um hashed with password like this I’m just going to literally prefix the password with hash so that way it at least does something okay all right so we just mocked hash password or hash password so now let’s go ahead and import up top over here we’re going to import helpers from utils helpers okay and this would allow me to reference helpers like an object and I should be able to reference hash password or maybe I need to do import as helpers yeah there we go okay I think I may have need to do that as well for validator I’m not too sure let me just run everything and make sure it’s good let me go over here and just come this out real quick okay there we go perfect okay just wanted to make sure that didn’t break okay so now we’re going to go down over here and we have wrote an assertion for for the Matched data function okay to have been called uh let me also change this to have been called with mock request to be more specific and then we’re going to go ahead and write an assertion for hash password so what I’m going to do is I’m going to expect helpers do password to have been called and I want to verify that it was called with data. password so data. password password is going to be whatever matched data returned so up top over here matched data returned password so I’m going to say to have been called with password like that you know what for the rest of this test let me just comment out all this stuff over here because I do want to actually see our assertions passing okay good so to have been called with password and then I also want to make sure that hash password so helpers hash password returns with the correct value so to return to have returned returned with hashed password and I know I’m just hardcoding these values but ideally for you you would probably not want to hardcode these values so that way you can make it more Dynamic but I’m just doing this for testing purposes okay just to show you an example so if I run the test you can see that it will in fact return hashed password and that’s just our mock implementation right over here nothing special but at least it is returning with something so we can verify that data. password is uh storing the correct return value okay so now the next part we want to um test this part over here you see how we are creating a new user so this is where we are invoking the Constructor of class so now you’re probably wondering well how do we test that so what we can do is we can actually mock these es6 classes it’s actually not that difficult and I’ll show you how to do it so what we can do is right over in our test file up top over here I can go here just. Mock and I can just pass the path to our our user right over here this this user. MJS file inside schemas so I need to go out One Directory to schemas user. MJS okay and then up top over here you know let me remove this mock users import let me import user from the uh mongu schemas user. MJS file okay so I just mocked that whole module right over here and now what we can do is is so I uncommented this line over here where we call the new user Constructor and I can write an assertion and I can say expect user so I’m referencing the entire model which is a class and that’s coming from this input right over here okay this is our model right over here and then what I’m going to do is I’m going to use the two have been called assertion and I’m going to run the test and it’s going to pass so this verifies that the Constructor was actually invoked if I comment this out you’re going to see that it’s going to fail because it it actually was called or it actually wasn’t called but we wrote the assertion to see that it was called so let me uncomment that and let’s just change this to to have been called with the correct arguments so we want to make sure that it was called with the correct username display name and the hashed password okay so in our test let’s go back up over here so notice how this is the return value of matched data because we are passing uh matched data whatever this return value is into the user Constructor only with the password being hashed so what I can do is I can pass in that object and just change this to Hash Hash password and remember this value comes from our mock function over here we just prefixed hashed uncore with whatever the password is so let’s go ahead and run the test and you can see that now it passes so that’s good and now one more thing that I also want to show you is if you wanted to access the instance that was created so the user instance you can do that by referencing user and it’s going to attach this mock property onto that user and then you can reference instances at subscript zero because we only created one instance and then let’s run the test again and you can see right over here we have the instance and this instance has this save method as well and you could of course also reference the properties on it so let’s go ahead and continue testing the rest of our code so I’m going to comment this out and since we’ve already mocked out the user model or mongus model I can actually just run my test and we shouldn’t get the same errors that we had before because all that is mocked out already okay this save method is mocked everything so what I want to do is I want to verify that the save method was called on the instance this new user instance so what I can do is this I can actually create another spy on this save method so I can keep track of its calls because there’s no way for me to directly ask this unless if I get the instance so for example if I wanted to I could do user. mo. instances zero do saave to have been called like that and this should work without any problem yep and then if I try to negate this call to verify that it’s it’s not passing incorrectly you can see that it actually was called so this is one way that you can do this the other way that you can do this is you can use a spy and I’ll show you how to do that so I’ll create a variable I’ll call this save method equals just. spy on and I can reference user. prototype like that and then what I can do is I can specify the actual method itself on the instance so save is one of the methods and then leave it like that and what I can do is I can go ahead and replace this part to be expect save method to have been called okay and if I run test again the test will pass and if I try to add the not operator in front of it you can see that by adding not operator the test fails because it actually was called so what I want to do specifically is I want to actually mock the return value of save so what I’m going to do is at the end of just. spyon I’m going to call mock resolved value once and I want save to just return the user that should be saved to the database but I’m just going to attach an ID you don’t have to do this but I’m just going to do it anyways and then I’m going to copy that so that way like the reason why I’m attaching the ID is that way it makes it feel like it’s being saved to the database even though it’s not because mongodb generates an ID for us so now what I’ll do is I’m going to go down over here and what I’m going to do is I’m going to let’s see so we are asserting that save was called so now let’s write an assertion on response. status we’ll verify that it was called with the status code of 2011 and then we’ll verify that the response object was called with the send method or called it called the send method with the saved user which means that it includes that user over here that we are mocking the resolved value so let’s do expect mock response. status to have been called with 2011 and then let me just go down here let me change this to mock resp response. send and let me just copy this object paste it here and we should be good so let’s test this out let me run my test and you can see that our test passes so that’s good all right so we’ve covered two cases so far for our crate user Handler let’s go ahead and cover the last case this one’s going to be pretty easy we just need to get it to actually throw this error so here’s what we’re going to do we’re going to go ahead and create a new test so I’ll go ahead and call this test let’s see um it should throw error when save or let’s see it should send a status code of 400 when save uh errors out okay so everything else is good except for when uh the save method is called maybe something failed the database and then it throws us th throws this error and it sends a status of 400 so let’s do should send status of 400 when database fails to save user so I think that’s good enough and let’s make this an async method so we’re going to uh let’s see we’re going to copy this create user Handler right here so everything is going to be roughly the same as the previous test so I do also want to copy this just spyon because we do want to make sure that we are going past this part we’re going all the way down but then it we just want it to fail when it calls the save method okay so the thing is though we don’t need to rewrite all of these uh assertions because we already did before so let me do this um con save method yep so let me copy this save method equals just. spyon let me copy this part and now what we are going to do is we’re going to go ahead and for the save method for this spy we’re going to mock the implementation one time and remember this save method throws it it could throw an error but we’re just going to mock the implementation so when it does throw an error then it’s going to handle this catch block over here but since this save method uh is asynchronous it returns a promise so we have to do promise do reject and we’ll just say failed to save user okay so now we’re basically overriding the save method to actually error out return um return an error so everything in our code should be good and then once it gets to this save method it’s going to go ahead and error out and then we’re going to go ahead and write an assertion on response and Status okay so let’s go ahead and do this let’s do expect save method to have been called and then what we’ll do is we’ll do expect mock response that’s send or I’m sorry send status right over here to have been called with 400 and let’s go ahead and run our test let’s make sure that it works and there we go we have covered all three cases if you want you can go ahead and write some assertions for some of these functions to verify that they were called but you don’t really have to is it would just kind of be redundant with what we have up here CU at this point in this test we know that all these functions are being called it’s just that we’re trying to get to the point right down over here to make sure that we are testing for uh this send status being called with a status code of 400 and if I were to pass 401 that test would fail because it is supposed to be 400 and there you go so hopefully all this makes sense I know this this part of the tutorial was pretty long but that’s because there’s a lot of stuff that I wanted to cover and I felt like with this specific test you learn so much with how to mock modules how to mock classes how to mock your own modules that you create yourself on your uh on your in in your source code so your local modules um and just a lot of stuff about unit testing so hopefully this tutorial made sense and I would highly encourage you to practice writing more tests more unit tests for your other functions as well so for example one thing that I can encourage you to do is maybe for the local strategy if this is something that you have you can go ahead and take let’s see you can probably take this part out you can take this Anonymous function out put it in a separate file and import it in here and then that way you can actually import that function into a test file and test the logic in here and using the logic that I showed you with how to Mock and how to override values of functions by mocking them out you can write those unit tests so hopefully all of this makes sense in this part of the expressjs tutorial I’m going to teach you how to write integration and end2end tests for your Express server so integration tests and unit tests basically involve testing your entire application at least with integration tests you typically are testing certain scenarios and flows in your application like for example create a user and then expect that user to uh return as a response and then try logging in as that user after you’ve created that’s an example of writing an into and test okay you have different scenarios it’s a lot different that unit tests where unit tests you are only testing one piece of your entire code base like one single function and many of you who have seen the previous section where I showed you how to write unit tests may actually find writing integration tests to be a lot more easier because you don’t have to worry about setting up a bunch of mocks okay some people do get confused with how to Mock and what to actually mock but with integration and ENT test you just call your API and then you write assertions so the first thing that I’m going to do is I’m going to actually disable the OA 2 configuration with the Discord strategy right over here I’m going to comment it out and I’m going to uncomment out the local strategy because I want to actually use local authentication we’re not going to be testing oath 2 we’re going to be testing actual local authentication where we create a user and then we can log in with that user and then we will verify that the user was created and that we’ve logged in so let me just do that so just uncomment this file everything else is set up the way that it should be and then we should have our both serialized these serialized user functions okay so we’re done with this part just want to do that very quickly now let’s go ahead and install super test so you’re going to type npmi hyphen D super test and we’re going to use super test with just they both work very well with each other and we already have just set up already so if you missed a previous section of this tutorial where we configure just and wrote some unit test check out at least at least the first 10 minutes of the video where or maybe like the first 5 to 6 minutes where we set up just okay then come back to this video but all the code is going to be in a GitHub Link in the description so check that out so you don’t have to like you know watch the whole thing you just copy the code and get the setup and then come back to this video so I installed super test now let’s go ahead and go back to our code what we’re going to do is we’re going to create a folder inside the source folder and I’m going to call it e2e like this cuz I want to keep all of my unit tests separate from my end to end tests because it’s good practice to do that and it’s also industry standard as well and I’m going to create a new file and I’m going to call this index. spc. JS or you can call it index. test.ts if you prefer okay and I’m not going to I’m going to leave this blank for now I’m not going to write anything just yet inside this new file what we need to do is we’re going to go into our package.json file and we’re going to add a a new test script but I’m going to call it test colon e2e so that way I can run either only unit tests or only endtoend tests for the test E2 script the way it’s going to look like is we’re still going to be using the just binary so again make sure you have just installed and configured and then we’re going to use this test path pattern flag and I have it point to the source The Source SL folder so that way when I run test colon e2e it’s going to go ahead and only run the tests inside this folder over here okay so we can run just the end to end tests and not the unit tests with it okay so we’re done with this now we’re going to go ahead into our index. spc. JS file and what I’m going to do is I’m going to import Super Test from Super Test like this and then I’m just going to show you a very very easy example right now I’m going to import Express and I’ll set up a very simple Express server with literally nothing no middleware nothing okay whoops didn’t mean to do that so I’m going to call the Express function and I’m going to register a simple test routes so I’ll call that route hello and we’re just going to send back a status code of 200 okay and then now to actually use super test the first thing that I’m going to do is I’m going to use the describe function again this comes from just so make sure you have just configured and I’m going to go ahead and call this hello endpoint just something simple and then I’m going to passing that callback function and inside the Callback function for describe this is where we’re going to have all of our tests so I’m going to use the it function that’s part of just to write my actual test so I’m going to go ahe and just say get hello end point well actually let me do get hello and expect 200 okay so I have one test inside my describe callback function over here and I can add more test if I want to so this is where we’re going to actually call our API so we’re going to use this function actually actually I’m sorry it’s not super test from super test it’s import request from Super test or that’s how you should name it import request from Super test because this is actually a function so let me just I just fix that real quick sorry about that so let me just invoke this request function which is this super test module over here again this is the top level function that we’re importing and then we’re just going to pass our app instance like that and then what we’re going to do is we’re going to go ahead and call the get method so whatever endpoint point that we want to make a request to and whatever method type you would use that one so for a get request I would use get for post I would do post so I’ll do get and then the URL so hello and then you want to pass in a callback function if you need one but I don’t need one right now so after the do getet I can go ahead and use uh this expect method at the end so I’m chaining this expect expect method on the return value of get and then what I can do is I can expect a status code like this I can do expect 200 and now let’s go ahead and run the test so we’re going to run the test by using this test e2e command that I just set up earlier so npm run test colon e2e like that and our test should pass there we go okay perfect awesome not sure why it took forever it might be because we did not end the request but I can do at the end of the expect call I can do end and then error res and and do if error throw error like this and that should fix that error in in the last part yep there we go perfect so you can see that the test passes and of course if I were to change the status code inside this app.get inside this request Handler I change the 2011 to kind of like throw off this test over here and show you what happens so let’s do npm run test e so the test should fail you’ll see that the error actually uh is thrown right over here the problem here though is that even though we are expecting 200 over here and keep in mind this is the expect method that is on Super Test not from just okay you can see that right now over here it still treats the test as passing even though the test shouldn’t pass and um even if I were to write an assertion inside this call back function for the end method call so we to do expect and then we have this res argument which is the response so res. status code to be 200 and if I run the test again the test actually will still be considered passing let me remove this expect as well okay you can see that the test actually is still considered passing right over here even though it actually is supposed to fail now to fix this instead of having to do uh do end like right over here I’m going to go ahead and remove that and so instead of that we’re going to go ahead and actually await this doget call because this actually returns a promise if you look at the end over here you can use then or catch like that so I’m going to add the ASN keyword in front of the call function for the it function or test and I’m going to go ahead and do const res equals await so this is the response object right over here you can see that the return value the resolved value is a response let me name it response okay and now what I can do is I can write an assertion on the response the status code and I’ll say response. status let go 2 B 200 so this should fail because the end point actually returns a 2011 and now the test actually fails so this is exactly what we want of course if you wanted to write an assertion on the response body there is this body property on the response object and then you can use assertions such as to b or to equal or to strict equal or to contain whichever mat you feel like you need so for example I can do Tob an empty object and let’s see what happens uh let me first fix this back to 200 and of course you can see the test fails because we’re not returning a response body so let’s fix that let me go ahead and set the status to 200 and also send some Json and empty response body and let’s run the test again and let’s see uh I think let’s do two equal since it’s an object okay there we go now it passes okay it does suggest to use two strict equal as well right up top over here that’s why it was erroring out okay and if I tried to pass in the wrong object like this let’s run the test and you can see that the assertion fails so hopefully this makes sense now I just want to show you this quick example we’re now going to go ahead and actually set up our end to end tests for our application so this will actually require us to grab our app instance right over here because what we need to do is similar to um what we’re doing in here we need to pass that app instance into the request function as an argument as you can see over here okay so inside our application right over here inside index. MJS this is where we actually have our Express app created and we have all of our middleware set up so the thing is though we need to make sure that we can export our app and import it into our test files our endtoend test files so that way all of the routes and all of the uh middlewares and anything else is actually going to be registered the other issue is that because in our file we’re not only just registering middleware but you can see right over here I am trying to also invoke the database as well so there are actually a few things that we need to do just to get this to work and so the good thing is it’s not going to be a big deal to do this so what I’ll do is I’ll create a new file and I’ll call this uh let’s see create app. MJS and all I’m going to do is just export this function create app like that and I’m just going to literally take let’s see I’m going to take all this stuff right over here and I’m going to paste that in here and then what I’m going to do is this I’m going to go ahead and pass an instance of app like that so then I can reference app right over here and I also need to make sure I’m registering all of my middleware which I am and I also need to import all of the middleware as well all the Imports right over here as well as right here okay and um let me see uh Additionally you know what actually I’m going to create the app inside the function instead and let me import Express up over here so let me delete all of these Imports in the index files because we won’t need them anymore okay so what I can do now is I can call create app and I want to actually return the app instance so when I call create app it’ll run through all of these it it’ll call all of these functions it’s going to register all of the middlewares right over here all of the routes and it’s going to uh return app so once all of the middlewares and all the rout or registered it’s going to return this app instance to wherever we called it so now what I can do is inside the index. MJS file I can go ahead and first let me import create app like that and then I’m going to go ahead and do const app equals create app and we don’t have any asynchronous a logic going on here so that’s good so we can just call create app and now the next thing is is we need to also make it so that when we run our end to end tests or integration tests that we’re also able to connect to the database as well so this alone is just fine for our development application like if I were to just run my code right now for just development everything would still work the same way you can see that still going to uh reference the app and then call app. listen to actually start up the server is not defined I think oh I think let me see where where was that over here um did I reference that in here oh yeah let me import Mongoose in here as well inside the create app MJS method because we do reference it down over here forgot about that and then cannot in a client please provide correct options okay so the other problem here is that it does require the connection so what I can do is I can move the connection top over here and now it works okay so it’s just an it’s just a matter of ordering things so first I’m connecting to the mongodb database I’m calling mango. connect then I am initializing the app because the application does require the connection to exist first so now what I can do is let me remove uh this app.get let me remove all of this for now and instead of just calling Express I’m going to remove that let me remove this import of Express I’m going to go ahead and import the create app like this okay so now we actually have our Express app in this variable like our actual app not the fake one that we just created just now but we still need a connection to the database and that’s okay because what I can do is I can actually just copy all this stuff over here and I can just paste it right in here and I can just import mongus from mongus and I can change the database that it is connecting to so I can change it from Express tutorial to express tutorial test like that and I can say connected to test database and now let’s go ahead and try to test a very simple endpoint so I have let’s see do I have any simple end points that I can set up um let’s do this one let’s do the API off/ status endpoint let me remove all these logs so what this should do is we’re going to write an assertion to return a 401 because we’re not authenticated currently so inside our test file let’s go ahead and do describe API off and then what I’ll do is say it should return 401 when not logged in and let me add the Asing keyword in front of the call function for our test and I’m going to do const response equals await so I’m going to call the request function that’s super test right over here we going to pass in our app and then we need to go ahead and call get and then go ahead and pass in the URL that we want to visit so/ API SL status just like that and then now I can write an assertion on the response do status code to be 401 so let’s actually run our test and see what happens so npm run test or I’m sorry npm run test e2e okay and you can see uh let’s see right over here you can see that it is logging in the console right over here it says connected to test database and our tests are passing so that’s good so it is actually calling the endpoint um and it passes because we are expecting the status code of 401 which it is actually giving it to us and of course we get this issue where um the test did not exit after the test completed so I think it’s likely because of our database connection right over here mongus doc connect let me actually do this I’m going to copy this and I’m going to go inside the describe block and then right before the test I’m going to go ahead and use this before all function this is a life cycle hook so basically this function takes on callback function and before all of your tests that’s why it’s called before all it will run whatever is inside this logic over here you can see before all of our test it’s going to connect to the database so there’s before all there’s also before each before each will run before every test and we don’t want that because we only want to connect to the database one time and then let me just make sure this still works as expected uh let’s see um okay so I think the problem is oh wait whoops let me do this uh it does require a little bit of tinkering but what I need to do is because we’re trying to create the app first before the database connection so let me actually do this let me declare variable up here called app like that using the let keyword and I’m going to reassign uh the value of what whatever create app returns to app and so that way I can reference it inside here okay there’s a bunch of different ways you can set this up so this is not only one way this is not the only way to do it there are different ways of how you can configure this but this should work okay perfect and now to fix this part we’re going to go at the end of our test I’m going to go ahead and use this after all hook okay so it’s pretty much the opposite of before all so after all your tests what we want to do and this is the part where I mentioned earlier or maybe in the previous section of this tutorial where you want to actually drop the database as well as close the connection to the database so you can do that by referencing doc connection drop database um and then you can see it says helper for drop database deletes the given database including all collections documents and indexes so that will drop the database that we are connected to which is the test database and this returns a promise so we will need to await that so let’s add the Asing keyword and await this and after we drop the database let’s go ahead and close the connection yeah I think it’s yep drop not drop sorry close and then this will close the connection right over here and then this should fix that uh warning that we have over here okay there you go you see how now the tests actually gracefully exit and this is important because if you have your end to endend test or really any test running in a pipeline it’s going to block your pipeline from proceeding to the next job so it’s very important that you resolve these situations okay but we have a pretty good setup right now so let’s go ahead and actually continue so what I’m going to do is I’m going to go ahead and write an end to end test I’m going to I’m going to write a scenario okay so what I’m going to do is I’m going to go ahead and create a user first verify that the user is created and then we’re going to try to log in and then verify that we’re logged in I know it’s a lot but don’t worry we’ll take it step by step ideally you always want to make sure you are separating your tests you don’t want to like have them all together so what I can do is I will go ahead and create a new file I’ll call this user dope. JS or really whatever ever it is that you want to describe it as and we can just literally copy this whole thing and paste it here so I’ll just call this uh create user and login and just have the same exact setup like this um let’s see yep everything else is good and then let’s just delete that because we’re our test is going to be different okay so the first thing that I want to do is I want to actually create the user so let me go ahead and do this it should create the user and keep in mind that we’re not going to be testing everything in one single test block we’re going to be doing everything in sequential order so first thing is we’re going to test that the user is created so it should create the user and we’re going to go ahead and make a request so let’s call the request function pass in our app instance and then we’re going to go ahead and call a post request this time and the endpoint is going to be/ API SLO SL user and let me just verify that route right over here yep router. poost API users or I’m sorry it’s I don’t know why off it’s API users with an S and then it’s going to go ahead and call this middle word function this is the express validator so this is where we can actually also make sure that the validation is working working as well uh we have create user Handler is called which is our request Handler and it’s going to basically run through all this logic so again in the previous section of this tutorial where we went over unit testing I showed you how to unit test this whole function this time we don’t have to worry about mocking anything it’s going to call this function and it’s going to run the actual logic it’s going to call the actual functions from Express validator it’s going to call our own hash password function it’s going to create the user and going to actually save it to the database using okay so let’s go ahead and go back to our test file oops sorry about that all right so we’re going to make a post request and let’s go ahead and send a request body so uh to send the request body you can use this send method like that whoops not sure why that is send yep and then you can pass in an object so so we need to send the username so for the username I’ll do Adam 123 password let’s do password and then display name just do Adam the developer okay so when we send this request it’s going to handle it on the server side we don’t obviously care about what’s going on on the server side with this because we’re trying to just care about what the response is okay so what I’m going to do is after this whole thing is done we also want to await this call because remember this do send method also returns a promise as well so let’s await that and now let’s write an assertion let’s do response. status code to be 2011 okay so let’s run our test so let’s do npm run test e2e so this should run all of our tests for us and you can see both tests pass and you can see in the cont conso that that’s I think that’s the salt from the hash password function that’s being logged if I am correct yep it’s the salt let me remove this console log but you can see that both tests are passing so that’s good and you can see that they don’t conflict with each other and one more thing that I also want to show you is if I open up my mongodb compass tool okay and if I were to actually let me see not this one but it shouldn’t be connecting yeah it should not connect to this Express tutorial database it should connect to the test database so you know what let me remove this line over here and show you what happens when I run the test okay so now watch this if I refresh the page or refresh this application uh what is this new version available let me click X you can see that now this Express tutorial test comes up and you can see that our collection our users collection is inside the express tutorial test database and so is our sessions okay so hopefully this makes sense but the reason why we didn’t see it before is because we dropped the database and the reason why we dropped the database is because we don’t want the test data from previous test Suites to conflict with other tests okay I’ll explain more about that later on because right now you might wonder okay well we do need the data with this user in the next test but yes that’s within the same test Suite in other test sues like in other scenarios you don’t want to have leftover data in the database conflicting with that scenario because you might have a scenario where you’re only expecting one user but there might be three users because you didn’t clear the database okay all of those tests that you ran kept creating a new user and because you didn’t drop the database the users kept adding on into the database collection and your assertions are going to fail so let’s go ahead and continue Contin so after we create the user let’s actually log in so what we’ll do is this I’m going to first manually drop my database let me just do that because it will error out if it creates a duplicate okay so we dropped the database good let’s go ahead and go back to our code so now we’ll do this it should log the user in and we’re going to make a request a post request this time to SL API SLO yep I think it’s just slpi SLO and then we’re going to send our whoops I don’t know why it keeps doing set encoding send username so the same username that we configured up top over here so Adam 123 and then the same password and then let’s go ahead and get the response in a variable okay so let’s just go back to our off I think I put that right over here yep so it should send back a status of 200 on success okay uh I think with passport let me just double check everything yep I think everything here is good so let’s continue so expect response status code to be 200 now let’s go ahead and run our test make sure that it passes okay so now it says uh let’s see now it failed and let’s see what’s going on over here it says received 500 so it seems like the backend uh there might be something wrong with the back end for it to send back a 500 so I’ll actually just console log the response body and see what that message says because it sent back a status code of 500 so that’s obviously not good let’s see okay so it says um maybe not response. body but maybe let’s just do response okay so it says right over here that unknown authentication strategy okay so I know what the problem is the problem is that it doesn’t recognize our local strategy and I think it’s likely because of the way that we moved everything into here so I’m trying to think what would be the easiest way to do this because if I were to actually remove this create app and then move everything back into the index file I would need to export the app and that would require me to import the index file which would also call this mongus doc connect code and I don’t want that to happen so the only other option is I would have to essentially move this to a separate file and then it would also call this app I listen which I don’t want so we don’t want to import this index file at all so I think the other thing that I might need to do is I might need to import this strategy into the create app probably maybe like right over here and I think maybe that might fix that so let’s try to run the test again and see if that same issue occurs okay so you can see that the error goes away now so it it seemed like this import did fix that I guess because we had it over here uh was what was causing the problem let me move this as well over over to here okay um I guess it has to be inside the scope since I guess this is where we are creating the app and we are initializing passport here so maybe that’s the reason why I’m not too sure but at least we fixed that part so now we can go back over here and let me remove this console log and let me just rerun the test we know that it’s passing though okay and you can even see in the console log from the actual source code right over here it is logging the user over here and if we go to where is the local strategy right here yep you can see that it should be logged I think yeah it’s being logged right over here inside the serialized user function and it says inside serialized user and it logs the user itself and then after successful authentication the endpoint right over here sends back a status code of 200 okay so we verified that we were able to successfully log in now additionally what you can do is you can write some more assertions on the response object they have this property called I think it’s headers yep headers and what you can do is you can check to see if the headers actually has the cookie that you expect because this response that headers object is actually just an object that has the cookies property so let me show you real quick what that looks like right over here yep you can see that we have this set cookie property which seems to be an array so I guess what you could do is you can look to see if the array contains this uh cookie name right over here so that’s one thing that you could do but I’ll let you all take care of that so now inside this second test we are trying to log the user in so now once we’ve logged the user in then we should have a session and we should be able to visit the o/ status endpoint and get a response back with our user record cuz that’s who we are logged in as so let’s go ahead and try that out so I’ll sa for the test it’s should visit API status and return logged in user let me just call this authenticate authenticated user and I want to show you what happens when we try to do this so we’re going to make a get request this time to / API o status and we’re going to assert that the status code returned is 200 and let’s see if this passes and you’ll notice now that it actually fails okay it gives gives us back a 41 and so I think the reason why this happens I don’t know the exact reason but I will tell you what I think because I ran into this issue myself so when we run our test they are running in order okay they are running this one first this one first and this one first but when we run this test right over here it doesn’t actually uh persist the cookies for the next request so for example we do receive cookies inside this inside this API call right over here okay we do have cookies inside this second test and those cookies are being sent from the server however in this third test when I when we try to make a get request to this protected endpoint we need to obviously send the cookies but in the context right over here we don’t have the cookies sent so I think because of that reason uh it is giving us back that 401 because it’s treating us as if we never logged in so the way around this is to actually implement this logic inside just one test so I’ll go into this second test over here and I’ll say for the for the title should log the user in and visit API status and return off user okay and so what we’ll do is after we call this send method I can actually use the then method and then I’ll get the response of the post request because remember I’m using the then method to resolve the promise for this request. post method and then that would resolve the value of whatever that post was going to return okay whatever the promise was going to resolve so inside this then I’m going to pass in a callback function which gives me access to that response for that post request to the API off endpoint so inside here what I can do is I can actually return request. apppp so I can make another request right after this post request is finished and I can make a get request and I’m going to paste that URL over here and then what I can do is I can also set the cookies so I can use this set function and then I want to set the cookie and then we need to just pass in this array of cookies which we can easily grab if we reference res. headers and I think the property was called set hyphen cookie I think or set cookies let me actually just double check real quick let me do this let me console lock this okay but then what will happen is we send the cookies along with this request and so this response so after we await this whole thing this response up top over here is the response respon for the actual get request okay so then right over here we can write assertions on the status code on the response body so let me go ahead and remove this third test because we won’t need that anymore and let me go ahead and run the test again and let’s see invalid value and defined um let’s see headers it may have been set cookie instead of set cookies maybe that’s why it’s giving us back undefined yep it’s set cookie okay yep that’s fine so let’s go ahead and change this to set cookie so this will pass all the cookies send it to the server and let’s go ahead and run the test again and now you can see that our tests pass and specifically this second test pass with all of our API calls and you can even see on the server side it goes through the serialized user function and then it goes through the Der serialize user function so this is invoked whenever we make a next request after we first log in okay so everything is working as expected and if I want I can write some more assertions on the response body so I can do response. body. username to be atom 123 for the display name let’s do that as well to be adam. developer and let’s run our tests and see what happens and you can see all of our tests pass so I hope that this shows you how to write integration tests as well as endtoend tests I hope that you better understand how to do it and how to set it up in a way that makes it effective and and this will be the last tutorial for the entire expressjs series I’m still going to make more expressjs tutorials it’s just not going to be part of this specific uh long series that I designed so I hope that you all enjoyed watching this series if you watch the whole entire thing like I said before the code will be on GitHub I’m going to leave a link in the description as well so you all can access it you’re more than welcome to ask questions Down Below in the comment section I check my comments every single day and I spond whenever I get a chance to if you need additional help visit the Discord server the link is in the description as well you can go onto the Discord server and get help with your programming issues uh talk to other developers um just you know just just hang out and whatever so yeah like I said I hope you all enjoyed this whole Express Chas tutorial and that is going to be it for this one so I will see you all in my next episode peace out

    By Amjad Izhar
    Contact: amjad.izhar@gmail.com
    https://amjadizhar.blog

  • Mastering Excel: Data Management, Formulas, and Finance

    Mastering Excel: Data Management, Formulas, and Finance

    The provided text from “01.pdf” serves as a comprehensive guide to using Microsoft Excel efficiently. It begins by explaining various keyboard shortcuts and mouse actions for navigating within worksheets and workbooks, along with methods for data entry and cell editing. The text then covers essential formatting techniques, including adjusting cell dimensions, aligning content, and basic visual styling, emphasizing the difference between data and formatting. Furthermore, it introduces concepts of inserting and deleting rows, columns, and cells. The guide also explains number formatting options, allowing users to customize how numerical data is displayed. Conditional formatting is discussed as a way to visually highlight data based on specific criteria. The text details the “Go To Special” feature for advanced cell selection based on various attributes like blanks, constants, formulas, and more. It thoroughly explains “Paste Special” functionalities for selective data transfer, including formulas, values, formats, and operations. Finally, the document covers the “Find and Replace” tool and demonstrates using random data generation formulas and lookup functions like IFS, FILTER, and a basic INDEX/MATCH.

    Excel Fundamentals Study Guide

    Quiz

    1. Explain the concept of a cell reference in Excel and provide an example of a relative cell reference.
    2. What are the three fundamental types of data that can be entered into a cell in Excel?
    3. Describe the order of operations that Excel follows when evaluating a formula containing multiple operators.
    4. What is the purpose of the SUM function in Excel, and how would you use it to add a range of cells?
    5. Differentiate between using direct numbers and cell references within an Excel formula, and explain why using cell references is generally preferred.
    6. Explain the difference between the “Fill Series” options for “Linear” and “Growth” trends, providing a scenario where each would be useful.
    7. Describe how the “Text Join” function works and provide an example of how you might use it to combine text from multiple cells.
    8. What is the purpose of the LEFT, RIGHT, and MID functions in Excel, and how do their functionalities differ?
    9. Explain the function of the IF formula in Excel and describe its three main arguments.
    10. How does the RANK.EQ function in Excel determine the rank of a number within a list of numbers, and what is the significance of the “ref” argument?

    Answer Key for Quiz

    1. A cell reference is a pointer to a specific cell or range of cells in a worksheet. It allows formulas to refer to the values in those cells. A relative cell reference changes when the formula containing it is copied to another cell. For example, if cell G3 contains the formula =C3+D3+E3+F3, and this formula is copied to cell G4, it will automatically update to =C4+D4+E4+F4.
    2. The three fundamental types of data are numbers (numerical values used for calculations), text (alphanumeric characters, including words and labels), and formulas (equations that perform calculations on data).
    3. Excel follows the standard mathematical order of operations, often remembered by the acronym PEMDAS/BODMAS: Parentheses/Brackets, Exponents/Orders, Multiplication and Division (from left to right), and Addition and Subtraction (from left to right).
    4. The SUM function adds all the numbers in a range of cells. To use it to add cells A1 through A5, you would enter the formula =SUM(A1:A5) in the desired cell and press Enter.
    5. Using direct numbers in a formula means manually typing the values. Using cell references means pointing to cells containing the values. Cell references are preferred because if the data in the referenced cells changes, the formula result automatically updates. Using direct numbers requires manually editing the formula every time the underlying data changes.
    6. The “Linear” trend in “Fill Series” adds a constant step value to the previous value in the series, creating an arithmetic progression (e.g., 2, 4, 6, 8…). This is useful for creating sequences with a consistent difference. The “Growth” trend multiplies the previous value by a constant step value, creating a geometric progression (e.g., 2, 4, 8, 16…). This is useful for creating sequences with a consistent percentage increase or decrease.
    7. The “Text Join” function concatenates (joins) text strings from multiple ranges and/or strings with a specified delimiter between each text string. For example, =TEXTJOIN(“, “, TRUE, A1:C1) would join the text in cells A1, B1, and C1, separated by a comma and a space, ignoring any empty cells.
    8. The LEFT function extracts a specified number of characters from the beginning (left side) of a text string. The RIGHT function extracts a specified number of characters from the end (right side) of a text string. The MID function extracts a specified number of characters from a text string, starting at a specified position.
    9. The IF formula checks whether a condition is met, and returns one value if true and another value if false. Its three main arguments are: Logical_test (the condition to evaluate), Value_if_true (the value to return if the condition is true), and Value_if_false (the value to return if the condition is false).
    10. The RANK.EQ function returns the rank of a number within a list of numbers. The “ref” argument specifies the array or range of numbers to rank against. Excel compares the “number” argument to all the numbers in the “ref” range to determine its rank.

    Essay Format Questions

    1. Discuss the importance of using formulas and functions in Excel for data analysis and manipulation. Provide specific examples of how different types of formulas (e.g., mathematical, text, logical) can be applied to solve common data-related tasks.
    2. Explain the concept of cell referencing in detail, including the differences between relative, absolute, and mixed references. Illustrate with scenarios how each type of reference can be effectively used in creating and copying formulas.
    3. Describe the various “Fill Series” options available in Excel and analyze their utility in generating different types of data sequences. Discuss specific situations where the “Date” series options can streamline data entry and analysis.
    4. Compare and contrast the functionalities of several key text manipulation functions in Excel (e.g., LEFT, RIGHT, MID, TEXTJOIN, LEN, TRIM). Explain how these functions can be used individually and in combination to clean, format, and extract information from text data.
    5. Analyze the role of logical functions, particularly the IF, AND, and OR functions, in creating dynamic and decision-making spreadsheets. Provide detailed examples of how these functions can be nested and combined to handle complex conditions and automate outcomes based on data values.

    Glossary of Key Terms

    • Cell: The intersection of a row and a column in a worksheet, identified by a unique address (e.g., A1).
    • Cell Reference: A way to identify a specific cell or range of cells in a worksheet, used in formulas to refer to their values.
    • Relative Cell Reference: A cell reference that automatically adjusts when the formula containing it is copied to another cell.
    • Absolute Cell Reference: A cell reference that remains constant regardless of where the formula is copied, indicated by dollar signs before the column letter and row number (e.g., $A$1).
    • Mixed Cell Reference: A cell reference where either the column or the row is absolute, but not both (e.g., $A1 or A$1).
    • Formula: An expression that calculates the value to display in a cell. Formulas can contain numbers, operators, cell references, and functions.
    • Function: A predefined formula in Excel that performs specific calculations or operations on data.
    • Argument: A value or cell reference passed to a function, providing the data it needs to perform its calculation.
    • Operator: Symbols used in formulas to specify the type of calculation to perform (e.g., +, -, *, /).
    • Order of Operations: The sequence in which Excel performs calculations in a formula (PEMDAS/BODMAS).
    • Range: A contiguous group of two or more cells specified by the cell addresses of the top-left and bottom-right cells, separated by a colon (e.g., A1:B5).
    • Concatenate: To join two or more text strings together into a single string.
    • Delimiter: A character or sequence of characters used to separate data elements.
    • String: A sequence of characters, treated as text in Excel.
    • Logical Test: An expression in a formula that evaluates to either TRUE or FALSE.
    • Criteria: Specific conditions or rules used to filter or analyze data.
    • Array: A range of cells containing values that are used in a formula.
    • Rank: The position of a number within a sorted list of numbers.
    • Round Off: To approximate a number to a specified number of decimal places or to the nearest whole number.
    • Data Validation: A feature in Excel used to control the type of data or values that can be entered into a cell.
    • Filter: A way to display only the rows in a list that meet certain criteria, hiding the other rows.
    • Sort: To arrange data in a specific order, either alphabetically or numerically.

    Briefing Document: Analysis of Provided Sources

    This briefing document reviews the main themes and important ideas presented in the provided excerpts. The sources primarily focus on basic Microsoft Excel functionalities and formulas, explained in a conversational and tutorial-like manner.

    Source: “01.pdf”

    This source is a transcript of an Excel tutorial, covering fundamental operations and formulas. The main themes and important ideas are:

    1. Basic Formula Construction and Cell Referencing:

    • Summation using direct cell references: The tutorial begins by explaining how to calculate the total of marks across different subjects (Hindi, English, Maths, Science) for a student. It emphasizes using the “=” sign to start a formula and then adding individual cell references (e.g., =c3+d3+e3+f3).
    • “You know g3 = c3 + d3 + e3 + f3 ok”
    • Understanding cell relationships: The tutorial highlights the relative nature of cell references. As a formula is dragged down, the row numbers in the cell references automatically adjust (e.g., g3 referencing c3:f3 becomes g4 referencing c4:f4, and so on).
    • “so you understand one thing as this is your g4 this will be g5 this will be g6 this will be g7 in the same way this will also be c4 this will be c5 c6 will be c7, d4 will be d5, d6 will be d7, so it will keep increasing in this manner, okay, you have understood one thing, we are talking about cells here…”
    • Difference between cell references and direct numbers/text in formulas: The tutorial explains that cell references update when a formula is dragged, while direct numbers and text within a formula remain constant. Text must be enclosed in double quotes.
    • “Numbers: If you are writing a direct number, if you are writing a number then it is always fixed, it will never change and in the same way, if you are writing any text, it is always fixed. The second thing is that the number is written directly, the text is written inside the double ted comma, okay now these things are now.”
    • Summation using the SUM function: The tutorial introduces the SUM function as a more efficient way to add a range of cells. It emphasizes the syntax: =SUM(number1, number2, number3, …) or =SUM(range).
    • “If we say equals to sum then we will put equals to sum and tab and always remember one thing, never listen to any person in the formula, you always have to listen to the formula, you have to do what the formula is saying, what is the formula saying number one comma number two comma number three comma number four comma and so on it has come then we will do number one comma number two comma number three comma number four and turn off the parentheses and hit enter.”
    • Using ranges with the colon operator: The colon (:) is explained as a way to define a range of consecutive cells (e.g., c3:f3 means all cells from c3 to f3 inclusive).
    • “if I say now what does it mean, add a1 to a2, then plus th, then plus four, plus fv, I can also write it like this, from a1 to a5, when you have consecutive numbers, there is this colon in between. What does this colon say? What does this colon say? It says from to means this is a range…”
    • Quick Sum using Alt+=: The tutorial introduces a keyboard shortcut for quickly summing a contiguous range of numerical cells above or to the left.
    • “The easiest way is that wherever you want the sum, you go to the cell and keep a condition along with it that there should not be any gap in between and then After that, if you press Alt Equal Two together then the formula appears to be the same.”
    • Basic Formatting: Simple formatting adjustments like using the format painter and adjusting column widths are briefly mentioned.

    2. Filling Patterns with Series:

    • Linear Series (Addition/Subtraction): This section explains how to use the “Series” option (under the “Fill” dropdown in the “Home” tab) to create sequences with a constant step value (addition or subtraction). It demonstrates creating sequences like 2, 4, 6… and 100, 95, 90…
    • “Whenever you have to do plus or minus, if you keep it in linear, then you have to do plus or minus. You have to do plus. Well, how much plus has to be done. Step value means, how much has to be done, then you have to do two and when to stop, what answer should come, stop when you reach 100, stop where the last 100 comes, then stop .”
    • Growth Series (Multiplication/Division): This section explains how to create sequences with a constant multiplicative or divisive step value. Examples include 2, 4, 8, 16… and 100, 50, 25…
    • “Second, the one that comes to you, comes to you, growth and growth deals in what , deals in both of these, in multiply and divide… when you use growth, it will be 2 * 2, then it will be 4, but 4 * 2 will be 8, 8 * 2 will be 16, 16 * 2 will be 32, 32 2 * 2 will be 64, that is this.”
    • Date Series: This section details how to create sequences of dates, with options to increment by day, weekday (skipping weekends), month, or year, and with a specified step value.
    • “Within the date, I have already told you in number format but still let me tell you what does date date mean today? … one way can be that I keep increasing every day from today, one way can be, I can show month wise and one way can be, I can show year wise…”
    • Using the SEQUENCE function (briefly mentioned): The tutorial briefly introduces the SEQUENCE function as an alternative for generating number sequences, available in later versions of Excel. It advises against using it for now due to potential issues with references if rows/columns are deleted.

    3. Understanding Constants and Formulas:

    • Defining Constants and Formulas: This section clarifies the difference between entering a value directly into a cell (constant) and entering a formula that calculates a value (formula). The formula is visible in the formula bar, while the calculated value is displayed in the cell.
    • “side I wrote I give, this cell is mine and here I write 100 and on one side here is the cell of mine, I write the sum a1 a10 then the answer is this is my formula will be visible in the bar but the answer is mine what will be visible is 100 so here which is only value there is no formula so what has become constant and here the value is there but is this value constant is it just value no check the formula b what? There is some formula attached to it.”
    • Types of Constants and Formulas: The tutorial distinguishes between number constants, text constants, logical constants (TRUE/FALSE entered directly), and error constants (errors entered directly). Similarly, it discusses number formulas, text formulas, logical formulas (resulting in TRUE/FALSE), and error formulas (resulting in errors).
    • Using “Go To Special”: The “Go To Special” feature (Ctrl+G, then “Special…”) is introduced as a way to select cells based on their content type (constants or formulas) and subtype (numbers, text, logicals, errors, blanks). This allows for targeted actions like formatting or editing specific types of cells.

    4. Filtering Data:

    • Introduction to Filtering: The tutorial briefly introduces filtering as a crucial Excel feature for analyzing data by showing only rows that meet specific criteria. It highlights its importance for reporting and understanding data.
    • “Filtering is very important. Filter and Sorting is one of the most important topics of Excel. The best feature is the single which helps us in many things, which also helps us in a lot of reporting, it helps us a lot in understanding something after seeing it, especially with the data…”
    • Conceptual Explanation of a Filter: A simple analogy of a water filter is used to explain that filtering removes unwanted elements (impurities) to show the desired outcome.

    Important Quotes Highlighting Key Concepts:

    • (On relative cell references): “so it will keep increasing in this manner, okay, you have understood one thing, we are talking about cells here…”
    • (On the SUM function): “always remember one thing, never listen to any person in the formula, you always have to listen to the formula, you have to do what the formula is saying…”
    • (On the colon operator for ranges): “What does this colon say? It says from to means this is a range…”
    • (On the difference between constants and formulas): “here which is only value there is no formula so what has become constant and here the value is there but is this value constant is it just value no check the formula b what? There is some formula attached to it.”
    • (On the purpose of filtering): “The best feature is the single which helps us in many things, which also helps us in a lot of reporting, it helps us a lot in understanding something after seeing it, especially with the data…”

    Overall, “01.pdf” provides a beginner-friendly introduction to essential Excel concepts, focusing on formula creation, cell referencing, efficient summation techniques, generating sequences, understanding data types within cells, and the basic concept of filtering. The explanations are conversational and emphasize practical application.

    The analysis of the remaining sources will follow in a similar structured manner to provide a comprehensive briefing document. Please provide the text from the subsequent files (“02.pdf”, “03.pdf”, etc.) for a complete analysis.

    Excel Basics & Formulas FAQ

    1. What are cells in Excel, and how do they relate to formulas?

    Cells in Excel are the individual rectangular boxes where you enter data. Each cell is identified by a column letter and a row number (e.g., A1, B3). Formulas in Excel are expressions that perform calculations on the data in these cells. When you write a formula, you often refer to cell addresses to use the values contained within those cells in your calculations. For example, =C3+D3+E3+F3 in cell G3 adds the values in cells C3, D3, E3, and F3, and the result is displayed in G3.

    2. What are the three basic components of an Excel formula, and how do they behave when dragging the formula to other cells?

    The three basic components of an Excel formula are: * Cell references: These refer to specific cells (e.g., A1, $B$2, C$3). When a formula with relative cell references (like C3) is dragged, the cell references automatically adjust relative to the new row or column. Absolute references (like $C$3) remain fixed regardless of where the formula is dragged. Mixed references (like C$3 or $C3) have one part fixed and the other relative. * Numbers: These are constant numerical values entered directly into the formula (e.g., 90, 27). Numbers remain constant and do not change when the formula is dragged. * Text: These are constant text values entered directly into the formula and must be enclosed in double quotes (e.g., “Pass”). Text also remains constant when the formula is dragged.

    Dragging a formula applies the same underlying calculation to adjacent cells, automatically adjusting relative cell references based on the new position, while keeping numbers and text constants.

    3. What is the SUM function in Excel, and what are the different ways to use it to add numbers?

    The SUM function in Excel is used to add numbers together. You can use it in several ways: * Adding individual cells: You can list individual cells separated by commas, like =SUM(C3, D3, E3, F3). * Adding a range of cells: For consecutive cells, you can specify a range using a colon, like =SUM(C3:F3). This adds all the numbers in the range from C3 to F3 (inclusive). * Adding non-adjacent cells and ranges: You can combine individual cells and ranges, like =SUM(A1:A5, C3, F1:F10).

    A quick way to use the SUM function for a contiguous range is to select the cell where you want the total and press Alt + =. Excel will often automatically detect the adjacent range of numbers and insert the SUM formula.

    4. How can you fill a series of numbers or dates automatically in Excel using the “Fill Series” option?

    The “Fill Series” option in Excel allows you to automatically populate a range of cells with a sequence of numbers, dates, or text based on a defined pattern. To use it: 1. Enter the starting value in a cell. 2. Select the cell (or a range of cells establishing a pattern). 3. Go to the Home tab, in the Editing group, click on Fill, and then select Series. 4. In the Series dialog box: * Choose whether you want the series to fill in Rows or Columns. * Select the Type of series: * Linear: For sequences with a constant increment (e.g., 2, 4, 6…). Set the Step value. * Growth: For sequences with a constant multiplier (e.g., 2, 4, 8…). Set the Step value. * Date: For date sequences. Choose the Date unit (Day, Weekday, Month, Year) and set the Step value. Weekday will skip Saturdays and Sundays. * Autofill: Extends existing patterns. * In the Step value box, enter the increment or multiplier. For dates, it’s the number of days, weeks, months, or years to add. Use a negative value to decrement. * In the Stop value box (optional), enter the value at which the series should end. 5. Click OK.

    You can also often drag the fill handle (the small square at the bottom-right of a selected cell) to automatically fill a series based on an initial value or pattern.

    5. What is the difference between “Constants” and “Formulas” when using “Go To Special” in Excel?

    The “Go To Special” feature in Excel allows you to select cells based on specific characteristics. When you choose either “Constants” or “Formulas,” you are selecting cells based on how their values are derived: * Constants: This option selects cells that contain values entered directly into them. These values can be numbers, text, logical values (TRUE/FALSE), or errors that were directly typed in (not resulting from a formula). If you further refine the selection within “Constants” by checking specific data types (Numbers, Text, Logicals, Errors), only constants of those types will be selected. For example, selecting “Constants” and then only “Numbers” will select all cells containing manually entered numbers, including dates (as Excel stores dates as numbers). * Formulas: This option selects cells that contain formulas. Similar to “Constants,” you can further refine the selection by checking the “Numbers,” “Text,” “Logicals,” or “Errors” checkboxes. This will select formulas that result in those specific types of output. For instance, selecting “Formulas” and then “Numbers” will select all cells containing formulas that calculate and display numerical results.

    The key difference is whether the value in the cell is the result of a calculation (Formula) or directly input by the user (Constant).

    6. How do relative, absolute, and mixed cell references work in Excel formulas, and when would you use each type?

    Cell references in Excel tell formulas which cells to use in calculations. There are three types: * Relative References (e.g., A1): By default, cell references are relative. When you copy or drag a formula containing relative references to another cell, the row and column parts of the references automatically adjust relative to the new position. Use relative references when you want the formula to apply to a range of similar data, and the referenced cells should change accordingly for each row or column. * Absolute References (e.g., $A$1): An absolute reference is specified by adding a dollar sign ($) before both the column letter and the row number. When a formula with an absolute reference is copied or dragged, the cell reference remains unchanged. Use absolute references when you want a formula to always refer to a specific cell, regardless of where the formula is copied. This is useful for referencing constants, tax rates, or other fixed values. * Mixed References (e.g., $A1 or A$1): A mixed reference has either the row or the column part absolute and the other part relative. $A1 keeps the column fixed but allows the row to change when the formula is copied down. A$1 keeps the row fixed but allows the column to change when the formula is copied across. Use mixed references when you want either the row or the column reference to remain constant while the other adjusts. For example, when calculating percentages of a total where the total is in a single row but you want to apply the formula to multiple rows of individual values.

    To quickly toggle between relative, absolute, and mixed references for a selected cell reference in the formula bar, you can press the F4 key.

    7. What are some common text functions in Excel, such as LEFT, RIGHT, MID, LEN, TRIM, LOWER, UPPER, and PROPER, and how are they used?

    Excel provides several functions for manipulating text strings: * LEFT(text, num_chars): Extracts a specified number of characters from the beginning (left side) of a text string. * RIGHT(text, num_chars): Extracts a specified number of characters from the end (right side) of a text string. * MID(text, start_num, num_chars): Extracts a specified number of characters from the middle of a text string, starting at a given position. * LEN(text): Returns the number of characters in a text string. * TRIM(text): Removes extra spaces from a text string, including leading, trailing, and multiple spaces between words. It leaves a single space between words. * LOWER(text): Converts all uppercase letters in a text string to lowercase. * UPPER(text): Converts all lowercase letters in a text string to uppercase. * PROPER(text): Capitalizes the first letter of each word in a text string and converts all other letters to lowercase (also known as sentence case or title case). * TEXTJOIN(delimiter, ignore_empty, text1, [text2], …): Joins two or more text strings into one text string with a specified delimiter between each text string. ignore_empty is a TRUE/FALSE value to specify whether to ignore empty cells.

    These functions are used to clean, format, extract, and combine text data within your spreadsheets.

    8. Explain the IF, AND, and OR logical functions in Excel, and provide examples of their use.

    Logical functions in Excel allow you to perform conditional tests and return different values depending on whether the conditions are true or false: * IF(logical_test, value_if_true, value_if_false): Checks if a condition (logical_test) is TRUE or FALSE. If it’s TRUE, it returns value_if_true; otherwise, it returns value_if_false. * Example: =IF(B2>45, “Pass”, “Fail”) in cell C2 checks if the value in B2 is greater than 45. If it is, “Pass” is displayed; otherwise, “Fail” is displayed. * Example with empty cell check: =IF(A2=””, “Pending”, “Payment Done”) checks if cell A2 is empty. If it is, “Pending” is displayed; otherwise, “Payment Done” is displayed. * AND(logical1, [logical2], …): Returns TRUE if all of its arguments are TRUE; otherwise, it returns FALSE. * Example: =AND(B2>5, C2>4) checks if both the value in B2 is greater than 5 AND the value in C2 is greater than 4. It returns TRUE only if both conditions are met. This can be used within an IF function: =IF(AND(B2>5, C2>4), “Bonus Eligible”, “Not Eligible”). * OR(logical1, [logical2], …): Returns TRUE if any of its arguments are TRUE; it returns FALSE only if all of its arguments are FALSE. * Example: =OR(B2>5, C2>4) checks if either the value in B2 is greater than 5 OR the value in C2 is greater than 4. It returns TRUE if at least one of the conditions is met. This can also be used within an IF function: =IF(OR(B2>5, C2>4), “Meets Criteria”, “Does Not Meet Criteria”).

    These logical functions are fundamental for creating dynamic and decision-making spreadsheets.

    Excel Navigation Keyboard Shortcuts

    Based on the sources, there are several keyboard shortcuts for page navigation within Excel.

    • To move to another sheet within the same workbook, you can use the following shortcuts:
    • Control Page Down: This will move you one sheet to the right (or downwards in the sheet list).
    • Control Page Up: This will move you one sheet to the left (or upwards in the sheet list).
    • To move between different workbooks that are open, you can use the following shortcut:
    • Control Tab: This will jump from one open workbook to the next. You can repeatedly press Tab while holding Control to cycle through the open workbooks.

    Additionally, you can use the mouse to navigate between sheets by clicking on the sheet tabs at the bottom of the Excel window. You can also go to another workbook by clicking on it if it’s visible, or by selecting it from the Window menu (which can be accessed without clicking, though the exact keyboard shortcut for this menu is not specified in the sources).

    For fast movement within a single sheet (not between sheets), the sources mention:

    • Page Up: To quickly scroll upwards.
    • Page Down: To quickly scroll downwards.

    These shortcuts help you navigate large datasets within a single worksheet.

    The name box can also be used to jump to a specific cell within a sheet by typing the cell address (e.g., A1, Z100) and pressing Enter. While not directly page navigation, it’s a method for quick movement to a specific location within a potentially long sheet.

    The sources emphasize using these shortcuts for efficient work within Excel, especially for repetitive tasks.

    Managing Multiple Excel Workbooks

    Based on the sources and our conversation history, here’s a discussion on workbook movement in Excel.

    Our previous conversation established that you can move between different open workbooks using the keyboard shortcut Control Tab [our conversation history]. This allows you to cycle through all the Excel workbooks you currently have open.

    The new source provides further context related to working with multiple workbooks:

    • You can open new workbooks by going to the “File” tab, then “New”, and selecting “Blank workbook” or choosing from various templates. Templates offer pre-designed layouts for different tasks, saving you from starting from scratch.
    • You can also open existing workbooks by going to “File” and then “Open”. This will allow you to browse your file system to select the workbook you want to open. Alternatively, you can use the search functionality within Excel to find and open workbooks.
    • The source also mentions the concept of a “workbook” as the entire file you are working in. When you save your work, you are saving the entire workbook. Multiple worksheets can exist within a single workbook.
    • Interestingly, the source details how you can move or copy entire sheets between different workbooks. To do this:
    • Right-click on the sheet tab you want to move or copy.
    • Select “Move or Copy…” from the context menu.
    • In the “Move or Copy” dialog box, under “To book:”, you can choose a currently open workbook or select “(new book)” to create a new workbook for the sheet.
    • If you want to create a copy and keep the original sheet in the current workbook, make sure to check the “Create a copy” box. Otherwise, the sheet will be moved to the destination workbook.
    • The “View” tab in Excel also offers options for managing multiple workbook windows:
    • “New Window” allows you to open another window displaying the same active workbook. This can be useful for viewing different parts of a large workbook simultaneously.
    • “Arrange All” lets you tile or cascade all open workbook windows on your screen. You can choose from options like “Tiled”, “Horizontal”, “Vertical”, or “Cascade” to arrange them in a way that suits your workflow.
    • “View Side by Side” helps you compare two workbooks (or two windows of the same workbook) next to each other.
    • “Switch Windows” provides a dropdown list of all open workbooks, allowing you to easily select and switch to the desired one.

    These features, along with the Control Tab shortcut, provide comprehensive ways to navigate and manage multiple workbooks in Excel. You can open new and existing workbooks, move content (sheets) between them, and arrange their windows for efficient multitasking.

    Excel Cell Data Entry Methods and Techniques

    Based on the sources, there are several methods for entering data into cells in Excel. These methods cater to different user preferences and situations:

    • Direct Cell Entry: The most straightforward method is to simply select a cell and begin typing. Once you have entered your data, you can press Enter to move to the cell below or press Tab to move to the cell to the right. This is the initial way to input new information into a blank cell.
    • In-Cell Editing (Double-Click): If you need to modify existing data within a cell, you can double-click inside the cell. This action places the cursor directly within the cell’s content, allowing you to make changes at the desired position.
    • Formula Bar Editing: Another way to edit cell content is by using the formula bar located above the worksheet. When you select a cell, its content is displayed in the formula bar. You can then click in the formula bar and edit the data directly. This can be particularly useful when the cell contains a long formula or a significant amount of text that might be easier to view and edit in the expanded space of the formula bar. Pressing Enter after editing in the formula bar will save the changes to the selected cell.
    • Using the F2 Key: A keyboard shortcut for entering edit mode in a cell is by selecting the cell and pressing the F2 key. This action places the cursor at the end of the cell’s content, ready for modification. The source also notes that on some laptops, like HP models, you might need to press the Function (Fn) key along with F2 to achieve the same result.

    Beyond basic entry, the source also touches upon efficient data entry techniques:

    • Fill Handle for Series: For entering sequential data like numbers or dates, you can use the fill handle. After entering the initial value (or a pattern of values) in a cell, a small square appears at the bottom-right corner of the selected cell. You can click and drag this fill handle down or across adjacent cells. For numbers, if you only enter ‘1’ and drag, it will copy the ‘1’. To create a series (1, 2, 3…), you need to either enter the first few values to establish a pattern or click on the drop-down arrow that appears after dragging and select “Fill Series“.
    • Auto Update Settings: The source briefly mentions a setting in Excel that can automatically extend data ranges and formats based on patterns. This setting can be found under File > Options > Advanced. Turning this setting on allows Excel to automatically recognize patterns and apply them when you enter new data adjacent to existing data. Turning it off will prevent this automatic updating.

    These methods provide flexibility for entering and modifying data in Excel cells, whether you are starting fresh or editing existing content. The choice of method often depends on personal preference and the specific task at hand.

    Excel Data Entry Shortcuts: Efficiency Tips

    Based on the sources, there are several useful shortcuts to enhance data entry efficiency in Excel.

    • Moving Between Cells After Entry:
    • Pressing Enter after entering data in a cell will automatically move the cursor to the cell directly below. This is useful for entering lists of data in a column.
    • Pressing Tab after entering data will move the cursor to the cell immediately to the right. This is helpful when entering data across rows.
    • Editing Existing Cell Content: When you need to modify data that is already in a cell, you can use the following shortcuts to enter edit mode:
    • Double-clicking directly inside the cell will place the cursor within the cell’s content, allowing you to make changes.
    • Alternatively, you can select the cell and then make your edits in the formula bar located above the worksheet.
    • Selecting a cell and pressing the F2 key will also put you into edit mode, with the cursor typically positioned at the end of the cell’s content. On some HP laptops, you might need to press Fn + F2 to achieve this.
    • Filling Data in Adjacent Cells: Excel offers shortcuts for quickly populating adjacent cells with similar or sequential data:
    • The fill handle, the small square at the bottom-right of a selected cell, can be clicked and dragged to copy the cell’s content or extend a series into neighboring cells. For a numerical series, you might need to establish a pattern (e.g., by entering ‘1’ and ‘2’ in consecutive cells and then dragging) or use the “Fill Series” option from the AutoFill Options menu that appears after dragging.
    • To quickly fill down the content and formatting of the cell directly above the currently selected cell(s), use the shortcut Control D.
    • Similarly, to fill right the content and formatting of the cell immediately to the left of the selected cell(s), use Control R.
    • Entering Multiple Lines in a Cell: If you need to enter text on multiple lines within a single Excel cell, you can use the shortcut Alt Enter to insert a line break at your desired point.

    These data entry shortcuts can significantly speed up your work in Excel by reducing the need to constantly use the mouse for navigation and repetitive actions. Understanding and utilizing these shortcuts can lead to a more efficient data entry process.

    Excel Basic Formatting Guide

    Based on the sources, basic formatting in Excel involves modifying the appearance of your data to make it more readable, understandable, and presentable. It encompasses various aspects, from the fundamental structure of workbooks and worksheets to the visual styling of cells and their contents.

    Workbook vs. Worksheet

    Before discussing formatting, it’s important to understand the distinction between a workbook and a worksheet. A workbook is the entire Excel file you save. Think of it like a notebook. Inside this workbook, you can have multiple worksheets, which are like the individual pages in a notebook where you do your work. Your manager might ask for a specific worksheet (a single page with certain data) or the entire workbook (the whole file containing all your work). You can add more worksheets by clicking on the plus (+) sign.

    Saving Your Work

    To preserve your formatting and data, you need to save your work. Excel provides two primary options: Save and Save As.

    • Save As is used when you save a file for the first time. It prompts you to choose the file name, location on your computer, and the file format (e.g., Excel Workbook, PDF).
    • Save is used for subsequent saves after the initial “Save As”. It saves the changes to the same file name and location without prompting you again.
    • The shortcut key for both Save and Save As (after the initial save) is Control S. If you press Control S on a file that hasn’t been saved before, it will act like “Save As”.

    Basic Formatting Steps

    The process of basic formatting typically involves these steps:

    1. Selecting Data: Before applying any formatting, you need to select the cell(s) or range of cells you want to modify. You can select the entire current region of data by clicking anywhere within it and pressing Control A.
    2. Adjusting Cell Dimensions: You can adjust the width of columns and the height of rows to better display your data.
    • You can double-click the right border of a column header to automatically adjust the column width to fit the widest content.
    • Keyboard shortcuts for adjusting column width include Alt H O I and Alt O C A.
    • To adjust the row height automatically, you can use the shortcut Alt H O A.
    1. Understanding Data vs. Formatting: In Excel, there’s a distinction between the raw data you enter and the formatting you apply to it to make it presentable. Formatting includes things like colors, borders, font styles, and alignment.

    Common Formatting Options

    The “Home” tab in Excel contains the primary tools for basic formatting.

    • Alignment: You can change the horizontal alignment of text within a cell (left, center, right) and the vertical alignment (top, middle, bottom). Left alignment generally looks natural for text, while center alignment can be suitable for headings.
    • Font: You can modify the appearance of text by applying styles like bold (Control B), italics (Control I), and underline (Control U). You can also change the font type (e.g., Calibri, Arial) and font size. Additionally, you can change the color of the font.
    • Cell Styles (Fill Color): You can change the background color of cells using the “Fill Color” option (the paint bucket icon). This can help to visually highlight specific data.
    • Borders: You can add borders around cells or ranges of cells to define them visually.
    • You can apply all borders (thin lines around each cell).
    • You can apply a thick outside border to emphasize the edges of a selected range.
    • The “Borders” dropdown offers various border styles.
    • To access more border options, you can go to “More Borders…”.
    • To remove borders, you can select the range and choose “No Border” from the borders dropdown.
    • Shortcut Keys for Formatting: Excel offers several shortcut keys for common formatting actions:
    • Accessing the “Home” tab functions starts with pressing Alt H. After pressing Alt H, letters will appear over the various groups and commands within the “Home” tab.
    • For All Borders: Alt H B A.
    • For Thick Outside Border: Alt H B T.
    • For More Borders: Alt H B M (likely based on the pattern).
    • For No Border: Alt H B N (likely based on the pattern).
    • Bold: Control B.
    • Italic: Control I.
    • Underline: Control U (source says Control Ya – likely a typo and should be Control U).
    • Merge & Center: To combine multiple adjacent cells into a single larger cell and center the content within it, you can use the Merge & Center option in the “Alignment” group of the “Home” tab. Select the cells you want to merge and then click “Merge & Center”.
    • Turning Off Gridlines: The faint lines that appear around cells (gridlines) can be turned off for a cleaner visual presentation by going to the “View” tab and unchecking the “Gridlines” option in the “Show” group.

    Number Formatting

    Excel allows you to display numbers in various formats. You can access these options in the “Number” group of the “Home” tab.

    • General: The default format.
    • Number: Displays numbers with decimal places.
    • Currency: Adds a currency symbol (e.g., $) and decimal places.
    • Accounting: Similar to currency, but aligns the currency symbol and decimal points in a specific way.
    • Percentage: Multiplies the value by 100 and adds a percent (%) sign.
    • Comma Style: Adds a thousand separator (comma).
    • Increase/Decrease Decimal: Allows you to control the number of decimal places displayed.

    You can also access more number format options by clicking the arrow in the bottom-right corner of the “Number” group. This opens the “Format Cells” dialog box, where you have more granular control over number formatting, including date, time, fractions, scientific notation, text, and custom formats. The Text format can be useful for displaying numbers with more than 15 digits, as Excel might otherwise convert them to scientific notation or round them.

    Date Formatting

    Excel recognizes and formats dates in various ways. You can choose from predefined short date and long date formats in the “Number” group or access more options in the “Format Cells” dialog box. Custom date formatting allows you to specify the exact way you want dates to be displayed using codes like d (day), m (month), and y (year).

    Conditional Formatting

    Conditional formatting allows you to automatically apply formatting to cells based on specific rules or conditions. This is found in the “Conditional Formatting” group on the “Home” tab.

    • Highlight Cell Rules: Allows you to format cells based on criteria like greater than, less than, between, equal to, text that contains, a date occurring, or duplicate values.
    • Top/Bottom Rules: Allows you to format cells based on their ranking, such as the top 10 items, bottom 10%, above average, or below average.
    • Data Bars: Fills cells with colored bars that represent the value in relation to other cells in the selected range.
    • Color Scales: Applies a gradient of colors to cells based on their values.
    • Icon Sets: Adds icons to cells that visually represent their values relative to other values.

    You can clear conditional formatting from selected cells or the entire sheet. You can also manage conditional formatting rules to edit, delete, or reorder them.

    Table and Cell Styles

    Excel also offers predefined Table Styles and Cell Styles that apply a consistent set of formatting to tables and individual cells, respectively. These can be found in the “Styles” group on the “Home” tab and provide a quick way to format your data with a professional look.

    In summary, basic formatting in Excel is crucial for organizing and presenting your data effectively. By understanding and utilizing the various tools and shortcuts available, you can create clear and professional-looking spreadsheets.

    ZERO to HERO in Excel! 📈 Full Step-by-Step Course with AI

    The Original Text

    Hey, have you brought a resume? There is neither AI nor chat, GPT. There is no need to bring a resume like this. The formula does not solve it. Everyone says drink tea, drink tea, the problem will be solved. Drinking tea does not solve the problem. Got my sister married. Did 99 workshops. Did thousands of interviews. Neither did I get a job nor did Excel come. So what happened ? What happened? What happened? Forget it. Now let’s talk a little about the real thing. Single compress features and The formulas range from basic to advanced and now there is a twist of AI in it, so in this video I have covered all the important features and formulas which are important for you if you want to survive in the corporate world. Here we have created such creative dashboards. If we talk about data, we have worked on huge data here, so whether you are a beginner or advanced, we have covered all these things here. What else will be the benefit? If you complete this video, then you get free certification and access to it. You can get data for practice on our app. Yes, you will also get the data which I have used in this video and apart from that, you will get extra data. You can check it under the free content inside our app. Mam, how to know what all I have covered in the video, for that you can check the description where pay time. If stumps are given, then you can go there and jump to your topic in a single click. So, if you want to do live training with us, that too on many accounting software’s, data analytics and finance, then you can join us. You will get all the information in the description, so check it quickly, like it, comment and don’t forget to subscribe because a lot of courses are coming, be it Excel. Pabi I have SQL, SAP, Telemark busy, so many courses, don’t wait too long, let’s start this video right here, let’s get started, now stop wasting, watch it, let’s start from the very beginning. If you want to read about Excel, then first of all you have to open Excel, then go to your search engine and type excel from here, after that you can open it from here, it will hardly take 5 seconds and your Excel will be open with you. There may be different versions, the version we are using here is 2021, it will take a little time and will open, see that it has opened and here we will maximize it so that the entire screen is visible to you, now it is possible that if you are opening it for the first time, then all these files will not be visible to you, whatever options you are seeing, all these will not be visible to you and if you are already working. Your files will be visible here, after that you can see Home New Open here , we will read about them later, here you can see that there is a blank workbook in which we work and apart from this, many templates are also made, here you will get more templates, so basically what are templates, see, it is simple, when suppose you are doing some work from scratch, then you will go to the blank workbook, but what are templates? Let me explain with an example, suppose you have 10 pictures and now you have to make a video of them. So what do you do? You go to some app, put those 10 pictures and choose a template and put it. There are many effects inside that template, there are a lot of stickers, there are a lot of text, there are a lot of frames, it automatically gets applied on your pictures and a video is prepared for you very quickly. So that which is ready in a second, what is it, that is your template, so in the same way, if you do not want to do any work from scratch, then here you have many templates available, you can use these templates, all you have to do inside it is your data, you can save it in it, you can do whatever you have to work in it, like this is a bill page checklist, you have to do some work in it, you open it and do the work inside it. You have to do something else, this is some weekly attendance report. If you want to work in it, you can do it in it. It has already created many templates in this way, if you want, you can use them. Here you also get to know how Ekal works, like Get Started with the formula, the formula is explained in detail, Power Query, Pivot Table, Pie Chart, if you want to see then you can see these also. Above you have it saying that suggested search, if you want to do any search, search from here, if there is any template related to it, then it will appear in front of you, here you get lots of templates, okay, let’s go, now we will read further, because we are studying from scratch, so what will we take, we will take a blank workbook because we have to learn to create all the things ourselves, so what you are seeing right now is Excel as is. You open Excel, you get this type of interface. Now the first thing we are going to do is to do an interface overview. What are we going to do? So let’s do that. To do that, I have found a way to do that, just because you have understood everything, so I have already taken a screenshot of this entire screen. From that screenshot, now I will be able to draw, I will be able to explain each and every feature to you very well, so I did one, now as soon as I move it down a little bit. And let’s zoom it from here so that it becomes easier for you to understand and from here we take the draw, see if there is a different feature visible on the top or any feature is visible somewhere else, then you do not need to worry, these features can be added to you too, how will it happen, we will add it now, okay, after that, now we start reading, you will see the Excel logo at the top most, this will let you know that you have opened Excel, after that You have the option of auto save, for now it is off, you can also keep it on so that the work you are doing gets saved automatically. In any case, you were doing some work, you were working on a big data and suddenly the light went off, your system is not charging and it is switched off, then in such a case, even if all your data is lost, it will continue to be saved. You can save it from here , at any place like let’s say this is the option you are seeing. Let’s say Quick Access Tool Bar, what is Quick Access Tool Bar ? There is an option of Redo and Undo, so you can do it directly here only. If you want to keep something else here, then you click on it. Whatever you want to keep here, you can keep it here, like Touch Touch Mouse Mode, Sort Ascending Descending, Spelling Check, Quick Point of Email, Open key, New key, whatever option you want to keep, you can keep it here. I find these options to be the most useful like there is an option to save or undo and so on. There is an option of Redo, I find these the most useful, so I have kept them here, you think something else, don’t do anything, see where my cursor is going, click on this dot drop down and add any option from here, OK, now let’s move forward, when you open Excel for the first time, then by default the name that comes here is Book One, so this is your file name, this is the name of your file, basically this is the current name of your file. The name given is Book One. Can we change it? Yes, of course we can. Is it mandatory to do so now? It is not at all mandatory. You can change it even when you are saving it. You can give whatever name you want to give. Yes, of course you can give it as per your wish to save it. You can do it by default. What comes is Book One, Book Two, Book Three. Now I open another file just because three files are already open, so by default that is it. What name will come, book four will come, you can change the name if you want, you can do it, after that you get this search engine inside which you can search, earlier if there is any file created, if anything is created, then you can search it here, after that look above, you will see all the same options, because we have taken the same screenshot of this, so that you can understand easily, here you can see my picture here. It is coming and here you will write ‘TS’, see, ‘ Not for now’ it is writing ‘Coming’, the picture is visible. Otherwise, the initials of your name are also visible here, so here I can tell you that this is just because I have logged in, this is my licensed version, so your picture will be visible here or the initials of your name will be visible. These three things will help you to minimize and maximize. You can save your screen by using this cross. You can also close it directly. After closing it, as soon as you cross it, it asks you whether to save it or not. It’s totally up to you. If you want to save it, you can do it. Look, these are the options here. Okay, I was talking about these options. Let’s go here right now, we are not going to get any other option in the left most left. That’s it. There were options which we have explored. Now let’s move towards this side a little bit. See, always remember this thing, whether it is single or any software, it is full of features and Excel has a lot of features but do we have to learn all the features. Do we have all the features visible on the screen here? So the answer is no. Okay, we do limited things which are useful to us, we do those things. Now as you can see, here I use a different color like you can see here. It is File Home New Tab Insert Draw Page Layout Formula Data Review View Help Acro, you may not have some options in the middle like it is not a new tab, whether it is a draw or not , then this is the one of Acrobat, it is okay, we can add it, I will tell you how to add it later, but what do we call these, what do we call these, what do we call tabs, what do we call tabs, file tab is home tab, new tab is insert tab, draw tab is page layout. If there are tabs, then these are your tabs. Now you will see a color difference. Here you are seeing a color difference, which is charcoal yellow and sorry, charcoal gray and this one above is black, right, meaning there is a box inside this black, what do we call this box, what do we call this box, what do we call ribbon, what do we call this ribbon, what is ribbon, so basically there is a tab at the top, there is a box below the tab, inside which all the features are given now about it. We will read in what is that box called ribbon, that is, there are things given inside the ribbon, okay after that you can see that there is Clipboard, then there is a line, there is Alignment, there is font, then there is a line, there are numbers, then there is a line, there is style, then there is a line, look, the same thing is there in other tabs too, there is insert, then there is tables, then there is a line, there is illustration, then there is a line, there is charts, then there is a line, there is spark line, then there is a line. What is this basically that you are seeing, what is this, so let us read it, these are our groups, if I talk about what is alignment, what is font, what is clipboard, what is number, what is style, what is cell, what is all this, what are your groups, what are groups, basically if suppose I have to do some work related to font, then the whole Excel has been put in this group, then inside it you will get all the options scattered like this. No, if it is in a very organized way, then this is your group, this is a group of fonts and inside the group, like this is visible to you for the font, this is the BiU border color and all these things which are there in the paint, so these are what are inside and what are the features, these are the features but the group that has been formed which means within which these features are, each one that is visible written below is your group. If I talk about insert, then the table is a group. Illustration is a group, Chart is a group, Spark line is a group, Filter is a group, but if I talk about page layout, then theme is a group, page setup is a group, scale to fit is a group, sheet option is a group, arrange is a group, so in this way it is a group and all the things that come inside it are its features. Got it, no one understands anything, there is no doubt anywhere, please let me know in the comment section, this is the whole thing . The session is going to be quite long, so there may be n number of doubts in it, so you keep writing down the entire doubt, wherever it is, you can tell it in one go, you can tell it separately, no issue, but you must tell it so that it can be replied to and you can get clarity about it. Okay, so you keep writing the note down and after that you will tell it because you are going to read it completely, right, so let’s go a little more. Let’s move ahead. After moving ahead, we leave these two options. This or 28 and this is visible. We will understand later. Now we will go down. What we see is this sheet one. So we call it sheet. What do we call sheet and with this plus sign, we can insert more. Add, insert is the same thing, we can insert. Now suppose I have created many sheets here, I want one more sheet, I come to this sheet, once the last sheet is here, I did plus, then look, another sheet has been created, I have this sheet inside it, it is by the name of sheet 14, it is fine, I have to delete it, I right clicked on it, I have deleted it, I come to the first sheet, look, by following these three dots, these three dots will appear in your sheet only when this one of yours. The portion will be filled on the screen. This portion will be filled only when there is nothing to do further. Otherwise, the option to do further will not appear. Okay, from here you can increase more sheets. After this, the options that you see are these options. Here on one side there is this and on the other side there is this, both of them do the same work, do the work of movement, do the work of which one do the work of movement and The movement it is doing is basically the one which is taking you left to right, left to right and the one above is taking you up and down. What is it taking you up and down? Okay and what are these two called scroll bars? What are scroll bars called? Okay, we call them scroll bars because it is helping us in scrolling. Now I am also showing this to you by zooming. If I am telling you, what I am doing is going left and right here and there like this again and again. If I want to go up and down then I use this, so these are our scroll bars, after that the options you will see are these three types of views. Okay, there are three types of views, so what do they mean? Look at what they do. Understand that, which is the first view. I take it for a second, which is the first view, what is the first view, what is your first view called? The first view is called normal view because it is the normal screen and you will see it in normal view, so what will we call it? Normal view which is the second view and is your page layout view. Well, if you go near it, it will automatically tell you the name. Like, if I moved the cursor here, this name came automatically. What is page layout? What is page layout? What does page layout do? Suppose you have to check this because you have created the data and then after that. Obviously, if you take a print out of it, then you have to know that later on, if I take a print out of it, then my data is not getting cut in the print. If I do this, in any case, if you want to check this thing, then you can do it like I suppose, now I click on the page layout, then it is showing me that if at today’s time I go to print it, then my data will be cut in this manner. You can see in different pages, it will be cut in this manner, so now. I can adjust my data accordingly and on clicking on the normal view, the normal work that we do is good, after this comes the page break view preview, so you can also see directly how the page break is happening, so it is showing me the page, in this way, this line is visible, this will become one page, this will become the second page and the rest will go in the third page. These four pages of yours are being created because you have written below also, in this way. This gives us the view, for now we have taken this normal view, so from here you understand the three types of views. Okay, after that see what is the option you are seeing here. I take it for once. Yes, after that what is this option you are seeing? Just give me a minute, look, this is what you have, to zoom in and zoom out, you zoom in and zoom out to zoom in and zoom out. From here, look at the zoom of your screen. If it is zoomed then it is at 175. Now if we zoom in then it will reduce. If we have to do more then it will become more. So if you want to zoom in and zoom out then you can do it directly from here. So here you have learned most of the things about the interface. Now let us move a little further that inside the interface you will see this in the middle. Just because when we started Excel, it was looking like this, so here they are coming in the form of boxes. So, what do these boxes mean? What are these boxes, what are they called, why are they called, why are they there, now we are going to understand the meaning of all these. Okay, now you have understood what we are going to understand, as much as you have understood is enough, now we are going to read about these boxes, so let’s just give me a minute, we have come here, look, you know that we are going to read about pay boxes here and the boxes that you had read till now, in what way were they coming, a line was coming like this. One line was coming like this and then one line was going like this And one line was going in this way and after that it was coming in the middle as a box, it is coming in the same way, look at the side, see this, a line is coming from here, a line is coming from here, a line is going from here, and a line is going from here, by doing this this box is getting formatted and what do we call this box, I am talking about it, so what do we call this box, we call this box, okay, what is this? Let’s say cell, let’s say OK, I understood that all the boxes in our Excel, we call them cells, so from now on, whenever I say something, I will not say box, I will say, is this work to be done in this cell, is this work to be done in this cell, okay, let’s go next. We see that you are looking at the top A B CD, so I can say that this line is a, this line is b and you are seeing numbers written on the side. So I can do one thing, I can write this as one, I can write this as two, so that means this cell is made up of a and b and one and two, so what do we call a and b, what do we call a and b a column, what do we call a column, this is a, not a b, from now on we will not say that a is b or b is a line or c is a line, there is a column, we call a column, so from now on, what will we call a, column a, what will be the meaning of column, then this a As far as this is, the entire line of b means the entire line of b means the entire column of c means the entire column of c. The entire column of n. The entire column of What is completely there is called row, we do not call it line, we call it row. Okay, so now I can say that look, to make a cell, I need columns and if I need rows, then I can say what is needed to make a cell, column is needed, row is needed in plus. What are your columns? What are your alphabets, which you can see on the top and what are your daily lives, they are numbers. Okay, together with them, your cell is formed. Now suppose we will understand which cell is which cell? They understand that suppose I am on this cell, look, now not only the grid lines are off, that means the lines themselves are off, the cells are still being formed, so let’s do one thing. I ask here, here I explain to you how we understand the cell. Now this is a cell. You look above, the color of all the others is of the same type, one has become a little darker, that means this is the income column, this is the eye column, also look here, which one is this 90, so this 90, so what does it mean? This cell is made up of what is it made up of? Aa is made up of columns and 90 rows. Because now you have not understood that a cell is made up of what? It is made up of a column and a row. So what is this cell made up of? I is a column and a row is 990 so what is its name? The name of the cell itself is called aa 90 and look here i 90 that is why we call this box the name box. If you go to this , this is our name box, that’s why we call it name box because it tells us the name of the cell, so that’s your name box. Okay, why is the name box telling us because it is telling us the name of the cell? How will the name of the cell come? Now we will find the name of the cell. Look, we have come to this cell, quickly tell me which cell is this. Look, what is this cell? Look, what is darker from here is j and from here 67 That means j column consisting of 67 rows. This cell has been created and what is the name of the cell j 67 So here is your g67 Suppose I have to do the same thing here now so tell me what is its name its name is q So we will see our column from here 66 Your cry So what is the name of this cell q6 66 So you can see here it is coming by writing q66 Got it understood one or two more let’s see here Suppose I clicked here So what is the darkness here Look at the dark color here What is darker is v and from here darker is 65 that means v column 65th row and what is the name of our cell become v65 ok this is how we do our interface this is how we name our cell this is your name box now you have learned three to four things what have you learned look at all the alphabets written here all the alphabets written what are your columns and see all the numbers you have seen here You can see the numbers here , you can see the numbers, I am just telling you this, okay, these are your daily occurrences, okay, and here, this is a box which is made, we call it a cell, now you have Learned Name Box. Now suppose you write something inside a cell. Now I am telling you to write inside the cell and after that I am explaining the difference in it. This cell is yours and inside it you start writing anything, so if I am writing anything then it is visible above here. So, whatever you write inside a cell is written here also, that is why it is said that if suppose it comes outside the cell and I have to make some changes in it, then to make the changes, if I If I directly change from here and write the taan here then see it has taken the taan here also. If I have written the taan here then it has taken the taan here too. If you have not written anything in this cell then look above it is empty. If it has been written in this cell then see your writing has come in it. You have written something in some cell. Look and it is being written here and the other way around. If this cell is empty then this cell is empty. So in this way, whatever you write inside any cell is written here also. This is why we call it the formula bar. Later , when you will put the formula and write it inside the cell, you can edit it by looking here instead of looking inside the cell. So this is your formula bar where your formula will be shown because the value is shown inside the cell, so this is the formula bar. Gradually, I will explain it better. I will explain it better where we will learn to do data entry. Now I will be able to explain it well. I zoom it out and make you revise the whole thing for once. As you saw, you get exactly the initiative cross, after that you get this file, home new tab and all these, what are yours, these are your tabs, if I go to home, then if I ask you, clipboard, font, alignment , number, what are all these, these are your groups, inside the groups, what are all these available to you, these are your features available, this is yours, this is your name box, this is your formula bar. Your A B C D E F G H What are all these, your columns, all the numbers you have written, these are your days, all these things are made below, this is your sheet, with Plus, you can create more sheets from these, with which we go left, right or up and down, what are these called scroll bars, what are your views, the first one is the normal view, the second one is your page layout view and the third one is page break view and from here you can see it. If you can zoom, here we have completed our interface. Now let us read about our next topic, which is workbook and worksheet. Now we will understand workbook and worksheet, what is workbook, what is worksheet, let’s understand with an example. Okay, Raju is a student. Raju is a student. Okay, and he goes to school, he goes to school, he has four He studies subjects basically Hindi, English, Maths and Science. Okay, he studies four subjects. So now you tell me that if he makes a joint notebook of all four subjects in which he writes the homework of all and does all the work inside it, then will it be okay? Can he do all the work in one notebook? Tell me, can he do all the work in one notebook? The answer is no. He cannot do all this work in one notebook. What will he do? That Means will make one notebook for one subject, that means there are four subjects, so there it will make four notebooks for each subject, inside each notebook it will do its work, Hindi inside this, English inside this, Maths inside this and Science inside this, oh ok, in the same way Raju makes each notebook for each of his work, That Means makes a separate notebook for each of his different subjects, in the same way, when we work, we are different. They create files, what did they create, notebooks, what did they create, notebooks for their different works, but what do we create to do different works, what will we create, we will create notebooks, we are not studying in school right now, we will create workbooks, basically, inside Excel, when you create different files, we call them workbooks, you have seen so many of these things files here in the file tab, these are different files, right, that means these are my different workbooks, that is why. Here it is written Recover Unsaved Workbook More Workbook What is the meaning of workbook this blank workbook is ok so what is the meaning of workbook this is this file this is this file and there suppose now Raju has to work Raju has to work now let’s take another example he is making a Hindi notebook he is making a Hindi notebook and there are 10 chapters inside it how many chapters are there in 10 chapters okay so what will he do what will he do one Will take only one page and will write 10 chapters inside it. Isn’t it possible? And anyway, if a page ends at the top line, you still go to the next page because I have to start chapter two from a separate page, chapter three has to be started from a separate page, chapter four has to be started from a separate page, so we call it that we make separate pages, that is yours, what is called here. Now as if I have to explain it to you, I only know the basics of Excel but here I have created an interface for you in the first sheet, I have created a workbook for you in the second sheet, I have saved the file for you in the third sheet. In this way, whatever topic I will be teaching you, I have created it here so that it becomes easy for me, so in the same way, the pages in the notebooks are pre-defined. What does pre-defined mean that the notebook you buy? It depends on whether you have bought 200 pages, whether you have bought 300 pages or bought 500 pages. This happens in the sheets. You can insert as many sheets as you want here. You just keep clicking on the plus plus sign and you will get that many sheets. We here, the pages are already available, they are already given, we do not already have the sheets. If we have to do any other work, do a plus and create another sheet, so here are our pages, basically the pages inside the file where we will work, that is your worksheet, so now you understand, workbook is the whole file, workbook is the whole file, and inside the workbook there is a worksheet, inside the workbook there are worksheets, so now if your manager is telling you that Tarun, I have taken a random name like this, Taran, you send your worksheet. If you give, then you do not have to send the entire file, you have to send the sheet where the particular work has been done, they want the sheet and if they say send the entire file, that means if you have done let’s say five-seven tasks in it, then they have to see all the work of yours, so that is the main difference of workbook and worksheet, its use will be that now you will understand when there is a conversation, there is a conversation about Excel, now you know. What is workbook and what is worksheet and this example was just taken from me so that you can relate it to it. Now your topic has been completed here. If we talk about the interface, we have covered the maximum things, we have completed the interface. Now I am going to teach you the next thing. See the save file. When you work, it is obvious that you would like to save that work. Suppose my This is the file on which I am explaining different things to you. Obviously, I would like to provide you this file, so to provide this file, I have to save it, so we save it by going to the file here. After going to the file, you get the option of Save and Save As. So now let’s understand it a little bit. What is Save S and what is Save. Let me just zoom it on my screen first, so I have this here. I have zoomed in and here I have taken the pen, see there is an option save as and add a save. Save as means in which way do you want to save it. When you save for the first time, it gives you the option of save as, that is, it asks you at the initial level, in which way do you want to save it, do you want to save it in Excel file or want to save it in some other form, where do you want to save it, where in your laptop. Do you want to save it, under what name do you want to save it, he asks all these things at the initial level. Now suppose we will take today’s date, that is, today you have saved it on any date, now tomorrow you will open that file again, if you work beyond that, then you will not have to give it name and location again and again, you have done it on the first day, after that you have to save what you say in the subsequent subsequent times, now after that for the first time. After this, every time you save, you will save the same thing. If you have to change something, then you will do the save as again. You will go and save in the other wise. The shortcut key for both of them is Control A. If you are pressing Control A, then if it is a file for the first time, then automatic save as will come and if that file is already created, then it will automatically get saved. By saving this, you will get the idea that OK, fine now, save as. There is no option, it means that this file is already running and already saved. Okay, so in this way we would have two options. The first one is save as, the other one is save. For the first time, when you save, the save as comes. By pressing control s, we are able to save it. Now I have to press control s, control s, then this pass option comes. If suppose I do not press control s, then what kind of option would I have, it comes in this way. If I do save as, then basically I have to browse here. I have to tell me where I can save it. If you want to find a place in your laptop where you can save it, then you take the option of browse, you click on it, here you can check any location, where do I have to do it, I have to do it in my volume D, I have to do it in Accounts Expert and from here in Advanced Excel course, going to Sheets, what we are doing right now is that we are doing the basics of Excel, inside this we have to save it here and that too in what name to save it Part One Over Part One Interface Overview I want to search by its name, so I saved it here. If suppose you want to change any format, then here you get many formats, you can save it in that format, you can even save it in PDF, you can save it in CSA, you can do it in whatever you want, but now in which we will do it, we will do it in Excel workbook, so we clicked on it and here we saved it. After saving, now we have saved it, right? Now suppose I cross it out, I have crossed it out, okay, we have crossed it out, now we go to that folder of ours, go to the new volume D, go to Accounts Expert, go to Classes, sorry, no classes, this is your file youtube0, you click on it and it will open and you will get all the work that was yours as it is. Okay, now whenever I have to do some more work, I will not save it. Now suppose I write something else here that this is how we Save the files, then I write something else here, here I write what is the shortcut key or what is this, I write this is the shortcut key, I have written this, now suppose I want to write the shortcut key in my new file because earlier I had not saved it, now I have not saved it, I pressed control S, then see this is what happened back then, now I cross it out and after that go back to the folder and open it by double clicking from here. After opening, see this is automatic in my Now suppose I have written the shortcut key here, let me tell you here, suppose I have written the shortcut key , okay now I am not saving it directly, I am crossing it out and why am I asking this again because it is saying that you have not made any changes in it, have you made any changes in the previously saved one, now do you want to save it or not, now if I want to do it, I will have to tell him. Save because I was going to cross directly, if I wanted to do control s, then it would have been saved as it is. Now after this, whatever I keep doing any work, that is why if you are working in a big data, then you can do control less again and again so that it keeps getting saved. Okay, so here we learned how we save our file. Let us move a little further. How can we do movement inside Excel. What is movement, let’s say this. This is my cell and after that I have to go left, I have to go right, so whenever we learn anything here, where we have to learn shortcut keys and other things too, we will always work in two expectations. What are those two expectations going to be? The first expectation will be yours. Here, if we have to do any thing directly with the mouse, then how can we do it? The next one is the keyboard that I am telling you how to do anything with the keyboard. When we talk about the keyboard, then obviously our short tricks come to us that how can we use the short tricks and make it work directly. There are many such short tricks for many things, but I will tell you the main things, which if you think, this is my repetitive work, remember its shortcut keys, there is no need to remember them all, because if you remember so many, you will get loaded. End After that, you will not be able to remember everything, you cannot even remember everything, it is not practically possible to remember everything, that is why whatever repetitive work you do, those things are your shortcut keys. You can remember all that in that, so see, now we are going to start now the shortcut keys that we will do or the things that we will do that we will learn about what are we learning about the movement means to move here and there in Excel, so how can we go, if I talk about moving here and there in this cell, then wherever you click with the mouse, you can go there, second thing, if I want to go to other sheets, I can go to other sheets by clicking anywhere. The third thing is, if I want to go to another workbook, then suppose I open another workbook and this is I have opened one workbook and I have opened another workbook, this is one workbook, so in such a situation, if I want to go to another workbook, then I go here, I do not click, it will come automatically. In this way, I can go to each one, so it was like going with the mouse, but if it comes to the keyboard, then what do you have in the keyboard, first of all, your The only thing you need to go anywhere are your arrows. What are the arrows? What do you get in the arrows? You get to go to the right side, you get to go to the left side, you get to go up, you get to go down. You can go in any direction here through the arrows. Look, I am moving through the arrows, okay, this is what we are moving through the arrows, I understand, okay after that. The thing that you get, the arrows are also for now, what do you do later, as soon as you start working, you start practicing, your work starts increasing, then there you have more keys also, if I talk about going to the right side, where to go to the right side, then you can go to the right side, you can go to the right side by pressing tab, by pressing what, by pressing tab, now my cursor is near D, which means it is in the cell, now we are pressing tab, so we are going to the right side, if I have to go to the left side right there. If we have to go down then I will tell you what to do. For now we will understand what we will do if we have to go down and after that if we have to go up then what will we do. Basically when we have to go down then we press enter, then see it is taking us down by entering, then press enter. See, you have learned about right side and learned about down. As soon as we start doing its opposite, meaning the opposite of right is left and opposite of down is up, then our keys remain the same. Tab is just put shift in front of them then it will come shift shift tab and it comes shift enter what comes shift enter ok now suppose I want to go right side then obviously I will press tab ok now I want to go left side then I will hold shift and go while pressing tab then it will come here automatically. If suppose I want to go down then I will keep pressing enter and if I want to go up then I will keep holding shift and If I keep pressing enter, it will go up, so this was your move from one place to another cell within the sheet, then you can use it in this way. Now it comes to the point that suppose I have to go from one sheet to another. See, no matter when we read, in which direction do we read? In which direction do we move? In this direction means in the direction from left to right, we go right, so whatever we will read now. You read it in the same way, if you have to do movement inside the sheet, if you have to do movement inside the sheet, that means you have to go left to right, if you want to go left to right, that means you want to go in the forward direction, then what will you press: Control Page Up, Page Up, Page Up, Sorry, Page Down, that means you are going downwards, no, you are going downwards, so what will you press here, Control Page Down, down and right there, you are coming right to left, that means going upward. Well, it starts from here, I am going towards this side, so I am going page down. The beginning is here, so I have to go upwards. Basically, I have to go here. From left right, I am moving towards left left. So what we will do here is control the page up. Okay, this was the point when in the sheet, if I have to move within the workbook, that means I have to move from one workbook to another. If I want to move from one workbook to another workbook, then I press the control tab and automatically jump from one workbook to another. What did I do? You hold the control tab control, it is okay and go while pressing the tab, then you see, I have gone to another sheet also, so it is fine here like this. I understood that if anyone does not understand anything, then I keep saying this again and again that you You can tell in the comment section, I will reply to it directly and whatever doubts you have, keep writing along with them. Either keep telling together or make a note together. Lastly, you can tell it in the comment section. So here we have learned our movement. This is what I am doing with the scroll bar with the mouse. If you want to go up, which one can you go? Either you can use the arrows or you can press shift and enter. You can go up by Shift Enter, you will go down by Enter, you will go down by Shift, Tab, you will go left, Tab, you will go right. Okay, from Control Page Up, you will go to the interface overview workbook, from Down, you will come back here, so this is the way you work. Now suppose you have a very big data and you have to scroll down and go down, then it will take a lot of time to scroll down, so in such a situation, if we page up, then of course you will reach the top, just page up and page down. If we do this, then we can do fast movement down below. For fast movement, within the sheet, you can use page up and page down, so I write here. If you want to do fast movement within the sheet, you have to do fast movement with in the sheet, just because you are going to get this sheet, that is why I am giving you everything hand written, so that whenever you open it later and see, if you do not get everything, then write it for fast movement. So what have we done, when we have to go up, what do we use? Page Up, just press Page Up, OK, don’t press anything else, and if we have to go down, what do we press, Page Down, let’s go for a second, okay, till now we have done all the keys for our movement. Now what we are going to do next is to do data entry. So far, we have learned all the things, that is, how to move, what is anything, what can we say, now the work that has to be done has to be started. So now we will start our data entry shortcuts. Initially we will learn the shortcuts that how to write things inside a cell. Now see the data entry shortcuts that we are learning. Suppose you go to a cell and you obviously have to enter data. So either you go to the cell and start writing anything directly. Like I wrote my name, I started writing directly and pressed enter and what comes from enter comes down, so this came down if I was in the cell. And after writing, if you press tab, it goes to the right, hence these keys are used. Okay, you were here, you started writing anything directly, you wrote it. Now I understood that oh my God, what did I have to do, I had to make T of Tanu bigger and S of Single, now I have to make some changes inside it, so understand how the entry inside the cell is done. Now if I have to enter inside the cell, then either I will double tap, in which position I go. Here I am, I want t, I went here and double tapped, then my cursor came here, after that I put control t here, which means A from here, I will write it in capital, okay fine, one way was this, the other way, what is this, the second way is that suppose now I had to do it in small, I have written it wrong. The second way is, I can go to the formula bar and fix things directly, whatever I want to do, that is why the formula bar is there because of the cell. The same thing is written there, you press enter, then this is yours, okay, the third method and I will tell you because if you do not want to double tap, you do not need the help of mouse, if you want to go directly, then you can go inside the cell directly, you go inside your cell. Now suppose I had to do it in capital only, then you press the function f2 or press f2 directly, then your cursor will come at the very last, now you wanted a single or from the side arrow. You come to the side and make it S and you come to the side with the side arrow and you make it T and after that you enter, then your name will appear in this way, so what are the ways you have to enter any cell, basically what we were talking about here was about entering the cell, how to enter the cell, how to enter the cell, so if I talk with the mouse, then you can enter directly, there is no problem. If I talk about the keyboard, then what all you got in the keyboard, you can do it directly with the mouse and also for the formula bar, you will need a mouse, so I do the formula bar in the keyboard, you can either go to it and double tap or double tap and your cursor is there. It has gone inside or you can press f2 or in some laptops like HP laptops, this thing is also seen that you have to press f2 with the function, then go and enter f, then you will get a key on the side of the control, press f2 with the function, you will go inside that cell, in this way we enter inside the cell, in this way we write our data, now we will enter the complete data in actual. Now we will learn that if we have to write inside a cell, then how to write that also. Now let us move towards our entry. See, now what we are going to do is we are going to do data entry and for data entry, first of all we went to the first cell. Now whatever I want to write, I can start writing directly just because there is nothing inside that cell. So now I wrote the serial number. After that I wrote the party name. After that I came to the side and after that what I wrote here is cells. For now, we are directly creating a small data, so we have created a very small data, after that I wrote one here, here in the party, sorry, party name, I have given the name of some party, I have written my name, after that I come here, I have written any amount here, after that I will write two here and here I will write any other name. Now see how tiring it will be. I write any amount here. It is so tiring that again and again I have to be serialized. If you have to write numbers then what will you do to avoid having to write serial numbers like this again and again, then delete the second one, first write whatever you have written there and then look inside it, look here, now your cursor is like this plus and as soon as you go to it, another plus is formed. A small square is visible, so as soon as you go to it, click on it, hold it and just drag it down, so for now, what it did is it copied it. The same data which is written above has been written below because we had written one, so one has been written, so now click on this drop down on this box and choose fill series from here and after that it will fill the series and give you it, so you could drag as much as you wanted, you could drag it directly. Now if you want, you can write all the names here, you can write any name here, okay, you will keep writing any name and whatever is your data will be created here, I will quickly do something else. I write the name here, you can take the help of your shortcut keys, movement and all these and can use them only. Okay, so we did this and we will write some more names here like and here we write some amounts. Okay, so here you have created your data. Okay, in this way you write your data. Whatever you write in it, inside your sheet, in this way we enter our data. If you want to edit something, then you can double tap that cell. You can go in or you can go with f2 or you can correct it with the formula bar, so this was the way of entering your data, the way you have done it now, let us move ahead towards our selection, see how the selection is done, for this I have already taken a data, here now let me tell you a little bit why I am doing the selection, what is the need, what are you going to read, selection means that suppose you select something or something. If you want to apply for Pay then you will have to select it first. Let’s understand from an example. Suppose you are using your phone, okay, you are using your phone, you are using your phone, okay inside the phone, you will go to WhatsApp2 inbox and go there and paste it and whatever you had to copy there and after pasting it there, you will send it. Correct, you do the same thing, if suppose you are directly forwarding a message, there will be a forward arrow like this. If you are using this too, then this is also selected first, then you understand that no matter what the software is, when will you be able to apply any work, when will you be able to select that work first, the thing you select and the thing you apply will be applied only on the thing which has been selected, the message you select is forwarded, the same message is forwarded, the rest do not get done, to do the rest, you will have to select the rest as well, so here what is We are going to learn that selection, we are going to learn that when we work inside the data, we should know the selection , how can we do the selection, so look at the first expectation, so like I always tell that we study in two aspects, the first one is mouse and the other one is Keyboard, you can select the whole thing with the mouse. In this way, you click once and then hold it, do not leave it and take the selection till the selection you want to make. What can you do apart from this, apart from this you can learn with the help of the keyboard. Now with the help of the keyboard, the thing we are going to learn is the first thing we are going to learn, we will learn complete selection. What will we learn complete selection? Suppose, let me give you my data. If I want to select the data up to where the complete data is written, then I press Control A because I have made complete selection means all data selection, all data selection now all starts with All starts with A, so we have put Control A. Okay, now let’s do this selection, first of all we selected it and then came here and selected it. Click anywhere in the cell. Okay, press Control A there till the data is written. Selection will be done, OK, you click anywhere, after that you will use control A, then as far as the data is written, selection will be done, that is done, if we want to do complete selection, then how can we do it, after that comes single click selection, you can write this, these are some terms, we create them to understand ourselves, it is not that things will work on the basis of these terms, so what will we do now, single click selection, but there is one thing in it, you will be able to go till that point. Selection has to be done as far as the data is written. I give here as far as the data is written. The data is there or is there. Okay, so if you have to make a selection till then, what do you have to do? You have to hold the control shift and then use the arrow. Now the usage of the arrows is up to you whether you have to go up, go to the right, go to the left. It’s all up to you, so right now the data you have, suppose I tell you that you are on the reference number and you have to go till 10. If you want to select up to 15, then if you press control A then the entire data will be selected, but we do not have to select the entire data. We are here and we have to select up to 15, so we will hold the control shift, after that press the down arrow, then the entire selection will be done. In this way, we have to select till the data is written. Suppose I am on this entry and till this data is written . If I want to make a selection, then if I press control A, then the entire data will be selected. I hold the control shift and after that press the right side arrow, it will come till the data is written, suppose I write any values ​​here also, write anything here, dozen matter, we have written this here, okay, after that I come here to five, hold the control shift and press the side arrow, so as far as the data is written, the selection is done, understand. Hey everyone, I hope you all have understood, but if you don’t understand, if you have any doubt for a second, then you can ask me in the comment section. So here we have understood that how we can select a single cell with a single click, how we can select till the data is written. Now comes the third thing. The third thing comes to you is that suppose you have to select a single cell, that means you have selected the entire cell in one go, right? If you want to select a single cell, then till now you were doing it by holding both control and shift. Now you have to hold only shift and then use arrows. Okay, then use arrows. So let’s do this and see what I am telling you. Look at the reference number. Suppose you are on the reference number and you have to select up to 10. Now if you assume that if you hold control and shift, the entire data will be selected, then this is also not required. After that, if you assume that you are on the reference number. If you go and use control shift down arrow then selection will be done up to 15. If you don’t want this then what will you do. Don’t even touch the control. You have to hold the shift and just tap it tap tap tap tap tap. You keep doing it. Down arrow will come to you and you will select one cell. What did you do by selecting one cell each? Okay, it is all up to you as to how you want to make the selection, so it was your selection that if you want to select a single cell. So you press shift and after that all your selection will be done. So the thing you learned here was that whenever we have to do any work in the data, how do we do the selection? You must remember that if you want to select the complete data, then control A will be used single. If you want to click selection then these controls will be used shift and arrows and single cell selection sorry in single click selection and if there is single self selection then we will use arrows by holding shift. Now let’s do our basic formatting just because we have data entry. Selection has come so let’s understand a few more things. Now let me explain to you. For adjustment adjustment, let ‘s take another sheet for once. We are on the selection, after the selection, we tapped and after that see rename it here. If the sheets do not have a name then we will not be able to do so, so we will right click and rename it. What will we do with the adjustment? So let’s move on to the next thing that we will learn. We will learn what to do with adjustment. Now let’s see what adjustment is to be done. Suppose I write my name here Tanu Singhal. Now you see what I have done here. The name is written, it is written in b2, but the name I can see is also visible inside c2. You are able to see, I can see it inside this cell too, so have I written something inside this cell c2 also? Look inside b2, Tanu Singer has been written. Nothing is written inside c2. Your formula bar can tell you this, so what is happening here, what is happening here is that all the cells of ours have a particular width. If you You write some data inside it which is bigger and we will have to do its width adjustment ourselves. Now its width will remain the same but now we can adjust it. Now how is the adjustment done. You pay attention to my cursor. For now, which way is the plus? This is the plus of this way. As soon as you know where you have to make the adjustment, where is the extra coming inside C? Is it coming inside C, right? If the space between B and C increases then your work will be done. You will go to the middle of C and see your plus has changed. You are seeing that your plus is changing. Correct, your cursor is changing. Cursor is changing. What does it mean? Now you can make a selection. You click on it, hold it and just drag it as much as you want to drag. You can do this much, you have to do this much, you have to do this much, you have to do this much or you have to do this much, it is your choice, I have dragged this much, so look at your cell. The width must have been increased. It is in between these two that you will have to select the complete column. You can do it in this way. Similarly, if you have to increase the height also, as you are going to this, your plus is getting changed. You can do it like this. Okay, you can do it in this way, but I was just telling you about the width, but what happens is that if we assume that I have done this with the mouse, we will not do everything with the mouse, we will also learn from the keyboard. For now, for the time being, you can do this directly with the mouse, but the thing is that right now Tanu single could have come in so many cells but I have done so much by dragging, so look, it is possible that I could have done this much by dragging by mistake or it would have remained like this again and again, doing it like this, like this, this looks right, this looks right, this seems right, doing this can be very tiring, so what would you do in such a situation, suppose you have selected the cell like this. So you will go between B and C, this plus has come, right, after this plus comes, you do not have to hold anything, do nothing, just double tap, this will automatically adjust it. Yes, yes, if suppose your cell was like this, it was not like this, nor was yours, you go between B and C, go here, just double tap it, so it has corrected it here, so this is the way you make this adjustment, so I have explained to you in a single cell, here in which way you have done it. You have made an adjustment by double tapping. Let’s take a data from here. Just give me a minute. Control A did control C did. I went to the cell with my adjustment and did the control here and after that we saw this data. Now look at this data, you are able to see this party name. This party name has been reduced because what I have brought is to keep the width of everyone’s cell correct. Now in the process of keeping the width of everyone’s cell equal, the rest of the things are not coming properly. Now what will we do? We will fix it, but first of all, let us tell you about what we learned from the mouse. What we learned from the mouse. From the mouse, we learned that either you take the cursor there, hold and drag, learned this one method, learned the second method, take the cursor there and just double tap it, we learned these two methods. Now we will come to the keyboard related things, that if we have to fix something from the keyboard, that is, with the help of shortcut keys, then see how to do it. So here

    you have it, if you want, you can go here and fix it one by one, but do you have to do it like this, is it a very time consuming process, you don’t know how much to fix, how much to do, if not, then what will we do, we will use shortcut keys, we have to use it on the whole, it is not so, if we have to fix one thing, then how do we select the entire data in one go, you click anywhere and use Control A, if you press Control A, then you have pressed Control A. After this, you have to use shortcut keys which is Alt AO I, then by pressing Alt AO I, it automatically got whatever width it should have had. Now suppose your data was in this manner, at some places its length would also have been going on. In this manner, the data would have been there. Now you have learned how to correct the width. You have selected the data. You have selected the data, by pressing Alt AO A, its length will also be corrected. Correct, this length will also be correct, so you have two. Just learned the thing from me here, if I have to correct the width, there are two keys to correct the width, if I want to correct the width, then there is Alt H O, Alt H O I and one more is Alt O C A, this will work in some people, OK, what is it for height or what will be Alt AO A for length, so basically this is the difference between I and A. Last, the rest is the same, now you do not remember the keys, now you just listen to the keys. How to remember, I will teach you the whole memory technique so that you will say oh my God, it was so easy and I was so nervous, okay so don’t memorize the keys right now, you just learned the adjustment, the main adjustment was that we will double tap from here and adjust things, okay now we have entered the data, made the selection, made the adjustment, now we will move into our basic formatting that when we enter the data. If we do this, the data is created. What we are going to do is do our basic formatting, but before doing this, we should know a little theory. Whenever we talk about Excel at the initial level, we talk about two things, one is data and one is formatting. Now what is data, what is formatting, let us understand a little bit what is the meaning of data. Look at what you will be working on, that is, if you are working in Excel, then what is Excel for? You can do calculations, you can present it in a good way, you can make reports from it, you can make dashboards from it, then you can take decisions for yourself from it, you can take decisions for your business, so basically whatever work we do, we do it on data, but data means when you have seen the data, you have seen the data even in the past, there are many things like this inside that data, there are colors, there are borders, your figures may be different, their size may be different. Basically, when you present it, you do it in a slightly different way, don’t do it like this, see what I have written above, this is the entire data written, you will see the data in this way, what will you see in it, what will you not understand, you will not be able to understand, right, you will not understand in this, why will it not come because it is given in this format because only data is written here, there is no formatting done, if I speak in these lemon language. Decorating is basically when you decorate your data, you make it presentable. I have presented my data in such a way that now the person in front can understand it, that is your formatting. So the thing we had learned till now was that data entry was just taking a data and going into the cell and entering it, but now we have learned to make that data beautiful and also to make it presentable, now we have learned it inside it. You are going to learn to make a presentation. Like see, in this also I will make you remember many shortcut keys. Cut keys will be remembered by you. Trust. Now I will make you remember all the shortcut keys. It is clear that we will use only what we have learned till now. Now initially we know that we have to correct something or apply something, so first of all we have to select it and if we have to do this within the entire data, then what do we have to press to select the entire data? Just tell. I will have to click anywhere and press control e. We will have to press control e. By doing this, our entire data will be selected because whatever work we have to do, we have to do it on the entire page. Now we have to fix its width because you can see that some are bigger and some are smaller, so to fix the width we can press Alt OCA. Otherwise, if you press Alt AO, it will also be done. Now it looks a little better to me. Does it look worth seeing? Does it look worth seeing or not? It looks absolutely fine. Now let us correct our data. The first thing we have to correct inside the data is to correct the alignment. Now we will carefully see that all the text written here is written on the right side of the cell. Look, this is also written on the right side, this is also right. They are written on the side and only there you will notice the text, all of them are written on the left side, so suppose I select the entire data and look at the options here, either I do everything on the right side, it will look a bit strange in reading but it still looks better than the first one, but if I turn it to the left, then it looks right on the left, why is it looking right? Psychologically, you can apply a small logic in this, that is, we If I am reading Tanu Single, then I am going like this. Tanu Single Right, then we read anything like this. So to our eyes, if something is in left alignment, then it looks fine. It does not look a bit strange to our eyes, it does not look strange, that is why the left still looks fine to us, but which one is best for us? Which one is the best in the middle? Which one is this in the middle? Is this one in the middle okay? So, we have done the middle. Are you understanding everything right now? Is the text right? What is all the things? So this is what happens in our Alignment. What is Alignment? That means whatever we select, we can move it to the left or right or in the middle. Now I have made it in the middle. Now, what are these top three portions? You will see carefully, this is at the very top, this is in the middle and this is at the bottom. You will not understand the difference now, but now you will understand. Suppose right now it is celled in this manner, now I have selected it, or I can put it at the bottom. Do you want to keep it at the top or want to keep it at the top? See, for now, when your data is absolutely accurate, when the width of your data is absolutely accurate, then there is no difference between the top and bottom. It seems that you select the entire data and look at it from top to bottom. Not much difference will be visible. When does this difference become visible? Suppose at that time your data is shifted here and there, if your alignment is down or up, then it will be visible in this way. So, since you have done this in the middle of your data. If yes, then make it in the middle from here also. Now suppose even if your length increases, it will still remain in the middle. Okay, now you fix it by double tapping from here. You have fixed it, so you always have to keep the align ment, what is the align ment to keep, if you want to keep the center center, then what is the align ment to keep, if you want to keep the center, then I keep writing the points below that what have we done, so that we can remember that later, okay, this will be fine, we write the pay points here. What are we going to do? So first of all, what we are going to do is that we have done the right alignment. And what we have done right in the alignment is that we have done it in the center. Okay, we have done it in the center. Basically, we have done middle middle, so we can say that we have definitely brought it to the center. Even if I talk like this, I talk like this in the center. If I talk like this in the center, then also in the center, we have brought him to the center. Second thing, let us try and see. Second thing, what will we do? We have gone to our data now. Now what we will talk about is the heading, what can we do on the heading, so in general our heading which is the heading you will see, now we are seeing in the adjustment one, you are seeing that there is a color on the heading, it is slightly raised, then the data is looking good because it is emerging, it is understood that what is written above is the heading, the data below is written as normal data, so in the same way we will have to create this heading, now I will have to create my data from here till here. If we have to select from reference number to amount, then what do we have to select, what shortcut do we have to press ? As soon as we press control shift side arrow, control shift side arrow, we will have all this data selected and that too within a single click. Now it has been selected. Now if we want, look, go inside the home tab and here you will see the rest of the things which you have to do, so do them one by one. Let’s say you want to make it appear a little raised, you want to make it appear a little thick. Yes, right now the words are written thinly, so you can bold from here, so see it has come in this way, I will close it, see if you can see the difference, then you can see the difference that you have bolded. Given italic, it becomes a little tight. We do not want italics. Underline brings the underline below them. We do not want underline. If you want to change their font, you can do that too. Generally, we professionally use Caliber and Arial. Okay, so you can use them also. You have to use this, you have to use this, you have to use this, you have to use Arial black, whatever you want to use, you can do it normally. Used this and it looks very thin, so we use the normal caliber. Okay, after that you get the cell color and that means first we see the size. For once, here you get the size. You can write the size yourself and can also select from here. As you keep increasing the size, its size is increasing. As you keep decreasing, its size will decrease. 12 I think okay, what will we do after that? Just because you are seeing, now because of this heading again, it is not coming complete, so we will do control A, we will do control A anywhere in the data, we will do Alt OCA, then it has adjusted itself, now we have to color in it, so we will select it, now understand one thing, which is this, what you are seeing is this box, let me just take the pain fast, what you are seeing is this box, which means what we call a cell, inside the cell, if I have this If I filled it like this, then what color is there inside the cell? Red and on top of that, if I write something with white color, then what will we call that white colored thing or what is written as font? So what we write inside is our font and this is our cell, so the color shown here, this bucket, this bucket colors that cell, so suppose I color it yellow, then what to do, yellow bucket means I have colored the inside of every cell and there is a font inside it. Meaning, for now, suppose I make it red, then look, it has become red, but I don’t like red, I make it white, so it has become white, now I take this one, I color it green or I color it blue, this one is blue, then look, it has become of this color, so basically this bucket colors your cell and this is what is written, it colors your box, whatever you write and keep something inside the cell, it colors it, okay , I understood. Now we write everything here, what other things have we done, what things have we done? Pay attention, we will write some things here, we have bolded it, after that we have italicized it here, then what else we have done here, we have underlined it. Okay , after that, what have we done right now, we have not done anything else, just colored the colors and the font, no problem, now you will see that the data is visible fine but there is no error anywhere inside it. Oops oops, there is no border anywhere inside it, so now we will put a border on it, what will we do, we have to put a border on the entire data, we will select the entire data, after that we will go to the home tab, inside the font group in the home tab, here you see an option which we call border, if you go to this, then look, after writing here, thick outside border will also appear, you click on this drop down, after clicking on the drop down, you will have so many options. Are there options, ma’am, do you have to remember so many options? The answer is no, all these are for drawing a single line, you do not need to remember this, you have All Borders, so you take all these borders, if you click on All Borders, then a thin border will appear on everything. Now with All Borders, you have seen it in this way, but do you remember in your school, when you used to make drawings, you used to make sketches, You have made a sketch, filled the color inside, after that you are busy in darkening it, brother, we will make an outline on the outside, we will make all the thick outlines so that the sketch of yours can emerge, in the same way, we have to make our data beautiful, so what will happen by making it beautiful, you selected the entire data, after that you selected it and after that you used thick outside border, then you see, it has become thick on the outside, it has become normal on the inside, do you want it or not, ma’am? I have to put different types of borders, so don’t look anything else, I will tell you three to four, you see exactly that, after that you look straight and don’t look for anything in between. Come here, Thick More Borders, More Borders, Here you get the option, suppose you want to apply this thick, right now it is this thick, it would have been this thick or suppose you want to apply dotted, then I took this one. After you see where you have to put it, there is no need to put it one by one, here you can put it whether you want to put it on the outline or you want to put it on the inside or if you want to put it on both sides, then turn on both, here you can see the preview. I only wanted to put it on the outside, not on the inside, so I did nun here and then took the outline and did OK. So now see, it is on the outside and the rest have been removed. Okay, so in this way we put our borders, so what did we learn today? Meaning, for now what we learned is, look at what we put inside the borders, first of all we put all the borders, okay, all the borders, then what we put thick outside border, so we put thick outside border, we are writing this because later we are going to remember the shortcut keys of all of them, ma’am, so many shortcut keys, yes exactly so many shortcut keys, more borders and after that what we are going to do is what we are going to do, tell me one thing about all the ways. You have put a border but what can you say in English to remove the border, no border, we don’t need any border, so you have no border. Now, if I ask you to do all the work that you have done, but if I say this, you will have to do all this work with shortcut keys , then will you be able to do it? Let’s make this data exactly the same as before. See, what is the first thing you have to do. If you want to remember any key, then in your laptop, in your computer, press Alt. Press Alt. After doing this, look upwards, H is visible everywhere, all this is visible, no, whatever work we are doing, what kind of work we are doing, for once, I go here, now I press Alt, the work we are doing, what are we working in, in which tab we are working, we are working in home tab, no, home tab starts with what does it start with, read the spelling of home, H O M E, home starts with H, so here. Your H will appear. Look, H is written here, what does it mean? If I press H, then a key will appear on top of all the functions inside the home. Now we are going to talk further. Okay, first of all, I will scape it that I do not want this. Here you have understood the activation. If I talk about activation, what is it? Alt is activated. What is the key of home? What is the key of home? Whatever function we are working on, where is it present inside the formatting, all that is present in the home tab. Right, to reach the home tab home tab, we will have to press all touch. Now the thing is that how to do the align ment, then the align ment starts with a and we have to center it, so we will press a. So this is its shortcut key, understood. Let’s understand one or two more, then you will understand that all the borders are there, how to do all the borders. Suppose your What are the keys starting from Alt, then after that you are going to home, then after that you are applying border and which border are you applying. If you are applying alt border then your key will become Alt H BA. Remember one thing that the key is activated from Alt, from home to home we are doing all the work so h will go and after that b will come. If there is a thick outside border then from alt we activated it. From h we went to border home. From B we went to border and If there is a thick outside border, then thick starts with T, then it will come here. Okay, more borders. From old, we activated it. From H, we went to home. From B, we went to border and from here we applied more borders. So, in the same way, what will happen to no border? Alt HBA has nine borders. So see how easy it was. It is very easy to remember these shortcut keys. You just need to know your work and the system, how you are doing any work. Wherever you get that work, pick up its initials and you will easily remember it. Well, for bold, there is control one. If you try this, Alt H and here it comes by writing 1 2 3, so if you want, you can do Alt h1 23, that will also work in the other wise. Control and Bolt starts with B, then Control B. Italic starts with I, then Control I and Underline starts with Y, so this is your Control Ya, in this way we remember all the keys. One thing, I will tell you the bonus here, just give me a minute. Here we will take the red color. After taking the red color, I will tell you here, did you see the one with width and length , ma’am, width and length? Yes, you were doing it right now, no, what were you doing right, what were we pressing, I did not remember at that time, right? Alt AO I and Alt ho A Now I understand why these two things are taken because inside the home tab, you will get this feature, then press Alt H, look at O, where is the format, we take it here, okay, inside it, as you click, I have clicked that by mistake, Alt H O, and inside this, there is auto fit height and auto fit width, so I and A, so these keys of ours are made here, these are the keys, it is okay, so this is Alt AO I and Alt AO is A and in this way we do all the things. Okay, I hope you have remembered all the keys well. If you have any doubt anywhere then please ask me. Now let me try and tell you for once. Suppose we do the border, then first select the entire data with Control A. With Alt HB A, I have removed the borders from the entire data. I did Control A, did Alt ABA, then did border on everything Alt. If we have done HBT, then there is a border on the outside, in this way we can do whatever work we have to do quickly and very easily, so what we learned here was our basic formatting and we have done the entire basic formatting very well with all the shortcut keys. Okay, if you want to note down, you can note down other wise, so you will definitely remember it, still you are going to get this sheet as it is, so don’t worry about this. Now we have done the basic formatting, now we will understand a little bit about one more topic, which is insert and delete and after that we will move to the advanced topic, what is the meaning of insert, if we look at it in general sense, insert is insert any thing, that means they are adding any thing. Now suppose I saw this data and after seeing the data, I understood, oh no , I have not added any heading inside it, so now in such a case. What will we do, do I erase the entire data and after that go and see that oh my God, now I will go and write the heading and only after that I will make the entries, then it means that there is no problem at all, no, we will not do this at all, what will we do, we will add one more row for ourselves right here, if I add one row for myself right here, then how easy it will be for me, so what will I do, I selected it, look after selecting it, any. If you add something, then what is the plus sign? If you delete something, or if you delete anything, then what is the sign of minus? If you do a minus, then you have to press the plus sign with control, then it will automatically add a row. Now you can write a heading for yourself here, in the same way you had to add it somewhere else. Suppose you have to add here, you do control plus. Now, if I don’t want this thing, then what will I do, I will make the same selection and make it control minus. So, in the same way, now I have told you how to add a row or add and delete a column. Similarly, with Control Plus, you can add a column and delete a column. Now you have learned this thing that when you have to add a row and a column, now if you want to add a cell , you can do that too, but why do you have to add a cell? When we are adding a row column, then look, suppose you have a data written in such a way that a data is written above it. There is a data written below also, now what do you have to do or not to make any changes, that is, do you need another column in the above data, before the name of the party account, you had to write something else, okay, now suppose you select C and do control plus, then this is added below also because it adds the entire column whereas it is required in the data below, otherwise we cannot do this. This is what we have done wrong, so what will we do, as much portion as we want to add, we have added our portion. After selection, I did control plus, now it asks, okay, I have understood the selection you have made, you have to add so many cells, but tell me, what will I do with the remaining data, then what can you do in such a case, you will give command to it, Antays has nothing to do because if I had to antays, then why would I select the cells, if I could have directly selected the entire row and column and done control plus, then these two options would have been useful. Don’t even look, look at the two options above, it is asking where should I shift the remaining data. If I shift down and do OK, then for him it means that I have to make space for you. What are you telling him, I have given it by doing control plus, make space for me, I need space and after that he is asking OK fine, I will make space but tell me what should I do with the earlier data, then you say shift it down to me. I don’t know, make space for me, so he shifted that data down, but did we have to do this? No, we did not have to do this, so what did we have to do? Control Plus, now what am I saying, okay fine, do one thing, shift the earlier data a little to the side and then shift it to me, then the data that is shifted here will be shifted to the right and you do OK, then your data has been shifted to the right and as many sales as you wanted have come here for you and Even if your data below is not corrupted, then in this way we add our data to any row, column and cells inside the data, then here we write it, for one time, use the shortcut key so that you remember later that we have to add any thing, we have to add or insert, then what do we do and if we have to delete any thing or write substack, then what do we do, basically these two things are happening. In which sense it is happening whether it is row or column and whether your cells are dozen matter, you will do control plus to add or insert and control minus to remove it. Okay, so in this way we insert and delete any row column cells. Let’s move the cells inside our excel. Now let us move towards advanced formatting. See, what we are going to do now is to do advanced formatting. Those are the features of that as well as separately. There is no feature but we take it a little advance. See, now suppose we suddenly remember that the heading has not been written, then how can we do the heading? For now, let us keep from deleting the entire data. What we have learned now is that we will select it and do control plus, then we have one row, it will be inserted. We do not have to do that. Right click here, insert option comes, so it will be inserted in this way also. Now I want to write here in the middle, ABC Limited, I want to write the heading, ABC. Limited, so what should I do, tell me quickly, should I do it like this, okay fine, there are three here, there are three here, so I write in D, it will come in the middle, we can do it like this, no, what do we have to do, we write here A B C Limited Limited, okay, we have written this, now what do we want in the middle, neither where in the middle, so first of all, select which one we want in the middle, we want it in the middle, after that you go to the home tab, in the home tab, you are inside the Alignment group. You get only one option of Merge N Center, you click on the drop down of this Merge Center or click on the Merge Center, after clicking it will appear in this manner. Okay, our ribbon is now removed, so now what we will do from here is that if we click on it, it will come in this manner, so see it came in the middle, what did you do in it, merge all the cells we have selected and after that, align them, what do you do with them, center. If you do this then Merge and Center has come here. What did Merge and Center do? After that you can give any color. I give black color that would be better. You can make it bold, you can show it in some other color, you can do some font. In this way, now suppose you had to write this also just because this is a sales report, so you selected this also, Control Plus, Control Plus is not happening, it’s okay, you have inserted it from here, here is another one. You are still able to see that there are separate cells, it has become one cell because you have done the margin center. Now you will write the sales report here, okay and after that you will select this also and then you will click on the merge center and then you will give it a dark color too. In this way, now think about it that you have to do separate work for both of them, so this is not making the work a little easier, it is making it difficult, so when you have to If you have to do more work like this, if you select it and make it merge center, then it will tell you that the top most value which is written will come, if you do OK then only this will come, then don’t do this, what we will do is click on the drop down here and merge means merge in this way, click on merge across, then automatically it will come in this way, okay, this was your merge across, apart from this, suppose you want to unmerge them, you click on this. Click on unmerge cell, it will come like this, now I will do the merge across, so what have you learned here, what have you learned here, two things, what have you learned, three things, you have learned, the first one is merge and the center, you have learned this, the second one, what have you learned, you have learned, merge across, you learned this. And third, you have learned unmerge, okay now you know where all the three things are, we are working in the Alignment group of the home tab, so basically how to activate the home tab, that is, with the activation key, we go to the alt home tab, from H, what have you done after that, after that, you have merged and centered, then your shortcut key will come, merge and center, what have you done, you will activate it from old, go to home from H and here. Merge Across, Merge Across, you should not know the feature, what keys have to be used, the keys are created automatically , Alt H, Sorry, Alt H, now unmerge will happen only when merge is done, first if something is merged then only then it will be unmerged, then M and then you will use U, then in this way, these three shortcut keys of yours have also been prepared, you see, you have to memorize so many shortcut keys in such a short time and trust me, you will not forget once you have memorized it in this manner. Once you start practicing, you will not forget at all. Okay, so in this way, we have done a little more formatting here. One more part of the formatting is left, which is wrap text and one small thing which increases it, I will tell you in the next topic, which is wrap and shrink. See, when we did the interface, inside the interface, I had forgotten to tell you one thing. I am so sorry for that inside the interface, when you will see let me just. Zoom at my screen, you have zoomed this and after that you have come here, you will see here, look here, this is this mark, what is this mark for, see, you can also see here, what is this mark for, I write this mark here, we call it extension, what do we call extension, now what is this mark for, what is that, let’s go to our place and understand, there is no problem in that, okay, we will come to our place, what were we understanding? Wrap End I was thinking, let’s zoom it a little, okay, now it’s okay, so let’s see what it is for. Suppose you have a lot of features. I am saying that Excel has many, many, many, many features, so are there many more features related to fun, and there can be many more features related to alignment, and there can be more, so in such a case, is it possible to show all the features on the screen? Is the answer is no, is it not possible to show them all? So what do we do? There is a symbol of extension in the corner near the group. Look, this extension is not in every group. Look , it is not in Styles, it is not in Sales, it is not in Editing, it is not in Done, it is inside this one. Why is it there because wherever you have it in this way, you have some other options too, but here if they are not visible then the extension comes there. If you click on this extension, a window opens inside, then you have more options to explore here. You get to do another ​ ​No, to fix the cell, I do not want the width of my cell to increase, I want to keep everyone equal, I do not want to increase it too much, so I want to increase the width of my cell, there is no problem if the length increases, but I do not want to increase the width at all, so what will I do in such a situation, I will click on this and I will wrap my name in the text here, wrap my data in such a way that it will be its width. Its width is neither increased nor increased, then in such a case I will click on the wrap text. Now it is here, now it does not mean that it has become like this forever, as if you are clicking on it, then you are seeing here that it is written ‘Tanu Single’, it means that it is written ‘Tanu Single’ and it is written like this, this is just because you have clicked on the wrap text and now the width of this cell cannot be increased, so this happened, now increase the width of the cell, this is fine. It will come, okay, so where you do not have to increase your width, you can increase your length, there you will use it in this way, in this comes the next one, suppose I write the stems single again and they are going out, now I am saying that I am imposing a restriction but now I am saying I am saying that the width is not increasing, it is fine, but the length should not increase, if the length also increases, then it will not work, so what can we do in such a case, it is obvious that the length should not be increased and if the width is not increased, then the obvious thing is that I will have to shorten the font, now if I try to shorten this function manually, then I will not be able to understand, okay, it looks fine in the ate, maybe in the ate ? If he is going out in the nines, then I will keep doing the same thing, otherwise what do I do in such a situation, I go to this extension and here it says shrink to fit, shrink my data to such an extent that it fits inside this cell, then you click on it and do OK, then it fits inside it, okay, it fits inside it very well, we call it shrink text, you can see it here in both the cases above. In both the cases, Tanu is written as single, but I actually want that no matter how much the width increases, how much length increases, but our data is that Tanu comes down by writing single, so what can you do in such a situation, if you write Tanu, if you move your cursor down, after pressing enter, the cursor will not come down, the cell comes down, your cursor is missing, you have come out of the cell, then how will it be written, see what you will do Tan and when you have to bring the cursor down, now you Do not press enter but press alt enter, your cursor will come down, now write, you enter single, then see here also in your formula bar, it has come written in this way. The formula bar shows the same thing which you write in the cell and the way you write correct, so now it has shown it tan single in this way. Look here, it was showing together, here I reduce the width, see it has come in this way, still it is showing it like this because We have written as it is here, we have written it as it is, so it is being displayed in this manner, so here we have completed our wrap and shrink text. This comes within the advanced formatting itself, so within this we have covered it, we have chunked a lot of the basic, so miscellaneous things also come inside it and along with it, the group with clipboard is also included, which means we are going to add some features in the group, so let’s do the work first. Let’s look at the Clipboard feature. Basically, what do we get inside the Clipboard? You can see that we get features like cut copy paste and so what is the meaning of copy? Here you data. Whenever you have read Excel, you have come reading two things inside Excel. I had initially talked about what are the things we are reading in Excel initially. We are reading the data and we are reading the formatting. Right, so when you copy any data completely, the copy is done. What does it mean, we do Control C or you can copy from there by right clicking, then when you copy, there is data in it, whether there is any formatting, no matter what kind of formula is there, all of them come up in that cell, that is your copy and wherever you have copied it, after that what do you have to press to paste, you have to press control v. Now let’s assume that this is where I bring this data, so first of all I am in advanced formatting. What will I do, I will select the entire data from Control A. After selecting Control A, after that I will do Control C. After Control C, you are seeing these dashes running on the side, that means its selection has been done, after selection, Control C has been done. Now I will go to Sheet Two here because I have not named it yet, it is right in front of you here. Let’s pay here. If I do Control V, then as it is data has come. Alt OCA. Do it as it is, the data has come, let me do it a little like this, as it is, your data has come, if you do this, copy this data and paste it on the side, it will come, that means there will be data here and here too, the data will be right, but if suppose you select the data and do not copy it, cut it, do that means control Basically, what is meant by cutting, data goes from there, what is your shortcut key to cut ? Control You should have selected the data, Alt OCA, done the data, okay, now suppose I want to copy the construction company from it, then I want to copy this, let’s do one way, so let me do this control C and keep controlling v here, control c control v control c control v, so how much tiering process is there, how much tiering process is there, no, I have to do it one by one, so we will not do this, so I deleted it, okay, but now what we will do is let’s see what else we do. You can do this for multiple selection, what can you do, hold the control where you are selecting, then wherever you are clicking, you see that it is being selected, it is being selected, okay, now you control it, it will not take, then it means that for multiple copies, this control one which does the selection method is also not working, then what does it do, what does it do, you open the clipboard in your home tab, keep clear all from here, it should become clear here. Select Control C, go on selecting anywhere, go on doing Control C, Control C, Control C, Control C, I am doing this but I am not holding anything, I am going there with Control C and wherever I feel like, you go to that cell and paste it wherever you feel like. You go to that cell and here there is an option of Paste All. If you click on it, then all these things are there, it has pasted here, all the things are pasted here and after that, clear all from here, then all your things are there. If you want to paste multiple copies here, then this is a shortcut method that if you want to paste multiple copies, then you can do it from here. I hope you have understood, I had to tell you only these things in the Clipboard group for now, there is one more thing I need to tell you. Suppose you want the same formatting for another table, then what will you do. Suppose you will copy from here, paste it and then delete the data. There is no need to do so much fuss, you select this data and here there is an option like brush. If you go to this, then its name comes Format Painter Painter, meaning are we the one who is going to paint, who should do the formatting, then if you want the same formatting, then click on it, see the selection is done here, wherever you leave it, this same bean will come after your formatting, so in this way, we use Format Pinter, now I should name this sheet, so I name it, I give it a name, Clipboard Clipboard Group, we have Here we have completed it, now let us move towards our miscellaneous topic. In the miscellaneous topic, the first thing I have taken is the clear sheet. What does the clear sheet tell you? The meaning of clear sheet is that if I want to delete the data then how can I do it? What can you do to delete it? Let me show you a data. Here we can see this data in the clipboard itself. Do you have this data? You selected this data and after that you deleted it. If you press the option of , then the data is gone but your formatting is not gone. If this problem arises, then here we are going to solve the same problem. You get this feature inside the home tab. Now we will remember its shortcut keys. Now we will remember what happens here for deletion. Firstly, we have called the content data here as content or you want to delete the formatting or you want to delete everything. Which is all, then this is fine. Three things come to you, now let me tell you just because it is in the home tab, so from old you will activate all the keys, you will go to home, from old you will activate all the keys, from old you will activate all the keys and you will go to home, what will come for content, clear, what are we doing, we are clearing all these things, we are clearing right, so for clear, the key it has taken is E, E is taken E. Now you don’t need to do anything, if you are clearing the content, then put ‘C’ to clear the formatting. Just put ‘f’. If you want to delete everything, then put ‘A’. Now let’s see it on our own. I would personally suggest you to delete the content, don’t do anything. After making the selection, you can directly press the delete option, that too will be easy for you, but for formatting and other things, you can do this like you can do with clipboard. Now you have this data and you have to delete it, so I directly pressed delete and it got deleted. Now suppose you have to delete the formatting, then suppose you selected this in the formatting and if you delete it, it will not get deleted. Because there is formatting, then you came to Alt H home, see from E, this is the option of clear, E is for clear and F for formatting, so see, it is completely cleared, if suppose the data and both of these have to be removed, you select the data, activated Alt H, E was for clear and if you have to do everything, then do A, then the entire data will be gone. Okay, in this way we do it, after that you have two more shortcut keys. What is Undo and Redo? What is the shortcut of undo and redo? Suppose you have done some work. Undo means suppose you have done some work but that work was not to be done, then you do undo and for any work that has to be brought back, you read it. For the work that has been done, you press control root that I want it back, meaning I have done it. After that, if I want to bring it back, then I press control w. Now suppose I have to delete what I am writing because I have done it. If I have written wrong, then I will keep pressing control, then by controlling j, all these steps which were mine have been removed. Now if I control yy, then look, all the things which were mine have come back. So this is how it works. Which is your undo and redo? Let’s go. Now let’s see what else comes to us next. Insert and Delete. What is there in insert and delete? Suppose, if you want to add any sheet, then from here you can insert from plus. You can do this and if you want to delete any sheet right there, then you click on it and if you delete it, this sheet will be deleted, so in this way we insert or delete, I right click here and write here that on right click you get these options. Till now I was giving name to the sheet, so to give any name, you have to right click. On right click, you get the option that you can name that sheet like this. If you want to rename, click on Rename then we can give this name. Okay, everyone understood in this way, we check the option for tab color as well. Here we get the option of tab color. If we want to give any color to our tab, then look, I want to give red color, so look, this red color of my clipboard has come. I want to give some other color to Miscellaneous, I took the tab, I want to give green color, so look, my green colored Miscellaneous tab has arrived. Okay, as soon as it is open, it will appear gradient, otherwise it will appear solid color, so in this way you can also give different colors to the tabs, so here we have covered the basic things which are very small things of Excel, now what we are going to do next is to do the basic formula. Further, we are going to start from the very basic. Let’s talk about the formula, so first understand a little theory. See, whenever you are talking about Excel, then Excel is more about the calculation that it makes your calculation part very easy, so whenever we do any calculation, how do we do it, we do the calculation only by taking the help of formula, so formula is a very important aspect of Excel, so all the formulas there are here, they will be taught to you in a very easy way. Now the point comes that ma’am. Formula is maths, I am afraid of maths anyway, so what should I do so that I don’t have to do formulas and it is going to be so typical, so how will I be able to do it, so see here you need a general understanding, a basic understanding, you need a basic understanding, if you have a basic understanding of maths then you will be able to do this work, you do not need many such tricky knots in this, you just need to know that you need to do it. What is your work, what do you need, what is the answer, if you know this then you can definitely apply any formula directly here. If there was a need for typical maths here, then why would we be doing Excel? We would not have done the maths on our own, but this makes our work easier, that is why we use the formula here. When any formula is started inside Excel, then what is the initiative? Equals to It happens that first of all we have to apply equals to and then we have to work. Now you will say ma’am if you don’t understand then you will understand easily. Keep a little patience. You just remember each topic which we have done till now. Name of the cell, what makes up a cell. You just tell me that our cell is made up of one column plus row. If I tell you this is a cell and the name of that cell is a1 then what is the meaning of a1 a is the column one is the row. Just keep this thing in mind, after that I I will explain all the things automatically to you. Let’s take a scenario and after that let’s understand it in a better way. You will understand better here. Here you can see that I have taken a data here. What is the data? Let me tell you, first of all you are given the serial number, after that the student name is given, after that the marks of Hindi, English Maths and Science are given. Now if you want to find the total, then if you want to find the total, then basically what to do is to sum. Now do the sum. In which do you need even, which cell is g3 in it, it is okay, you keep looking carefully, which cell is this, g3, please understand this thing carefully, because if you miss this topic even a little, then there can be problem in the future topics, this is your g3, what answer do you need inside g3, do you need total, whose total do you need, one is needed of c3, one is needed of d3, one is needed of e3 and one is needed of f3, okay then basically you You know g3 = c3 + d3 + e3 + f3 ok now let me say suppose you are here you are here which is your g10 which is your g10 so if you come to g10 then what you need is obviously c10 d10 e10 f10 so you understand one thing as this is your g4 this will be g5 this will be g6 this will be g7 in the same way this will also be c4 this will be c5 c6 will be c7, d4 will be d5, d6 will be d7, so it will keep increasing in this manner, okay, you have understood one thing, we are talking about cells here, now let’s apply formula to it and see, we will learn to do sums in different ways. See, this is a very basic thing, when you do maths, you used to study maths in school too , then the thing that was taught to you at the initial level is when it comes to the calculation part. So that was your even, so here also we are going to even, we will spend full time in even, the rest will not take time, okay let me just remove it, first we remove it and after that we do further work, now what do we have to do, have you understood that the answer we want in g3 g3 is c3 + d3 e3 f3, so what we have to do is we just have to write, when we start any formula, what do we start with? Let’s start from equals two, so equals two, now what did I tell you, what is needed here, c3, so I went to c3, what to do plus, then what is needed, d3, then what to do, plus, then what is needed, e3, then what to do, plus, then what is needed, f3, then what to do, if you don’t want to do anything, then go till f3, you have to do plus, press enter, then this answer will come to you, now you can drag it, so see this is yours. The answer has come, what is the answer, you can check here, this is g4, then yours here is c4 d4 e4 f4, suppose you are here, which is your g9, then here you can give the formula, c9 d9 e9 f9, suppose you are here, which is g12 c12 d12 e12 e f12, so basic, we drag and bring the rest of the formulas ourselves. Initial formula. We have to put it in ourselves, so one way was this, you had another way and take it out, okay, later we will fix its formatting, okay, I will do it like this by going to the home, giving the format to the printer, okay, for now, let me assume that I have told them to sell, if I had done something directly, then equals to 90 + 27 plus 10 PS 47 174. Now should I drag it, what will happen to everyone when I drag it? The answer is 174. Why did this happen? Look, it is a very simple thing. We give three things in the formula. Three things consist inside the formula. I am telling you this very basic idea. There are three things in the formula, one is a cell, one is a number and one is a text cell. It gets changed by dragging, it gets changed by dragging and the main thing is that if you want to fix it then you can do it manually. What can be fixed can be fixed manually, we will have to apply some formula by ourselves, which fixation will also be learned later on. Numbers: If you are writing a direct number, if you are writing a number then it is always fixed, it will never change and in the same way, if you are writing any text, it is always fixed. The second thing is that the number is written directly, the text is written inside the double ted comma, okay now these things are now. You must be feeling that it is very confusing, you have to read it just once to understand, so read it, you have to understand it, understand it, very good, it did not come, there is no need to worry, because now when we will do this with the example, then you will automatically understand something. If you do not understand the theory, then hold on. Because that thing will be understood in practice, not everyone understands everything in theory, not everyone understands everything in practice, so here I have covered both the expectations, okay now we have come here, now tell me one thing, what happened here, just give me a minute, okay, this is not erasing, what happened here, I had given them the value by taking 90 plus 27, plus 10, let me make it 47, now the numbers are If there is no change then here too the formula remains the same. Here also the formula remains the same everywhere. If the formula remains the same everywhere then the answer will be 174 everywhere. What is the second thing? Now suppose I did 20 here then it will change because when we give cell in the formula then we tell them that look, add c3 plus d3, add e3 plus f3, now the formula does not make any difference inside c3. Whether you write 10 or 100, what it means is that he has understood that whatever happens inside c3, I just have to total it and now write 1000 inside c3, even if I come here and here and write 1000, the answer has changed because it does not care what you have written, it just means that he just takes the command in this way in which you told him to add c3 to plus d3. Make a plus on e3, make a plus on f3, then he has just taken the cell. Now whatever you write in the cell, he will do a plus, but what you have done here is that you have told the values ​​yourself, turn 90 into a plus by 27, turn the plus into a 10, turn the plus into a 47. You have already given the values ​​here, so that is why it has not changed it. Okay, and later also when we drag the cells, they drag. If there are any, then they get changed, like here there was c3 + d3 + e3 and f3, here the same thing happened c4 d4 e4 f4, those cells change automatically but here you have given the value, the value never changes, it remains as it is, so this is the problem with us, if we apply the formula in this way, then we will get the wrong answer. Now the next thing comes, I will take one more for once. Okay, I am here and I have selected it and controlled it. Okay, it’s okay, it’s okay. Okay, let’s go. Now we are going to learn another kind of total. Now see how much tiering it will be if I go to each cell and do plus plus plus. So let’s say there were four values. If I have more values, then what will be my benefit? If I do it in the calculator, then in such a case, we will apply the formula to add. What do we call sum? If we say equals to sum then we will put equals to sum and tab and always remember one thing, never listen to any person in the formula, you always have to listen to the formula, you have to do what the formula is saying, what is the formula saying number one comma number two comma number three comma number four comma and so on it has come then we will do number one comma number two comma number three comma number four and turn off the parentheses and hit enter. If you give it, your answer will come. Now drag it to you and see the correct answer will appear. You can check whether you have written Equals to Sum. Pressed Tab. By pressing Tab, the sum will automatically be in capital letters and will open your bracket. Whatever things are written inside your formula, keep writing them. It was written there, number one, comma, number two, comma, number three and so on. So, we gave him this formula, so how easy it was now. Our formula has become automatic. If we change anything, there will be changes inside the formula. Now comes one more thing , control c control v. Now comes the thing that see what it has taken here d3 e3 f3 and along with it g3 because it has understood it as further, so we delete it. Okay cell, when we write neither, they move, that is why our answer keeps getting auto updated. Now tell me one thing, you have applied the formula. Sum is written there too, you have to select each cell and put a comma. Is it easier than this? I will use a calculator, so to make the work easier, look at what we do, when we know that we have to add something continuously, then we write it in a different way, like suppose you have now understood what Equals to Sum is, equals to sum and numbers have to be given inside a1 a2 a3 a4 a5, okay five. The numbers were one way, so this is the second way, if I say now what does it mean, add a1 to a2, then plus th, then plus four, plus fv, I can also write it like this, from a1 to a5, when you have consecutive numbers, there is this colon in between. What does this colon say? What does this colon say? It says from to means this is a range, what is a range, we have You have selected a range that is from a1 to a5, if someday you make it even like this, a1 a5 means what is written in a1 and what is written in a5, add both of them, add both of them, then only two numbers will be added in it and here where you have given the range, it means from a1 to a5, if there are five numbers inside it, then all five of them will be added. Now how does this come, let me tell you first. Funda told you here we will apply the formula of sum, equals to sum tab, after that number one number to number three, don’t do it now. Consecutive numbers are going to come, so you select it, there were consecutive numbers in the same heavy, they were together, then you selected it, now comes c3 colon cf3, sum from c3 to f3, enter and now double tap, it will appear everywhere from d4 to c4 to f4, see this, from c6 to f6 everywhere. Now suppose I will tell you another way, if you had done it like this, I delete it, I would have done it like this, here you would have done equals to sum tab and you would have done c3 f3 and enter, then look, it has given you the wrong answer because it will give wrong answer to all the others because for that you have put a comma, meaning now it is totaling which ones, it is only totaling c3 and f3 and not totaling anything else but us. What was actually needed was that I color all the wrong ones red and here we go red and this one we will give light to this one. All the wrong ones we have colored them in this way and this one is fine. Okay, still I say that I have understood one way how to do it. Well, let me tell you the one which is even. You total it like this. Do it like this. Its total is 184 na ya see below the average count. And all these three come in writing but this is only for reading, that is why we have to learn the formula because we want to write it in actual. Now tell me one thing, now we are doing the sum but how much time is it taking, no, it is not taking time, so now I am going to teach you the best one which is the best. The easiest way is that wherever you want the sum, you go to the cell and keep a condition along with it that there should not be any gap in between and then After that, if you press Alt Equal Two together then the formula appears to be the same. The formula for sum is from c3 to f3, you want the sum, but the thing is that we have not set it, it has become automatic. Now you enter it and obviously you double tap it, now you will get all the answers in the same way. Suppose you wanted the total here, what would you have done if you press Alt Equal Two and enter, then see this sum. It’s ok, we don’t need it right now, so I erased it. I want to fix this formatting, so what can I do? I selected it. Alt HMC Alt HMC. We had just learned this. We have corrected this. I have to fix its width. Do Control A. Do Alt OCA. Use this. Look, my table has been corrected. Here, we have corrected all the formulas. We have shown the total in different ways in which we can sum in different ways. What do cells mean? What do numbers mean? How do they behave ? How do we drag? So here we learned the basics of the formula. In plus we learned the formula for sum. Now let us move on to the formula. Now suppose you have the same, I am giving an example of a basic formula. You have the same data. You have marks and also the total. Now if you want to know or any student can do it by himself. Want to know ma’am, I had total four subjects, how many subjects were there, let us understand a little theory that what we want to find out, then the total subjects we have are four subjects, here there are four subjects, each subject is of your 100 marks, so your total marks become yours, your total marks become 400, your total marks become your 400, now the marks of any student are 300 is the first student, the marks he has got are 300 marks, so obviously how much is the remaining, it is 400 – 300, if I say, he has got 100 marks less, then this is the thing we have to find out, we have to substack there, now the thing is understood here, I have done this calculation for the first student, that means marks for the second student, let’s say 200. So how should I calculate the remaining portion for him? I will calculate the remaining portion for him in the same way – 400 – 200 and after that my answer will be 200. Now suppose a There is another student, now suppose we have another student, the third student, his marks are only 100. Now I have to calculate his remaining marks, so how do I calculate his remaining marks? His remaining marks will also be calculated in the same way. 400 – 100 = 300. So, you must have found one thing common in all the three scenarios and that common is that when you are applying the formula. Minus will always have to be done from 400, 400 or 400. No matter how many marks you have got, whatever marks you have got are secondary, you are putting them here right but right now what is fixed is 400, so just here we have this funda. I wanted to make it clear to you that here, when we apply the formula, 400 is our fix, so 400, we will write something in the number when we have to fix it. The number is always fixed, so we can write that number directly, the cell keeps changing, we fix the cell in a different way, we fix it manually, but if we write the number, it always remains fixed, so we will write the number here, what to do is to subtract it from 400. Now see – 174 has to be subtracted here, then 150 has to be reduced to 108. This is a thing that keeps changing, that is why we are here. But instead of taking the number, we will take the sale of the sale lane because the marks are written here itself, who knows, if any number is changed later, the total will be changed here, it will be automatically reflected here, so you can enter it and after that you will draw it. Look here, out of your 400, g23 should have been laced, g23 is laced. Suppose you are here, which is your h27, then it is in 400. Cess g27 should have been minus, the same thing is happening, so it means that you have found the correct answer, everyone has understood it, if you feel that you have any doubt or are not understanding any formula, then you can tell me in the comment section. I was telling you earlier also that write all the doubts together so that you can convey me and at the same time, I would definitely like to tell you that look very much now, generally we have 40 50 There is time as much as hours or there is a minimum time of 40 hours. One is that time and one is this time within which we have to cover all the things in a limited time, so there is definitely a little time constant which is not there in live. In live, no matter how much we stretch, in how much detail we read our things, there is a slight difference, but I will try my best to make you understand all the things that I teach. Okay, here we are on Substack. Learned to do, now let’s move on to our next formula. Now our next formula that comes is this, we are going with the basic fundamentals. I also did plus, minus, if we multiply, then it is basic. Here, just like a sheet of sales is made, it is just like there are party names, there is quantity, there is rate, so you need the amount. How is the quantity and rate amount arrived at, that is, we multiply the quantity. Obviously we get the amount from the rate, so we will equalize to that we need the quantity , basically we will give it, we cannot fix it here, you cannot write this, 442 * 985, if it changes later and you have to put it for everyone too, then you will not write this, what will you do, you will give a cell, then you have given c46, you have to multiply it, for multiplying, you will get a star above the eight, you can use that star. Do this and after that give this cell that this d is to be multiplied by 46, enter it and in this way your answer will come. Double tap it and you will get all the answers. Now suppose you are on e48, then on e48 what do you want that is c48 * d48 then you can see your answer that it is c48 to d48 so in this way we multiply. I have also taken the divide in the same way. This is a little bit of its opposite, suppose you have the amount given, the rate given and now you have to know the quantity, how much has been sold, this is the normal way in which we used to do maths, this is not normal maths, okay, there is not much hard and fast rule, so what will we do inside this, see, let me explain to you a little math inside this so that you do not face any difficulty, so here is what we did initially, what we did initially and what we are going to do now, I will tell you that. Let me tell you both the scenarios . In the beginning, we have multiplied the quantity with the rate and the amount has come. Now what is the amount? We have given quantity, our quantity is x, for example rate is given to us, 10 is given to us, amount is given to us 100 and quantity is given to us, that is, it is not given yet, so what do we do to find out x. 100 / 10 because This is in multiplication, so what will it become in division, then we come to know that our answer is 10 because we cut it from this, so the value of Basically you will go to your place, if you want to calculate the quantity, then what was equal to the amount? You will take the cell with the amount, for divide you will use slash and after that you will enter the rate and after that you double tap, your answer has come correct, okay in this way you can get this c67, in up, this is d67, this is c70, then d70, this is c75, then d75, that means your correct. I hope you have understood all these things, we have done the arithmetic formulas here, we had to do these basic formulas at the initial level, now I will move ahead where I will tell you about the features, when it comes to statistics, Average Maximum Minimum Count Count, this is the thing, we do one feature, after that we will continue or we are going to explore another new feature. Which is a number group, then inside this we will number. Formatters are going to do format work with a very basic understanding. Let’s go through the theory. Okay, so I do one thing, I turn off the grade

    lines. So, I turned off the grade lines. All the lines that you see, we call them grid lines. Now, what I am going to tell you is what formats are actually available to us, what do we write inside Excel, so what do we write if we look inside Excel. Normally, if we talk in normal language, if we talk in a normal scenario, then either we write numbers as you have seen, we are writing our cell, we are writing marks, if there is anything, we are writing numbers or what are we writing, we are writing text that means we have written the name of a party, we have written the name of a student, till now we had understood only these two things, now many things come inside these numbers like That number one is also 23 and number one is also 23 and number one is also 23 and if seen then number one is also on 23, okay so all these are numbers but in a different way this is a normal number, we can say that in accounting we take care of points points also, we take care of so many money too, so in that way it is written in decimal, we can say that currency is attached with it, this is for accounting. Inside we also put money, so here we have put currency, it is written in percentage, so in this way we have only numbers, but we can also show the numbers in different ways, so in the same way, we are going to read about many number formats here, now here comes another thing, whenever I explain anything to you, I also explain even formatting, so I have always said one thing that first you have to select something and then after the selection, you Do you apply anything beyond that? For example, I have given you WhatsApp2, so first we will select somewhere, after that we will apply this thing on that thing, so now let us see by formatting the number in actual, like first I will come to you here, after that we are also going to read the theory of number format here, okay, I did this by mistake in the third portion, no problem, in the third portion, we do it here and here we have drawn our grid lines. Suppose I write one of my numbers here : 1 2 3 4 5 6 7 8 9. So we have written a number. Now when you click on this number and go to the home tab and see here, journal is written. So the way we write the journal number, it has become your journal. If I change the format of this thing and put it in number format, then it has brought it in decimal. The thing which I explained to you here is that 23 can also be written like this and can also be written like this. It’s totally up to you as to how to show it. If you think that later on in my data, things can come in points, things can come in decimal and I want to show it in decimal, then you can go for this format. After that, if I take, let’s say, another number, let’s say I have taken the same number down here and if I want to put currency on it, then what can I do? I am doing this by clicking on this drop down and when I click on currency, then ready currency is also shown on it. Currency comes, if suppose you want to put something else on it, like ₹ 5 is 45, you want to put currency on it but want to put Indian Rupee, then you click here, you will get English India here, for now we do not have it here, it is added, we will learn this later, we have to change this thing from the setting of the computer, but for now, we have dollars, so we will click on dollar here and in this way we will add our currency, now suppose. In any other way, you write a number here, write 45 6 9, and you want that decimals should also be included in it. If all the things like currency come automatically, then you can directly choose accounting. Because accounting is like this, see, comma has also been placed here, along with it, other things have also come along with it. Okay, accounting has been written here too, this is also in the format of accounting, this is also in accounting, comma has been placed, decimal has also been placed along with it. At the same time, if you put dollars then this is the format of your accounting. See, there is no need to open it again and again, you can do it directly from here. Suppose I wrote a number here and you want to put comma in it directly, then you click on the comma, then it will come. If you click on currency, then it will come. So, it is totally up to you whether you want to do it directly in accounting or you can do it from here. Next comes suppose I am writing something here. 10 20 And right now I have to write 30 but if I have to write the percentage then I have to do it manually like this 40 but if I have to do it in this way then now you do not need to achieve so much, you select it, click on the percentage here, now whenever you write something in this area, the percentage will appear automatically so that is your a custom format like you would have seen at many places, for example, do you have a steel business and In that you have to write the quantity, you have to put ton behind each quantity, so what you did was to set the format in it in such a way that as soon as you write the numbers, turn will be written automatically. You do not need to write ton again and again. If you are writing turn again and again, then where is our work easy? It is hard, isn’t it? It is done in this way. Suppose now I write a value, this is the value I have written, then if I want this and that in that. To show it, I have zoomed it and dragged it like this, otherwise if I keep reducing it, it will show me less decimals. For now, I have shown all the decimals. If I want to increase or decrease my decimals, then I have both these options available. Either I can decrease or I can do more. As soon as you leave it, like this is three three, then it will remain three. As soon as you press it, it gets automatically rounded off. Okay, you can do this by clicking here. See 5 6 9 OK and I take this and I reduce it, then see it automatically reduced it to 65, which was 65, yours was 6596, so it automatically reduced it to 66, that is, it rounded off, so it automatically rounds off yours, so these were your number formats. If you click on the extension of number format, then you get a lot of options. I will make you explore more options. There is also a text inside it, if the value is Take any date you have written, like I have written this date and which is in slash, this short date is written, how 2 24 25 is written like this, then it is short date, you can do short date like this, if you want to do this same date in long format, go to this drop down, click on long format, this hashtag error comes when your width is less, then in this way your long date will come fine. And in that you get the percentage. If you want to do something in the fraction, you did it like this and by selecting here you did the fraction. Now you write here 2/3 and 2 s 3, that is, write 2.5 like this, then it will come by writing 2 1 a 1/2. If you write 5.3, then it will come by writing 5 2 and 7. So in this way you can also bring in your fraction whatever you want, any scientific number. I need it, if you write too many numbers then it gets converted into scientific number but it is a small number and you have to change it to scientific, then you can go and click on scientific from here, then it gets converted into scientific number, in this way you get the option of text in the last, if suppose you have written any number which is more than 15 digits, then I teach you a third step here which tells you that if any number is 15 Dialog if it is more than 15 digits The last digit will not come in the box, Excel will convert it to zero, so what can you do in such a case, when you have a scenario like this in which it says 15 digits and if yours is more than 15 digits, then it converts it to zero, so in such a situation, what will you do, you will convert your number into text, what will you do, you will convert its format into text, then with this it will take the number fine. Let’s remove the ink for once and go there and see this thing. Let’s go here and suppose I write a number. Just give me a minute. Here I wrote 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16. So see, it did it in this way in the end. If suppose I go to home and go here and convert it into text right now 11 11 Digits 15 Digits Yes, so now look, it has taken the text, now it is in the text format, it has taken it, above 15, it comes in scientific, above 11, you can convert it into text, in this way it will be converted into text, now no, what I have to explain, you have to explain less because of the custom format, this is the most important, the rest of the things can also be applied directly, so let’s go now. Let’s move towards our custom format. If we are going to do custom formatting, then in custom formatting, the things that I will teach you are according to the date format. What is the date format? First of all, let me tell you a little bit about how we are going to read about the date format. You have any date, let’s take any date like today is 2402 2025. Okay, this is the date and for now, for once, I will move the cell to the side. Okay, now what is the date consisted of, first of all you have day, what is today’s day, then after that comes month, generally what we write is month and after that comes year, what comes year, so now look at their initials, to write day, d is needed, to write month, m is needed and to write year, y is the same thing. If suppose, in what other way can you write them, I just want to explain that to you now. In what other way can you write these? Can you write in this way that NN is Sunday, February and 2025, so instead of writing 2025 like this, I can write 25, it is 25, can I write this date like this? Yes, and what kind of date is written on this date, will it be in short form, we can say that it is in short form, it is a short date or can I write like this, Sunday February 2025, so can I? I can call this date a long format date. Yes, of course I can call it a long format date. Okay, so now I have told you the result of how the general result is done, how your short date is written and how your long date is written, but now let’s convert it into the format. Whenever you are seeing this format, if you have to write this, then we define the day with D, then D will be written, then there is a slash, month. If we define Ko with M then it will be written as m and year we define it with Va and this year is written in full 20 25 So when we have to write anything in complete then we write four times so it will come like this Look, if you want to write any thing in short then write it twice then here DD because Sunday is in short MM because Fab is in short but 25 is also in short so YY Now look here Sunday is written in full so D D D D D February is completely written as M M M M and Yer is completely written as y Wa Wa Wa. So remember the basic. If you want it in short then you have to write it single time. If you want it in short and in text then you have to write it two times and in other wise it has to be written four times. This is a fact because you will check. You can check your month even in the month. You can write June, write April. Everything is in three letters. You can check your days whether it is Sunday, Monday or Tuesday. Wednesday, Thursday, Friday, Saturday, Sunday, check anything, all of them are of three letters only, so it is pre-defined that if you write two times, that means you want this type of answer, if you write four times, then you want this type of answer. Now let’s proof it a little and see, let’s say I write a date here, what is the control, I wrote this date with semi colon here. There is a slash, now I don’t want a slash, I want semicalculus, I will go to home, click on this extension, then click on custom and you can see here, why is there MGM, so the short is two. It means m is given a month ago just because m is here, if I had written d here first and then did DM and then OK, then look this date has changed, 24th February, now it has come like this, I have understood what is the meaning of this format, I have gone to custom, now d is also written single time, m is also written single time, hence single single date has come and y is 2025, that means complete, so it is written like this, neither is it four times, if I If you would have made it two times and I would have given it OK, then look, it is written as 20, 25, it is okay, it will always be written as two times or four times, it cannot be written as single time, OK, if now I have to write the same date in dash, then how will it be? I clicked on this, clicked on extension here, went to custom and as soon as there is a dash here, there is a slash, here we will put a hyphen, say hyphen, say dash, put a hyphen, then we will do OK. It will be converted into hyphen. It’s all up to us as to how we want this thing. It is very important to know the formatting. If these date formats are not available, then you will not be able to know many other formulas too. So, it is very important to have these formulas. Let’s take one more date. Let’s take one more date. Let ‘s say I want a little more of this in the anchor version. So I clicked here, went to custom and here now we will write as per our wish DD D AM D. Wawa y wa four times it was written that 2025 is written in full, so look, in this way your complete date has come. Whereas if suppose we want it in the langar version, then we clicked on it. Come here, we will go to the customs. After going to the customs, D D D D D M is kept small. Let’s keep M M W A Y Y Y OK. So see, Monday has come in full writing, just because I had kept the month short, I had kept it in MA only. Two came and 20 25 I had kept complete, so it came complete, let’s take another date, you will understand that this date was taken, after that went to extension, after going to extension, went to custom and here we write D D D D D M M M M WA Y Y Y and we did OK, so look, it has come to us with complete date written, so this is your custom format of one date, I have explained to you very well which In many ways, you can format your dates yourself. Whenever you make a sheet, you need dates in many ways. So now you do not have to worry about making dates. You can make dates as per your wish. We do this in our life just because they are not used that much right now. This marathon is based on usage, the number of things you use are taught in great detail, here is a For the bar, you can go through the theory that let’s say T is the rate, what does it do for you? It is a place holder. You wrote some text, you wrote it forever and after that you put T the rate, then if you write any text later, this thing will keep coming in front of it. Now what is this ma’am, let’s try it, let’s say okay, we take it here. Let’s say I took this space and I went to the custom, after going to the custom, I took it here and first of all I took the T in the journal. We put the rate, then we opened the double inverted comma, gave a space, wrote tons and then closed it in the double inverted comma and we wrote OK. Now I write 20 here, 30 here, 40 here, 50 here, then the automatic has come with turns in front of it. Why, because what is T the rate tells you that where you are writing T the rate, you can write anything as per your wish. You can, but you have fixed what has to be written behind it. What have you fixed that you told him because I always tell you that whenever we talk about any text, the text is always written inside double inverted commas, so you gave space first, that is why there is space in it too. If suppose you do not give space here, you deleted the space here and you did OK, then see, the space will be gone from here also and see, I had not selected the one here, so in this. If there is space then we can do our format in this way. Now if you want then just ignore the error and your data will come like normal data. There is no problem then in this way you can find your sum. Okay, after that if you want, you can read the star from here that it pats the character, other things are not so important, the date one is the most important, so we covered it in detail, so here we have explained our number format. complete it Now let’s move towards our conditional formatting. They will do conditional formatting. Now what is conditional formatting? Let’s take a small third portion for once and understand what is the meaning of conditional formatting. As is its name, so is its work. What is the name of conditional formatting? Whenever we talked about formatting, when we did the initial formatting, what all did we talk about whether we We talked about the alignment, then we talked about the font, then the font color, the font became the color, after that we saw the fill option, then we saw any kind of color, border, we had done these types of things in the formatting, so now we have to format our data, so it was understood that we are going to decorate it in this way, but there is a condition in decorating too, we will give it a condition that if anything like this happens then this Do it otherwise don’t do it. For example, you made a list of students in which there were marks of the students. Now inside that marks you wrote that if any student has got more than 33 marks, if he has got more than 33 marks, then you make him in red color, otherwise you make him in green color or put the opposite, then wherever there is red, you will understand how many marks he has and wherever there is green, you will understand how many marks he has, so basically. You gave him a condition, let’s take another example, suppose there is a report of sales and you are writing that whoever has sales more than ₹ 10 lakh, we have sold to whomever has entry above ₹ 10 lakh, make it in green color, then wherever the amount is more than ₹ 10 lakh in the entire sheet, there will be green color automatically and by doing this, you will directly know to which party you have sold more than ₹ 10 lakh. This is the condition for matting that there will be a color, there will be a border, whatever you want to do, everything will happen but with one condition. If we talk about the condition, here it was at 33. If we talk about the condition here, it was 10 lakhs or should be above 10 lakhs. So that is your conditional formatting. Now let’s explore their options. Conditional formatting is available to you inside the home tab. You will go to the home tab called conditional. You will get the option of formatting here. Now it comes to the matter, as I always say, if you want to apply anything, first its selection is very important, so here is the selection I am taking. First of all, I want to know the maximum rate to whom I have sold. If I want to know the maximum rate to whom I have sold, then I select this data. I go to conditional formatting. I have clicked here, I have not clicked, I am just coming, so the option has opened automatically, after this you will go to Greater Dan and write here, I want to know, all those above 650 or 700, color them or those above 750, you color them, I have to do it in red color, different colors are available here, I have to do it in red, I want to do it in yellow, I have to do it in green, let’s say I want to do it in green and I did OK. So, whoever was above 700, you will be able to see the color here, whether the color has come automatically here, what we have applied on one data, can we apply something again on that data, the answer is yes, just do not over rule, if you over rule, then the next one which you apply now will take it and will make the first one null and void, so basically now suppose you want to do the same in this only by going to the highlight cell role. Less than means now you have to know more, now you have to know less than 600, if you want then color it red, you did ok, then you realized that Less than 600 have come to you in red color and More than 750 have come to you in green color, so now you will understand just by looking at which color defines what, okay, after that let us assume that we want to see in quantity, we have selected a range. We will go to the condition formatting and we said between, we want to check the quantity between 300 and 400, I want to check who I have sold between 400 and 500, let me know that and all that mine comes in yellow color, then I did ok and it told me, to whom I have sold the quantity between 300 to 400, then I came to know, now I am also able to know from here that the load should be seen twice, urban. I have sold these in medium quantity to Binds and Ekta Creation but at low prices and here I have sold both of them at high prices, so in this way you can get a lot for yourself by applying different colors. You can take all the decisions, you can check the decisions of many, you can check all the things, now this was that normally you have got greater than, less than, you have got between, like we do in our maths too, now comes the next option, what do you get, equals to, suppose you know the exact amount and that exact amount, you want to capture where that exact amount is. It is written for example, I have selected everything and I want to capture the exact amount 376. Where is it written, so I selected it, went to Highlight Cell, went to Equals 2 where I have to go, where 376 is written and after that I want to give a different color of my own which is already pre-defined, if she does not want to give it, then come here to Custom Format, see, the same dialog box opens inside Custom Format, First of all, by opening the extension of Alignment font, it opens and the same key appears, so with more options, you will not feel that oh my God, I don’t know this option, you know, okay, we give purple color here, go to the font, we make the font white, bold and bold, do OK and then OK, then it told me that in the entire data, the amount of data I had selected, if seen inside it, there are 376 here. If it is written, then in this way we can check where something is written, if you know the exact amount, whereas till now all the things we were doing were related to the number, now whatever comes, comes related to your text, like your next comes the text that content, suppose look at the text, if you want to check the text, then there should be data of the text only. I checked this, now I just did not remember much or the name of the party, I just remembered that. Behind that party, it comes with no solutions, so I clicked on the solutions here and said, brother, color the solution written there, so that I can see it and then I will know it, fine, I had talked about it, so now I did OK, then it told me OK, these two entries come to me in the name of solutions, okay, so if you have a chunk of some text and remember the same and you want to find the complete text from it. You can also do this by highlighting the text with that content. Next comes the date ring. Suppose you have selected the date just because. If you want to do the formatting of a number then the number should be selected. If your selection is correct then you will get the answer also correct. If you select the number then you will get the number. If you get the selection of text then you will have to apply conditional formatting related to the text. Now Next. The option which is going to be related to our date, so we have chosen the date, you go to the condition formatting, go to the highlight cell rule and after that you go to the date array, after going to the date array, you get the options here that you say yesterday just because today is 24th of February, so here is yesterday, if I do it today, then today is coming, tomorrow is coming. I have to highlight yesterday, I have to do it with green, so I made it green and I did OK, so you can see this here, you can also check the date, our date today is 24 Feb 2025, so the date we see here which has been highlighted is 2025, sorry, 25 Feb 2025. Okay, if you want, you can highlight yesterday also in the same way and inside this you will get more information. You get a lot of options, which is like last week and this week, next week, last month, this month, next month, you get a lot of options, you can explore it here, the main thing is that you should know what are you going to do in conditional formatting, what is our use case, what do we want to know, whatever you want to know, you can explore it here and different different. You can see by applying options in it, here then you are left with the duplicate values, that is, if there are duplicate values ​​anywhere in the entire data, then remove them, but before doing this, look, we have made it so colorful, so first of all, find out that if I want to remove all this, then how can I do it? So, when you go to the very bottom in Kandi formatting, you get clear rules, then here you get two options, one is clear rule. From the selected cells that I select a cell and remove the condition formatting from it or I call it clear rule from the end there might be chances right now it is very small data It has been taken that there is huge data, there is a lot of condition formatting, you are not even able to understand where it is included and where it is not included, then what will you do in such a case. In such a case, you will clear the roles from the entire sheet, but before clearing it, I will teach you the management once, after that, clear because I have just cleared it, then how will you learn the management? So let’s see the management now, maybe you have some I did the conditional formatting and later suddenly it came to my mind that this purple looks a bit strange, it has become too dark, all the other light colors are there, so we have to change this color, so what you have to do is go to the conditional formatting, you will come down here, in Manage Rules, after coming to Manage Rules, you are not able to see anything because you have not made any selection, you have directly reached the conditional formatting that I So if you want to change then look above, you are seeing the show formatting rules for whom, then you show this worksheet from here, then all the conditional formatting done on this worksheet will be shown to you here. Okay, you have to change this one, you select it and look above here, there are options like this: New Rule, Edit Rule, Delete Rule. What you have to do is you have to edit, you go to edit and after that you Obviously you want to change the formatting, then you go to the format, from here you choose any other color, I take blue from here, okay and we have done okay, now we can apply it, you can also do okay, so look at this, it has been applied in this way, I like it much better than before, so in this way you can make changes. Now suppose I select this cell and after that go to condition formatting and clear rules. If I go to the selected cells and from here, I go from here only , I go from here but I don’t go anywhere there and I go to Clear Rules and want to remove it from the entire sheet, then your conditional formatting will be removed from the entire sheet. Now let’s do what we wanted to explore. Next, let’s explore the one with duplicate values. Suppose I want to know whether there are any duplicate values ​​in the entire data. Not checking in dates, so I selected this and it is talking about values, so text will not work, so we took this, let’s consider text also, so we took this, after that we went here, came to duplicate values ​​and whether to take duplicate or take unique, it is totally up to you that you have to color the unique or whatever is not repeating, so obviously it is the complete data which is not repeating. If you want to duplicate it, then how to color it, you can do it here. Now suppose I make it 521 here too, then it will also be colored. Now suppose I make it 314, then it will also be colored because it is a duplicate. Suppose I make it a color, then it will also be colored. It also works on text, so because it is a duplicate, okay, so in this way all your things work if there are duplicates everywhere. If you want to check, then you can check in this way. Okay, next you get this. What does Top Bottom Rules do? First of all, we have to select the item in which we want to check. Suppose I have selected this and after that I want to know what are my top 10 items. Only two items are 13, so knowing the top 10 is a bit weird, but you see, top 10. If you want to know less, you have to know the top five. So you can also do the top five and from here you can color them, I gave yellow and gave OK, then it measured all of them and colored the top five out of them. Similarly, if you want to know the bottom 10 also, then you select it. Go to the conditional formatting and take the bottom 10 items from here and if let’s say you want to get the red color in it, then you did OK, then the remaining ones are in the bottom 10. Oops, we have 10 should not have been taken because in bottom 10, obviously it will take the rest of the data also, we come to the bottom 3. Okay and did OK, then it told me that your data comes from bottom 3. Now it was normal and directly wrote to you that bottom 10 is needed, bottom 3 is needed, top 2 is needed, top 3 is needed, top 5 is needed and color has come. Now more options come in it, on top 10, on top 5, on bottom 10. But what is it at the bottom 5? Basically if you suppose the whole is summed up and how much comes out at 10, off the total output at 10 will tell you. If you have conditioner formatting then go to the top bottom rules and if you want to color the top 10 para in red color then it will appear on your top 10, there can be more than two values ​​at the bottom, there may be more than one value, your top 10 para is falling on it, there might be chances that it is falling on it too much. Well, you can also change the percentages from here. If you want, then you can make the bottom at 20. But you have to know about 20 and you have to fill green color in it. Look, in this way you can fill more than one value can fall, even one value can fall, so in this way you will get the values, so this is what you have learned now, learned the highlight cell rule, learned the top bottom rule, after that you are going to learn the data base color scales and icon set which is very simple but for that, first I clear this data, so I have just selected. And now I can also do selected cells. Now suppose you want here that the one which has higher rate means the color should be filled inside our cell in such a way that the higher date can be understood. If the one with higher rate can be understood, then you will go to the data bars. Here you get two options. The first one is gradient and the other one is solid. What is gradient? It is the one which keeps the shadow like shadow. Look, whatever color you are doing. If yes, then see the shadow is coming in the last, it is becoming a little light in the last and what is the gradient? What is the gradient? What is solid, sorry, solid is not a solid color, it will look exactly like this, okay, if you want, the gradient is solid, you get the same result, you can click on it, which is more, then that cell will be filled. Now what is it, I can tell by looking at this cell completely, 932 is the highest because the whole cell is After that I can tell that this is 9907 which is the second highest because it is just a little bit left after that, it seems to be 855 or you can say it is 876 or you can say this. In this way you can judge by looking at these colors which one is more and which one is less. It is totally up to you whether you want to show it or not, whether you want to show it with gradient color or with solid color. It is totally up to you. To you, you can show as you want, okay , let’s go next, let’s say I want to show something in quantity, then what do the color sets also do? What is there now? In the data bars, there was only one and it was showing you in the form of bars. What is there in this? Shade shading is like, you will get different shades like middle, so it means the one which is least is dark, then it will be less than that, then in this way you will get less than that. It will be visible in the form also and just like this shading is happening, you can also put the icon in the same way. If you want to put any icon, it works exactly the same way, the lowest number is red, the normal number is yellow and the best number is green, like our traffic light thing, so look, if you put this icon, it came in the icon in this manner, then it was 932 highest, so see green is visible, after that 856 green is visible. After that 855 green is visible, okay, so in this way you get these highlighted and this was your conditional formatting. In conditional formatting, let me tell you one more thing, these are the clear rules, we talked about manage rules, let’s talk about the new rule. Inside the new rule, you get to explore all the same options which you have explored on the outside. If you want to read it in detail like Format All Cells. Based on the values, we just did the format cells that cells that content, so we did the values ​​that contain , format only top and bottom ranked values, we did the top 10, take a look, it is also written in this, you can turn on top 10 or percentage or format and only values ​​that are above and below average, so above and below average, you get it here, let me show it to you. Click below you get to know the average 2499 28 And if you want to color then you can go to this and you can color the above average in one color, if you want to color the above average in red color, if you want to color the below average also, then from here you can give a yellow color to the below average and in this way you can color the below average also, you can get this directly here too, it is ok format only. Unique and Duplicate Values ​​We have tried this now, this is one option which you do not get directly, whenever you want to explore, you will have to come here, that is Use a Formula to Determine Which Cells to Format, meaning formatting has to be done here using a formula. Now till you have Unless you learn the formula, you cannot do it here and even after learning the formula, you do not have to do anything here, just like you write a formula somewhere outside, you just have to come here and write it and after that, if you are satisfied with the formula, then you can get that color done here. We can look into it further, but here we have covered all the other things which were there in the conditional formatting and that too very good. If you have any doubt anywhere, please let me know in the comment section, I will definitely help you and I am constantly saying that you go while writing your doubts and if you feel that I want to learn better in this thing and want to do it, then you can definitely come to the live course also, all the things will be found in the description and what happens is that in live, you can discuss with me which is the best. The most main benefit is and the other thing, now you will get this sheet also, so daily when you get the sheet, do you practice something daily, either you do it in one sitting, then there are more chances of forgetting it, or slowly and gradually, if you start absorbing it in your habit, then we start getting comfortable, so that is the main purpose of life that there are many people who have already excelled and are still doing it. There is only one major area, no, it is that normally, what do you do, what do you learn and then the end of that, yes, we have learned this, the certificate has come and when you do it live, you practice it, now somewhere when you listen to something daily, you understand more, so that’s all, so here we have completed the condition formatting, now we move ahead, see inside the home tab, we People have done the number condition formatting. Now we complete the table cells style and the rest of the things. The remaining chunks are completed and after that we will move towards our remaining basic formulas. Data entry and the other thing is table creation. In normal data entry, you do not have to do things manually, whereas in table creation, you do not have to do things manually and it keeps running automatically. Your data is basically a dynamic one. This is done in the form which is updated automatically, that is why table creation is a better option. In comparison to the data entry and when it comes to the formula, neither is the formula. The bigger the formula, then obviously ranges are given in it. Initially, when I had explained the formula of sum to you, I had explained that brother, we will give the range, then your formula is applied on the same range, so what is a range here? Suppose you have given a range somewhere from a1 to a1, but later you have written the data in a101 and now your data is written in a200, then later when you have written normal data, what will you have to do? You will have to update your formula there. You will have to give the range from a1 to a200 because now your range has increased, now you have entered more data in it because of daily new. The data is being entered but when it comes to the table, initially when you give a range in it, it does not take even a 200 or 100 and will write it like this. The table will write the range in such a way that later whether you enter 200 or even 2000, it will automatically give their sum, it will automatically update your answers, so this is the biggest and most effective use of our table. Mainly, this is very useful in the formula. Now if we have to talk so much then it is important to see how the table will be made. So look, first of all we have to make the table. Let me tell you one thing, whatever heading is there on the table, we call it a header. What do you call header? You select your data. Oops, I am so sorry. You took this, you select your data. Now you have two options, either you go to the Insert tab and here you select the table. There is an option, click on it or what you can do is you can press control t. Table starts with t tab. So if you press t with control, then you will have this type of OK, my keys are not working. It’s okay. If you go here and click on the table, then you will have an option like this. Now what is it saying, My table has headers. If you turn it off then it thinks that the data that you have It is given in the first row in the first column that dates are written party name quantity rate amount is this also your data is it your data no which is at the top It is written that it is a header, it is possible that sometimes you have data in such a way that there is no heading above it, then you should not turn it on. Now it is necessary to turn it on. My table has headers and if you do OK then now your table has been converted into a table with a header. Always remember one thing in Excel. When we insert something separately in Excel, then if we have to make any changes in that inserted thing, then a separate tab is automatically created. Otherwise, you have as many tabs as you have , but it comes as a separate tab. Now like I have inserted this table, in a way, I have converted my data into it, in a way, I have inserted the table, so whenever I click here, I get the above format of a table design. Look, click somewhere outside, it will go, click on this, it will come, isn’t it coming because it thinks that I have inserted a table, now whatever. If you have inserted, then whatever changes we want to make in it, we will do it through a new tab. First of all, whatever work you should do, what work should you do? Even if you are doing any work in your real life, you are creating a lot of tables inside it, if you are doing a lot of work, then I would call it mandatory, so that you can make the work easier and make it better. What should you do for that? After creating the table, you should name the table here on the very left side of the table design. And here you don’t have to give space. If you give space then the name will not be taken. Okay, so don’t give it space. Name it anything. I have given the name of Sales to Sales, so what will happen in the future, whenever you have many tables, suppose you have a lot of tables, some are Purchase tables, some are Sales tables, some are tables of employees’ details, there are many tables and you have to go somewhere and apply a collective formula. If you have formulas somewhere, then this is yours. There is no table one, table two, table three, what did I just explain to you? Look, normally, what happens is that a1a 200 is done in this way, but in the table, he takes the range of the table and writes the table range, so now table one range would be written there, then you will go around wondering what is this table one, now go and check whose table one was, table two whose it was, table three, so if you name it that is the sales table or the purchases table, then now. Even when you apply the formula, it will come by writing ‘Sale’ or ‘Purchase’, it will not come by writing ‘Table 1, Table 2’. Table 1, Table 2 was coming only when you had given that name to it. Along with this, you can see above that these filters come. We will learn later how to use the filters. This comes by default in it. You can go to the table design and change any color from here. If you want any color and type of table, then you can convert it into that. It is totally up to you that how do you want your table, I want it in this way, I want it in this way, I can keep it like that and inside the table design, what are the options you get? Header, we want total, we want total in this row, below is the total. If you don’t want, then you can turn it off and in this way you get other things. If you want to remove duplicates from it, then you can remove them directly. Have you removed the duplicates? Yes, check among these. Is and after that you can check in it, if nothing happens then it will not be deleted. Now we have learned about the normal things about the table. Now it is very important to understand the difference between main data and table. It is okay to have made the table but it is also very important to know what is the difference. So, let’s do one thing, take one data and after that we will know easily. So, I copy only this from here and enter control alt vv. Now why did I do this, I will tell you this slowly later on. I will explain it to you there, you will get better clarity. Now if I sit to explain, you will not be able to understand and I will not be able to explain because you have not got that understanding yet. Let me format this data for once. As you can see, these are numbers whereas they should come in dates. So what will I do? Now, I had explained to you the number format, I will go to the number format and convert it into short dates. If I want to select this data, then control a. I can select this data with Alt AB A, I put borders inside it, with Alt ABT I put borders outside it, and just because for now, I have converted it to normal values, so this is not our formula, so we will apply a formula, quickly equals to this multiply by this enter, so like this Now double tap on it, you will have these formulas. Now we will start understanding the difference. How can the difference be understood? Suppose, now I have to make a new entry here. Let’s enter from today’s date. So I entered today’s date. Here I name anything. Stella Stella Rojo. I named something like this and look here, automatic zero has come, that means it has automatically updated your formula here, do not wait. Here it is 2000, here I have given 100, so see, it has updated automatically, so does it do the same thing here, it will do the same here too, but why does it do it, I will definitely tell you the difference, here I write Stella Roger and then here also I write 2000 ok here also I write 100 and here also we are getting the answer, so ma’am you were saying that all the things in the table get updated automatically. But it is not happening here, it is happening here, look why this is happening now, let me tell you the reason. Now as you can see, here it has automatically applied the thick border that I had applied here, it has taken it automatically in the correct manner, so you can see that here it is not in the correct manner, one thing, so you see this, the second thing, I had shown you here already zero, it has automatically updated your formula, that is not the thing here. I was waiting to see if any value came. Is this happening? Why is this happening? Due to a setting in your Ekal, there is a setting inside Ekal that if you make three-four entries in the same pattern and after that you keep writing something, then it automatically considers it as a pattern and starts answering. Now where is that setting, like you will go to the file, you will go to Options and from here you will go to Advanced, then you are seeing that you are allowed editing directly in the cells. Extend data range from the formats and formula, you do one thing, turn it all off for once, turn it off, after that you do OK, now I will make an entry here and after that you will see, now we are going to make an entry again with today’s date and now I would have written here robot robot robot chucks, after doing this I have written anything, I have seen random 500, this zero comes already, this is a great thing. Okay, so I have come to this, now I do the same thing with robot text and now look, it did not even take this, it did not even correct the alignment, earlier it was correcting the alignment, 500 150, and no answer, why because you have turned off a setting of your Excel, then there is a setting due to which your data keeps getting auto updated, otherwise it does not get auto updated in the normal data, now suppose I turn it on and go to the options. After going to the options, I go to the advanced and turn them on. We turned on all the settings that were there and from here also turn on the automatic search. Now when you do it, it will take it automatically, then we delete it, do it again. Here we will take robotics. There may be chances that he may or may not take it because we have already entered once, now he has taken it because now he has followed the pattern and we have turned on that setting. That the pattern which is written above should be extended below also and take it in that way. Okay, so this is what we have, how to make entries inside our data, what difference do we see in the table . Now one more main chunk, I am going to tell you about the table creation, I am going to tell you one advantage, which is the slicer. Let us now look at the slicers of the table. See, we get the slicer inside the table. Now what is the function of this slicer? It allows us to easily access our data. For example, suppose one, these are filters so that if I want to see anything, just want to see something of Aqua Pure Solution, then it has shown me the data, so in this way we can see from the filter, but how big is the process of filter, you will go to this filter, select it, after that, you will check, it seems quite time consuming, it seems to be a big process, so what can you do in such a case, you can insert a slicer, now you can insert something. If you want to do this and that too is related to the table, then you will have to go inside the table, then click somewhere on the table and go to table design and here you will see the option of insert slicer. It is asking you whose slicer you want to insert, meaning for which thing do you want a date slicer, whether you want to filter your data according to the date, whether you want to filter it according to your party names or according to the quantity, rate and amount. So I take the party names, I do OK, now I adjust it here, anywhere else, for once, I adjust it here, clicked on Aqua Pure, Bharat Craft has come, Ekta Kapoor, Sorry, Ekta Creations, what has come on Green Leaf, Organics, what has come on Innovative Solutions, if you want to do multiple things, then if you want one, then turn off the filter, this crossing means filter. Only off, if you want multiple, then you turn it on, it is on, Aqua Pure Ekta Heritage Mastek, now everything is selected, no, remove it, I want these, so this has given me the answer to these, in this way you can do this, you have also inserted this slicer, if you click on it, there is a separate tap for the slicer also, see, I always say that if you insert anything in Excel, then there is nothing in that inserted thing. If you want to make changes, then you get a separate tab for that and you should make changes within the same. Changes can be made from within the same. If you want, you can also keep your slicer related to this, so that is a beautiful one, it will show you that, you cross it, the complete data will come, you can also adjust it, you can make it smaller or bigger in this way, now I delete it, you can show the slicer in this way or else I can control it here. I do plus plus so that we have a little space and I select it and do Alt AE A so that it gets deleted and I place my slicer here. In this way, the slicer is automatically placed. I can make the color a little better, so I take green. It looks a little better on the screen. So, in this way, we create our data. In this way, your table creation is done in this way, all the things are done. I hope you understood it completely. If there is any doubt anywhere then please let me know in the comment section. Let’s move ahead a little. The other thing is cell style. What does cell style do to you ? Like suppose you have taken this data, you have taken this data and copied it. I just create another sheet, rename it with cell style, do end ok and here I enter control alt vv so that my data comes in. Okay, exactly the same way as I had fixed its formatting earlier . Similarly, if its formatting needs to be corrected, then I will quickly correct its formatting. When you do this work again and again and you see it being done again and again, give it all. I also had the option that I can prepare everything in advance, but this thing is known to you, what happens, we will not show you the process right now and will tell you all the things directly, then how will you be able to relate because in your life, you will also have to correct similar things, so that is why we do it in this way. So see what the cell style does to you or does it help you directly ? Now I do one thing to do any kind of formatting. Now I do one thing to make it normal. Now what I do is select the entire data, take control A and after that I go to the cell style and select anything. Here, I can directly do the formatting of the table in the way I want, it will give it to me directly, after that if I want to make any changes then you can do like That now it seems a little light to me, so I made it dark, I want to make it black, I want to make all this black, so it has come in black, I like it better, now I want to give it any color, so I can color it, so in this way you can change it later, it seemed beautiful to me, so I made it in this way, so this was your cell style. Colors are pre-defined inside the cell style. If you want, you can change the themes of these colors as well. Right now you are seeing one set of colors here. If you want that this set of colors should not be visible , if you want to see some other set of colors, then you will go to the page layout. Here you will go to the theme. Inside the theme, here inside the colors, you get many different types of palettes. Suppose you have taken this palette, now you will see in the cell style according to that palette, then the color has changed here. Now you are seeing the colors. Look in this way, I have seen this cell. Selected and went to sell style and I took this color, it looks so beautiful. One of my favorite color. Okay, so this looks so perfect. If you wanted any other palette, then you can take another palette in the same color from here. See, whenever you change the palette anywhere, overall because you have done this work using a single palette, then overall the entire theme of the system gets changed. Now you will go to the home and look here, you will see that the theme of colors has changed, there will be some other colors first, you are not able to understand. Once you remember these colors well, what kind of colors are there, okay now I go to the page layout, go to colors and here. So now you go to your home and see the colors here, the theme of the colors has changed, earlier it was in a slightly reddish reddish color, now look, it has come in this way, so with this, the colors can be changed not only in the cell style, but also in the cell style, which seemed to me one of the beautiful, one of my favorite seemed to be not here because I changed the theme from there, so it does not change only here, it also changes there in our home font. If it is changed then it is a cell style so that you can do any formatting directly, you do not have to do much hard work, this was one thing, the second thing is that I would like to tell you about a shortcut, let’s say do Control C and enter Control Alt v v here, now you just change its format and nothing else to do, you did the short date, did Control A, did Alt and C A, did your data, now suppose you want to do any formatting directly, you should do it in this. If you don’t want to do any hard work, then what you have to do is, you have to select this data, after selecting the data, you have to press Alt O A, then after this a window like this will open in front of you. What can you do from this window, whichever way you want to format, you can do a lot of formatting inside it. Suppose I like it, I have given OK, then this formatting has been automatically converted into it. If you want to do any formatting directly then this is the direct formatting. You can also do this in this way, what have I pressed, I write the shortcut key here, which is Alt OA, okay, your shortcut key, I have written here Alt OA, so in this way we work in our A cell style, now let’s move ahead, so look, till now we have completed our cell style, after that if you see any feature, then those features are visible here for insert, so we have already made you know where you know how to insert the cell. How you have to insert a row, how you have to insert a column, we have learned its shortcut keys, after that comes the delete key, we have also learned how to delete something, after that comes the format. Inside the format, we have learned the row height, the column height, it has to be auto-fit, all this, now comes the turn of hide and unhide, if suppose you want to hide something, suppose till now. You have done this work and now you have to hide this cell, if you want to hide this column, then you can hide it from here also by right clicking or you have this option inside the format also, so why do you have to go so far, you have to right click from here and then click on the hide option . Here something is hidden, if you right click and unhide it, it will be unhided, so in this way we hide or unhide something, in the same way, if we want, we can hide or unhide any sheet too, like I have hidden it and if suppose later I want to unhide it, then I will click here only and unhide it here and it will tell me that I need to unhide this file. If there is more than one file, then you will see it here. If you do OK, then your file will come back here, that is, your sheet will come back. So in this way, if we want, we can hide or unhide our daily columns or our sheet. You get this option here also, but there is no need to go there and do such a long process. You can get this option by directly right clicking. This option is there in almost all the formats. If you get it by right clicking, then I like the right click option better like now you have the next option, take rename, take tab color, take protect sheet or take mover copy, take hide and unhide, then here you can check hide and unhide rename sheet. Move Copy Sheet Tab Color Protect Sheet Lock Cell So almost all the options we get by right clicking, you get the same options here too. Now let us move a little further in this Rename Sheet You know this thing how it is done, you click on any cell, any sheet and rename it here and you can rename it, okay, we have given that cell, after that suppose you want to color, then you right click and tab. Press on the color and you can do whatever color you want. I had made it purple, so we will keep it purple. When you are on that sheet, then that gradient fill will be visible on the sheet. As soon as you come out of that sheet, if you are on any other sheet, then you will see that solid color. Okay, after that, the most important thing is that there are two things here, the first one is mover copy sheet and the other one is protect sheet, so I am giving you both of these. Here, I am going to teach you, first of all, what we will learn is mover copy sheet. Suppose now you need another sheet which is exactly the same as whatever work has been done on this sheet . In this workbook, I am explaining to you by taking three scenarios. For now, I want a copy but in this workbook. Now either, what is the first method I have that I select the entire data and do control C and then create another sheet and do control V in it, then it is a time consuming process. How can we do this work directly? What do you do to make it exactly the same? You are on this sheet of yours, after that go to the format, click on move and copy sheet here, understand a little what it is asking you, first of all, the names of all your sheets are coming here like number format is theory, number format is theory, so in all the sheets, whatever number of sheets you have, that is, whatever number of sheets are created in the workbook, that name is coming here, The Other. The thing is that what do you need, whom do you want to copy, now suppose I have to get the cell style done, so I clicked on the cell style, OK fine, after that what do you have to do, create a copy or not, yes, you will have to create a copy, okay, I did it, the cell style has come here, look, the cell style is the same, you will not even be able to tell the difference, it will come in the name of Tatu, but you say no, we don’t want, we need it in some other file. Meaning, this file should remain here and should also be moved to another file. Okay fine, if we do this then what will we do, we will send it to cell style two, we will do the work, then we will go to format, move and go to copy, select cell style two. Now we are saying that the copy of the sheet that we will send there should also remain here, meaning that sheet should remain here and in the one in which we will send it to the new one, so here we will turn on create copy, now you have to send it somewhere else, that’s it, right? If you want to send it somewhere else then now you will have to choose another file, first you have to select the place where your file is, then as soon as you click on the place where you want to send it, you will see all the files which are open in your Excel, you have to keep them open in whichever workbook you want to send it or the other way is that if you want to create a new workbook, then New Book is also written here, so suppose I want to send it in Book One and OK. So here I had another Book One open and Cell Style Two has arrived here in exactly the same way. Okay, in exactly the same way your Cell Two has arrived here. Okay, suppose we come to this only and Cell Style Two. Now we will send it again but will send it in a new book and now we want it to go from here, it should go from here, it should not be here because what will we do with two sheets of paper here, then we will go to Cell Style. Now we will not click on create a copy because in such a situation it copies it. Now we will directly click on the new book that we want in the new book and do OK. So see, a new book has been created. Look, now you will say that it is not the same as Book One. Look somewhere in Book One, there are Sheet One, Sheet Two and other things. This is a sheet in itself and another sheet has been created with the name of Book Two and has come to you, so in this way you can get it very easy in Excel. You can move your data here and there, you do not have to select the entire data again and again by using Control C Control v. For example, suppose you are seeing the data till here, now here below, there is some data written at the very bottom, it will not be copied but it will remain because you have not seen that data, so when we copy and paste manually. So there might be chances that we make a mistake or leave some data but in this way your sheet is exactly moved there and also copied, whatever you want to do is done directly, so this was the way we have to move and copy, now it comes to you that you want to protect your sheet, meaning if suppose you have done some work, now you have to go for a break or an important call has come and now you Do you want to say, hey, I will go, if someone does something in this time, my work will get ruined, so we have to protect our work, we basically want to protect our work, we want to keep some kind of protection in it inside our system, then what can you do, you will go to format control, that is, you will go to format A, from here, click on protect sheet, make sure that these three arrows are selected, basically let them be locked and unlocked. The type of cells can be either locked cell or unlocked cell. Now if you select both then it means that all the cells will be locked. Okay and after that you can give any password here. For now I am giving 1 2 3 password and it will ask us to reenter 1 2 3. We gave it and we will do OK, so in this way now this password has been protected. Now how will you know whether the password is protected anywhere, you can do anything. If you try to write, it will not let you write. The cell and chart you are trying to change is on a protected sheet. To make a change, unprotect the sheet, you might be requested to enter a password. OK, so what will you do? You can do it from here again, you can do it on the sheet as well, it is the same thing, you will go to the unprotected sheet and enter your password here. 1 2 3 And OK, if you do it, look here, now you can enter your password. If you want to write anything, you are able to write, it is allowing you to enter. Okay, if you want to do this temporarily or not, I have to do this thing, put the password again and we are going out, you can go for a break, no one can write anything, we are trying to write something, it is not allowing us to write. Okay, so in this way you can protect your sheet. This option is also available here in the format. Look at the home tab, which is a summary. Most of the features are inside the Home tab of the entire Excel and there are some features in the Home tab which are for the overview, you will get those features later too, like here I unprotect it for once, like you saw the Protect here in the Review tab, when you go inside the Review tab, you get the option of Protect Sheet and Protect Workbook here, but if you do not remember there, then you will get it here under the Format too, if it is not there then also. If you right click, here also you get the option of Protect Sheet. Basically, you are protecting the particular sheet. Okay, so in this way you can put the password here. Now we have completed this which is our format, after that what comes to you is Autos. You have already done the rest of the things. These are the functions, we will do them only when we do the statistics, after that I want to teach you this series. So, we will start very basic. If we start from basic, then first of all I will give it a name. Okay, here we have

    different different things. For once, I will also give it some color. Now, when we are giving color to all the things, then it is not this, which color should we give? Give us blue, what about blue, okay, see what it does basically. The first thing I will tell you is that you have to fill any thing, see what is this option, this is the option that you will get. It is visible that this is the option of fill, and what is the spelling of fill, it is FI, so remember that what is this option, it is the option of fill, what will be the spelling inside it, it will be FI, so now if you have to do anything inside the option of fill, then see how its shortcut key will be made. Let’s draw once for the shortcut key and just give me a minute, we will adjust it and We have come to the draw page and see what our activation is, what does it mean from alt to home page, where do we go from alt to home page, what is the spelling of fill better than H, F I, so remember now, whatever work we will do in this entire sheet, it will remain as Alt H F I, next to this, that thing will keep changing, after this, whatever you have to fill, the name will keep coming according to that. Everyone must have understood very well that what is Alt, what is H, what is F a. What is ok, now let us work in actual, see what is the first option that comes, suppose I write here Tanu Single, I have written this name, ok, I auto adjust it with double tap, fill some color inside it, like I wanted to fill a good color, this color is good and we have filled this color, given a border in it, in a way it looks quite good, ok, if I want the same content at the bottom, that means exactly. We want that thing in the cell below, so basically what we want is that the shortcut key to fill down fill down is Control D. I am telling you exactly the shortcut key. If you want to go directly from here, you can go from here too, but I will also tell you the way to go from here, but remember this one, Control D and if you want it on the right side, then Control r. Now let me tell you one thing, what does it do? Basically exactly the same if there is any other color here. If there was a different color font here, then it would also have chosen a different color font. If there was a different size font here, then a different size font would have come here too. Exactly copy paste does exactly copy paste. So to know us about fill down, I write here, what we did for fill down, what is our shortcut key for fill down, fill down and fill down, control D and this is what we did, fill right and What is the shortcut key we have for fill right? Control R is fine and at the same time if I want to go according to the home keys because you get this option in the home tab then Alt HFI and it is found D and right is called R. So if you want, now you have two shortcut keys meaning one more thing, meaning the easy one, if you do not remember this then what shortcut key can you use because now you have generated the shortcut keys from the home tab also . Alt H means Home F I Fill and after that it is D, it is D, neither is it D, and here Alt A A I D D will not come, what will come, this is right, otherwise r will come, okay, this thing which I have just told you has been done for down and right, if I talk about the same thing for once, I copy it and paste it here, if I have to do this thing in the upward direction or if I want to do it in the left direction, then I have There is no shortcut key. We don’t reverse anything anyway, we don’t go up, so that’s why the main thing is used only. If you have to do something on the left, then you will go to the left cell and after that you will click on the left, then it will be filled in the left. If you have to go to the up position, then go to the up position and then go up. Okay, we can do this directly, they do not have any shortcut key. Okay, I understood, generally we either We move towards this or move like this, that is why their shortcut keys are available with us. Okay, everyone understood, so what did we learn here? We learned these four types of fill: Down, Right, Up, Left. After this, what we are going to fill is a series of fills. Which is the most important thing, so let’s listen to how the serious feel is. First of all, let me look at you in the serious feel, first I will give you the complete feature, and then one last one. I will also write a formula, okay, let’s write a series, first of all, let me tell you the normal series. If I want to write a normal series, then I wrote one and I can drag, one way, I have this and I can do the fill series, one way, I have this, I take it a little to 10, it is okay, the second way, what do you have , the second way, you have this, you write the initial number here, one and go to that initial number and here in the series. Go, after clicking on the series, a window like this comes to you, now what does this window say that what you have to fill, you have to fill it daily, you will come to fill it daily, otherwise it will go like this, it will go like this, I will do it one by one, let me tell you how the daily works, keep it in daily like this, linear means what is linear used for, plus is used for minus, so plus minus means we are adding one number one by one, isn’t it technically you? When you see the series 1 2 3 4 5 6 7 8 9, if you check it technically, then what are you doing? You are doing the same thing, then here you write one in the step value and assume 10 in the stop value, because you have to write till 10, then if you have given OK, then it will write it in this way and give it to you. It is okay, but you did not want to write the column in this way. That’s why we choose columns instead of rows, we have taken columns, we have taken linear, only one plus has to be done and here if it stops at 10 or 10, then till here your value will come directly. Now you will say that ma’am, we can do this by stretching, that is, we can do it by dragging, why should we achieve so much, these were also 10 numbers, so that is why you are feeling that I can do it by dragging, but if this is the same thing I can do to you. Say, if you want to do it for 1 lakh entries, then till 1 lakh you will keep dragging and here you have to write the amount by just one go, so you will write it directly. Okay, so this is what we do, this is our series. Now let me tell you another way. Suppose you have to write some pattern. You have to write the pattern. 2 4 6 8 10 If you have to write the pattern by doing something like this, then what is happening in this pattern. What is happening in this pattern that I have started from 2 . Starting with that, we write the numbers, OK, then what is happening + 2 4 + 2 6 + 28 8 + 2 10, so basically two are being added, so in this way, if we have to write any pattern, then we will go to this, we will go here, meaning we will go to our fill, we will go in series and what do we have to fill in, first of all, why do we have to do it in the column, now you have understood because every day, he will give us all the answers like this . If you want an answer, then this is your column. The second thing is that you have to keep it in linear. Whenever you have to do plus or minus, if you keep it in linear, then you have to do plus or minus. You have to do plus. Well, how much plus has to be done. Step value means, how much has to be done, then you have to do two and when to stop, what answer should come, stop when you reach 100, stop where the last 100 comes, then stop . If you do OK then 2 4 6 8 10 12 14, see, you keep going on till 50 values ​​till 100 is reached. Everyone has understood the guess. If you don’t understand then you can do the same thing. Let me show you in some other pattern. Let me show you in some other pattern too. Let’s say I is 100. Keep subtracting F from it until the answer is zero or till the answer is one. Okay fine 100 is written in the series, now what do you have to do in the column but now you have to do minus F because now you have to do minus and for how long when the answer F does not come, for Apple you have to do it till the answer F comes OK then 100 95 90 will keep decreasing and it will keep going till the answer F comes in the last, okay so it is up to you how you can implement any feature. When you use your features, you get to do it in this way, whatever is linear is for plus minus, just remember this, I will write these things to you, what we have done first and what we have done for linear, what we have done first and what we have done for linear and use for plus minus. Okay, so those who use linear, they use for plus minus. If you have a basic understanding of how the pattern is being filled, then you will understand these things. Now let me do one thing here and delete it so that we can talk about the second series below. Second, what do you see here, if you go to the series, then next comes to you, growth growth, which is growth, which deals in multiply and divide. Second, the one that comes to you, comes to you, growth and growth deals in what , deals in both of these, in multiply and divide, you will say that this See what kind of pattern it is, suppose you have written two, till now what was there was that you wrote 2 + 2 4 4 + 2 6 6 + 2 8 8 + 2 10, it was going on like this but now when you use growth, it will be 2 * 2, then it will be 4, but 4 * 2 will be 8, 8 * 2 will be 16, 16 * 2 will be 32, 32 2 * 2 will be 64, that is this. If it will grow in the same way then you go to the series and select the column. Now to take growth, what do you do here? Write 2 here and stop value 100. Then stop till 100 is reached. Do OK then 2 * 2 4 * 2 8 8 * 2 16 16 * 2 32 32 * 2 64. Now 64 * 2 becomes 128. 128 is greater than 100 and you had given the stop value as 100, so beyond that it did not give the answer. Okay, in the same way, if you want, you can divide it. Now like you have written 100 and after 100, you have gone to the filter, that is, you have gone to the fill, gone to the series, gone to the column, gone to growth and now you have to change the step value to 0.5, keep deleting by half the number and till the answer. If you don’t get five then ok let’s try 100 Did Ba 2 50 / Ba 2 25 25 / Ba 2 12.5 12 Did Ba 2 A 6.25 makes half of that, it has come, you just have to be a little careful that what values ​​should I put in it so that I get exactly the answer I want, then putting those values ​​is your main here. The work is going to be done, if you have put those values ​​properly, then all these things will come to you in the correct manner, so that is your growth and linear, you have also done the growth, now the main one comes, the end date of the day comes, this part of the date is used the most. Within the date, I have already told you in number format but still let me tell you what does date date mean today? You can see the date of 25th Feb 25, this is today’s date, so what is inside it, day, month, year, okay, so one way can be that I keep increasing every day from today, one way can be, I can show month wise and one way can be, I can show year wise, right now I am not able to understand it, it’s okay, now we will understand, okay if you see the example, you will understand, suppose I have taken today’s date. I took the date and after that I want to drag it, then it will get dragged, either I can drag directly, we do it when we have small data, we have to drag for some time, like for a second or two seconds, within three seconds we can do that thing by dragging, so we obviously do the drag thing but when it is taking more time than this, then do not drag, after that what do you do this Take the date and suppose you want to write from 25th to 26th, then you will go by dragging for a time, then you will have to pay attention that when 26th 25th February 2026 comes and then you will have to stop and there is one way – go to home page, go to the series, go to the column, why are you going to the column. You know this thing, go to the date and there are two things in a day, one day comes that is a normal day, the way other things are coming and so on. If a week day comes, it will automatically remove your Saturday Sunday, that is, you don’t need Saturday Sunday at all, if your days come without that, then this is also a liberty in it and the good thing is that if suppose you have to write only working days in this way and want to remove Saturday Sunday, then it will write it to you. Now suppose you want to write it only till the third March, then three three just because will remain till here, so okay, look here. Now suppose it has come, now you have seen that the step value is also written there. Now if you wanted to write a date in which if two days are lost, then you will go to the column, here you will write two in the step value and after that you will write 03 03 2025. Okay, so look, 25 has come, 26 has been left, 27 has arrived, 28 has been left, 20 first of match has arrived, second has been left, third. It has come because you have given two values ​​so that by adding two plus it comes in it, then in this way, if you want to fill any pattern, then you can fill the pattern, you check your step value, it will come only by adding or minus to the step value. If you want to reverse it, then put a minus, like suppose if I write 03 03 2025 here and then go to fill, go to series, go to column, go to date. I do -2 and I say keep writing till 25th January or 25th February comes, then see 3 1 27 25 You can also do this in reverse, what have you written this time, if you have written -2 there, then it happens in this way, now I will tell you the week day thing about the same thing, if you have to write the week day, then on the week day, first of all we will do this thing, then we will do this, then we will do this, so that you understand the difference, okay for the week day, you will do the same thing. First take today’s date, after that you go in the series from here, leave one in the column and from here take the week day and take it as 03 03 20 25 and ok so this came to you 25 26 27 28 and one and two he has removed it May be one and two Your Saturday is falling so one and two he has removed it Directly three has come Now the same work if we have someone in it If we want to do addition then we can do that too. We have this value. After the value, what are we doing? What should we do in the gap of two days? After that, we went to the series. After going to the series, we took the column, here we put two and this time we took the week day and the stop value, we took the same 3 3 20 25 and did OK, so see 25 26 is gone, 26 is gone because we called it two step value. If it was then it will give according to two values ​​and after that 28 is also gone because 28 will not come, the next one was supposed to come from that, why did the next one not come because it was within the week day, two did not come, so these three dates are left, like this we can do the reverse also 03 03 2025 And here we went to the fill series, after going to the series, went to the column and after that we went to the week day and here is the pay step value which we have Given -2 and the value that should be stopped here is 25 2 2025 and Okay, so we have these three dates. Okay, last thing, what is left with you for the month? Suppose, if you do this three times and you want only the month to be dragged, then what will you do? After going to the series, we will go to the date in the left column and will do the month. Now till how much do you have to write, suppose you have to write till 25 12 2025, then see 3 4 5 6 7 8 9 These middle ones are increasing. Which is your month? Okay, if you want to do the same thing for the year, then write down today’s date and after that you go to the series. After going to the series, you take the date from here and go to the year. Whether to increase by one year or by two years, it is your choice. I am trying to increase it by two years. I have shown this and after that, I am trying to reach where I have written 25 to end, okay two dashes. It took 20 15 ok then 25 27 29 see the date in between is not changing, only the year is changing and it has come to 49. In this way you can write the date of whatever pattern you want, you can write series which is fill series, it is mostly used for date, it is mostly used for date, now it complements the series itself, if you believe that then this is the feature. If you do not want to use this, then you can use a formula. Which is equal to sequence? What does the sequence do? Tap on it, write as many numbers as you want, directly want up to 1000 or only up to 10, you write this, enter it, see, a series up to 10 will appear, this is your formula, ok, date is needed, something has to be done for the date, Equals to sequence tab, sorry search, the tab has come, right? How many are required daily, let’s say 10 days are required and 10 dates are to be written, how many columns do you need, that is, how many columns are to be written, suppose I have to be written in two columns, then two OK, where to start, if it starts from today’s date, then you can write today’s date or you can apply today’s formula, let’s do this thing further, just because right now you will not know the today formula because we have not made those formulas, so normally you can understand. That we can do this even by applying the sequence formula, but it is better if we do not apply the formula because the references come from the formula, we can mess it up later, if you remove anything in between, it will create a mess, so that is why we should do it in this way by using this option, rather than you use any formula, we will learn the complete formula for this later, but for now, we have learned this much. If you have any doubt then you can tell me in the comment section. I say this again and again that all of you either tell me your doubts one by one or keep writing those doubts as you are reading because it is difficult to cover the whole thing in one go, so your doubts will come continuously. Slowly, slowly, slowly, you will get the answer and solve it and if you think, I will see everything in one go and After that, if I ask all the doubts in one go, then it is totally up to you. If you want to ask like this, you can ask like this. Okay, here we have completed the series. After the series, we get a clear all which we have done. After that, we get the filter. Filtering is very important. Filter and Sorting is one of the most important topics of Excel. The best feature is the single which helps us in many things, which also helps us in a lot of reporting, it helps us a lot in understanding something after seeing it, especially with the data, so now we will do sort and filter filter and sorting. What is if I talk about filters, then let us understand a little bit three times and after that we will get a little better clarity about it. So just give me a minute, so see us here, I will make a filter, just ignore my drawing. Okay, so we made a filter, okay, how does a filter generally work, for example, if you put 200 liters of water inside it, okay, 200 liters, you put water inside it and what is coming out is 185 liters, that means, what are the impurities in 15 liters, the 15 liters of water that was impure has been removed and 150-185 pure water has come, okay, so what is the effect of applying a filter? It happens that you separate the things, whatever you had to separate into pure and pure, the filter has done it, so in the same way, suppose there are many things written inside a data, like you can see the data, here date is written, name is written, category is written, product is written, state is written, there are many things if you want in your mind. It came like this, okay fine, many states are written here, I want to know how many sales we have done within Assam, do you want to know how many sales have we done within Assam, you just want to know, now if you sit down to search on your own, how much time will it take, it is a very time consuming process, so in such a situation, you will filter out, what will you do to filter it out, okay, let me tell you how the filters are applied, whenever you have to apply filters, you will go to the heading of your data. You will go to any heading. There is no mandatory whether it should be the first heading or the last heading. You go to any heading and click on it. What will you do after clicking? In the home tab, I will tell you the direct feature once, after that I will tell you about the shortcut key. Okay, so what will be the direct feature you will have. Look here, this filter which I made and told you about, you can see the same shape now, so you will click on it and there is an option of end filter, its shortcut key is also written next to it. Which is Control Shift L, then you click on it, your filters will be applied, drop downs like this will be applied, the way to remove them is also that if you go to this and click on the filters, then they are removed. Now I have to apply filters anywhere, obviously filters will be applied on headings, so if I click on any heading, I will press Control Shift L, then my filters will be applied. Now we were talking about how filters are used for. Example, if I want to see, now I have different categories, electronic, decker, fashion, etc. If I want to know how much electronic I have sold, then it will consume a lot of time to check it myself. I will click on this drop down. Just give me a minute. I will click on this drop down. After clicking on this, I will get a window like this. Whatever data you have, write here all the unique values ​​in that column. Now you have to see only electronic data, so this select all is already selected, remove it and after that select electronic and after that you do OK from here, by doing this only electronic data has come on your screen, rest of the data is gone, you are able to see, you have only electronic data, I will show you from here, see only and only you have electronic data, then in this way you can filter out, now you have filtered but if you want to go back. If you want, then there are two ways, either you directly press control shift L, then the filter is removed, removing the filter means that the entire data as it is will appear in front of you, the second method is that you will click here and it is written here, clear filter from the category, you will do this like this, the filter which was applied from the category will go away. Okay, the next question of yours is that ma’am, can we apply more than one filter inside one data? Yes, absolutely it is. We can take an example and let’s go with the same, suppose I wanted to know how much electronic has sold in the category, then I did how much electronic has sold, how much electronic has been sold, it came, after that you know that electronic is fine but I want to know further that how many laptops I have sold, so we did electronic, inside electronic, we had to know how much we have sold laptop, so we got laptop, then you say, ok, about laptop too, but I want to know how much the females bought and how much the male bought, I said ok. Then we will impose fine on gender, how much did the mails buy, okay, but I want to know how much was sold in Rajasthan, so you will select it and remove it, we will keep checking below, Rajasthan starts with R, so here Rajasthan is and after doing okay, we have only these four entries in Rajasthan and this much has been sold, so it has come to us, so look everywhere, there is a symbol like this above the category, there is a symbol like this on the product name, there is a symbol like this on the state too. There is a symbol like this on the gender too. Having this symbol means that there is a filter on it. Now suppose you suddenly remember that no, I don’t want to remove it on the product name, it means I don’t want to put a filter on the product name, I had to put it on the rest, so now either you will control it, then the whole work will be removed, so in such a situation, what will we do, we will click on whatever has to be removed and here comes Clear from the product name. If you click on it, then look away from here. there is space left You applied the rest later on like state, gender but still they are there. Okay, so in this way you can remove your filter even from an individual and you can automatically filter out your data and see it. So in this way, our filters work for us and help us a lot. Now suppose I want all the data back. So what to delete after going to each one. Directly press control shift l and control shift l and the drop down will come back. Okay, in this way you Let me tell you one more thing, if you click on the filter, you will see some options above here, Sort A & G. If you click here, then the options you see are Small to Largest. If you click here, you will see Oldest and Newest. So what does this mean? Look, one thing is very simple. Let us understand that if you want to filter out anything, then filter it out in the same data. Now let’s talk about the text. If we talk about the text, then if the text has to be arranged, what has to be done, if the text has to be arranged, then how can it be arranged? How can it be arranged? So how obvious is it that for its arrangement you have to do A, either A to 2, I don’t know why it is not working, A to 2, you can do J to A, right, these are the two arrangements that can be made. In what other ways can you arrange the alphabets? You will put it in the same way. If there is any customization, if you want to put it in a different way, then it is a different matter, then we will look at the custom, but the general thing is that whether it will be A to 2 or Z to A. If I talk about numbers, is it possible in the arrangement in numbers ? If we can put smollet, then it is possible for the date in the same way. Is it possible to make the smollet largest or not from A to Z? Will it be oldest to newest or oldest to newest or new to old, should the oldest one be placed first or the newest one should be placed first, then this arrangement will be done in this way, otherwise it is possible in the same way as our arrangement, that is why the features that you see here are those on the text, if there is any filter somewhere. If you are looking here then you see A to two and J to A. If any filter is being applied on some number, then what you see is small to largest and largest to small and if you check on the date, then on the date you see oldest to new and newest to oldest. Okay, there I will make you check one more thing. As soon as you go to any text, you see text filters here. If you go to a number, then you will see number filters here and if you go to a date, you will see date filters here. Okay, now you have understood why something is written there, you have got the answer to the question, okay, there is a green color here, okay , I have to find that, so how do I do that? Suppose, sometimes what happens in the data is that we apply some color to highlight it, then you can sort that too, you click on it here. And here after writing ‘Filter by Color’, the color comes, now I am saying that somewhere it has got green color by mistake, so it has happened here, now I can change it by going to the home, suppose I have done this, I have made it charcoal grey. Now look, it has come in the text filter, it is fine, but I made it white just because it was done by mistake, okay, I had to do it here, I made it white, okay, now for you, I will tell you the data once in this way. How to color Control Shift L Control Shift L No problem, it is not working for us. Okay, let’s color one place at a time. By holding any control, I have selected this data and I am going to color at various places. Okay, and I will color it here. This one is fine, I have colored it at various places. Now I have to sort it, so what can you do. Okay, I will take another color, single color, so you know, so I have colored it here. But I have selected anything from here, you are not even able to see it, I can’t even see it, and we have selected such a small, small, small one , and here we have red, see how many yellows, okay, now I have zoomed it, just for once, I had to do it, now suppose if you have more than one color fill at some place, then you can filter it out, you will go to this, fill by color and here you will see all the colors, you want yellow first. Look, yellow has come, all the yellow ones have come, okay, so this is definitely a way, when you can filter any of your data according to the color, if you removed it , then this data of yours has been removed. Okay, now I tell you, if I ask you, do you know all these text filters etc., text filters and so many filters that are shown to you, you will say, ma’am, I am learning new things and you are asking me whether I know it or not. You don’t know, you know all of them, now how to see that. What you just learned from me was that you had learned conditional formatting, so now let’s move on to it by meditating a little and relating it a little and we will also understand a little what conditional formatting does, see, for once let’s talk about what does conditional formatting do and what does a filter do, okay if I talk about conditional formatting and on one hand what I talk about, I talk about filters. If it is ok, then what is conditional formatting doing? If you give any condition, if you give any condition, then I will do the formatting instead of that. I told you some condition that if it is so, then do this, then only that data is there in it, let’s say this data is of 1000 entries, the data of 1000 entries is okay and inside this you have to highlight the duplicate values ​​and 50 There are duplicate values, for one time, it will color it in 50, it will change the border in 50, it will do something or the other in 50, but here the data that you will see will be of how many entries, only 1000 entries will be visible, only that much is visible, wherever we want to highlight people, there is a color there, then what happens inside the filter, no entries, only 50 will appear, the answer is the same. Will come but the method of representation changes. How does the method change? Now when you apply filters, 1000 entries will not come, only 50 entries will be shown, no color, nothing, only 50 entries will be shown, so it is up to you as to how you want to keep the representation. Features are all the same, you will see that if you go to text from here, if you go to text filters from here, Equals to does not equal to begin with and. With does not contain condition was done in formatting and not written in solution then tell me if anything is written then tell me then all these are the same as if you go to custom also then you have the same, you have the same, greater than equal to whatever you had read, when you go to number format, you will go to number filters, equal does not equal greater than greater than equal to less than top 10 Top 10 Below Average Above Average All these things are the same, isn’t this the same, you can check in the date, when I told you about a date in the date, I did not tell in it, Yesterday, Today, Tomorrow, This Week, Last Week, everything and that is the same, okay, so in this way you can do the same work here in the conditional formatting, here you can do the same work in the filter, what is the difference in the conditional formatting, 1000 If there are entries of 1000 then 1000 remain but what comes in color but what is in the filter comes out after being filtered, the rest of the data goes away, whatever is asked for as it is remains the same. Okay, so you know all these filters, definitely practice. If you have any doubt on any of these, please let me know in the comment section. I will definitely tell you but there is no point in repeating it here. Because we have done that, we know it already, we will not waste time there. Now whatever we can learn, we can learn sorting. So, now we will learn sorting manually. The thing that we know is sorting which I just told you about the arrangement. So the arrangement itself is called sorting. We have to sort. Suppose now you can see that the names are written in different types. There is no such thing as A, A, T, Z, Z to A. If it is written then you can do that thing, you click on it and from here you click on A to Z, then see that in this way your data has been sorted in it. Okay, suppose you want to do something else, you want to do according to the number, then you can go to the number. If you want to do the largest to smallest, you click on it and see, a sorting icon has also appeared on it. Let me just show it to you, then see a sorting icon has appeared on it. And look, the number which will be on the top will be the highest and accordingly the entire data has been changed here. Let me tell you that earlier the data which was there was Harijan Wellness and later when we made it from largest to smallest, now it is Bright Harijan Venture. Okay, earlier we had done the price, so that is something. And it was showing that here we had done the price from largest to smallest, so here it was Radiant Health Club, so in this way we can sort the entire data is about the same thing, if suppose I want to arrange the data according to the date, from newest to oldest, then the new largest data which is written is written according to that, the entire data is arranged here, Zenith has come here. Now okay, one thing is that when you do the sorting, then you can undo the sorting. It doesn’t happen. We have done it hand to hand for now. If you think that sorting is left, then I have left it. Later, I will do the same data again, then that thing does not happen. Now, what I will teach you will make you aware of sorting also. As soon as you have your data here, after that, you can go to Sort and Filter here and click on Custom Sorting. On Custom Sorting, first of all you can see all the headings inside all the data that you have. This means that it is asking you that the custom sorting you have to do should be done according to what. For example, if we have to do it according to the name, then we have done the name. After that it asks you according to what we have to do, according to the cell values. We have to do it according to the cell color. We have to do it according to the font color or there is some condition formatting icon. So let’s say, from here I take the color only. When I took the cell color, I took the cell color and now as soon as I took the cell color, my options have changed here, now it is asking me which sorting to do, for example, I want to take yellow, but there by default yellow was coming, which was yellow by default, it was only bringing and giving yellow, now this is sorting, not a filter, it is sorting, so what will happen in the filter, it will bring and give only the yellow color, the rest of the data will go, sorting is not done like this. It keeps that data as it is, it just arranges whatever arrangement you want to do, now as I want it to come on the bottom, that means all the yellow data should go at the bottom of the data, I have done OK. Now look, go to the very bottom and whatever data you had, see the data is getting finished. Here, that entire yellow part has come down, that portion is fine, so in this way, if you want, you can do custom sorting. Okay, everyone understood, here you will get custom. The option of sorting is available here, it is completely up to you as to what you have to do and what not to do. If you want to delete any level, then you delete it. If you do OK, then your sorting has been deleted from here. Those who will be sorting from here, look from here for a second. All the sorting which you had done is gone and your yellows have again come from scattered places. So the custom sorting which is done from there is done by you. You can also delete from there itself. So here we learned to do normal sorting. If we want to do text then it can be A to 2J to A. If we want to do with numbers then it can be small to largest and largest to small. And if we want to do date then it can be L to newest to oldest. We also learned custom sorting that how we can go there and do our according sorting. Let’s do filters here. And we have completed the topic of sorting, now we move ahead, the next topic comes to you , Go To Special, how to use Go To Special, for what, first of all we have to know that and what is the meaning of Go To, why is Go To Special being used, when we know this, then we will be able to apply it easily. See, Go To means to jump directly over any cell. Now this thing is asked many times in your interviews also, if you agree, then we will be able to apply it easily. Let me say this, we have come here on this side and I tell you that I do not want to go to Rs 1 lakh. If I want to reach Rs 1 lakh, then what will you do by scrolling, will you go scrolling like this or will you go down using your keyboard, use the page down, then how much tiring will it be if you have to reach Rs 1 lakh, then better than this you can use Gotu. Now there are two ways for you to use Gotu, one way is where you directly. You can use the shortcut key and one way is known to you that we will explore the feature directly, so what you have to do is, first of all you will go to Find and Select on the Home tab. After going here, you will click on it, then here you get the first option of Go To. If you click on it, then you will get a window like this. After this type of window comes, here you will have to write the reference where you had to go. a100, you had to go to a1 lakh, after that you press OK, then it has taken you above a1 lakh, you can see that this is our sale, it is above a1 lakh, but I would not personally suggest you to use it, for once, I will definitely tell you its shortcut key, go to starts with the g, so what happened to its shortcut key, what am I saying that go to starts with what is go to. Starts with the G. Hence, its shortcut key is Control G. Okay, now Control G. If you press Control G anywhere inside your sheet, then this window opens to you and you can write directly here, but I say this is also a big way, we will not do it in this way also. If in any case, if you are told that I have to reach K 3965 3, then where will you do what, you go directly to your name box and write here k. 3969 8 You had to reach here, just enter, then see it has taken you to 3969 8 and from here you can see that it has brought you to the place of that sale by jumping directly, so instead of using Go To, use the name box. Go To adds more features in itself. There are many features which are very useful, so we will do that, but here my job is not just to tell you the features, my job is to tell you in this way. Let me tell you the features that should be so effective so that you can do your work better and use the name box to do better. It will give you better results. Well, what is he doing here on the side by jumping directly to the cell? Now suppose your interviewer told you that you have to select the entire area till 1963, so in such a situation, you will do the same work, you will write in the name box : 9 63 5 2. 8 You can write anything till the selection and after that now you will not directly press enter, if you press shift enter then here it has given the entire selection till the point where you have written here 963 U which is your number, not sorry 3969 8 So it has given till here yours is ok so we can do the selection in this way, suppose I am here and from here till how much do I have to select. If you want to reach m10, then I wrote m10, after that I pressed shift enter, then put the first cursor till m10 and after that, write jump on the cell where you want to reach and after that press shift enter, then the entire selection till there will be automatic. Why do we learn selection? I have always told you in Excel that whatever work you do, first you have to make a selection and only after that you can apply something beyond that. Yes, right, that’s why we are doing selection here, so that first we get to know different types of dynamic selections, after that we can do anything. Till now, if I talk about what you had learned in the selection, then you had learned the basic selection. Now what was that basic selection? The basic selection was this. If I told you to do a complete selection, select the entire data in one go, then what would you do ? If you used control A, then the entire data would be selected, then I used to say, brother, do the selection with a single click, how was the selection done with a single click, it was done with control shift, then you used control shift arrows and the entire selection was done, after that it came to you that you have to select a single cell, then the single cell was also selected, you held the shift and after that used the arrows and here a single selection was done, but I am saying . Yes, this is the way to select the data. I gave you the data and said in the data, select all the blank cells. Then brother, how will this happen because neither can you select the entire data. How much pressure have you put in it that select all the blank cells. Well, I tell you to select all the text written inside the entire data. Now look here, there is text written in between the values ​​too, they should also be selected, so you will keep watching like this. For this type of dynamic selection, we use Go to Special. As soon as you press Control G, you get a special option below. Click on it. You will get a window like this in which there are many options. If you do not want to explore it from here, then you can also explore it from the Home tab . Go to the Home tab, go to Find Select, here also you will get Go to Special. Where does it go? Now we have to see what options are available inside it and how can we use it. So see, we will control A so that our data gets selected, after that we will control G so that we have this option, after that we will go to special. I would personally suggest you that whenever you go, control G and then go to special. First of all, let me tell you that it is very small here, so you may not be able to see B, so below each word. There is an underline, there is an alphabet inside every word and there is an underline below the alphabet, then that alphabet is its key. In the same way as home, when we press alt , one key does not come, similarly, there is no key here, the one under which there is an underline, that is its key. Okay, the other thing, the first one is notes. Let’s say I put notes here at different places with shift A2. I put some random notes here at different places with shift f2, okay. And now you want to select wherever these notes are present. Suppose you have a huge data and now you have to highlight wherever there are notes, so that you can see where there are notes in the entire data. So before applying anything, we need a selection, so we will do Control A, Control G, we will go to Special, we will select the notes and we will do OK, so see where the notes are present, that selection. It is done, now I have colored it in this way, so now I will always see in my data that OK fine, there are notes here and there, OK, now suppose you want to remove this color again, then you will do Control A, Control G, after that you will go to Special, after that you will select the notes and you will do OK. Now if you want, you can remove their color, I have made it white and look, all these selections have been removed, so in this way you select the notes, after that you can see. Do Control A, Control G, go to Special and you get the option of Constant and Formula. You will have to understand it in a little detail but before understanding it, let us know one thing. See, when you click on the Constant, these four options are active, the first one is number, the other one is text, the other one is logical and then the error and even when you click on the formula, these four remain active, so are these four for both? Yes, can you explore them together, that is, you can choose which constant and formula together. The answer is no. When you do it for a constant, it will be a constant thing. When you do it for a formula, it will be a formula thing. These are their common options which you can use. Now you need to understand what is a constant and what is a formula. In this entire table, the most useful ones that you will find are these two options. You will get constant and formula, that is why it is very important to understand the difference between these two. If you do not understand the difference between these two, then understanding the whole go to special will be useless, so let us understand it a little carefully. See, here you get two words, the first one is constant , the other one is formula. Suppose from a1 to a1, some 10 10 digits were written like this 10 10 10 10 On one side I wrote I give, this cell is mine and here I write 100 and on one side here is the cell of mine, I write the sum a1 a10 then the answer is this is my formula will be visible in the bar but the answer is mine what will be visible is 100 so here which is only value there is no formula so what has become constant and here the value is there but is this value constant is it just value no check the formula b what? There is some formula attached to it. Yes, so suppose this is your formula. Okay, so the first thing we understood is the constant and formula. Let me give you one more example. Suppose you had written some ‘A’ and ‘Your’ marks here. Okay, now you have written directly inside the cell according to the marks, if someone’s no came at 30-40, then if he passed, then you wrote ‘pass’ after seeing and on one side, what did you do here, if you put the formula that if. If it happens then do this or else do this and then after that means you applied some formula here, you calculated pass from that formula and if you failed then the answer will come here then you will see pass but inside that when you checked in the formula bar, the formula was written there, so this is your constant and this is your formula, so now you have understood this at the initial level, what? Is it a constant and what is the formula? Now see, when you write a value, we call the value a number. Here also the answer is your value. If your answer is 100, then this is also a number. So this number is the number of a constant, meaning that number is the number of a constant. And this number that has come has come after being extracted, what has happened, has it come after being extracted, that is why it is the number of the formula. Now you see here, when I control you and tell you, go to the special, see, a constant also has a number option and a formula also has a number option, but there is a difference between these two, what is the difference, now you understand what is the difference, one will be the number of a constant and one will be the number of your formula, in the same way, if I talk in the way we have talked about numbers, in the same way, if I talk, it is of text. This is about the text, is there any formula written here or did you write the pass directly? If you write the party name, then what are they directly? Some generate it from some formula and do not come up with it. You normally fill the name directly yourself, do some data entry, so that is your text. What kind of text is the text of the constant? And here you have applied some formula to find out whether the student has passed or failed. If you have done anything like that then it is by applying a formula. If you did not understand then that is the text of your formula. If you understood then now you have understood two things – the number of the constant, the number of the formula and the text of the constant and the text of the formula. After that you have two more options. What are the other two options that come to you? Here we will explore both the options which is logical and after that what is an error logical? Anything written as true is false. What will be the logic, either this or that is logical , then what is written is true and false, that is logical and error, you must have seen that in the formula there is such a value error, by putting a hashtag, such an error comes, a name error # a # spill # divide, you have errors in many ways, then you have got these errors, so if we assume that there is an error in a constant, then it means that an error occurs when a formula is applied. If the formula’s error and other wise are written directly, then directly the error is the error of the constant. If you apply any formula and the true false answer comes, then the logical of the formula and not come means it is normal. Directly, we ourselves have written true false as per our own wish. That is your constant. Now even if you did not understand it so well, then it is okay because now we have explained it in great detail here. Let’s see it practically, this is our data, okay, inside this data, let’s say, let me tell you, you will constantly keep looking at the formula bar here, like I zoom it a little here, we clicked on the date, the date is coming, that means there is no formula, clicked on the name, the names are coming, there is no formula and look at the product name, state, gender, quantity, the value is coming in the quantity, there is no formula, cost, price, no, no, this price is coming. The value is directly written in it but when it comes to the purchase cost then look at the formula written here, the value is visible but the formula is there, click here, the formula is visible here, the value is visible here, click here, the formula is visible here, the value is visible, click this, the formula is visible, but the text is visible, click this, the formula is visible, but it is visible. Okay, so here you are given two things. You can select the formula numbers and text and all the things, so now accept that I tell you, tell me the number of the constant, then select the number of the constant and tell me, then I will do control A, I will do control G, after that you will go to the special, from here you will select the constant and here, leave only the numbers selected and OK, so see, the constant date is always counted inside the number. Let me tell you this thing, the date is always counted in the number. So, here, these numbers are there as well as the quantity because there was no formula in it. I just showed you that it was not included in the cost, it was not included in the price also, but when it comes to the purchase cost, sale cost, sorry, sale price profit, so your formulas were included inside it, so it did not select which one , which one was selected which were just constant numbers. Now if you want, you can do anything with it separately. Can you give them some color so that I can color them and highlight something like this? What I have to do is tell you what you can do. My main job is to explain how the selection will be done. Okay, so here we did the go to special thing. Okay, next here we did the constant number. Now the same thing, if we had to do the formula number, then we will control A, we will do control G, we will go to special, we will go to the formula, we will select the numbers and do OK. So see, the numbers have been selected from here, but you see carefully, this is zero, this is a, this is the value, this is this. There must be some digit written directly in B, so it has not selected it , you go down here and check if there are any other errors, see because the value in itself is an error, it is a text in itself, it is a constant text, so here we had told him to select the formula number and then he is so pressed that he has not taken those things from the middle which are not your formula number, which is the formula number, he has taken that, okay let’s go. Next we will see Control A will do Control G will do the same goes with the text, if you want to take the text of a constant then how will you take it, all these names and names written are your text, these are constants, you have written them yourself, not generated from the formula from somewhere, but right there, by doing Control A, Control G, if I go to special and if I take the text of the formula and do OK, then it gives me the text here, now you will say that Ma’am False True False This is also a text, yes text is datchi, so what does he consider as true false? He always considers logical true false, he will not show it as a text here, a thing can be one thing, it can be either text or logical or it can be an error. Now if there is an error then the value is also written. If the value is text in itself, then is it in the text? If he will not count it, he will count it in error and one thing cannot be counted in two things, he will have to count only one thing, Hans, what is written here, the value, is your error, True False, what is written, is your logical, that is why all the texts were there, he has given even, here you will believe it or not, here ok, you will believe it, yes, we had taken the text with formula, neither have you taken this one, now I have taken the one with constant. You had to tell me more in the text, control ji will do special and I wanted to check one more time with the constant one, I wanted to check it once more, you see, from here, he has selected this, so we saw it, you look here, see, for one second, we came to the side that yes, look here, he has written the text here, neither has this also been selected, he has not left that data, if you have told him the constant text, then he has selected this also, I had to show you this, we had gone to the data on the side. By mistake, here we have done two completes, which is the first one is number and the other one is text, after that if we talk about control, we have done it directly, no problem, we have come to special, after that we will go to the constant and we want to check the logicals, will we get the logical in the constant here, tell me from which, the answer is no from my side, if yes from your side, then you are facing some difficulty in understanding and we will explain it well, see, okay. So look here, we had not selected the data anywhere, so it checked here in the blue one, this is the heading, I had to check here in this one, Control A, do Control G, do special, and here, go to the constant, and here I have to take the logical, and do OK, so there is no logical here, saying no cells and found, why because what is logical here, what is true false, is that true false, from whom did this true false come, see from whom did this true false come, look above. The formula is attached, it has come from the formula, so if I do the formula one, control a does control g does special and after taking the formula and then taking logical in it then it comes again see then it has made the selection but here it was not in the constant na look for the constant, I have created a separate data so that you can practice control a did control g did special and here you took the constant so here you can do OK with it so look here this Why did you make the selection? Look at the selection here. Click on it. Check your formula bar at the top. Is there any formula written there? No, all the text is written, so the text is written and true. If false is written, then what happened to you, it became logical, which constant one is it ? Similarly, if I talk about the error, then look at the control a, the errors are written here, the error is written by itself, here the error is not coming from any formula, okay, then you will control a, control g will go to special and from here you will take the constant, from here you will take the error, okay, then look, it has selected all these errors, okay there. If I talk about the formula, then see these are the errors. For the formula with red heading, see this, we have applied the formula and after that, if any error has come, now you control a, control g. If you go to special, go to constants and take an error here, then it will say no cells found yes because all the errors here have actually come by applying the formula, so you have to control g special. We have to go to and select the formula from here and select the error from here and click OK, then it will select all the errors, so here we have completed all the options which are the main options of Gotu Special, in which we have seen all the four options inside the constant and we have seen all the four options very well inside the formula also, now next is our We will see what comes close, we will do control A, we will do control G, after that we will go to the special, the most important comes blank one of the important. Suppose and this is also asked many times in the interview, that is why I am going to create this data in front of you, we had created this data earlier and here we do one thing, why did it happen like this for a few seconds, yes brother, it is okay, I am making a selection by holding the control, because I have to do multiple selection, hey, I used the control. Don’t hold it, I will make the selection from here, okay and here I have made the delete option and now look, you have this data, now there are many blanks inside it, if I tell you that you have to delete all these blanks, then are you going to sit there and delete them one by one? Otherwise, if you start doing it one by one, then it will be a very time consuming process. Now, if I have to delete all these blanks, then to delete them, I have to do the selection first. And what do we use for selection? If we do Control A, then sorry, we do Control G. Now can I select the entire data with Control A? Try it, it will not happen because there is space in between, hence we will have to do the complete selection from here in this way. You have made the selection, I have made the selection with Control Shift Down Arrow, after that I press Control G, I go to Special, select the blanks and do OK, what is it now, right? In these blanks, we can directly do control minus. What happens with control minus, our sales get deleted. We will delete the sales here. We will not delete the entire raw because there may be some data in the surrounding as well on our side, so we do not want to spoil our data. We do not want to spoil the whole sheet, so we will do control minus. We will delete the sales. Do control minus. We do not want to antagonize. Now we will think that we have to do ba sales. I have already explained to you how to delete cells. But understand it a little more carefully , what do you have to do with the assisting data. Do you want to move the assisting data to the left? Do you not move it to the left? You will bring your remaining data upwards only. If the cell in the middle is empty, then delete the cell and shift the remaining data to the top. If this is what you want, then shift the cell up and do OK. So in this way your data will be completely shifted, now there are no blanks inside it, okay in this way there are no blanks, the first thing you learned is this, the second thing I teach you is that suppose what you do is that you have a blank, there are a few blanks at some places, there are a few blanks in the whole data, now here there are a lot of them but there are a few blanks, okay now inside those blacks all the same values ​​are going to go and you in that You do not want to fill one by one, you want me to write something so that it fills all the blanks in one go, then how can you do it in such a case, suppose the first thing you have to do is select the data because you will select the blanks, only then you will be able to do something, so first of all you have to select your data. Select it, OK, after that use control G, after that go to special, after that select the blank from here and do OK, then all the blanks you had will be selected. Now you have to write anything that you want in all the cells together. For example, I write my name here, single for once or write any value or write anything, I write 1000, so I I have written 1000. Okay, now I want it to appear in all of them, so if I press enter, what will happen? What happens after entering? We enter in the next cell and the entire selection will be off, so we did not do this. Now you can do one thing, instead of enter, press control enter, then that 1000 will be written at every place, here if you are thinking that ma’am, you have written 1000. Why did this format come? It is date based, that is why it came in the other wise. You will write the same value everywhere. Okay, I understood what you have to do. You just have to make a selection and start writing directly. It is not like you are clicking in a cell. As soon as you click, the entire selection gets lost. So do not click. Start writing directly. After that, control has to be entered because the selection is already done. If we click once more in the selection, then The selection gets turned off. We don’t have to turn off the selection. You directly enter control and your data will go everywhere. Okay, now I do control Pressed k, pressed enter and you have got this selection, do control minus, we will do shift cell up and do OK, so in this way our data will be fixed, okay, we have learned this here, after that I will tell you one or two more options, before that , first of all, I will cover all the important things which are important and after that I will make you explore them normally. Okay, after that you will have the information which is important. Option comes , that comes, let me tell you first option control g special and inside it there are two options, row difference and column difference and these are very useful, they are very useful, that is why I am telling you this, see how it is, raw difference and column difference, like suppose you have a small scenario and the real life scenario is that you suppose you do data entry, okay, your business is there, 99 invoices are made in it for January March. It is okay that 99 were made in the month, you put 1000 invoices in LI and in your Excel there were 99 or it could be its opposite or there is a difference in some value, that is, you have written all the details here, here you have written in Excel and first of all, when the recount comes, first of all we check the values, suppose there is a difference of 5000 in both your data, then first of all you will see this and not directly I can find this out. Where is the difference in the values, then if suppose you ever want to check the difference in two values, you have two days here and you want to check the difference in them, then you can use this trick. Basically, what you have to do is to select the data, selected the data, did control G, went to special and took the raw difference and did OK, then in this way, wherever the values ​​were different, the rest are the same. Look, this one is different, this one is different, this one is different. This one is different, just color it, you will come to know, yes, it is different, everything else is the same, so in this way you can find out, it also has a shortcut key, now we have gone to Control G, its shortcut key is Control and forward slash, control and here your forward slash will come, so you can do this work by using it too, how did I do it, let me tell you back, why did I take it, why ok fine just give me. Minute OK, I selected it, went to home and made it white from here, OK, what did I do now, control selected it and pressed forward slash with control, did control forward slash OK, that works, sometimes my key of my laptop, the key of my system is not working, but you try using this, your work will be done, you can also do this, control A did OK, control A did control G did and went to special And from here you took the row difference and you did OK, then it will come in this way Control A control data select control G special row difference OK and just color it OK, similarly if suppose your data is in this format then you do the column difference, check the columns, there is not much difference, it is just the same thing, so you selected the entire data with control

    shift side arrow, after that control G made it special, after that you did the column difference and then OK. Wherever there were differences, they have come, now you can color them, so here were the differences here and you have these differences, okay, so these were the major two options which are very used, when you recalculate any two values, then you can do it directly in this way, after that if I show you the option in special, then here we will not do the current region and array, right now we will do the object, we will understand the object also but here But before that, we can see President and Dependents, what do we mean by these, so let’s see, we write a simple formula, here I write 10 * 2 = t this multiply by this enter so basically 10 * 2 * 20 if I convert 10 into 20 then 200 this is working, suppose I took this data and controlled g, then went to special and after that If I did presse dents and direct only or all levels then did direct only and ok then it told me after doing 10 * 20 this is 200. What is president basically you have it here just give me a minute look at this way you can see like suppose you are here then what is president where is this particular 200 from where did it come from? Multiplied 10 by 20. If you want to remove 200 aya then you can remove it from here. If you want to see the reverse of it then say let’s say where these 20 are being used. If you want to check on what it is dependent on then it is dependent on this. If let’s say you want to see the same thing for 10 then you can do it from here. So in the same way when you have to make a selection then you can also do the selection by controlling g, you will do special, you will do presidents and end. If you do OK, then it has selected both of them. Now suppose here I write 50 here and here I write yours equals to this cell multiply by this cell. So now tell me once that the dependency it has is here also. If I make it 20 here, then see everything will also change, so we have created a dependency. So if I click on sorry dependents from here, then it is dependent on here, okay. If I remove array this President, I go here and click on it, then it is dependent on these. If you are understanding it, then it is okay because we will do it in detail later also, so here what we have to do is remove the arrow once and after that make this selection, then control G, after that go to special and we took President and did it at all level and did OK, then it told me all the dependents. Similarly, if I want to see its opposite, then I did a special control and here I came to the dependents and if I want to check at another level, then the dependents are there, these two values ​​are dependent on some or the other, then it has come to you, so basically whenever you want to see the formation of the formula, where has this particular value come from, from which values ​​has this value come, then you check this. You can do it, okay or here you can also say that we have covered this topic a little bit, which is Trace President and Trace Dependent, if we explore it further then we will do it but it is not so useful, just whenever you want to check, you can also check directly by going to the formula bar, but if you are not able to understand, you have to check that movement, then you can check that movement from here, okay after that you have. Another option comes which is your special, go to you, last sale comes to you, sometimes you do not know where in this whole sheet something is written last, so what can you do, you will do last sale and ok, then here you have this is your last sale, because you must have some entry here, then it told me, this is my last sale, okay , you can jump directly to the last sale, after that you will get more options . You have just done the conditional formatting and data validation. Conditional formatting has not been done. Suppose you have applied some conditional formatting here. I have this data. Let’s apply conditional formatting for once. Here I do control A, after that I go to home, here I take conditional formatting here, here we take the text that content and here we come inside the decker, where it is written decker, it gets filled in red color, then this is what I do now, control A, I do control G. I go to special and I say, do you want to know the conditional format, do you want to know all or do you want to know only, I have done all, that is, if the same is of the same kind, then it will make the selection, do all, then look, it has selected it and given it, where is it applied conditional formatting, then we have it in the whole, when you have applied the condition formatting, then it is in the whole, now the decor is in the whole, now tell me one thing, I will write the decor here, please write the decor. Okay, I have written this wrong, haven’t you written decker, so it is coloring it too, it is not a big deal because we did it with a little selection, we had selected the entire data, so it has given us the selection of the entire data, after that the option you see is data validation, which we have not done yet, so we will do that. And there is also an option for the objects objects. As soon as we insert, there is also an option for the object. If you tab, the pay will be covered there. Okay , so here we have completed our go to and go to special, that too in full detail. Now let us move towards our pay special. So now the topic that comes to you is what is the pay special of pay special. So what is normal special and normal. What is paste? So basically whenever we have taken any data here, we will select it, after that we will control it and if we go anywhere else, we will control it. v If you want to do this then that will also be done and or if you want to press paste directly then that too is done then normal copy paste all two, you have already learned that I have taught that they pick up all the content and bring it to you as it is ditto but now you do not want as it is, do not want normal work, you have to do something different, you just have to bring the formats, you just have to bring the formulas, you just have to bring the notes, you just have to do some more work. In such a case, you can use Pay Special. Well, here as soon as you click on paste and many icons visible here are all Pay Special ones but it is very difficult to understand directly from the icon, hence if you click on Pay Special here, you will get a window like this. Now look at this window, Pay Special is used a lot, so either you go directly from this window. If you do not remember the shortcut, but if you want to remember the shortcut, then control like you used to paste normally. Inside this, you just have to add Alt, then hold Control Alt and just press V, then this special window will come to you, then after that you can do whatever selection you want, so here for once, I will delete it, I do Alt AE A, it is deleted and after that, now we will explore it one by one, what are the options available inside it, I first took some data here, like this is what I did. I have taken control c of the data, I will come here and do control alt v and after that look, first of all, see the above options, no, we will not explore all the options, we will explore only the most important ones, so that is the rest of the things, we will explore. Like, I will tell you what is happening in this thing, but mainly we will see the examples, as many of your important ones are there. First of all, we will see the above options, which is paste the first one. It is all as it is, it should come as it is, which is also being done by control c and control v. So if I have to do the same then why would I waste my time by coming here, I will not directly control c and control v, so there is no use of all here. Okay, so here you do not have to do anything with it. Next formula. Suppose you have a formula inside the data and you want to take it as it is and take it somewhere. There is no formula here right now. It is already there, but can we apply it here? Can we apply it at all? For once, we apply the formula here. If you enter Equals to this Multiply by this amount, then this formula has been applied. Double tap it. Okay, now let’s say you have applied it. A, let’s take it here, copy it and paste it here, so do n’t you get the amount? You have copied and pasted it. Now here you do p special and try control lt vv, sorry v, I didn’t want to do the formula. Okay, I did it. So here you have the formula n3 * o3 o3 * p3 o3 * p3. So see, look at the formula. Here, he has dragged it like n3 * n3 * o3. Here too, he has dragged it in the same way. Formula has brought only the formula, it has not brought the rest of the content. What did you say in it, just bring me the formula, so it has brought the formula but has not brought the rest of the content. What it does here is it brings all the content, there must be some formatting in it, there must be some color in it, anything can happen, it brings everything. Whatever you want to choose, if you want exactly the same thing, you can bring it from there, okay, I select it here. I remove it from Alt HEA. Let’s see next. Next, what do we get? I copy anything for once. After that I go here and do control alt v. Next tells you the value. What does the value say? Suppose, you will learn the random formula in future and you will learn other types of formulas, then what happens in such a case. You can say, assume this is this thing, this is the amount, as soon as I copied the amount. And when I come here and paste it, obviously all the values ​​have changed but I say no, I have to put this amount somewhere in the report or I need this amount somewhere, so what will you do in such a case, you take it as Control C and go to any place where you want to take these values, put Control LT v, then it will convert it into values. See, the values ​​which are there now are extracted from your formula. If it has been extracted from the formula, then that is the formula, you will see in the formula bar, that is the formula, you can see the answer of the formula, so basically, that is the formula, if you convert it into value, whatever you are pasting here, do it in the form of value, if you do OK, then all your values ​​will come, now will it not change, okay, so in this way, whenever you have any data which You want to see that this data never changes because the formula is based on the reference and the reference can change. If any reference changes, your formula will change. So in any case, if you think that you do not want to change your formula, then what you can do is simply convert all your formulas into values. To convert them into values, you can We will select control C, go anywhere here and do control alt v. Like I told you in Got Special also, the alphabet under which there is underline is its key, so its key is v. Values ​​value starts with the v and you press enter, then your values ​​will come here. It is used a lot, that is why I also remember its shortcut key. Personally, you can also remember its shortcut key. Its usage is very high if you correct. You have learned how to use it, look at the features, the features are the same, it is just that how can you apply it on which situation, it is totally up to you. If you have learned that thing, then the work is sorted, then you must remember this thing because it is very useful. Okay, we learned about values. Next, let’s see what we have. We did control C, we did control alt v here, after that comes the format. Suppose I have this same table somewhere else. I want but only want the format, then you can do it, choose the format from here, do OK, then look, the same table has been created here, now I go to scape here, do Alt AE A and remove them, just I wanted to tell you that in this way you can format, there is another way to take the formatting there, if I had to take the formatting somewhere else, don’t trust me, I do not use pace pressure because we have another one. There is an option which is control a and format printer, I would have taken it and just clicked, then this thing would have happened here, okay, so this is it, look at us, there are many ways to do the same work inside Excel, it is up to you which method you remember at that time and which method seems suitable to you, okay, let’s see next, you selected it, did control c, did control alt v, after that comes you Comments and Notes Comments and Notes I’ll leave a comment or two for this Now suppose you have selected all this data and after that you have done control C and after coming here you have done control alt v and you have selected only comments and notes and OK, so wherever there are comments and notes, that selection has come and exactly your comments have also come. Exactly your comments have also come. Now you Wouldn’t you think that all my data should come because you have selected that comment, it takes up a lot of size, as if only the formula had come in the formula, its formatting had not come. If you have selected the comment and notes here, then only those will come. Okay, here you can delete it. Which is Alt A and A. Okay, now I have to delete both of them, so what do I have to do? Obviously, by selecting it and using control g, we can go to special. From here, we can select the notes and do OK, both will be selected , we can press Alt HEA, both will be deleted, then you can use this method effectively, like I just realized that why am I deleting one by one, I can do it together, so I used it and if I did not remember that, then I too would have been deleting one by one, this is what we call. We can use it effectively. Okay, let’s go next. Let us learn that we selected this data, did control C, went here and did control alt v, after that you have validation validation. You have not learned it yet. When we were talking about control G also, data validation came in it also which is go to special. What is data validation? Let me give you a little overview so that you have clarity so that you do not get confused like this. Data validation is not done there either. Data validation is a type of drop down which we create. It is available to us inside the data tab. We will learn to create it. Okay, we will learn it in detail but for now we leave this option. Later you can see. All using source means same, almost same data comes. All accept border means complete data comes but borders do not come. Column width column width. A. Like once I make you click ‘All Accept Border’, OK, everything is there but the borders are not there, you can check it, ‘A. Control Jd. Suppose, you want to make the column width, then you did control alt v, after that, you made the column width. What is the column width? Suppose, sometimes we have data where we have adjusted the columns by stretching them one by one, so now we want that next whenever we create the data, the width of our column. If the width is the same then you have done OK, then see here the party names extra is coming, here also the party names extra is coming and rest of the space you can see is the same, the rate is coming small, so here also the space is small, so in this way you can control the column width, lt v will do next, you have formula and number format, now only formula was going from there, number format will also come, values ​​of number format all. Merging condition formats, as per your requirement, you can use these combinations. This is completely situational. If your situation is like this then you can use it. Next, let us move towards our operations, which is very very very important which will help you a lot in doing any work effectively. Suppose I have all these digits. Okay, now I am not 500 in these digits. To add, these are old, wrong digits are written. 500 is written less or 1000 is written less. If I want to increase it, should I increase it one by one? Should I not increase it one by one? What do you have to do? You have to write 1000 somewhere, okay, you copy it. You can paste this copy here anywhere, so I want to increase all of them or select the one you want to increase. Suppose you have to increase this, this has to be increased, this has to be increased, this has to be increased, this has to be increased, okay, then you do control alt and now you see in the operation, what you have to do is to add, multiply, subcut, divide, divide, you have to add, okay, you do OK, look, this has been added to your values ​​and this is not a formula, this is also the most sorted thing that this is not a formula, so you can immediately It will be sorted and there will be no change. You can delete it later. Yes, there will be no change. Your data will also be updated. Suppose you have to do the same thing here. I have to do 1000 laces, try doing 1000 laces, try control C, in this I selected the entire data, did control alt v, from here I took the substack and after that I did OK, then look, the value has been substacked, I selected it, put it here with the format printer and delete it, what difference does it make? Similarly, now in the multiply one, I can take another example like suppose you have the complete cells. Like I will draw here and tell you, this is the sheet of the entire sale. Okay , now the empty cell will not be written in the sale. The sales return will also be written. Now here the amount of one sale is written. The amount of one return is written. Now here you have to calculate the net sale. Now tell me one thing about the net sale. There will be cell minus one SR. And your sheet here is the sheet. It may be of first second, third entry sale, fourth entry may be of SR, fifth six. But there is a difference that in front of the sale, something is written as ‘SAIL’ and ‘SR’ is written in front of it, ‘SR’ is written in front of it, so now in such a case, how do you mean that you have calculated the net sale here? In such a case, suppose I leave the pay sale positive here and put a minus in front of every sale return, then it is automatically plus minus minus, it will become minus when the final calculation is done. If you understand what I am saying then that is the last calculation. If you have to convert something into minus, then how do you do it? This is just one scenario. In any scenario, if you suppose you have to convert something into minus, then how to do it. Now let’s see what you have to do. Do you know that plus minus is minus and if you multiply any number by one, then only one will come, that is, sorry, only that number will come. So you write -1 somewhere. Okay, after that you copy the entire data. Select control alt v do v do sorry v don’t do this I have got into a bad habit this is good multiply ok do it then see all these numbers multiply these will be in minus. How did all the numbers become in minus? Now you have this, you can also delete -1. Similarly, if you have to divide something then you can also divide. Suppose you want to divide all these by 10 or by 100 . So what you will do is control C, select control TV and from here select divide and do OK, so in this way these are your numbers, okay I selected it, did Alt H app and selected here, okay why did I do Alt H f p, you should know this, I am not telling you right now, you should know okay, so here we have completed it, even after this we have one or two options left like you have this data. In what format is the data? If you are seeing headings inside each column, then this is the data. I can say that it is in vertical format. In which format, if you wanted to make this same data in horizontal format, then in what way could you have made it. So see what you will do, you will select this data, you will do Control C, you will go anywhere and do Control Alt v. One, if you have to work on all the data, then All and what you have to do is Transpose Pose, which means the data. It will be in a different format than the one in which it is, like if it is vertical, it will become horizontal. If it is horizontal, it will become vertical. So, if you did the transpose ok, then look, now the data is the same, y 269 591 -11 28 is the same, it is 1479, it is the same, it was in the vertical format, it came in the horizontal format, okay, so this was yours, I will get your transpose option . Let us write 1000 and 365 963 853 963 1000. Okay, suppose you have some data which has some blanks inside it and what will come inside those blanks is written in a separate data. Suppose it is written here 635 965 and 523. Now you want that these values ​​should come inside these blanks, then how will you do it, you do not have to do anything. Selection has to be done here because like this then it will take time. If someone starts writing here manually or by applying formula, something will have to be done, then something or the other will have to be done in it to fix it, so in such a situation, what can you do, you do one thing, select this data, whatever data is equal to it, select all the data, select control C, now come here do control alt v and after that do skip balance and do OK, then see 635 has come here. 965 is here, 523 is here, now delete these values ​​if you want. Your data has been completely updated. Blanks of skip balance means that the blanks have been filled as per the data given by you, but remember that your data should be next to those blanks, only then the cell will understand that wherever there are blanks, I have left them and I will fill the rest of the data here. So, suppose you have written 635 here, then it will clash from here, then if it will not be able to do it, then this is a little. There is definitely a bit of a draw back but yes when such a situation comes then you can use it. Now let me tell you one more most effective thing. Okay, I create a little space here, just give me a minute. We have to create space here, so control plus shift right does not work. I take it, do control C and control v below here. Exactly the data has come. Now suppose you want some data where the data at the second place and the data at the first place change. If I do this, if the data gets changed at another place also, then we can do this work directly without any formula, so what will you do, like suppose I have taken this data, I did control C, here now I will do control alt and not, and here below there is an option of paste link, you do it, now not only data comes inside it, formatting is not available, what can you do for formatting, select it, click on format printer and it comes from here now. Suppose I have made it 100, then see it has become 100. Here, suppose I have written Tanu single. Tanu is here. I am writing anything. No, see, changes are happening here. I have deleted them here, so see here, they have become zero. Here I set the control, so the value has come here too. So basically, the changes that are in our first will be in the second. Will the changes that we do in the second be in the first or not? Because this data has come from data one to data two. Data two has come from data one, so the changes that happen inside it will reflect the same changes here but the changes here will not reflect here. Okay, so you have to be a little careful and in this way you can do this thing. So here we have completed, we have completed all the features on the special, now let us move ahead. Next topic comes to you, find. And replace has the same function as its name suggests. First of all, where is it found? Find and replace is found by going to the Home tab or Find and select. Now you can see that there is an underline under F in front of Find, so we can also find with control f. The second thing, let me tell you, first of all, this feature and the next thing is that there is a formula for find and there is also a formula for replace. Okay, so what we are going to do here is that we are going to feature. We are not going to do formulas here. Okay, what is find? Basically, if you want to find something inside the entire worksheet, then he can do it, or if you want to find something inside the entire workbook, then he can do it. The second thing is that you have to decide, see, first of all, what to do, either you do journalize control, then it will be done in everything or if you want to find something inside the particular data, then select that data and after that, like I did, select this data. I have done control f and after that look, this find and replace are together, so if you do not remember the two shortcuts, because the shortcut key for replace is not control r, because with control r, then we fill right, it is control h which is our replace, so if you remember control f also, then it is fine, then you can go to replace here. Okay, what is the find in find, for example, you have to find. Where to write crafts, so where to write crafts, so I have written C is big, craft is written, okay, window is going to remain the same, so we will keep the window as it is, after that see what option do you have now, we will not do any formatting right now, we are trying to do normal work, first thing with in means where to search, do we want to search in this entire sheet or in this workbook, we want to search in the sheet, we took the sheet, search by everyday, go to everyday. Look, go to the column column and see, so we are fine in the daily routine, we have to check in the formula, we have to check in the values, there is nothing like this in the notes, let it be as it is, match case, what is the meaning of match case, the case which I have written means C must be big, r must be small, A must be small, in this way match case has to be done. What does not match the entire cell content like suppose now if I put any color in it then it should be exactly the same as it is? I want to do the normal one for now so I did find all then it told me that in the more basic feature in the sheet with find and replace, Bharat Craft is written inside this cell, so look you can see here, this is the Bharat Craft, it has also brought the cell here, if suppose I write crafts here. Even if I give and then do find all, it is finding because we have not turned on match case here. Now I turn on match case, now I do find all. What is saying is we can’t find what you are looking for because here you can see all the numbers are in small letters but we have made them in capital letters here. Now I remove it and then I do find all. So look, it is fetching me if let’s say I am a workbook. And after that I do Find All, then he told me at different places where this is written, so look, P is also written here, it is also written in the condition formatting section, so wherever this is written, he told me all of them. Okay, if I had done match case and did Find All, then it is saying that it is not there anywhere. Suppose I am here, you understand its meaning, right? I do this and did control A, did control F, and after that now I search. When I do Find All, then look, it has searched and told me because now this graft is in capital letters, okay, so in this way you can find out anything, you can find out anything, it means if you are not able to find something, there is a number, there is a name, you have found out and now you have to find that thing, then what will you do, you can use control F and find any thing inside your data, after that you get the thing that let’s say you have this. Is it Craft? You have to write something else in its place or Creations have to be written instead of Creations. Ok, if you want to change anything then first either find it and then change it or you can directly replace it. You do the same thing, you press Control H and it opens directly to the replaceable one. In the other wise, you can also go to Replace with Control F. The thing is the same, okay, first of all we need to find Craft, that is, Find Vt means in whose place you have to go. I have to make changes. I have to change the logistics solution of the bytes. I have written the solution here. OK, my caps luck was on. The solution is fine. Match case is also fine. I have done that, remove whatever case or match case, remove the match case. If you feel like I do, something is written differently everywhere, then you can turn on the match case, otherwise you can remove it. Now I have to replace it. From the solution, I have done the solution and if I want, look here, find all, where are they, because it was a workbook, I should have done the sheet, and when I came here and find all, then these two solutions are written, and now I want to replace all, then it is saying that two replacements have been done, and look, now these are the solutions here, earlier there were solutions here, okay, so in this way you can also do the replacement. It is very easy, first inside Find What, write what to change, which word to change, and inside replace with, write what you want to change. Okay, ok, let’s do one more thing. Suppose, I take some random data like this and inside it, I gave any color like this, gave it yellow color. Now suppose I am not liking it, I am not liking this yellow color, so I selected this data, did control H and then After I replace, first erase these, erase them because then they will cause problem. Format set means we can also search the formatting. If suppose I will search and tell the formatting first, after that I will replace and tell. Suppose I just want to know where my data is written in yellow. So what will you do? You will go here to format and from here go to fill, choose yellow color and do OK and find. All sorry, sorry, sorry, sorry, find all, so it told me where all my data is in yellow, you can see, it has made a selection here and told about all of them, okay, I accidentally replaced all of them with only the empty one, so I do it again, it got clicked by mistake, after that let’s control A, like suppose I had accidentally replaced it and this replaced one was empty here and here. There was no format on it, so that’s why he left those cells empty. Okay, so you can understand how effectively it works. Now suppose wherever there is yellow color, what have I given in the Find What? Now I have to replace it with something, so I can replace it. I checked the change here. Let’s take the green color and go to the font and make it bold. Make it white. Then the preview will also come and it will look like this. If you do replace all then see that your entire data has been replaced, wherever it was in your yellow color, it has made changes there. You do not have to do anything, you go to control A and see, if you write something, it will appear here that you want to make a change, then do it here, but if you want to change some formatting, then do it here. Now see, whatever is written is also visible first, now it is already visible here, now what do I have to do from here first, in clear format, this is green. If I want to change this too then I took it here fill green font bold and I have to change this thing ok and what to change inside the format I just have to change the fill color to red ok rest is ok so I did replace all, now I am not able to find it out because even I have not understood what is formatting so I chose format from the cell, I took it from inside this cell ok replace all then it did six replacements. Now we know why it has done six replacements because there is date format inside it, we had told it what is this format, it is journal color, not only colors are formatted, your numbers are also formatted, now like here it is, it is a number format in itself, it is a different format, so it did not change, here it was text, here there were formats, it changed it, okay, so here it should have changed these also, we converted them into values. Okay, so in this way you can use Find and Replace very effectively. You can change anything anywhere, whether it is your value text or any kind of formatting. So here we have completed our Find and Replace and Find and Replace. As soon as I complete the Find and Replace, I can say that the major thing which is our home tab, we have almost completed the home tab. Now we We will move towards our basic formula because it is very important to do that. As soon as we get the formula, our grip in Excel will get stronger, so now let us do our formula. We are going to start the formula from the statistic formula. First of all, you get the sum. You have already done it. I told you about its shortcut key, so you will enter Alt equal to two here, then you will see that your sum has come and just double tap. You can drag it from here and just double tap it, then you will see your answers. Now let’s talk about the average. What is the average? First of all, I will tell you another way to calculate the sum. Like we did it like this, here we get the sum, here we also get the average and we also get the count and this is the formula we are going to apply. Secondly, all these formulas are going to be applied in the same way as the sum is calculated, only your calculation will change. What is the average? As you might have heard, now let’s see, RF Sharma has 90 in one. He is very good but in English he has 27, in Maths he has only 10 and in Science he has 47, so on an average, how many marks does A R V Sharma have? It is very normal. Let me give you an example, like if you watch cricket, if you watch this sport, then you know that there are six balls in one over, now it can happen. On some balls he may have hit a six and on some balls he may not have done anything, then after that an average comes that how many runs we have scored in a particular over, so that is the average which we are going to calculate here. If you want to calculate the average, you will apply the formula Equals to Average tab, after that number one, number two is coming in the same way as it comes in the formula of even, that is why now we will give the range here. No, the reason is because we have already done the sum, so why are we giving the range here, you enter it, after that you can double tap from here, you will get all the answers, you can check whether this is the correct answer or not, you take your number here, see how much is its average, see, this is the answer here, after that you get the maximum minimum, maximum minimum means this. Suppose you have these four subjects of RO Sharma There are marks and now you want to know how many maximum marks he got and how many minimum marks he got. The method of applying them is exactly the same, just what you have to do is to write the sum directly, what is there in the average, what is there in the average, you have to write the average directly, but in maximum and minimum you have to remember one small thing that what we call maximum in short is max, then whatever formula is given will be called max and what we call minimum in short. If there is Min, then the formula used here will be Min formula, so here we will tap equals to max, this is also saying the same thing, number one, number two, number one, number two, means we have to give the range, enter it, it will give it, it will tell what is the maximum, see, if you do not give the correct range then no matter how correct the formula is, the formula will be called wrong, if the range itself is wrong then you will get wrong answers too, hence you have to give the range carefully. Ok, let’s set the minimum, tap as per your wish, after that, take all the numbers and enter, then your minimum will also come from here and just double tap it, then you will get the answer from here, you can check, like suppose I check in this only, then which number is your biggest inside this, 74 68 27 32 74, then your answer is 74 and which is the smallest, which is 27, so come here. Gaya Your 27 Okay, so here we have done four formulas, what is the sum average, maximum and minimum, let’s move forward to the count, we will have to learn things inside the count, a little bit, so we take a sheet of three here and call it statistics here, okay, we delete it, here we come with the three, so we bring it here, so that’s what we have with the three, let’s go now, what are we going to understand in the three. We are going to understand the three formulas and how they work, we are also going to understand which formulas are we going to do here, are we going to do the count formula, what is the count basically, we are telling you by counting, we are telling you by counting, so look at the data you have in the count, what are the things you have inside the data entry, either you have numbers or you have text or characters, I can speak text or characters, okay so. What all do you get inside the numbers? Some values ​​come , whatever the values ​​are, or you get the date, or your percentage, or your time, that too is written in the format of numbers or I have already written your date. Okay fine, so we count all these things inside the number. Whatever is left inside the text goes inside the text. Also, I can write this, the non-MT cell which is empty is empty inside it. So if there is nothing, then we can say non MT cell or text or character, it goes, so suppose you have some data here, there is some data, there is a list and inside it, number, text, number, text, some empty text is also given, now you have to check how many numbers are there inside it, then you can apply count formula, if you want to know only the numbers, then what does Count A do? Count A also counts the things with count and also counts the things with text, like I will tell you a small one. Let me tell you this in tabular form. See, if I talk about count, I talk about count a and then I talk about count blank. These are the three formulas that I am going to give you here. Okay, see what count does for you. Count only counts numbers. Date percentage time counts these. Count a counts whom. It counts all the things that count, what count formula does, apart from that and text. Character or I can say non MT cell but at the same time count black like its name is how many blanks are there so call it blank cell or call it force or call it MT cell it counts it okay so now see we will see it according to the formula meaning we will see it by applying a practical formula so that there is better clarity Now I want to know what to know here how many if we assume this is the marksheet of my marks if I have to just count the numbers if I am here I will count the number and here it comes, four is four numbers are written, that means I have done all the entries, right, if I have written three, then that means either there will be some text there or it will be MT, only then it is showing three, it means we need to check, so in this way, you can apply it in any situation, we have tabbed the count, inside it, just did not write the number and wrote the value. The method of applying is exactly the same, you have to give the range, you have to enter, three numbers are written, now double tap it, now where it is two, you have understood that the person in front has given only two papers, that is why all the marks obtained in the exam are written, the rest are not written, whereas when it comes to count A, see here you have understood, we have to check only the numbers, when it comes to count A, now count A will also count the numbers and It will count the text also. Suppose someone is absent, if he has written absent, then if he has written that text, then he will count that too. In such a case, what result did you get? Did you get the result that I will come to know that I have not entered by mistake? If I have entered, whether marks have been written or absent, I have entered but if I have not entered somewhere, then I will know, that is why we have the formula of Count A. We will put it here, we will give range to him and he will enter, then here he told me that there are four entries, so now I know as soon as I see three entries here, that there is no entry here, seeing three entries here, I realize that there is no entry here, as soon as I see three entries, I realize that there is no entry here, why is it not because, either see, I must have written the number, if any student has come, his marks must have been written, if someone has not come, then I must have written absent for him, but in some case, I If nothing is written then that is my default and this count is one which is telling me the numbers as well and is also telling me the text. The count is only telling me the numbers. Now the count is blank, it will tell you the blanks, tab it, hit enter, then here it has told you that wherever there were blanks, it has told you that only these three will be blanks. So looking at this from here, you get a lot of things. See what the count blank means. Zero is blank, four is blank, that is, all the entries are there, out of which three are numbers, one is your text, see, there is no blank here, four entries have been made and all four are numbers, here one of yours is blank, three entries have been made and all three are numbers, here you have one blank , three entries are made and all three are numbers, even after looking at this, I have not even seen it, trust me, I told you just by looking at this, what is here You must have kept the entries because whatever formula you apply, the result comes out in the same way. You can find out all these things from that result, that is why we apply any formula, so here we completed our four formulas, these were Sum Average, Maximum and Minimum and the other one which we completed, which is count, count A and count blank. After this, we move ahead with our cell referencing. Cell Referencing: What is cell referencing? Basically, till now, whenever I had taught you the formulas, I had explained one thing in the formula, what I had explained was that the formulas which start with equal to two, how do we write them, so for once, let us repeat that thing once so that you can remember the thing and understand why we learn cell referencing. Here we are basically looking at the answer to why we are doing this. We are going to talk about the topic, why are we doing cell referencing? Okay, so see, whenever we write a formula, we write three things inside the formula. We will write three things inside the formula. One is where we write the cells, one is where we write the numbers and one is when we write the text. The cells which are there are always keep changing. Now what is the meaning of keep changing? It will keep changing as we drag, as if something like a1 is written above and When I drag, it will be a2 a3 a4 a5. What are the numbers? What are the numbers? They are fixed. If you write a number, like we learned in Total, if you write a number, then that number remains as it is and the text also remains fixed. Whatever you have written manually, how will you write the number and text manually? If you write by giving a cell, then it will go into keep changing, that is the cell. If you manually write any number and text, then they are always fixed. Okay, one more thing is added to the text. Whenever you write in a formula, you write it inside a double inverted comma. You do not write it directly. Whenever you write a text inside a formula, you write it in a double inverted comma. Now tell me one thing, the number is fixed, the text is fixed, it is keep changing, so suppose I have any such reports etc. She has to make a place If I have applied the formula, will I keep applying the formula everywhere because sales are ever changing and suppose I ever have to fix it, if there is such a situation, then we have to fix it, then we can fix it, but we can fix it manually, we will have to fix it separately, when to fix it, when not to fix it, what is the need to fix it, this is the learning we call sale referencing that we do in this way. We will learn when we have to fix our cell, when not to do it, why we have to do it and how to do it. We learn all these things inside cell referencing. So now you have understood that we will learn in cell referencing. In cell referencing we are learning that when we have to fix our cell and when we have to keep it in keep changing. Okay, now let us take the topic of referencing a little further. Cell referencing. Okay, let’s talk about cell referencing. How many types of cell referencing do you have? There is no need to remember it but as a la for general knowledge or if you understand these few topics then you will understand things in a little detail. Just for that there are three types of reference. The first one is relative reference, the second one is absolute reference and the third one is mixed reference. Okay now what is relative reference ? What you are talking about till now in reference is relative reference, meaning keep changing. Whatever I will talk about here, I will talk about sales, I will not talk about numbers and taxes about anything else, I will talk about sales because whatever work we are doing, we are doing it for sales, so what comes under relative reference, keep changing, it will keep changing. What is there in absolute, fix everything, fix everything. This is what we were going to talk about in referencing, what to fix and when to keep changing, then in relative, always keep changing, in absolute, everything has to be fixed, now what is mixed, what is mixed and mixed means it does relative plus absolute, now both are fighting among themselves, change everything, no, fix everything, no, change everything, fix everything, so now me. Tell me the solution to this. If there is a fight between these two, then what will be the solution? Tell me, if one person is saying everything, I just want to explain, one person is saying change everything and another person is saying fix everything, then in such a situation, if you have to give a solution, what will you give? Fix half of the solution and keep half of it changing, otherwise what, do 50 50 brother, half of you agreed. Half of yours, assuming the work of both is done, then we call such a reference a mixed reference. Lad, this is a part of the theory. You may be wondering why we are reading all this but it is very important. Now, as soon as we do the practical, you will say that it has come out so lightly and it is very important to learn it. You will understand why it is so important now. Let’s do one more topic. After that, we will move towards the practical. What is the small topic and what is the topic? It comes that you just have to remember one thing, this is a cell, this is a sieve cell, so C is the column and one is the raw and what does a cell get? It is formed by R in the column plus and when we give a cell inside a formula, we give a cell inside the formula, then the names of the complete cells come, you will see that if you apply the formula of sum, then a1 to a10, then those are the names of the complete cells, you just had to keep this in mind, now let’s move towards the formula. After that, you will understand all these things. We come inside the cell reference. The first thing that comes to us is the relative reference. What does the relative reference say? Look, I have to put the sum here. Tell me the way to put the sum. Here, how can I put the sum? I can put it by doing Alt equal to two, I can enter and double tap it. The answer will come. Till now we have not put so much mind into it, now we will put a little bit of mind into it so that we can understand what is happening and what should we do. Have understood this thing, what had to be done till now has been done, but the thing has been understood, which cell is your h3, what is your h3, what is the even you want inside h3, what is the even you want, what is the even, you want from d3 till g3 here, okay what is this h4, what is the even inside h4, what is the need from d4 to g4, then what will come, h5 will come, then what will be the even, from d5 to g5 and so on. Suppose I reach h100, then what will I want, what will be the even, what will be the d. 100 to g100, tell me one thing, the h3 here is also changing, h3 h4 h5 h and along with that, the simal new, along with that, you are seeing that d3 d4 means along with that, these are also increasing, so what is this whole scenario? So when the whole scenario is changing, we have to change, so we don’t need to fix anything, that’s why what we were doing here was taking the formula and double tapping and my formula was being applied all over the place, you see d3 to g3, if suppose you are on h9, then this is d9 g9, if you suppose you are on h16, then d16 and g16, so there was no need here, now we will do one more. Let’s take an example, which is going to be our absolute reference, so see, we are going to calculate the percentage of these marks within the absolute reference, so here you learn two things at the same time and also calculating the percentage, but my main focus will be to teach you cell referencing, along with that, learning the percentage will become automatic, okay, so let’s first understand how to calculate the percentage, okay and then Later we will understand this scenario a little with the study of A. Suppose there are students here, let me make five students, this is your A student, this is your B student, this is your C student, this is your D student and this is your E student, okay now here the marks of A student are 200, marks of B student are 300 marks of C student are Marks of 350 students came to 250 and end marks came to 275. Okay, these marks have come. Now suppose you have to find out the percentage of all these students and how many subjects they study. If they study four subjects, then how do you have to find out the marks. What is the formula of percentage? What does Total Marks Obtain mean? The number of marks obtained, so let us put the number on the right and upon. There is an exam of total marks, we will keep it below, now tell me one thing, how many are going to be below the total marks A, 400 because there are four subjects, one subject is of 100 marks, then you will have to see the marks above 400. If suppose I calculate this percentage of A for A, then how will I calculate it, then how do I calculate the percentage for A, 200 / 400 * 100, so here is my Now here we are in Excel, so even if we do not put 100, it will be fine because we have applied the format of percentage. If I calculate the total percentage for b then how will it be 300 / 400. If I calculate for c then how will it be 350 / 400. If I calculate for d then how will it be 250 / 400 and if we calculate here for e then what will come out is 275. / 400 So tell me one thing for everyone, we have calculated the percentage in this way and you have come to know how to calculate this percentage, now we will travel a little, whatever we do, we should do a little traveling in it, we will understand the things, let’s travel, let’s travel for a second, so first of all, what did you take, first of all, what do you have to take, the number of any individual, then it means you took the marks, okay and the marks were taken for a, tell me one thing. So there is a different mark for B. There is a different mark for C. There is a different mark for D. There is a different mark for E. So what are the marks? Keep changing and keep changing is happening again and again. What is the keep changing thing? Cell number text. You can write these three things in your formula. What is the keep changing? If it is in the cell, then it means to choose the cell. Here, OK for divide divide. We have put slash below we need total marks total marks how many are there 400 here how many are 400 here how many are 400 here how many are 400 here and how many are 400 here so that means is a fixed thing now tell me one thing we can write three things in the formula we can write cell we can write number and we can write text 400 text is there otherwise this one gets cut off now let’s talk about these two The number is always fixed. The number is always fixed, so either we write the number directly or we write a cell which we have to fix manually. In both the scenarios, our answers will come because what we need is to fix that number below, that’s why we can write the number below or we can also give a cell. Okay, so now we will apply our formula in both these scenarios and find out our answer. Let’s do it here. First of all, I take the total, Alt equal to enter and after that I double tap here, so here our totals are here, now it comes to the percentage, first of all we will do it, which is the easy way, whatever we know is fixed, we will write the number, it is always fixed, so we do the same, so equals to, first of all, we will have to take the marks because we knew the thing. The marks are being changed, we have taken the comma, sorry slash, after that what will we write, we will write our 400 and enter, then see you have got the percentage, just double tap it, see, double tap, we are able to do h32, for here obviously we need h33, so we will do h33 because it is in the keep changing, now you know but suppose I say that we have this cell, marks are written inside it and now we We are going to calculate this percentage through cell, that is, I put equals to total here and slash it and after that I give this cell and hit enter, still my percentage is correct, now I double tap, so do we have all the percentage here? No, why is it not there because if I double tap the number g30 in the divide, then it will go to the key changing. Now after g30. Is it g31 ? Is it science? If you divide it by science then only the value will come. Do you divide it by 34? Will you divide it by 37 47 93? See, the values ​​will come in the same way because it is keep changing. Look, after g31, it becomes g31, g32 becomes 33, then tell us one thing that you should not do this. Even if your answer is here, whatever you have to write, take it as h. You have to write h32 diva ba g30, you are here, suppose this is your h36, still divided by g30 is required, you assume this here, suppose your h is 42, still divided by g30 is required, then g30 is g30 g30, below everyone else is g30, you know this thing, everyone needs 400 below, so what will you do in such a situation, you will fix g30, now let’s learn how to fix it, this small thing. The concept is that we will learn how to fix any thing, here we come to our third part and from here we will learn how we fix. Suppose you have to fix any thing, any thing has to be fixed, we are learning to fix the cell. Inside the cell, let me assume there is a cell, then I will tell you how to fix these two. Look, the symbol used for fixing is dollar, now dollar is also above the fourth key, so Do not put dollar manually with shift, you have to press press f4 and there are some systems in which f4 will not work. If f4 is not working in your system, then hold the function, press and hold the function and then press f4, then it will be okay. a is also fixed and one is also fixed that means column is also fixed raw is also fixed the thing which has dollar in front of it is fixed like suppose if I write dollar a1 then here what you fixed fixed this column now when you drag it what will come # a2 is sorry # I am saying dollar a3 dollar a4 a will remain fixed if suppose I write a one then now when this would happen when now this What would have come if we had dragged? If we had dragged, what would have come? If suppose I am dragging it from this side, then it would have come ‘Bud 1 S Dove D Dove’. Why because I have not fixed ‘A’ then ‘A’ will keep changing but if I have fixed ‘One’ then it will remain ‘One As It Is’ so basically the thing which has a dollar in front of it becomes that thing. Okay, so here you don’t memorize it. What do people do, they memorize it so many times? If you press f4 then just dollars should come here. Hey why should they come and why should it be fixed? We have to learn this. Now we will apply the formula again inside the cell reference. See equals two, we will take our marks and divide. Now we need g30. Tell me one thing in g30 whether I have to fix g or fix 30 or fix both. Let’s see, you press f4, you tell me one thing, g30 was required completely no matter which cell. Go in, you wanted divided by g30, then g has to be fixed and 30 also has to be fixed, so I took the cell, pressed F4, dollars appeared in front of both, that means both are fixed, just double tap it and in this way your answer will come, okay, in this way we can fix our cells, it is very important not to memorize at all , if there is any data doubt anywhere, please let me know in the comment section, it is okay Let us now move towards the third reference, now you have come to relative, absolute has come, then mix has come, okay, there is no need to panic, but still we will do it a little more carefully. Okay, if you have understood this one, then after this you will be able to make any kind of formula for yourself. Here too, if we have to find out the percentage, then percentage. You already know the method of calculation, so here we will calculate the percentage, take equals to marks, divide by 400, write whatever you want, take this, take this and fix it with f4, you know I want the whole cell, so you have fixed g61 here, now enter, after that you double tap, you will get the correct answer, now you have the next thing, this is a case study in the way. We divide our marks by the total number of marks, in the same way I say that what is my percentage of Hindi within this 189, what is my percentage of English within this 189, so if you want to find out something like this, then you will have to apply the formula here, now like what we were doing there, we keep as many marks as we got, above, so that means, if I have 41 marks in Hindi, then I will put above in And Upon. The total marks here is how much is the total marks 189 so I will keep 189 ok next this is your Hindi, after that you have to find out English then 39 diva is 189 after that 75 / 189 then find out like this now look what is 41 41 is your d3 so basically what are you doing d3 divided by what is your h63d was 63 this and upon In h 63 if we talk about next then d63 / 63 divide by h 63 that means your h 63 is fixed h 63 is coming in everyone everyone needs it otherwise if you drag then it should remain fixed that h 63 is coming in everyone so let’s now apply the formula so we will apply the formula here How many marks are there in Equals to Hindi this is the comma because d63 Then e63 then f63 so it is changing but the one below is h63d 63 / h 63 should have been this e63 / so look here also here also h is 63 if I assume that I am going here then here also h is 63 tell me one thing if you have to do this for 27 75 68 79 then will you check according to 189 then you will make it for 249 According will check the meaning, understand the meaning of this , it means that suppose you were doing this one here or this one here, f e your 73 so what you wanted here is 73 divided by h 73 if I talk about this then what do you want here d69 upon h 69 if I talk about this then what do you want d65 h65 and now yes ya to hindi ka nikala ka karenge then f65 / h65 so In this way it will keep increasing, so now I understood one thing that it is true that here we need h 63 but here again we need h 64, here we need h65, here we need h66, that means this h is remaining fixed 63 64 65, these are changing, so do not fix the thing which is changing, right now you have fixed both of them in the formula, that is why the problem is coming, don’t fix them at all. We do not fix the things which are in keep changing, that is why now we will apply the formula here again, so see, you remove this and after that apply the formula, take equals to marks, divide, now we will take 189, h will take 63, we will press f4 so many times that we get the desired desired result. Now what is our desired result that we have to fix h. But do not fix 63 because it will become 64, 65 will become 66 , then keep pressing f4, keep doing this until the dollar appears in front of h. No one will remember whether to press two times or three times. If you are remembering this, then you will not be able to make any formula by yourself, that is why this is being done in such detail so that you can make the formula by yourself, so here you are wondering why h. Why is 63 not being fixed and if h has to be fixed then dollar should come in front of h then just keep pressing F4 as many times as the dollar comes in front, I see, I press it again, I am gone, it is coming on both, it is coming in front of 63, that means 63 is fixed once more, it is done, no memorization, it has to be done like this, enter it, now you drag it, drag it. After check below this 63 63 h 6363 correct and now drag it for a second now look I am here I this is your g70 so h70 is coming below d70 it is not so h 63 is here h70 is coming here so h is 74 is coming that means now your answers are absolutely accurate so what did you do here you fixed half of it and left half of it so it is the same It was when I explained to you in the mixed section that half should be fixed. What is the solution? Fix half of it and leave the other half for keep changing. Okay, so this is what we have done here, so this is where our cell referencing ends. If there is any doubt anywhere, please let me know in the comment section. In the live class, we do it in a lot of detail, but we know that here we have a little restriction of time, so here we have done it in as much detail as we wanted. Still, if there is any doubt, please let me know in the comment. Section and let us move ahead towards our next formula, so now the formulas that come to you are tax formula, how are tax formulas which are related to tax and let me tell you one thing about these formulas, all the formulas that you will see are very easy to apply, without doing anything, we have just told the text that if we want to make any change then in which text we have to make it but then what is the difficulty in it . So there is nothing but you have to keep in mind that whenever you have a situation, you should remember that this formula will be applied in this situation, the challenge is only that we have to remember that oh we have this situation, now we have to apply this formula, there is no problem in applying, it is very easy to apply, okay, first of all we will directly take the three formulas together and talk about the three formulas. Okay ma’am three yes yes three suppose you have some data like this a one let’s take some data here ok suppose you have some data here I write abc 1 2 3 xyz this is your ID some code is written now suppose you take this abc from inside it each meaning here there are 100 entries from inside that you want to extract the initial three words you understand this we can extract any text How to read, we read from left to right. Okay, now let me quickly explain from the left side. Now from which side you have to do this extraction. If you have to do it from the left side, then what formula will you apply? Will you apply the left formula? What do you think in the left formula? You will tell from where to extract from. From here, we have to extract from this text. Suppose a1a, so you have written a1, after that how much has to be extracted. A, B, C, three letters. If you want to extract, then you write three here and your answer will come, in the same way, suppose you have to do 11 will come at number 9 10 11, that’s fine, so you will not be able to extract it, how will you not be able to extract it, because it will go from left to there, you cannot write this, extract the number nine, if you write nine numbers, it will extract all the numbers and give it, then you cannot apply the left formula from here, you cannot go from the left side, now from which side will you go, you will go from the right side,

    that is why what formula will you use? You will put right, now when you go from the right side, what will you get , which number is it on? One, first tell me which text you want to change, you have to change it in a1 and on the right side, how many texts do you want, if you want three, then you have done three, then your answer will come to you, third comes to you, what does mid say in the middle? It says in the middle and if there is a middle, then we will not decide the middle, that means it will not decide the middle itself, we will tell you which middle has to be decided. middle you left right if you don’t remember both then middle can also work ok what do you do in middle first of all tell which text you have to change a1 has to be changed then tell where will be the start from where will be your middle start from suppose I am starting from 1 2 3 4 four so I have made four after that how many extractions do you have to do let’s say 1 2 3 three If I want to extract, I made it three, then my answer will be 1 2 3. Okay, so the middle works in this way. It’s totally up to you, what you have to extract, depends on your situation, what you have to extract and according to that, you will apply your formula, so let’s apply the formula. See, here we will go to the formula. We will apply the left formula for ourselves. To apply the left formula. We will write equals to left, tab ups, we will tap equals to left, we will give text, we have come here, comma number charge, which is written Na C H A R S, its meaning is How many characters will you go here, how many characters will you have to take from there, you have to take a, you have to take r, and you have to take that dot, I told you that here the spaces are counted, so you have to take m, you have to take r, you have to take that dot, then how many numbers have become, they have become three numbers, you will enter three, so here it is, now you double tap all the initial numbers that you have, they are there in keep changing. You already understand that, but you have got all of them, okay, just like that, now suppose I have to extract all this from the right side, M A O K L M So look, it has come with a dash, I said no, it counts, okay, you read it, Oops, Oops, Oops, I’m so sorry, I’m so sorry, you double tap it, you will get all the answers. Let’s talk about the middle, what do we call the middle in short, when we say mid, then the formula you think is the mid formula. Equals to mid tab. After that, the text will come. What will the text come? Here is your text, okay, this is your text, this is what it means in which. We have to make changes. If we have to make changes inside this text , then this text came. Comma start number, start number, what does it mean, where to start that middle, then a One second, how many characters do you need, comma four, okay, enter 5678 and just tap it, okay, then it would have come to you in this way, if you had done four here, then it would have counted the dashes and given the answer from 5 to 6, because it counts the dashes also, and it starts giving you numbers from whatever you start the middle stew, so you just have to pay attention to this small thing. We have to keep that in the middle, the rest of the things are directly in the left and right, so here we have completed three formulas: The first one is left, the second one is right and the third one is mid. Okay, let’s move next towards our length. If we have to apply the length formula, suppose you have an ID. The ID is written in this way. Okay, you have made 1000 entries and you have the data. Now you want to check whether all the IDs are written correctly or not. Look, if there is any problem in writing, we cannot tell right now how we will check or what we will do. But we know that our ID is only of 12 numbers or 13 numbers only. Just like you know that there will be only 10 digits in the contact details, you know that there will be only 10 digits in the contact details. So suppose somewhere I tell you that here 11 digits are written, here A is written, nine digits are written, then you will not even check what is written, you will tell me straight on the face that it is wrongly written, so this is how you came to know, you checked the length because its length is fixed, the length of the number is fixed, that is, it is of 10 digits, so whatever. If it is of 10 digits, whether it is more or less, then obviously it is wrong, otherwise we check the length in this way. Now we call the length in short. What do we say in our formula? If we say AA lane, then we will put the lane formula here. The suffix was not supposed to come here, we will put the lane formula. Equals to Length tab and what to do in it. Always listen to the formula, do not listen to anyone else, what does the formula say? If you want to take the text, then you take the text, you have taken the text and after that you enter, it will come here and just double tap it, then your complete length will come. Okay, let’s move ahead with this, here we have completed the length, after that comes to you. Trim formula. What does the trim formula tell you? The trim formula tells you that suppose you have some data which has a lot of unwanted spaces inside it. What are the unwanted spaces? I am writing here that there are unwanted spaces, so if you have to remove those unwanted spaces, then now you will sit down and start doing it one by one, then how time consuming is the process, one by one. What will we do in such a case, in such a case, we will apply trim formula here so that all the unwanted spaces will be removed, so you apply equal trim here, tab, after that give that text and hit enter, then in this way all your unwanted spaces will be removed from here. After that, double tap, then all the unwanted spaces there will be removed. Okay, so in this way, when Whenever you get any data, like any data comes from a client, in which data cleaning has to be done, then trim formula is used a lot in data cleaning, because no matter how the data comes out there, suppose sometimes you copy something from the website and bring it from anywhere, then this mistake happens there too, then how can you correct that entire data? You can correct that entire data in such a way that you apply a trim formula and then After this, all your unwanted spaces will be automatically removed. Okay, now let us move towards our next formula, which is not the text formula, we will do the text formula later, after that we will do lower upper and proper. Now what is this lower upper proper? Basically, let me tell you a little because we are going to do three formulas together, let us do a small overview. See here what we are going to do in lower. We will do upper and one we will do what is lower upper and proper one second prop what is lower like your alphabets A B C D this is lower what is upper what is your A B C D this is your upper and what is proper if I have to write tanu then T A N N U S I N G H A L So see the first letter first letter what came first letter capital came and all the other smalls came that is your proper which is your sentence Case, what do we call this? We call it sentence case. If you want lower case, you want all the letters in small letters , then use lower formula. If you want all the letters in capital, then use upper formula. But if you want everything, that is, you can use proper formula. If you want it in sentence case, then you will go here to the text formula. And after that, for a second, look here, all the things are now in sentence case, then you will use small letters. You can do this for small letters, don’t write small, you have to write lower, tap will give the text, meaning what changes are to be made inside it, enter it, then your formula will come and just double tap it, all your formulas have come, in the same way, if suppose you have to do all the things in capital letters , then equals to upper tab, after that you will give the text and enter, then here you have all the things. If it has come in capital letters, then you can convert it to capital letters in this way. When it comes to the proper means sentence case, then already you can see that it is in all the capital letters, so now we have to convert it to sentence case, so to convert it to sentence case, we will apply the formula of equals to proper, tap, after that give the text and enter, then here in this way you will Look, all these things have come in the sentence case, easily the data has come automatically in this manner, so this is what we have completed here, three formulas, the first one is lower formula, the other one is upper formula and the third one is proper formula. Now let us move a little further and let’s see what other things are there. You get tex join flash fill is also of the same. There is an alternative which is not available in every version. It will be available in the versions after 2019. It is very easy and first of all, let us move towards our formula. Suppose you have two types of text and here we will read one more topic, so read it a little carefully. Just give me a minute. Suppose you have two texts here, you have to join both of them, then you can apply the formula like text join. As its name says, its function is also text join, text join, text join, tub came, now read it because I will explain something in it and after that we will apply the formula, first comes the delimiter, then comes the ignore f mt and then comes the text one text two text thi, it goes on. Okay, you have read this, now we will understand it, first after that we will do something, so see, what is a delimiter, it is very important to understand, okay daily pea, this will come in more formulas later on. While going on, understand this very carefully. It is easy to understand. Okay, look, what is a daily pea? It is a thing that joins two things, just like we read in English. Not a conjunction that joins two things. So, in the same way, it is a daily pea. Suppose I write like this Tanu Singhal. Now, there is a space here, a small so t space, what is a daily meter? Suppose I write here tan single, so this is the underscore, what is this daily meter, I write tanu comma single, so this is the comma. What is this delimiter, I write Tanu Sl single, so what is this slash which is there, what is this daily meter, what is daily pea, then what is daily meter, which is connecting any two things, even if there is no space, then space is also your daily meter, okay, you just have to pay more attention to the space thing, that if you put anything because of space, whenever you apply the formula, then you can get confused in the space thing. If yes, then do not get confused in the thing with space, space is also your daily pea. If you want to join two things and there is a space between them, then that space will also be called your delimiter. Okay, now let’s apply the formula here. Equals to takes join tab. After that, we need daily pea. What is daily pea? What have we given daily pea? Suppose R Sharma, how do we want to join it, we want to join it with a space. Okay, now look, I had explained to you that you can either give cell or Then you can give number or text or character along with text, I have said character along with text and character. Right, so the space in text and character is like a character, so whenever we write something in text character, in what thing we write, we write in double inverted comma. Right, then we will turn on double inverted comma. Now for space, we will tell him that if I want a space, then I will give one space, how much space is needed, I will also give one space. Look, sir, I went ahead of him. After this, I will turn off the double inverted commas, I will put commas. Now what are you asking next? True False is never to be memorized. It always happens like this. Whatever formula you are applying, True False is coming in it. Suppose now this data is very small, if later on the data becomes very big and there is an MT cell in between, then do you want it to be ignored or do you want that MT cell to also be included, then there will be a lot of space in between, then what kind of answer do you want? Obviously if it is included, if the MT cell is included then it will become empty, nothing will be shown, then you will make true, false, okay. Now there is comma, text one, text two, then text one, what to add, OK, text two, what to add, enter it, so look here, Aarav Sharma, one is connected to it, if let’s say , I will show this thing by doing it one more time here, text join, don’t get confused, tap delimiter, now I have to add comma, so I put a comma in the double inverted comma, after that I closed the double inverted comma, then put a comma, after that I made true, now you know that this is done twice. Why is the comma coming once again? The comma is to move ahead from that formula and the comma in the middle is for the delimiter. This is called the true sense of the formula that you are able to understand its true sense. Now you are not memorizing the comma and after that you have taken the comma and then the text. If you enter then Rohan comma, okay, it is done in this way. Let us double tap the same formula and come here. Now we have to do a lot of processing inside it too. We had to look at all the things and came up with an easy version of the same, but the easy version works on a little pattern, so we will talk about that also, let us move ahead, we do the same work with flash fruit also. See, any particular work can be done in more than one way in Excel. It is totally up to us that which thing we are remembering at that time, which one we understand better in doing, which one we think is easy and which one we can do in the best way. In that way, we do this work, okay, now where do you get this feature, it is found here in the flash fill inside the data tab, okay, but we will do it with the shortcut key and its shortcut key is control e, what is control e, I write it along with it so that we always remember control e, okay, the flash result works by using control e. Now a little talk about how the flash fill works. And after that we will use flash fill as I told you that the flash fruit works on a pattern like flash f. Okay, now see what is the function of this pattern. It works in two ways, one is input and as soon as we need an output, now we can call input output as question and then we need answer. The thing is the same that you give a question, that means you give an input and from that you get the output, that means you give a question, from that you get If the answer is found, then there should be a pattern in giving the question. There should be similar questions because you need an answer by dragging and there should be a pattern in taking the answer. If there is no pattern then you will not be able to get the answer. The only thing is that if I tell you that after looking at this data then the flash result will definitely work in it. It is possible that the flash result may not work on it, then there is no such guarantee of the flash result but if it If you have understood the pattern then it will give you the answer. If you have not understood the pattern then you will not get the answer. Now let us give you an example of this. Let us assume that you will understand the pattern of the question. Then you will understand the pattern of the answer. What is the pattern of the question that on one side all the first names are there and on the other side are the last names. So are they written pattern wise? Yes, the same work has to be done in all of them, not first name last name first name last name first name last name first name last. Name is something different, something is changing, not changing, neither the pattern means the same, what is the answer to the question, what is the answer, we need Aarav Space Sharma, Rohan Space, Aditya Space, Mehta, Vikram Space, Malhotra, Rajat Space, Bansal, Arjun Space, Thakur, same is required for all, pattern is being formed in the question, and from the same, when we have to extract the answer, a pattern is being formed in it too, so when the pattern is being formed, Will the flash fruit work here? Yes, of course. Now how does the flash fruit work? How does the flash fruit work? You have to give him a command, you give him a command, explain it to him, sometimes it is not possible with one command, then you can also give two commands or three commands, but from my personal experience, I tell you that whenever he had to work, he would do it in one command and when he did not have to work, no matter how many commands you give him, it is okay if he does not work, then you will give him a command here, after giving one command, he will do your work. It will make it automatic and it will understand the pattern, what do you want the answer to be, then the first command we will write here is A. Okay, as you write, it will come A. A. R. A. Correct is to be written. The first command is you have to give correct . If you do not give correct then the answer will not come. Okay, I have given correct and I have given space here Sharma. Now I do not have to do anything. Come to the cell below and press control E and see your yes, see your answer has come, your answer has come, this is the answer for everyone. I wanted, yes, let’s see one more example, suppose it is the reverse of this. Now think what is the pattern here, think what is the pattern here, what is the pattern here, here is the full name, how is the full name also given, there is a pattern in everyone, Arf space Sharma, Rohan space Iyer Aditya space Mehta Vikram space Malotra Rajat space Bansal Suresh space Reddy, so all these are written in a pattern that there is a name, there is a space, then there is a name for them only we know. What is tex split? In my version of tex split, we are using version 2021. It does not have that formula. Inside 365, you will get that formula. What is tex split? Just like we have joined the text, it says to split the tex, so here we will do this work with flash feel, how will we do it, we will give our commands and after that he will understand now what is the command , what do I want Arav here, so here comes Arav. After that, what is the command that I want Sharma here, then Sharma comes here, okay, after coming here, press control e, after coming here, press control e, and this has done your work, okay, so in this way, we can use the very effect of flash fruit, wherever you want to extract any of your things, you have to do anything, you can use your flash fruit there, so this is your flash fill, we have completed it here, let’s do one more formula here. Let’s make some substitutes. Before substituting, we do one thing. We text the text formula. What does the text formula tell you? There is one thing in the text formula which I have taught you very well. It is going to be used here. It is going to be used here. I always say ‘Bo’. Suppose you want this date given. No, which day was it on that date, just like you don’t write your birthday, we write the birth date and you are asked in interviews etc. that which day was that day, tell me which day it was on that day, tell me, if you want to know this, then how will you tell, see, we will apply the equals to text formula, we will tab the value, what is the meaning of the date, the date has to be given, the meaning by which you want to know, you are asking about the comma format, what is the format? You have to know the format of date according to the date, how is the date written inside the date, D D M M Y Y Y or it is written like this. Now if you want to know the day, then that means you have to write DD, but if you want to write the day completely, then how many times can you write it by writing it four times. Now you have understood how many times D has to be written four times. Now what is D in itself? What is D, is it a number, is it a one? What is text? What is that character? What is text? So there is a text and any text is written in double inverted commas. So here you will turn on double inverted commas. Here you will turn on double inverted commas. You will write D D D D. You will turn off double inverted commas. You will turn off parens and enter. So you will get your answer here. Now you can double tap it, you will get all the answers. What did you do, if you wanted to know the days, let’s say. If you want to know the month , then go to Equals to text tab, after that give the value, meaning give your date, in the format of comma, you write four times mmmmm. When you enter the parenthesis off, then look, it has told which month it is – June, September, July, April, July, November, March. So, you have all the months here, so in this way, you want to get the days. You know the format, you want to get the months, you know the format, you want to get the year. Do you want to get the format written, you know the format, you should know the format and now I have got the format done so well for you, so you know the formatting, why we wrote four times D, why we wrote A, don’t memorize it, people here memorize it, write four times D, the answer will come, write four times A, the answer will come three times M, the answer will come, no, the logic behind it. Now you know the logic behind this, why we write four times only, we three. Why do we write only times? Why do we write only two times? Why don’t we do something directly? Why are we writing at all and why have we put double inverted commas in it? Now you know all these things. So here we have completed our text formula. Now let’s move ahead. Now we will do our substitute formula. Substitute formula. We will do it very easily here. What does the substitute formula say? What is a substitute? What is a substitute? What is my substitute? Someone else has come in my place, today I am teaching you Excel, okay, someone else has come in my place, so he is my substitute, someone else can teach Excel in my place, so that is my substitute, if suppose you are not using Excel, you are using G sheet instead, so goel’s has been replaced and in its place, we can use it. Suppose, you can write with a pencil and you can also write with a pen, but if you have picked up a pen instead of a pencil, then what have you done? Is pen a substitute for pencil or is it meant for writing? Yes, both the tasks are being done by it. Yes, there is a difference but what both the tasks do is only for writing. Neither is pen. Pen is the substitute of pencil. In the same way, if there is something inside the data which we want to change, then we can do it with some substitute formula. Then, Equals to Substitute tab. After that, we have to give the text, then which one should be changed. What is the meaning of the text? What type of change has to be done? Do the commas have to be used in it in a single single because there is not the same change in everyone. If there was the same change in everyone then we would have done this. It will not be able to be dragged. Okay, now we have to tell the old text what to change. 56 78 so 56 78 is the number so you can directly write the comma text. What text do you want to write? Let’s say I want to write here 1 2. 3 So I have to write 1 2 3, I have to do something else, if I don’t understand anything else then just finish it, enter the formula, see if the text is apx600, then you will give it in double inverted commas, p, k, r, you will write exactly the same so that it can understand and, what have to be written in its place, suppose you want to write a b c, then you are writing the because text in double inverted commas, right? If you want to write enter then it has written ABC. Okay, so in this way you can replace anything. Replacement here is this one. Why did it mean that we have substituted? Replace is basically a kind of replace but it is not a complete replace thing because we have to do it differently in each case. If you want to replace a particular thing with a particular thing, then you can do that directly. Okay, this was your substitute formula. Now we will move towards our date and time formula and if we are talking about date, then first of all let us learn that the current Which formula is available for date and current time and which shortcut is available? Shortcut: Yes, you can get your current date and current time directly through the shortcut. If we talk about current date, then you will know the current date. Here we apply the formula to get it. Write today’s today formula, tab it and see, I always say, listen to whose formula or listen to the formula, what are you saying brother, nothing else is required, direct parenthesis. Do it, I will give you the answer, then it’s ok, then if he doesn’t want anything, then don’t give it. Turn off the parentheses. If you enter, then the current date will come. Similarly, if you want to get the current time, you can get the current time. For the current time, you have to use the formula of now. I will tab and it also says, I don’t want anything, just turn off the parentheses, so we turned it off and entered, then it gave me the current, okay, I checked today’s time. Have you just put the formula ? Okay, there is a date here, we have to do the time, so look, it has given me exactly the time. You can check the time formula from here. If you make a little mistake in the date formula, if the time and date of your system are not in the correct way because they are captured, then somewhere, how is it able to find out on its own what date it is and what time it is, then suppose anyone’s answer is wrong here. So please check your time setting, is it accurate, whatever it is will be shown here is fine, so you make sure that in any case, if your answer is coming wrong then the reason for that is in your right corner that your things are not correct here, if things are correct here then your current date and current time will be accurate. In the second method, I will erase this. Let ‘s not erase it. Let’s do it here. If you agree, Take the current date, if you want then control and you have to press the colon control and after pressing the colon, you get the date in this way, then look at what you pressed for this, the control is fixed, just remember that for this we press the colon and for this we press the semi colon, the only difference is, now remember the semicalculus, if you do not remember the semicalculus then remember this, just for this we apply shift. Applying shift means using semicalculus. If we are pressing here control shift semi colon, if the colon one is pressed then basically semi colon will be automatically applied, then your timing will come. Okay, you remember this colon colon control colon, your date has come, control along with shift and put it, then use the colon, then your time will come. So in this method, we find out our current date and current time. Okay, now we will move ahead with the text formula. You already know that by pressing it, take a look at the text tab for once. We gave the value D D D D, turned off the parenthesis and entered and here our formulas have come. We had just learned the text formula, so there is no hard and fast rule in it, as you all know that inside a date, there is a day, there is a month and there is a year, so if you want to extract the same thing, then you can directly extract it. It is a very easy formula, like it is very easy, okay, so what you have to do is to apply the day formula. You have to tab the serial number meaning if you enter your date then the day will come. Okay to get the month equals to month, this is very easy. If it comes in handy in any situation then it is very rarely used directly like this then you enter then your month will come and in the same way if you want to get the year then the year tab serial number means if you enter the date then your year will come. Okay so in this way you can get the day month year, it is very easy. Why do let’s say you have a date, it is 9823, it could be like this, it could be 9th August 2023, and it could be like this, it could be 8th September 2023, isn’t it a possibility? Look, it could be like this, 12th month of 2014, who knows, it could be like this, 14th month of 2014, who knows, it could be like this, 14th December 2014, anything can happen, so to know this, you have read Day Month. Year done now you know 14th will be taken in 2012 ok so sometimes such situation comes you don’t know in which format it is written you don’t know Within this date, which is the day, which is the month, which is the year, then you can extract it directly from the formula by applying the formula of day, applying the formula of the month and applying the formula of the year, I hope you have understood, there is a doubt somewhere, let me know, okay, now we will do it. Look here, the day formula tells you how much day is there in that date, when I say days of any two dates. When you find the difference in between, there will be only days, otherwise now the formula we will apply will apply the days. Basically, what does the days do? Here is the formula applied in between two days. Okay, I have to remove this formula. Okay here, how much gap is there between the two dates, how many days have gone by. If you want to know, then what formula will you apply, what formula will you apply, what formula will you apply, the two dates of the days. How many days have come in between, then what will you do? Don’t memorize all these formulas, you have to do them according to what is written. If you go to memorize all the formulas, you will mess up all the formulas because in some, the start date comes first and in some, the end date comes first. In such a situation, you will get confused, you will not even be able to remember the formulas, they will start looking typical, that’s why they seem typical, so that’s why you don’t have to memorize these, put the days formula and tab it. Two and after that see what is written end date end date meaning when is ending end what is happening here comma start date start since when start when is it starting from here enter 42 days have come ok I for once just hold it with control I shift it here for once ok and control minus it from here left ok for now I shift the data for once Took because I wanted to make you do Days 360. There is one day which tells you how many days have actually passed between two dates. That is where Days 360 comes in. We know that look, we go with a very general understanding about our year, which means our entire year, how many days are there in it? Tell me quickly how many days are there in a year. Normally there are 365 days. There are 366 days in a leap year. Okay, if I remember maths, we used to do calculations in maths and in maths, marks were given like this, calculate the number of days below every question, like there are 360 ​​days in the whole year, so what does it mean, what is the meaning of 360, 360 divided by 12 is 12 months, so it means 30, it will not even consider in which month. It doesn’t matter which month has 31, which month has 30 or which month has 28 or which month has 29. It doesn’t matter to him what it is, he has to know that I will agree that in every month even if it is your February it has 30, your May also has 30 and your November also has 30. I don’t care in which 31 comes, in which 28 comes and in which actual 30 comes, I am I will take 30 out of all and give the answer according to that. So in such a case, the formula we apply is Ear 360. Sorry Days 360. Sorry Days 360. Sorry. Sorry. Sorry. In such a case, the formula we apply is Days 360. What is Days 360 doing now? What was Days doing? The Days which was giving you the answer was 365 on Edge or 365 on Edge and Was giving according to 366 which is actual but how will it give you as per month on 30 days but month month as per month on 30 days is ok now when you apply the formula then you will understand see I am going to give the same date here the difference will come in the answer equal to 2 days 360 tubs after that start date brother see it is in this start date look at that and end date was taken earlier. Start date first, take start date, take comma, after that end date, leave it for once, enter it and see if the answer is coming, is it yes, leave it, don’t enter it, then see, here it was 220, here it was 217, here it was 43, it was 44, then the answer changed, no, why did the answer change? Just because of this difference , somewhere it must have considered exactly 31. 30 A must have considered 29 28 must have considered because 24 isn’t 24 is the leap year so maybe B He must have considered 29 but he has considered 20 everywhere Sorry everywhere 30 It doesn’t matter to him So that’s yours What is your days 360 So here we completed two more formulas Which is days and days Let’s go 360, now let’s move ahead, which is your network days and network days intel. Look, now you understand a little, now you were given a date for example, you were given a date from 1125 to today’s date, let me write this today’s date is 12 3 2025, what to find out the exact in between. To calculate it exactly then we need days formula. To calculate the according of 30 days in between, what is needed to calculate the according of 30 days, so we need 3 days. Well in this I should say exclude weekends and weekends also only Saturday Sunday off, then what formula will you use for network days and if I say look see what I just explained to you that I want to know how many days are there between two dates. But among them automatically it will turn off Saturday Sunday and tell me that if I take it from here to here and there are six Saturday Sundays in it, then it will remove six and tell me that it was not doing this thing, Days 360 was not doing this thing, who will do this thing, the network will do this thing, but the network will do this thing, but one situation has come, what do you get for the second situation? Now let us read the second situation here, let’s read the second situation here. It comes to you that you say that ma’am, it is fine that they are giving Saturday off but my company does not give Saturday off, I only get Sunday off, that means you are excluding the weekend, you want to exclude the weekend but here you want to customize the weekend, meaning it can be as per your wish, you get it on Monday, I get Sunday off, someone gets Saturday off, someone else gets Saturday off. Some people get off on Monday, Tuesday, some get off on Friday, Saturday, so many things can happen, so in such a case, the formula we apply will be network days intel’s, then you will be able to notice this thing there and you will be able to understand well which thing is there and why it is written. Okay, so here you just understand that the network is also doing the same thing, it is giving you the difference between two dates, but what it does is that it Saturday removes Sunday, where when it comes to the network day int64, then you have applied. Now comes to the network days and network days, ital network days. We have to do this after reading and reading. After reading, all will be done. What is the network days tab asking for? Start date, take the start date. What is the comma asking for? End date, take the end date. Okay, now first of all I will show the answer by bringing it normal and then We will also consider the holidays. If there are any holidays other than Saturday and Sunday, then it is okay to consider them too, but we will talk about it after two minutes. First, we will understand it directly. Answer: Look, 31 has come, look, I had given the same date, in this also I had given the same two dates, in this also the same two dates were given and in this also the same two dates were given, but the difference came here and here, it has removed Saturday Sunday and told me, so how many less days are there. If you have gone and seen, you will get the difference everywhere, then it has removed Saturday Sunday automatic. Now I have one more here, one second control control plus, no, from here, control plus, I don’t know what kind of data is below, so let’s write it, let’s do control R and here we write holidays that we are considering holidays also. Okay, what is there in holidays? You have to tell them the date that my holiday is only then when you tell it, right? So what is there in that, he will consider, if suppose your holiday is falling on Saturday and Sunday, then he will not deduct it twice, he will not deduct it twice, he will not deduct it once, if you directly write the number of the holiday, then he will not be able to understand it. How many holidays are there? Will consider if any of these dates is falling on Saturday Sunday then should I count it only one time OK then you will have to pay for holidays also here and pay attention to cell referencing Look here now look at Network Days tab Start date this is taken comma end date Oh hey hey sorry end date this is taken comma Now these are holidays, when I take them for the first, then also all those holidays are for the last. Loo, there are holidays in all, you will have to look at the same holidays for all, otherwise what will you do, fix it with f4, enter, 31 has come, tap it, then look, there are four holidays here and there is one holiday here, why because it has now considered some holidays there, she might not be falling at all, so you have not taken it, then you should also fall, if it is not falling at all, now these three, four, these 8. From 11 to 20, 12, three or four does not make sense, so it will not fall, so it does not come in it. It is okay, if we had written any holiday directly, then it would not have understood, it would have given the wrong answer, so that is why we should tell them the dates of the holidays. He will check himself whether she falls within that time period or not. Is there any of those dates which is falling on Saturday Sunday? So he will not deduct her double time, he will deduct her single time. So that is your network days. Okay, now network days intel, when did I tell you, I write holiday inside it, network days ital, when did I tell you, then I told you when you have to do customization, look at network days ital or it seems exactly. In the same way, customization is done in the last one, start date is taken with comma, end date is taken with comma, then look, it has automatically opened the list, I have not pressed anything, it has automatically brought the list, now check, Saturday Sunday off is required, was it available only in network days, Sunday, Monday, Tuesday, the answer will be the same because only two days have to be removed, yes, changes will come, it is ok because of the date, Wednesday, Thursday, Friday. Friday Saturday, I want only Sunday only. Either I bring it down like this and press tab or directly write 11. Ok tap comma. After that, Holidays. If we are not taking holidays for now, then we enter this. This is the answer. Look, it was the same thing, but now your answers are different. Why is the answer different in all, because the demand is different, here something was coming exact. According to 360, here Saturday is coming without Sunday. Here along with Saturday, holiday is coming with Sunday. Here we have removed only Sunday and here now if we remove Sunday and also remove holidays, then what will we do? Network days, itel, tap ups, sorry, tub, start date, start date, see, whatever formula is there, see, it is written here, so you can also read the end date from here. You will take comma, after that you have written the same 11, if you want, you could have tapped from there, after that Holidays, Holidays, you will take this, you have to consider this for everyone, you will fix it with f4, hit enter, then look, the same thing has come because there was no holiday considered there and it has been changed. Here, holidays must have been considered, so here he must have changed because he must have checked from there, so in this way, we will make this network of ours. days and network days are used by intel, if you have any doubt then please let me know, I have explained it in very detail so that you can understand it very well, now let us move ahead towards our next formula, which is start month, e date and e month, ok, what do you do here, like you calculate the average due date, that is the work of average due date, understand a little here. It will be better with an example . Let me adjust it for once. This is adjusted. For once, we will understand the theory. Let’s take a case with us so that we can understand it better. Suppose this is you. Okay, Mr. He bought clothes worth Rs 10000. Now he is saying payment of Rs 10000 is fine. So Sir, I will not be able to make the payment right now, I will do it after two months. I don’t have the money right now. So Mr. Don’t you know how many people would be coming in a day? So , he records what Mr. I was patient for two months, now I have to pay my due date, so you should know it, and how to know the due date, it is on 12th March, if you add two months in plus, then what will come in March, April, so your due date will be made in May, so you have added two months, right, so in this way, we calculate our due date, so this is the work which you have done manually, this formula. If you want to do it with then use the formula of e-date, end date, basically end date, then you will put e-date, you will tab it, I have said the same thing, you have to do it after reading it, not by rote learning, what is asking, start date comma, okay, now some people may say, ma’am, if there are days, then there are days. Convert it to months, brother, if the date is days, I tell you, first take the months because you cannot do it with your formula, I have this, so what should I do, no, you did this, after that you went to home just because it is on the journal, we need the date, so here we took the short date, this is the date, one more, I create it here so that you can understand, control plus or control R, I would have removed it if you agree, you say. If I have this month, I will make another one, this is the days, write the days 60 90 65 52 62 32 45 85 45 62 If you have these dates, you do not have these, if you do not have a month, then how will you do it. Look, you will have to give the month in the formula, now how will that month come out, you have to know that, equal to e date tab start date taken comma after that take months. Now there is no month, forget the month, there is no month, you have days, how do you get months from days, how many months are there in a year, if there are 12, then divide by 12, no brother, month will automatically calculate , enter yours, 84, enter did you take this date? Well , there are 30 days in a month, so we will not do it by 12 months, we will do it by days, but it will not be standard, that means, in some, 31 will come, in some, it will come, then this can be messed up, okay, here that thing can be messed up, here two is written, here it is 90, that’s why here I write three, your answer will be correct, equal will come, okay, so here I have standardized it. I have divided it by 30 but you will have to convert it into months. Okay, if you want to be very accurate, if it is normal then you can enter the answer in this way. You will not get confused after seeing these two, because they are written randomly, don’t look at it right now, it is written as one, so here I write 30, the answer will be correct. If three is written here, then if I write 90 here, then the answer will be correct here. It is written here that if I write 60 then the answer will be same then this is different because random is written here just to tell you ok this was your end date, after this another formula comes end of month, now what does it mean, this is the formula which I had understood, within this formula I add one more condition, after that you will understand better, now what is the next condition, this person says this thing. It is true that I have to do 10000, it is true that I will do it in two months but but what does it say but sir, whatever date I follow your due date, take the end date of that month, end date of that month and date of that month, what do you say, oh sir, it is very easy, you are telling me, I did the transaction today, yes yes, then you are saying that my due date will be on my 12th, yes, I am on 12th. I am not liable to give it, I will be liable to give it on 31st May, O then your due date should follow anytime, on that day you will be liable to follow that due date which is the last date of the month, K Yes, now if you understand it right, then if such a situation arises, then you can use end of the month, see equals to e, O month which is the end of the month in which you started. Date taken, start date taken, comma, same months have to be taken, here you have to enter months, then look here, your answers have come, now look, it is the same, you had put the same thing in this date also, you had not done anything different, so here, look at 31, 8 is 31, 20 is 31, 23 is 30, look, all the last dates are just months, if yours is June, then tell me what will come, your date is that date. What is the due date? If it is June, then 30th of June. If your second is September, then 30th of September. If your third is of November, then 30th of November is your last date. If it has gone up even by one day or has fallen, then I am liable to give it in the end of the month. You see your formula, so that is your end of month. Okay, after this we move on to our next day. That is a very very very good formula. It is okay but it will be understood very easily. To understand this, let us consider a small case study and from that we will get better clarity. Okay, see here, he has asked to give the resignation. Now what does the manager say, OK fine, calm down brother, you have to give the resignation, there is no problem, but remember that after giving the resignation, you will be given 21 days’ notice. You have to serve your notice period. You have to serve your notice period. What do you have to do? You have to serve your notice period. Oh shut up, meaning I am here today on 12th March and Now I have 21 more days, which means that if I work, it will go till 3rd April, and this means that I will go till 3rd April, I have to work till 3rd April, but no problem , I will work till 3rd April, I will definitely leave, I am very fed up from here, so he has done the calculation directly till 3rd April, but the manager there says no, son, it is not like what you have done for 3rd April, in that you have also counted your weekends too, have you counted the weekends? Obviously your working days will not be counted. What have I said? 21 working days, 21 working days have to be done. If you have to do 21 working days then your Saturday and Sunday cannot come in it or whatever your weekend is, that is also customization. You know this thing that we do customization inside Intel. Okay, so Saturday Sunday cannot come. They say, OK, so now calculate and tell me till when will I have to work . We will tell you who will calculate and tell. Let’s calculate and tell. See, you came here in work days, after that you enter the formula of work days here, tab it here, it is written work day, it means it gives you the last date, I was saying work days by mistake, I am really sorry for that, like you see, when you did the day formula, do you remember in the day formula, you were getting the date as to which day is within that date, but like you said days. If the formula was done then the difference coming between two dates was net work days because in it the difference between two dates was coming, these were network days. I have also made the mistake written above, I will change it now but this work day by day day means that particular day, that is why he gives the date. Okay, we will take the start date, we will take the start date, comma, what is it saying after that, how many days have to be served, let’s say there is no holiday to serve 50 days. Will we talk about holidays later? Will we talk about holidays later? Let’s enter and here I do one thing, I take it from me, I go to home and here I come in short date. Okay, here I do a control plus A, A, I write it and here I do control R. Okay, here we will do the holiday one, then the holiday one too. You have to explain that if any holiday is considered in between, then neither the manager will consider that. Do it, it’s a holiday, work a little bit, so here you have the work day here , it ‘s ok, so here your work day has come, you double tap it, you will get all the dates. I was talking about today, right, I will show you today’s also, you did it here and we had taken out 21 days, so how do we take out its work day tab, after that was the start date, we did this with a comma, after that we gave this and entered, then we have 10th off. Where will April come? He was sitting there with ‘Third of April’ in it, do Alt HEA, then it will be deleted. Okay, so here we will calculate the working days now according to the holidays, so it is the same step of holidays which was in your network days, you take the start date, put commas, tell the days, take commas, for holidays, you have to tell this and this has to be considered in all the holidays because it is going to remain the same in future, so you Fix it with f4 and enter, your answer will come and here we go, so here you can find it in this way, if suppose you want to do customization, here by default it has considered Saturday Sunday as weekend, but here, if you want to consider Saturday and not Sunday, you want to consider something else, if you want to consider only Sunday, then you can do that also, you will enter the working day, tap the start date. You will take start date, you will go here and put comma, after that you will take days, you will take days here, you will put comma, after that you have to do customization here, what will you do for customization, you have to show only that of Sunday, otherwise you write 11, put comma, after that you have to consider holiday, if there is anything, then we will consider the holiday later, so I removed it and entered, so see this in working day only it considers both Saturday and Sunday. Here it has taken a consideration, so the date has changed, if I suppose I do the same thing here, I take it, I control it like this, and here I take the holiday, we write the holiday here, we write the holiday thing, holiday and we turn off the parentheses and enter and here I am going to consider the holiday also, so we will apply the formula again, how to do equals to work day, take the intel tab here, after that you should start. Date Start date How to take Start date is your comma after that you want days then for days you have this After that you need Sunday only, to take Sunday only you have taken 100 sorry 11 taken I am really sorry for that 11 taken com, now you need Holidays, I have told you about the holidays, select it, fix it with f4 and hit enter, then see it is the same thing but now your only holiday has also been added in it, so your answer has changed Holidays. You have understood the concept, you had done the same concept in the network days and the same concept is there in the work days also. I am so sorry. Okay, so here we have included all the possible formulas related to our date which are used the most. Here we have completed them. Now let us move towards the time formula. There is nothing much in the time formula, it is a very easy thing which you have just learned about the date. What are the things written inside a date? Inside a date, your day is written, month is written and year is written, similarly what is written inside a time, an R is written, a minute is written and a second is written . Because for now it is in this format, so what format will we do it in? No general format will come in the time format, okay ninth R means ninth R is going on, we will apply the minute for minute formula, we will tap, after that you will take it and enter, then it is 10 minutes, from how many minutes it has extracted, we will tap for second, after that we will take the serial number, we will enter, so so many seconds are written in it, okay, we do not want it in this much, we will take it in this. We have rounded it off and given it. We have given it by rounding it off. If you want, you can do it in this way. You can show it normally to two seconds. By rounding it off, we can take it from this. Okay, so in this way your R comes with minutes and seconds. So here we have completed all the possible formulas of our day and time formulas which were most used. We have completed them here and also. We will do the formula further, let’s move ahead, see till now we have seen, now let us start our logical formula. What is the logical formula? The first formula inside the logical formula that we are going to learn is the if formula. Now before learning the if, see how if is called in Hindi . On the basis you will be asked what is the answer, basically you will be given a condition and according to that you have to answer. If you did not understand the thing, let us understand from the example. Suppose there is a Raju, Raju goes to school. Okay, now Raju has given the exam. Now what is said in the exam that if he gets more than 45 marks then he has passed, otherwise he has failed. What did I say that if Raju gets more than 45 marks? If he comes, then he is passed, otherwise he is failed. Okay, so what is the condition that we have given? What is the condition that we have checked his marks, are they more than 45? What is the condition that we have given that the marks are greater than 45? If this is true, then either this will be true or this will be false. If this is true, then write PASS there and if this is false, then write FAIL there. Have you understood just one thing? You have to understand the condition very well, after that you can do this work like suppose we will travel again for now this is student A, this is student B and this is B and this is student C and if I say his percentage then it is 55. If I say his percentage is at 40 and if I say his then it is 75. So now tell me whether the one who is a is pass or fail is pass or fail is pass. If I talk about b then it is pass or fail is fail and if I talk about c then fail of dice is pass then if you tell me this then you know how to apply the formula, we just have to understand a little bit of the formula, basically what will we know by doing time travel, first what did we check, did we check our condition whether the marks are greater than 45, what did we check whether the marks are greater than 45 and look at the marks, it is such a thing. Marks percentage is the same thing, okay percentage is something which is different for this person, it is different for this person, it is different for this person, that means these are the marks. How are the keys changing, so what does it mean here, what will we select , we will select a cell, that is, we will select the cell with marks and then greater than 45, 45, whether it is this or this, the condition is same for everyone that it should be more than 45, so here we can write the number at 45 because the number is always fixed, so here we understood one thing that the first thing we have to check is what we have to check is to check the marks. Is she greater than 45 days? Then we time traveled that as soon as we get to know about the marks, that means we get to know about a condition, sorry, we erase it. As soon as we get to know about a condition, what do we have to do? Now that I have got to know about the condition, what will I do now, I will think about the condition. Is it yes or no, that means, has this condition been successfully achieved, if it has happened . So what will pass and if it has not passed then what will fail? Okay, what are these two? What is text and what do we write the text in? We write the text inside double inverted commas. Okay, now we have understood this but I have explained these things, why what is their logic? Let’s see what formula I am making you here. Right, just give me a minute . Why is it showing like this? No problem, here we will write equal to if tub here. Read what is the logical test value of true and value of false, so now we will elaborate this formula a little bit, after doing it in detail, we will understand it completely, okay, so here I write the F formula which is what is our logical test value if true and value false and the formula we have just given, we will understand it according to the example we have just given, so that we can understand F in detail. What is Logical Test? What is Logical Test? Check the percentage of marks. Is it true of the individual? Is it greater than 45? Value if true, if the condition becomes true then what to do is pass and A value false. If the condition becomes false then what to do is fail. So in this way you will be able to apply your formula here, that is why I told you the value of true by making this condition one condition two. Because value of true value of false also comes in your formula, so now you know what is value of true value of false, you just have to think of the condition properly, after that think about the condition whether it is true or false, after that you can apply your own, so see, here we will apply the formula practically, we will go with the same thing, whoever has more than 45 marks, he will pass, otherwise he will fail. Here we will write equals to if tab, after that logical test, what is the percentage in logical test? The only thing to be checked is the percentage of every student. Take the percentage of every student and obviously now Aarav Sharma will be next. Riya Verma will be next, then Anaya will be there, then Karan will be there, then Sanya will be there and then Rahul will be there. Meaning, the things that are changing will keep on changing, so don’t fix it. Okay, keep it at Greater Day 45. Greater Day 45 will be there. Do you check the comma value of true? If this is true then the condition is true then you have to write pass and if this is false then you have to write fail. Now you don’t know what you have learned till now in so many formulas and in that way. Now you will never get troubled by looking at formulas or symbols. Half of the people get troubled by seeing what are the symbols that why did you put this double e and inverted comma and then why did you put comma after that. Why is this greater than given? I will not be able to understand the formula or they will come. Now look, double inverted comma is text, hence we use comma for any next command. Greater given is given because we want to check this condition. If you hit enter, it will come close to here. Double tap it, then look, it is failing here, why 27 at 33 45, we have not put equal at 45, if we want to assume that If there is equal, then put the equal sign here, enter and now double tap. Now the one who was at 45 also passed. If you want that the one who was at 45 should also pass and the one above him should pass then you can do it like this. Okay, is this working or not? Once I check it, I made it 20. In this side also his marks will have to be 20. So see if he has failed, then in this way you apply your if formula. If you understand how the IF formula looks, take one more condition and tell it in another statement. Suppose any party name is written here. Party name is ok. I write any party name here. A A B C B C D E F G H I have written the party name here. Now I write the amount here and write the status here. I am explaining it very easy. Look, let’s go with a condition that see, this is my party. Now if any payment comes from them, then I write it here otherwise this cell remains empty and now I have to put the status. Suppose from here I have received a payment of Rs. 10000. It is okay from B. No payment has come from C. No payment has come from D. I have received a payment of Rs. 20000. After that I get F. A payment of Rs 63000 has come from H and then I have received a payment from H of Rs 52000. Now I have to update the status here that from whom has payment been received and from whom has no payment been received. Okay, now what will I do here, wherever the amount is written, that is, wherever the amount has come, then I have to write payment done and wherever the amount is not written, I have to write pending. So now what is the condition whether the cell is vacant or not? What will I think here, what is mine, what do I have to check, I have to check the cell, is it equal to MT, if this is true, that means, if it is MT, MT, then yes and no, yes and no, if it is true, the cell is empty, then what should come here, cell is empty, it means payment has not come, it means pending should come, and if we assume that cell is not empty, it means payment has come, then yes, payment received, understood, confusion, tell me once more. See what I am saying, come in the third, I am saying here we are going with a condition, see what is the condition, we have to check the cell whether it is MT and if it is MT, the condition of MT thing is yes and no, if yes means cell is empty, when is it empty, when payment has not come, payment has not come, it means pending and if it is not empty, that means payment is written in it, that means amount has been received, then payment is done. If it comes , then you know the value if true and value of false. You know that pending and payment done have to be written, but this is a logical test, how to write it? What am I saying in the logical test, you have to check the cell, whether it is MT or not, then it means that you have to check a1, then you will take a1. In the logical test, a1 is equal to two. How to show empty, there is no number, any number of text or character or anything other than the number. If it comes in double inverted comma, then double inverted comma. Now you have to show it empty, right? If you have to show space, then you give space. If someone has to show you a symbol, then they write that symbol. You have to show it empty. Stop it as it is. It means nothing. If space is given, what do we sometimes do? We give space to show empty. If you have given space here, then he will understand that there should be space inside that cell which you have shown in double inverted comma. What you write will come, now you will not write anything directly, you will turn off the double inverted comma, this means that it is empty and if it is empty, then it will come, so let’s try it for once, then you will understand better. We will go to logical formula here, we will put Equals to If tab. What is the logical test? What is the need to check this cell, what is the need to check whether it is empty, then I turned on and off the double inverted comma, but did not do anything in it because Only then it will appear that it is empty, there is nothing to be done, comma, if this becomes true then it is really empty, then it is empty, it means the payment has not come, that is, pending, see what happens, sometimes we think negative situation, sometimes we think positive, that is why I explain the logic, if you understand the logic, try the condition by making it yes and no, then we will find the correct answer, otherwise we may get confused, okay. Pending

    comma value false means the cell is not empty that means when the cell will not be empty then when the payment has come then we will do the payment. Pens of enter then see if you do this then see here the pending is coming. Now I delete it here, this is also pending. Suppose if I write any payment here then this payment is done. Okay, in this way we can effectively use if. If one like this. There is a formula which is used a lot, whether you are doing small work or big work, whether you are making a report or doing anything. If is used the most, that is why if you have a doubt about understanding If very well, then please let me know in the comment section. Here we have done it in great detail, just like we did If, similarly in logical functions, there are two more formulas in the logical formula. Other two formula R and and R and and R Now let us give a little logic to this We have to understand what is the meaning of ‘and’ and what is the meaning of ‘and’ and after that we will be able to work well. Okay, now what I am talking about is ‘end’ and ‘or’, these are English people, they are English people, now how come this is my friend Mr. I will eat pizza and burger and on one side I sent a birthday card and wrote what all will happen, meaning this is a fictional kind of example ok and there it is written pizza and burger in English and there is either pizza and burger, can we get both? The answer is no, where else comes to mean either A or B, one but where end comes, means A and B means both and both are ok, so this is the basic difference. Now why did I explain this in between is and and and and, I am talking about logical, I am talking about condition, I see where I have reached, here also it is a matter of condition, like suppose till now you had what was being talked about inside if and what was being talked about, single condition is ok, now it has come to the case of if condition, multiple condition, you have more than one condition and now there are two situations, either both the conditions are satisfied. Only then will some work be done or if only one of them is satisfied then it will work. If both have to be satisfied then apply the ‘And’ formula and if any of the two conditions, suppose you have two conditions, if any one of the two will be satisfied, then apply one more thing. Well, one more thing. The ‘if’ formula is more flexible and gives more customization. How inside the ‘if’ formula, you tell yourself that I have to write a pass, I have to write a fail. I want to get payment done written, I want to get pending written, I can get anything written but there are such formulas which will give you the answer not only on the basis of true and false, remember Go to Special, inside which there was a formula from which true and false were taken out, that is why when we were saying that brother, only where true and false are there, he considers it logical, why do he consider it logical? These and and and and whatever they are, they come from the logical formula. You will answer only and only in True and False. Through these you will know whether your condition is satisfied or not. Now if you understand it with a practical example, you will understand better. Whenever you do not understand the theory, no problem, we explain the theory only so that you can understand the core of it. If you do not understand there, it is okay. Not everyone understands the theory, then you will understand through practical. Now we have an example. What is the example that our manager is telling us to make a list of all the persons who are eligible for the employment like bonus. I said ok, it will be fine, we will make it. What is the condition, the experience of the employee should be greater than 5 and his rating should be greater than 5. If it is so, then he will get the bonus, otherwise I will not get it. Said right, meaning he needed both the things that he should work for more than 5 years and his rating should also be good, only then he will give the bonus. Okay, so in such a case, we will apply the formula of end, what is the end tab logic one, I have to check the experience, is that greater day equal to 2, because even if it is five, it will work and after that we have to check the rating, is that greater day equal to 4, if you enter it, the true answer will come. And double tap here, always look at us, here we are giving sale to whom, we are giving experience and we are giving rating and this is in keep changing, that is why we have not fixed it, now see, here it is six years and if it is 4.1, then your pay here has come true but here it is 3 years, it is 3.8, even if I make seven years of pay here, it is also false, if I make five years of pay here, then go. It is true that means both the conditions should be satisfied, I made it three here, then why did it come false, because the experience here is less than 5 years, he has to satisfy both the conditions, what has to be done, if both the conditions are satisfied, if even one condition is satisfied, then it will not work, see where the thing with one condition works, same is the same example, everything is the same, same is the data, here if even one condition is satisfied then let’s go. If you go to that is your or formula tab, you have to check the logic, Greater than = 5, comma after that, if you want to give logic two, then you will check that the rating is greater than equal to 4. If you enter it, then it will come here. Now let’s see here what was 65, so 65, so it will remain true, assume it is 4, this is 4.5, that means the rating is good but the years of experience are less, still he is giving true, if this of mine becomes three and this also becomes three, then it will go and give false saying brother, if neither of them is failing then if even one thing is right then it will give true to me, what else is that single condition also. If it is satisfied, then it will give you the answer. True and what are both the conditions, that is, all the conditions which you want to impose will be satisfied, then what is more, even if even one condition is satisfied, it will give you the answer. By default, the answers they give are in True and False, so here we have completed our logical formula. Now we come to you some miscellaneous formulas. First of all, we will learn that we have to rank. Now we will understand the method of calculating the rank from an example and then after traveling in the same way, we will make the complete formula. Okay, so let me draw five students here for you. Let us write the students here like this. Student A is one. He is at 60, the marks of D are at 85, and the marks of E are at 45. Now tell me the rank, who will come first, who is the student who will come at the first rank, who has the highest marks, then you will simply look at it and say that D is the first, then you will say for second, B is the second, C is the third, the fourth who will come will be A and the one who will come fifth will be E, and if you If you have given the same answer, then you have given the correct answer. Okay, now it comes to the fact that we will travel. Basically, what did you do? If I have to get the rank of a student, I have to get the rank of A. If we are taking an example, then first of all what I check is, I check the marks of A, that is, that person’s own marks. So, are these marks going to be different for A, different for B, different for C, different for D, different for E? Yes, of course, A’s own marks. B has its own marks, C has its own marks and D has its own marks, so this is keep changing and keep changing means that we are not writing anything on our own, we have to take cells only, the leaves of both numbers and text are removed, only cells have to be written and because there are individual marks, after that, what did you do in the second step, you can tell by just looking at A, what rank he has got. Unless you look at the other students, then to check the same rank, you have to check the same rank. Also checked B, it is 70, which means it is more than A. Well, it is 60, which means it is more than A. Okay, its 85 is more than A. Okay, if it is less than A, then according to this, whatever A will be, it will be on the fourth, so it means to check the rank of A, what did you check? So the second step comes that check the whole lot, basically the whole data. Okay, now tell me one thing, if you find it for b, then find it for b first of all. B’s marks are checked, O is 70, okay fine, after that, you will not do this. C’s is 60, D’s is 85, E’s is 45, okay, you will check A’s too, so no, we move ahead, we check all of them, it means for B too, you will have to check all of them, for C, we will check C’s marks, after that we will check all of them, only then we will be able to tell what is its rank, so basically the whole data remains fixed. If it is sales, then we will fix the sales manually. What is the meaning of fixing manually? We will apply dollars beyond that, then in this way your rank will be determined. It is very easy to get the rank but still you make mistakes in this, then we will also see what mistakes you make and we will correct it and will also see the correct answer. Now let us try it practically, so here we will put the formula here, we will have equals to rank, here you have it, tap the number, the number means which. What is to be checked? What is to be checked? Percentage is to be checked. Have you taken the percentage? Okay, comma is saying that reference means which one should I check? I check in these and I do one thing. For now, I will not fix it and after that we will check the rank. Okay, comma is asking for order. Now don’t memorize here, we will take zero, we will take one. Hey, here it seems to be zero, here it seems to be one, whenever things like this come, true false comes. If row one comes or any thing comes then in such a case you have to read that thing, you read why it is getting written and zero. Why am I writing this? Now I want to know why I am saying this. Generally, we take descending in rank but sometimes the opposite can also happen. You are carrying a negative situation. If you are checking your date, then in the date, the person who is lowest for you will be the one with good date. The one from whom our debt is less, so those are good things. If you use ascending there, then when will you be able to use it now. You will be able to do this when you have understood the logic in it, now you have not understood the logic only, you have done only 01 01, then you will make a mistake, then you will think that how will this happen, here we will do zero, which is descending and parent off, we will enter, we have got the rank, double tap it and the rank is correct, what is it, see, the first rank here is at 78, then the first rank is at 62, then the first rank is at 6051, what happened now ? Let’s check for once the mistake that people generally make, the mistake about which I had also told you that here we checked the rank, what did we check? Firstly, i3 is what is written in i3 and after that we checked from i3 to i17, it is okay, i3 is the individual marks and from A3 to i17 are all children, after that we came here, we had to find the rank within what is i k4, so here we will check. i4 as well as what is staying here from i4 to i1 means what did it do. If you are getting the rank here for i4 then it has been taken from i4 to i 18 whereas in 18 there is no data here, there is no data here and where did it start from. Sorry here, there is no data here and where did it start from here, it did not even check this 51. Then accept it if you are on i6. If you are coming, then it is checking from i6 to i20, it is increasing like this because you have not fixed anything, then in such a case, will it give you the correct rank or not? That is why this was the mistake, so now we will correct it. Just give me a minute, I have to remove all of this and then we will put our formula again here. So we took this, after that we erased it, after that now we will put the formula here. Equal to rank tab ok rank average taken by mistake I took the tab number take the number comma after that take the reference take the reference I took this and now fix it with f4 comma ascending penis off enter and now see now you double tap then your rank has come here see if these failed were failed then see the last rank is 12 15 14 okay so in this way you have to find your rank so here we have another formula. Completed, what is a rank formula? Now let us move ahead. We will do the round formula. What do we do? Whatever you round off, you get it rounded off. Now how will the round off be done? Let’s learn to round off a little bit. I will write a number and according to that I will teach you the normal round off, like suppose you have written 9635 6949. So first of all this. Understand, if I tell you that I want a number up to two digits, then it means that I am saying that I want a number only up to two digits after the decimal, so I want five, so I will write as it is and after that I am here, I want this number up to the second digit, neither this till the second digit, as far as we need, it is dependent on the next digit, if our next digit is If it is above five or equal to five then it gets converted to the next number and the other way it remains as it is, so now the number here is nine which is more than five, so now we will write this number by taking it here, then it is completed in two digits. Suppose this number was 96 3.56 449, then what do we do here in such a case. 9635 Now see on which it is dependent, on the next step it has to be checked whether it is greater than five or equal to five, so here it is four, which is less than five, so we leave it as it is, it comes to zero, okay, it is five, it comes to zero, let me tell you another number, let’s think of rounding it off, see here 89 7.65 5 3 2 I have two. Do you need round off till digits, what will you write 8976, what is the next number, five is equal to five or more than five, then what do we do with it, we round off, so that is your normal round off, now this is the normal round off, I understood when to do it and when not to do it. Here are two formulas and come out which is round up and round. Down tell me one thing, let’s me in this, we will understand this one and I will take its example, okay, I am taking the same number but changing the example a little bit 8 9765 432 Now tell me the answer to this, what will happen on rounding off 8976, this f is dependent on this four, four is small, f is as it is, now what these two are, what is the normal round off? Normal round off, but at the same time, let me tell you some different round off. Suppose I have got this situation here that I have got this number and now I have to apply the round up formula, then the round up formula says whatever the number is, I don’t care what your number is 8976 5 432. If this number is not there then it is smaller than f but still 8976 6 will give the answer, he will always round up no matter what. It doesn’t matter whether the number is above five or not. Okay, this thing, now let’s try it by rounding down. We use this formula to round down, see 8 97.6 5532. Now tell me one thing, technically this number after five is five, so it should become six, but rounding down will give you the answer 8976 5. That means he keeps the number as it is. It doesn’t matter to him whether the number on the side is higher or not. It is less, he keeps it as it is, so that is your round out, now we apply this practically, I explained this round off because people get confused about the decimal thing, so now you will not be confused, so see here, we will apply the round formula, apply the round formula, one second, we will do the equals to round tab, after that look, the number is saying, number has to be taken, meaning which number has to be changed, check, this one has to be done. The comma after that is saying the number digit. I had asked you how many digits to keep, so here we keep two digits or if you want to keep three digits, you can keep three, but after entering two, it has been sen. Now we will read this. First, we double tap it. See, after six, nine was and if it is more than five, then it was sen. After three, two was and if it is less than five, then we left three after six. Two was which is less than 5 so left it as six so in this way you have rounded off now let’s see the round up if the numbers are the same round up Tom after that we will take the number we took the comma the same one is asking the way of putting the digits is exactly the same situation will come different so you have to see ok now see this is the same number here now there was two after three so let it remain three but round up says I don’t care after Whatever number I have, I will tell him by increasing it, even after 63 there is a two, he makes it 64. Even after six, even after a two, he makes it seven. After five, even after a four, he makes it six. So that’s yours. Round up and same stubborn, ours is round down. He says, I don’t care, I will keep it rounded down. If I round it down, then we will take the number. After that, we will take the number . Comma digits two, you need to turn off the parentheses, enter end, you can double tap it, then here the answer comes, see it is 37, because after that there is nine, then it should increase, but it did not increase, it did not increase, it does not increase, it says, I do not care, this is fifth here, after two, there is five, it should increase, but it did not increase, it says, I do not care, I am stubborn, I will do it like this, so the round is your normal round off. Round up always keeps the dozen matter up, what is the next number and round down always keeps it on the down. Dozen matter, what is your number? So here we have completed all the three formulas very well, which is round, round up and round down. Now we will do some such formulas which tell you what is written inside the cell. Now you will say what is this, yes, I am telling you there is a list of formulas inside it, this formula is different. There is no point in doing this but let’s keep it in a little understanding like suppose you know what is written, a number is written, a formula is written, then you can check it, is the number tab, after that give the value, enter is this a number, yes this is the number, it is true, ok equals to is text, whatever you want to check, tab, did I give this value, enter, was this a text, then it gave false. Given, if suppose I do the text tab here, after that I give it and enter, was it text, yes, then it is True, in a way, it is behaving like a logical thing. In True False, it gives you the answer. Let’s tell whether that content is there inside that cell or not, like now you put equals to is here and you are getting lots of them here, you are okay, here you have to check if this is the formula, so you tap on it, give you this, enter the value given by you, is this a formula, yes, there is a formula inside it, then true, if I do the same thing somewhere else, then I would have given this formula tab and this Pooja Deshmukh enter here, was this formula no? That was the name I had written, the text was the constant text, you know this thing, you have already learned about the constant thing and the formula thing, okay, so here you will know, okay, next we will check is the error, is the error tab, is this an error, so you checked this, enter false, now see is this an error , okay, this is close, so we get this here, equals to is the error tab. After that we took this enter, so is it an error? Yes, if there is an error, then it gave true. In this, another formula comes, what does E E R R E R E R E R do, it also tells the error but it does not consider N. It is an error and considers all the errors but E E R R does not consider N and considers all the others. You take this, enter it and it will come true, it is ok. After that, more come to you in the same way like this error e error we have done ok fine after that comes to you e even meaning we have to check whether this number is even check yes this number is even in the same way if it is not an even number then it gives you this false and you get the formula in it see you can read from here like is a like e r r it does not do a but does the rest is a for particular a. You have to check whether there is any error with ‘A’ there or not, this number is good, this is weak number, so here you have many formulas which you can explore, I would like to do something else in this blank like took this blank, took tab, gave value, gave enter, so what was the blank here, otherwise if I remove it, then false comes, then yes, true, this is blank, so in this way, there are many many things here. There are formulas which are logical formulas, they are used very rarely, they are used along with some formula, their usage in themselves is less but if the situation arises then you should remember that yes, there are some formulas of this method too. All the terms that we have taught you, all these formulas are related to those terms in the data. Okay, so here we have completed these formulas, we have many good formulas. That’s done for now. Now let’s move ahead. I have done this for some advanced formula. I have been doing this in basic only but this is in kind of advanced. It is a good formula. Which is Sum F. Now let’s see it in detail. When I talk about the Sum F. So, first of all, look at its name. What is Sum F? How many words is Sum F made up of? Sum and F. Sum. What is the meaning of total? To total something if Had you read a condition just now? Had you read the if? Had you read the else? So this is what you had read for the if. One condition, one condition, two, check it in that. Now and in that condition, I am saying that you have to total. Now you have not understood the point, no problem. Let us understand from the example, this is your manager. The manager has a report. There are 10000 entries in the report and within the entries, there is data of North South East West and the manager has told you that Mr. Raju, you have to prepare a report. In the report, he gave this report to make a report. He wrote this, North, this, South, this, East, West, this, he wrote the total and did it like this and said, brother, fill in the values ​​here, fill in the values, meaning, tell me how many total sales have I made, take the data of these 10000 entries from me and check with me, what are the entries of North, what are the entries of South, what are the entries of East. What are the entries of West, what are the entries of West, total them and after totaling, make such a report and give me such a report. I want to know how many sales have we made in the entire North region, how many sales have we made in the Southern region, how many sales have we made in the East region, so what is the condition here, what is the first condition, first condition will we apply, so what is the first condition, what is to be found for the North and what to do, then if we get the North, we will get the entire North, then what? If you have to make even, then when you have a single condition and you have to make even, because you have to know the total sale, what has he told you, this is what he has said, I want to know the total sale of North Region. In such a case, what is the condition, what is the answer, what is to be done, then what formula do we use to sum, I have understood the condition, okay, I have understood the example, now let’s read the formula for once, after that you will understand better, it is sum, ff, tub, range, criteria, sum, range, ok, range, criteria, sum, range, I write it and after that I explain it to you completely, then we have another color, we work equal . To Sum F Tab Range Criteria Sum Range, this has to be understood carefully because they will understand that if they did not understand this one, nor did they understand the portion, then they will understand the reporting that you do in advance as well as the formulas used there and at the same time, if you are able to do all the work with the data using any formula you have, then you have to understand it very carefully. Okay, yes, first of all we will not talk about the range, we will talk about the criteria. What is the criteria? What is the criteria to search? Now tell me one thing that I have to search. Above, I gave you the example where the manager gave the report to you Raju and said that I want the sum of note South East West, then Raju will search whom, whom will he search for North, he will search only North, he will search only North, the amount is written in front of it, but whom will he search among all the entries, this is the amount, isn’t it? Will start searching for North. North will start searching for North. If all are found, then the amount is already written in front. So whom will he start searching for? North, here what will be his criteria, what will be North then for South, for South for East, for East for West, then what can I say? Can I say that the region is asked for region wise report, neither is the region within the report, within the region report within the report, so I wrote the report because the one with the report should be found inside the main. If you are thinking about the data, then what is your criteria range, meaning in which to search, in which to search, now tell me one thing, I am saying that you have to find the region, okay, you have to find the North, okay, you will search in the data given by the manager, you will search in that only, then you will search in that and tell me, North, okay, this is the entries of North, so in which you have to search, so what will you do here, if you take the region from the main data, then check in the region. You will do North North North North North North North North North and from that you will get to know the sum range which you have to sum means your amount which will come and where that amount will be written in the report. What has to be written in the report, if we have done the total, then what will you get in the main data, so basically now think about it, it was logical, but we have put it in the formula, how is it logical that there is a big data with 10000 entries in which North South East West has entries, so logical. Right, I want to know the total sum of North, so obviously I will first find out all the North, first I found out who I need to know, okay fine, I want to know the North, then I sorted out all the entries of all the North and after that I did all the sums separately and after that I took the total of all the amounts which were here, this is what you do, now we have brought this work inside the formula, how easy is it, so if I start making the formula here, if I start making the formula here, like this example. If I start making the formula, what will be the formula? Look, if Equal to Sum F Tab Range, then what will be the region in main data, what will be the criteria, what will be the region in report and sum range, what will be the amount in main data. If you do not understand this thing, then there is no need to panic. Let’s put an example practically. This is an example with me. What an example. See, here I have party names and also party names. What are the entries of the sale here, see how many entries have been made, one person comes many times to buy the goods, so look, we have a lot of entries, what is it now, I know that I do not have that many people, I have only so many customers, these people come again and again to buy, so here they are, now someone told me that I have to go, according to the name swift4, okay, so now you have come to a new example, leave that example. Now understand this, here there is an entry of sales, name of each party is given, there is sale next to it, you want to know how much sales have been done, then we will put it because if I search for swift4 in the name, then I have taken comma, now I am doing it for one, after that I will tell you how to put it for complete, so who did this comma criteria? If you want to search, then look, it gave me the answer 80586, okay, everyone understood, if I want to check this, then with control shift L, I applied the filter here, from here I searched for shuff nova, sf nova, ok and heavy go, then this is our total, look here 805 869, so here our total will come 80586, understood, okay, we remove the filter here, now the thing was, we have removed one if this is the thing, if I If I drag and bring all the answers, what are the correct answers? What are the correct answers? Look, he is choosing the range from b5 whereas our range should have been from b4. That means there might be chances that this is correct but no, this is the wrong way. We should not do it this way. We will use the right way because what I just said, there might be chances, I was not accurate, so we have to do the accurate work. Equal to Sum ​ ​ ​ ​So brother, do f4 or fix it with f4. Take all these criteria about comma criteria one. Okay, we have to remove comma for this. After that, even range, even range, tell me one thing. Sf Nava also has to be found in this. Same range for blue puck also, same even range for a cross. So okay, then when this is for everyone then take the even range and fix it with f4. Okay, enter your You will get the total of all the passes . Now you can do Alt Equal to here and enter. You have got the total of the sales. So, how much time did you spend in this method and was it a method that we will apply filters, we will find the answer of North, we will find the answer of South, then how hectic it would have been. So look here, you have to find all the answers in one turn, then this was your sum. If the way we calculate the sum, what do you think in that way? The average is also calculated and the count is calculated in the same way, so in the same way, no matter how much you read excel in the whole series, wherever it seems to be even, understand it automatically. Similarly, the average and count will also start calculating in the same way. Now suppose you want to know about Swift Nova in the same way. On an average, how often does it buy, what does it buy, meaning how much, what does it buy? Now imagine that there is a party which comes only twice or thrice in the whole month and It takes such a major chunk, that is, 30-40 business comes from only that, so we will see or say that three or twelve times it comes in the whole month, but if we look at the average, then brother buys in lakhs and there is a party which comes 20 times but buys in thousands, then from the average we come to know how much a person is buying from us. On an average, how much is he buying, then the method of calculation is exactly the same. Average Average F Tab is exactly the same. Range criteria now. Last comes the average range. Look, obviously if you are doing sum, then the sum range will come by writing the average. If you are doing average then you will write the average range. Doing is of the same values, otherwise the range in which we have to find is the same, so we will take this party name. Do you know that we have to fix it, why do we have to do this because comma criteria is same for everyone, meaning what we have to find is obviously, we have to find these only, comma average range, we will take the one which is in the sum range, the even range. If the average is even, the average will be in the range, we will fix it with f4 because it is the same for everyone, enter it, then see on an average, here is how much they do, if you do not want decimals, then you can remove them from here, okay , so you have this, now comes the point, this was also very easy, the main part of the average comes the count of sales. If I ask you, those who think that you have this for one month, it was a sheet of sales for one month, okay. Now I ask you, how many times does the person who is SF Nova come to you and buy from you, then if you concentrate on this thing a little, then think about it, if any person comes to you, he will buy something from you, if he buys something, then you will enter in your cell, you will enter, it means that every time a person is coming, he is entering in ours, so if I want to know how many times that person buys from me, then I check his name. How many times has his name been written in my entries? If I find out how many times his name has been written in my entries, then it will definitely become a fact. That he has bought something or the other from me as many times as that is why I have included him in the entry of the sale. So, we will do the same thing here. So think about it, here I have to check about a person how many times he has come but is there any consideration of any value in this? Rather, I am checking how many times his name has been written, that is why inside the formula, when you apply count if, then you will do a second tab, then here there is range, there is criteria, but There is no value because we don’t need the value, so we have to count how many times it is written in it, so you have taken the range in which you have to search, fixed it with f4 and after that you have done comma which means the criteria to find, you have to search for them, just enter, then it has come to you, see SF Nava, it is 28 times in the whole month, see the maximum, Golden Leaf has come to you, no, the maximum has come to you, True Harvest or Organics, so this is If you understand it in a very simple formula, then it is a very simple formula. From this simple formula, you have taken out all the insights about how something is going on in your business, so that is your sum formula. If any doubt arises anywhere, then please ask, I know this thing remains a constant for some time, but here also we are doing it in great detail, still if there is any doubt. Please note that you keep commenting, keep commenting because you will get their reply one by one one by one one by one one by one. Now let us move ahead and look at the formula. We have completed the home tab. We have completed our basic formula. Now we should move a little towards the tab. Now what we are going to do in the next tab is insert tab. So see, we have completed our home tab, we have completed our basic formula. After completing the formula, now we should move forward a little in tabs only. Now what we are moving towards is Insert Tab. Here is your Insert Tab, inside which there are different groups, Which is Table, Illustration Chart, Spark Line, Filter, Link, Comment for Insert Tab. If I summarize one thing and say that the Insert Tab is mostly used, then you can create and link the Insert Tab with this. Creativity. Mainly creativity, if you are creative or doing some work like creativity, then you need insert tab. Along with this, you can also do the work like reporting easily through insert tap. Now through creativity, you also get dashboards, so the most important for you is if any tab comes after home, then comes insert tab. Inside the insert tab, you can see the options, which are tables, inside which we can prepare tables. After that comes the Pivot Table. Pivot Table in itself is very useful for reporting. For now, I am giving you an overview of the Insert tab. After that, we will do the groups one by one. After that, you have the Illustration group. Inside the Illustration group, there are different types of things like there are pictures, there are shapes, there are icons . We will talk about all these now in the charts. Basically, I am going with a scenario here and that scenario. This is that we have Pivot which is useful for reporting, Charts in Plus which help in generating insights in creating your dashboards, if they help, then in Plus you will see filters which are your slicer and timeline. You have already used the slicers for the table. When you were reading, now the use of timeline will come with your pivot only, so I can say that there is a group of filters which has slicers and Timeline is the end, so these things are not complete in the complete reporting. This is a huge chunk in itself, which we will not do with the insert tab. We will do it separately and will do it at the end. Why do we do it at the end because what is the result of anything? It has the insight from which we will take the decision. There is a dashboard, so if I put it in the middle now, then it will not be relevant, you will not be able to connect because half of the things are available, half of the things are not available, now the advanced formula is there. If you don’t even know the advanced formula, you have to do it, so only after that, if we do the reporting, we will understand it better, that is why we will do it later, then what is left, the illustration, we will do it now, we will do the spark line, we will do it now, we will do the links, we will do it now, okay, so let’s complete the overview here, now we will do the insert tap. We are going to do that, we are going to do the illustration group. One second, if something comes first in the illustration group, then what is it? As soon as you click on the drop down, you will get three options, this device is stock image and online pictures. You can insert any picture from wherever you want. If you do this device, then it will ask you the location inside the device. If you do stock image, then the stock images will be shown here which you can directly insert . For online, it will be shown online. Now like I insert a picture from here, okay, I have inserted the picture of the boxes, so look, this picture has come here, now I have to arrange it a little, so I arrange its size in this way, look here. Okay, see, one thing is journalized for the insert tab, so understand it very carefully. From the insert tab, you insert anything, whether it is a picture, whether it is a shape, whether it is a table, whether it is a pit. Be it a table or a chart, if you have to make any changes in it, then you cannot make changes from the insert tab. Then we will say ma’am, then what can we make changes in, if only in that, we will have to make changes. See, whenever you insert something, what you do is click on that thing, then you will see that a tab is created above here, look, I am clicking outside, the tab is gone, I am clicking on this, the tab is clicked out. The picture format has been done on this, that is because if I have to make any changes inside it, then I will click on it here and I will get all the options here, I will get all the options here or I can right click and go to the format picture, then I will get all the options here. The options which are here in the extensions too, like these extensions are not visible here in full, they are visible here on the format control. You go to anything right click. Do format, go to picture or go to format, then you get all the options here to change them. So you understood. You insert anything from the insert tab. If you want to change any thing inside it, then a separate tab will be created. Changes will be made directly from it. There will not be a separate tab. I don’t understand. Right click on the same thing. Go to format. You can explore all the options from there. What did we learn here? Insert a picture. Now picture. I clicked on it from here, suppose I have to remove the background, I can do correction, I have to change any color, see, I wanted to show this kind of color, I have shown it, no, I want to show it a little brighter, so I have shown you the way you want to show the color, you can show it, okay after that, you have to show some artistic effect, what kind of effect should come or any other kind of effect, like this kind of, then you can show the effect in this way, I did not like it so much, I made it normal. I want to keep it in this way, I have kept it, after that you want to compress, the size of your picture is very big and you want to reduce it, then you can do that too. Here, if you want to change the picture itself or reset it, you can do that. After this, you want to frame beyond them. Look, if you want to do the framing in this way, then do it. This frame looks fine to me, it looks beautiful, so I did it, okay, I understood, after that suppose you want to change the color of the border of the picture, then I did. If you want to apply any effect on the picture, like I took this yellow color for glow, then it came, after that, the picture layout, if you want to show your picture in some other way, then you can do it like all text, if you want to put any text etc. in it, suppose you have done it here, if you want to make another copy of it, then what you have to do is either you select it and do control C and go to the side and do control v, then one way is to copy it. Look, I have made a picture here, the second way is this, you go to any picture, click on the end control and hold the roll, just drag it down, just drag it down, just drag it down, so in this way you can make many copies. Okay, now as you have done this, if you go to the picture format, suppose you go to the picture format, then bring forward send backward, this means to bring it forward, let’s say I am this picture . If I want to bring forward from this picture then I will bring it forward, so see that it has not come outside, I have to keep it behind this but if I want to keep it in front of the one behind then In this method, if you want to change anything on your pictures, you can do so. Now let me tell you one more thing, whether it is a picture or a shape, how will you know that it has been selected. As soon as you click on it, whether it is a shape, a picture, or whatever, you click beyond that, then bubbles come in the form of these bubbles. You are seeing these points. Yes, if you are seeing these points everywhere. That means there is a selection there, these are not visible, that means there is no selection, these are visible, that means there is a selection, okay, so from here we have learned about the picture, you want to crop it, you can also crop it, you have learned about the picture, after that suppose you come to the insert tab, I click outside, in the insert tab, Next comes to you, there is a shortcut key of the picture which is good for shape, I will also tell you the shortcut key of insert. It is N, like the shortcut key of home is H, its N is N, press Alt, see N is visible and the picture starts with P and stock starts with S, so S, then look, this window opens with you, whatever thing you use very often, just remember its shortcut key, okay shapes, look, shapes starts with SA, so if I press Alt and S H, then the shape will come, okay from here we can take any shape, I took this shape. I have made it, so here I will teach you a lot of good things in the shape later. I will do simple things. Now I have to make any changes in the shape, so look, I cannot do it from the insert tab. If I click on it, then look at the shape format. If it was a picture, then the picture format is this shape. So the shape format has to be changed. The shape has to be edited. You can do it from here, you have to write something inside it, double tap, your cursor will go inside, you will be able to write inside it too, okay. Okay, from here you have to change the color of the shape, you can change the color, let me assume that this color looks good, so I have taken this color. Look, this is the cursor, you can move it here and adjust it. Okay, after that, you want to change some color here. You can do that. If you want to keep some outline, I want to keep the outline yellow, so I have kept the yellow outline. If you want to give some effect like you can get the effect of glow, then you can change the glow in this way. Take the effect. Well, here if you say in the text, you write some text inside it, you Accounts My Bad Accounts Expert, you had to write this, you took this, after that, suppose you fill the text, you want to make it in black color, you want to outline it in black color, you want to outline something in white color, if it is not looking good then you make it black so that it looks darker, do you want to apply any effect, do you want to apply some reflection in this way, then see this reflection has been done, you want to fix it. Yes, you have selected it, gone home, normal, aligned it in the way you do alignment, formatted it in the way you do formatting, see how well it has come, you are not liking this effect, go here and change the text effect, reveal, you can also do this method, see, you can change anything in this method, OK, now assume that Bring Forward and Forward are exactly the same, you click on this. Do it, hold it with control , bring it backward, so you can do it in this way, okay, I have to delete it, I have deleted it, after selecting it, you had this for the shape too, if you right click on it and go to format shape, then you will get many options here, just as there were for the picture, you get all the options here also, it is totally up to you from where you access it, after that you go inside the insert tab. You will see the icon. Click on the icon. Let me tell you that as soon as you click on the picture shaped picture or the stock image, then look from here also. You can go directly to the icon cutout, people, sticker, illustration, cartoon people or you can go to the icon separately. If you want to go to the icon, then you can also go to the separate icon. From here, suppose I take an icon, I took this plane, I inserted it, this is my icon, now if you want to make any changes inside this icon, then I can go to this icon. When I click on it, the graphic format comes up. By clicking on it, the shape format comes up. In the graphic format also you have to change the shape of the graphic. Let’s say you have to change some color, you have to fill something inside the graphic, you have to make the outline of the graphic yellow in color and if you have to apply any effect on the graphic, then I have kept all these look, similar, similar kind of off. So that it looks good, bring forward backward, you know all this, you have to crop, all these things are same, right click on it and format graphic, then the options will come here, all the things are exactly the same, go to insert, after the icon, I tell you the 3D model, in the 3D model, you click, from here we take the emoji, there are very cute emojis, trust me and from here we took this emoji and will insert this emoji, look at the pot once. For this, I made it a little smaller and placed it here, after that I do a little bit on the side. What is a 3D model? You can move it in any way, okay, it’s totally up to you, how do you have to keep it and just look at the face, yes, it is a cute emoji, so now you have to change anything inside it, click on it, the 3D model comes up, you have to reset something from here, what is the way to do it, if you do not understand, then you can do it like this. Or you can move it directly from here, it is fine. Bring forward a backward. You know that by right clicking on the format 3d model, the main thing is to get the rotation done here. In this, you can get the rotation done directly from here. You can get the rotation done manually by entering numbers there. It is the same thing, in this way you can also insert the 3d model, after that you get smart art. Smart art is done in a way that your diagram does not. As soon as it is listed, it is processed, it is processed, if you want to show any type of relationship of cycles, then like you, I took this process one and I did OK, so it came here, now I decrease its size a little, not a little, but I decrease it a lot. And if I have to make any changes inside it, then I can make changes inside it too. How I clicked on it and here both smart art and format came , what is the format for the things inside. To change and smart art means I have to change only a shape, for that suppose I want to make the shape fill orange, so this is not looking good to me, white is fine, it is fine in this way, well, it looks fine for now, if you want to make any changes inside it, then you can do it directly from here, all the features are the same, you can also format the shape by right clicking, next comes to you, go to insert and screenshot screenshot . Let me tell you, if you do this in the screenshot, then if I do not have any screenshot in my system, then it is not showing. If you already have any screenshot, then it will show the other wise. Screen clipping, what does screen clipping do? Now, this will appear on my screen and suppose I take any screenshot, from here, I have taken any screenshot by doing like this, I have taken a screenshot of it. Okay, so look at this screenshot, it will appear here. Let me just adjust it. First, I have added this image here. Okay, now I zoom it, see, this is my image, the screenshot that came is coming in the picture format, I have to make any changes, I can do it by right clicking on it, doing format printer and clicking on it, then the effects etc. which were applied on it, will be applied here also, okay, you can use format printer also, so here we have completed our illustration group, now let us move ahead with our spark. Before reading groups towards line group, I remembered one thing which I have to teach you, what is a picture insert in a shape, so let’s see, suppose I have taken a shape, sometimes what happens is like we are making an invoice or anything, then we have to put a logo, so we keep adjusting it, so it is better that we take a shape and insert a picture inside it, now you will say, yes of course you take it. Right click, go to Format Shape and from here go to the fill option, here you get picture and texture fill, click on the picture and from here you can choose your picture, after inserting it, I take a stock image, from here we take these buttons and insert it, then in this way you can insert any picture inside your shape, first thing, then this is the second thing, let us assume that you are someone very creative in this. Shape has to be given, sometimes what happens is that you have taken a laptop with green screen and you want to show something inside that laptop, then how can we do such a thing, we will right click and here there is edit points, click on edit points. If you do this then you will see that points have appeared everywhere. Now your cursor is also changing. Now you can make anything happen with it, like made it like this, then from this point we made it like this, any kind of shape, like suppose I have to make it like this at this point. It has to be made like this. It is becoming kind of A, isn’t it? It is becoming kind of A. Now I will take this shape a little and make it look tight, now I understand. That is , if I want to do more on this point, then I will right click and do edit points and I have to stretch this one a little bit more, stretch this one and move it here a little bit and now I have to make this shape tight like this, so look, I have made a shape, I was just making a random shape, ch is a a, now suppose let’s look at another shape, we have taken a shape, we have taken a rectangle shape, right click here. Okay, now the picture has come, this picture has come, okay, now I will right click on it, I will do edit points and let’s say okay A points, so I have made it like this, look, it looks exactly as if there is no screen, it looks exactly like that, look exactly like we have created a separate LED kind of that screen, you can make any shape in any way, see, you can make any shape, anything is fine in this way. You can edit their points and create any shape. This is a problem for general people, but it can be done very easily here. Now we can move towards our spark line topic, for that we will need a data, so quickly let’s see what will happen that there are charts made inside the cell itself. There are very small charts which tell you about that data. We understand the charts as soon as we see them, so they are not charts, basically they are There are spark lines which we can create. Now suppose I want to see all the marks of Aarav Sharma in the form of a chart here. So what will I do. I will go to the cell in which I want to show it. I will go to that cell, after that I can do whatever I want to create a spark line. First of all, whenever you have to show a trend, you use the line, then you will take the line. Here you have to take the data range, the data range means which you You want to show that you have taken the data range, location range, I had already told you, go to the cell where you want it, if you do not go to that cell, then here you can put it in the location where you want it, you do OK, then it has come to you in this way, see, it has come in this way, now I will make it 60, it will come in this way, now see, I had just explained to you last that if you insert anything from the insert tab, then you will have a tab for that. One way it comes out is that I can drag it directly, then I will have to go through all the formatting one by one, I will have to change the thing or I will have to change the entire selection, so now what I do is, I click on it, I go to the spark line, first make changes in it, later I will drag it. Okay, what is the edit data here, meaning if you want to change the data itself, then you can do that here on the line column, let me say this. If I want like this then I can do it directly. There is no need to go and do anything. Look, high point means what is the high point of this entire data. 47 60 2040’s 60, then see second is high point, what is low point, 20 which is maths, what is negative point. Negative edge is true, we do not have any answer. What is the first point, from where it started, meaning 47, what is the last point, where it ended, 40 markers. Which will show these markers, like high point, low point, negative point, if we have turned it on then it is showing all the points through the markers, okay, now you know which point is which, okay, I have also told you from here, according to what I am telling you, if you want, you can also change the color of the spark line. Firstly, the spark line means the line that remains, if you look, I have made it red, then the line itself has become red, okay, if you want, you can change the color of the spark line. You can also change it. I am keeping the color of the spark line black, after that you can change the color of the marker, like leave the negative point ready, whatever the marker is, you can show it yellow if you want, or you can show the marker green if you want, I have taken green, or we can show the marker with some other color too. Which is blue, so we have taken these blue ones, after that we show the high point with green. Okay, we show the low point with red, you can show the first point with blue, so look in this way, blue green red red, now you will understand by seeing this, you can drag it, you are not able to see it, so I do one thing, I fill it with color so that you can see it a little better, now you can easily do not fill it just for the sake of showing, it will look very strange, just now you can see this thing clearly, so I have inserted it, just like when we have the spark with the column. If you want to make a line then you can do that also. You have started applying the formula. You go to the Insert tab and then go to the column. Give the data range here, after that you do OK and you have to change any things inside it, like here you have to make the negative points, the high point, you have to make it green, you have to leave the low point red, you have to make the first point blue, just double tap it or drag it and your spark lines will appear. Similarly, you have to do the same for Win Loss. You will go to the Insert tab, you will go to the Win Loss tab, the data will give the range, you have given the range, after that you will do OK, so this is where you got the markers, now you have understood how the markers work, then in this way you can change the colors of the marker, okay, it is up to you, in which way you want to see, in which way you want to show your data, you can use it at that place, so this was your group with Spark Lines, where we have completed about Spark Lines, this is it. All the options were there, after this the link comes to you. Now we will read about the link because of the filter, we are going to read with the pivot. Now we will read about the link. What is the link? For the link, I will need a sheet where we have many sheets like we have this sheet. Now suppose I create a main sheet and write anything here. First of all, I write a name which is written here. Data creation is ok. Creation, we have written this name here, Data Creation. Now suppose I want to put a link on it so that if I click on it, I will either reach the data creation sheet, then in such a case, we can insert the link. You can either go to the cell and click on the link, this window will come up or what can you do or what can you do directly by pressing the control, because what do we call this link, we call it hyperlink. If you do control H then the replacement will come K is the last alphabet so control key is fine, you can remember control key. If you press control key then you will get a window like this. Now let’s see what is there inside the window. First of all assist file and web page. If you want to tell any web page then you can tell. Okay place in the document. If you want to link to any document which is inside this workbook then you can do it from the document. Create a new one. If you want to create a document or want to attach an email address, then you can do it. Now we are going to explore both of these, like place in the document, so we had taken data creation, this data creation is here, comma, click it, OK, now see that it has changed, now you will click on it, you will go directly to the data creation page, okay, which sheet were we on? We were here, now this does not mean at all that we need to have a sheet. I have to take the same name like there is date and time formula but I write Accounts Expert here, okay and by going here, controlling it, going to Place in the Document, I link it to the date and time formula here, so it doesn’t matter what is written here, if I click on it, then access to the date and time formula is okay, so it doesn’t matter at all, it doesn’t matter at all what you have written, where has our sheet gone. Okay, we were here and we come to sheet one, okay, so here we learned, now after this we have to learn one more thing like suppose we have to do a web page, now I copy the link of our website here, here we took the link of the website and from here I copied it, now I go to my place in the sheet, write here web page or website, okay, here we did it with control, after that we took the web page one and we get here the browsed pages, current folder, all this, so Go to browse pages, enter the address here which I want to link, I have linked it, I have done OK, now I have one more thing to do. I will delete it from here so that you don’t think that we have taken the same link as before, we have taken the end here and okay, we have opened it, now we go and click on our link on the website, as soon as we click, it will take a little time just because this is the work of the internet and see, it has directly redirected us, directly on our website, we have come to our website, so in the same way, if you want, you can add any kind of link in it. You can attach it, it will redirect you there itself, okay, how do you have to do it, press the control key, your hyper link will come from there, that thing will be attached, here I have told you both the things, place it in the document and in which way you can also place the web page in this, the third thing is that your email comes in it, you have to log in for the email person, so you can log in that thing or you can directly create a new document, so here we have told The major point is that the link has been completed, after that you get the comment. What is the difference between comment and note? You are also hearing the note when we were doing go to special. We were doing special in pay special. In go to special, there was both comment and note. There was note in go to special. So, what is done with shift f2, like what is done with shift f2, this one is fine and one is this, you get this. Comment is fine. Comment, you can write anything like. Defaulter and Anything Okay, now what is the difference between these two, look for the difference, we need a data data, if we get it, then we can tell the difference, like suppose I have this data, one second, I take some good data, just give me a minute, we have taken this data, okay, we have this data and suppose I have added it here by doing shift f2 in such a way that the payment is pending for this person, so we have to take care of his payment pending in the next time, do this, OK and here. Also, I showed it through shift auto that the payment is done, I showed it here, so this is a note that whenever I go, the same will be visible to me and otherwise I can’t do anything in it, only these notes will be visible to me, only that girl can add a comment here, to add a comment, I showed payment pending here, I did this and I see, it is written here, if you press control enter, then it will be posted, then it is posted, now you will go to this. So the comment is coming but here it gives you the option that means his payment has not come till today, never mind, his payment has not come till tomorrow, never mind, the payment has not come till tomorrow, no problem, the payment has come today, so obviously you want to remove it, then you can right click on it and here you can resolve the thread that the thread is resolved, now whenever you go to it, resolve will show that brother, payment first. It was pending, now it has been resolved. Now let’s say, if you want to delete it, you can delete it. Now, if you want to delete it, you can delete it. Okay , so this is the difference between the comment and your note. This was your comment which got resolved, which you can delete. These are your notes which are visible as it is. You cannot do anything inside it. What you have written is there. It is done in that way, okay, so here we have completed the comment, you have given the link and also the comment, after that the text comes to you, the text is nothing, this is a text box, you will say that it is a text box, I don’t understand, see, it is very easy, the way you have inserted the shape, then you will go to the shape, then the first thing that comes is the text box, don’t you see, this text box has come, so the same text box is directly given separately here, this is also a text box, see, it is the same, you will click on it. Even if you click on it, the shape format comes, so it is the same as I told you about the shape, it is the equation equation or symbol equation, I tell you many equations are already there, ink equation. Suppose you want to write an equation and now you have like you are using a pun tub like me, then you can write any equation here like Why is he considering, he is considering the sum, he is not considering anything, 3 4 is not considering anything, he is considering the fear and the rate as zero, that is, in this way you can make any equation, like I have made this equation, it is behaving like an equation. Let me make one more equation and show it, it is not of much use but still if you have any use of it then you can use it ok just give me a minute equation, we will take ink equation and like you can write this x up in y = 239 in upon 435 multiply by 3 That equation will come, then this was a method, so whatever creative thing was there, it has come in the insert tab. We have completed our insert tab here. Now we will move ahead towards our page layout tab. Now the next tab that comes is the page layout tab. What does the page layout tab do? See, whatever you are creating data and doing, if you are obviously reporting, then there might be chances that you will need all that in hard copy also. So, if you want everything in soft copy, then in such a case, you will need a lot of Page Layout tab because it helps you in printing. Okay, so first of all, let’s have an overview here for once. The group that comes here is the theme group, which we have also read with the cell style, that if we have to change all the colors, then how can we do it? You can do it from here, like I have changed the palette here, so whatever is the initial a which is our home. The palette that was there inside the tab has been changed. Okay, here inside the cell style also, the colors of the palette have changed. Okay, if you want, try changing any palette here again and make it green. Now you go to home and check your palette from here and check the cell style from here. It has changed. Okay, so these are our palettes, which we are here to change things in the entire data. After that, we have the page setup, scale to fit sheet comes. Option comes and arrange comes then mean these three come here which is page setup scale to fit and sheet option ok so before we do this let me tell you why we are doing all this so that we can print right then print how do we select our data and take control . It is also visible that we can connect the printer, that thing is different, the properties of the printer etc., I am not talking about all this here, I am talking about all the other settings related to print, if you setup its end page here also, then other settings will open, then you, I am defining this thing here so that there is no confusion, the settings here and the settings here in the page layout are the same, it depends on you, from where you like to do it, do you like it better that I am here. I make the changes and after that I go to see the preview, then make the changes there and if you think that no, I do not understand what I have to do and what not to do, I want the changes to be reflected, so you can make the changes from here too, those changes will be reflected to you here, okay, so we will make some changes from here as well as from there, but don’t get confused, that is why I have already told you that this thing is going to happen in this way, let’s go now. We move towards one group each. The first group that comes is the page setup. So we know how will the work be done without theri. Our work cannot be done without theri. Our alt okay just give me a minute right now, first of all we will come to the page layout, we will come to the page setup work. First of all, what is the margin? Now what is the meaning of margin? What is the meaning of margin? So we hear profit loss margin, there is that margin over there. Don’t you see, this is your paper. Okay, I ignore the drawing. Do it, this is your paper and I am talking about the paper that comes to you generally and when you look at that paper, you can see the lines inside it in this way, there is another small line in it, okay, this is how the paper is visible and here a slight extra is left so that you can turn to the next page, so tell me one thing, here you are left for the title and for other things, here you can write the serial number etc. and you can write the other things. Yes, this one is left blank space for you and if you talk about exam, then you yourself come here with a line so that the teacher can write his marks here, then what do we say to the one who leaves this area on the side? What is called margin? What is called margin? We say that we have left margin on the side and the middle area which is now I make it a shaded area, a second shaded area which will be this middle area, this one which will be the middle area, inside this you write correct, inside this you write, then the outside area you have left is called margin. Now I will show you or tell you one or two things right there itself. One, you have seen the normal thing, two more things come that let’s say. You have this notebook here or this page of notebook, okay, one is this page and one is this page, okay one, I have done this where also I will do the yellow part, that is your writing portion that you can write here, so we did it here and it is here now I highlight the writing portion where you can write, you can write here and here you can write in this, you can write in this portion, okay so you one Tell me one thing, when you talk about the margin inside this one, you are seeing that the margin on the side is very high, so this margin is called wide margin. What is called wide margin in which there is less space for writing and more space on the side and right here, if you see that there is less space on the side and more space for writing, this is called narrow margin. And how basic understanding or common sense is that if you assume that you have large data, then obviously you You would like that the data on the side should be less in space and my data should come on the same page, then you will use narrow margin. If suppose you have a little data and it should look a little better in the page, then you will use wide margin so that space is saved on the side and my data should come in the middle properly. And if you have a normal situation, then you will use normal margin and not the normal margin as it is then it is fine. Similarly, now you understand the three types of margins, go to the page layout. There are three types of margins within the margin, normal, wide and narrow. We can also customize it. To customize it, we can do it by ourselves. It should be so many centimeters. It should be like this. We can do this by ourselves. It should be horizontal. It should be vertical. Look, it is visible here, the horizontal center on the page should be horizontal and vertical. So, you can do all these things. Now how to do this, once we Let’s look at my data here, if I go to control, my data is coming in this way, the complete data is not coming, then what do I do? Look from here, either I take the margin narrow from here and now go to control, then see more data is coming, first it is coming till the product name, now it is coming till the state or look here also there is an option of margin, you can click here also, you can do custom margin here, I make all the things zero, I definitely want

    margin. Otherwise look, the space is gone from here by mistake, it was removed from me, we will go back to the custom margin, we will make everything zero 0 0 0 Row and OK, so look at this whole page, even a little bit of space in the whole page, now the data cannot come on the side, there is no sheet, there is only this much data, so that is why it has done till here, so here I have not left any margins at all, my data is coming in the whole page in the whole page because I have set it myself, customized it if you want. If you don’t customize then you have normal wide narrow. Now if I did wide then only this much data would have come. If I had done normal then this much data would have come in normal. If I had made narrow then I would have had data in this manner. But what I had done at that time was that I had customized everything, I had made it zero, so I make it zero for once , from here I made it zero, made this also zero and did OK, so my data has come in this manner. Okay, next we come to orientation, now let me explain the orientation a little creatively so that that thing can be remembered, now I am telling such a thing and if it is not remembered then what is the use, so just give me a second, now let me explain it to you, see, all of you must be taking selfies, taking pictures, so whenever you take a picture, you have held your phone in this way and now you are taking a picture, so which mode is this mode? Let’s say portrait mode. You are holding the phone in vertical form. The form in which your reels come and shorts come in which form does it come in portrait mode? Suppose I do it like this. Now if I am clicking your picture or clicking any picture, then in which mode am I clicking? Which mode is it in landscape mode? This is landscape mode. If you are giving a picture or youtube0 video, obviously most probably you will be watching it in this way. Right, by doing this in this way, then in which mode are you watching? In landscape mode, if you were watching it like this, then in which mode would you be watching? In portrait mode, then it is fine. Similarly, we can adjust our data, it is up to us, how do we want to print, click on the orientation, look at the portrait, the picture is also visible here, portrait or landscape, we have the data is big, we need to show it in landscape, then do it in landscape, if you want to do it in portrait, then do it in portrait, from here, let’s say for now, I control p, control p for a second, then I have the data coming in this way, okay, let’s say now I once from here I will also tell you from there, I will control p, then look, it is coming in landscape mode, look, now everything is coming after writing till the price. I was not getting the columns in landscape at that time because there are more columns at the top, so I should have done landscape. It was not coming in portrait. Well, you can change it from here also. I told you that all the settings are there here, you can do portrait from here too, it is not looking good in landscape, that’s why we do it here because here we have to do it. You get a direct preview of what is there outside, then we have to come here and check, this is giving me a better clarity, this is giving me a better feeling, my data is visible in it in a very good way, so I will keep it in landscape, okay, so here we learned the next thing, that is our landscape or portrait, which is the orientation, after that comes to you the size, you click on it, many types of things are already given, so either you Pick it directly from there that I have to pick this, I have to do this, I have to do a legal document , I have to make a statement or I want a3 size, I want a4 size, do this, I will definitely tell you a very basic way to understand it, whatever document we make, whatever documents we print, all of them are done in A4, okay and if there is no problem in understanding, then I will tell you that as this number decreases, I will say a3. a2 So that means the size is increasing, the size is increasing, okay and as soon as I say a5, a6, it is getting reduced, now let me give you an example, there are documents in a4, inside a3, your sketch which you make is so one page, the thick page comes, that is your a3 and there if you talk about the pages of the notebook then a5 will come and if it is a small notebook then a6 will come, okay then it is the reverse. It is said that as the number is decreasing, the size is increasing and as the number is increasing, the size is decreasing. Okay, so in this way you can see that the normal document that we prepare is within A4, rest it is totally up to you that in which you have to do it, then that is your size, after that comes the print area. Now think of it, you are in your data, here you control p for a second, by controlling p, the complete data comes and you are seeing. Yes, there are 52 pages coming below, this is such a huge data, but you say no, I don’t want all this data, I only need the state and that much data, I only need this much data, so select the amount of data you want, after that you go to the page layout, after going to the page layout, click on the drop down of print area and set the print area from here, this is done, now you go to control page, only that data will come which you have selected, rest of the data will not come, look below, it is one page. Earlier, how much was coming, 52 pages were coming, so what did you do here, set the print area, what did you do, set the print area, okay, if you do not want to set the print area, then you will go here Clear Print Area, now look, press control, it is complete, right here it is complete, if you want to set the print area, then you can set the print area from there, after that you have the option of breaks, what does it say that if you want to insert any break, then we have inserted break here. So look at this line, my data was here at that time, look here for a second, I had put a break in my data here, so my data is here. Till now everything else is coming below, in this way you can apply brakes, you remove them for once, then these brakes are gone, one second reset all page breaks, look at ours, I take it in normal view, our data has come in normal view, I go here, only after three headings, I insert the break here, okay, one line has come, now I control p, so see, two lines have to come on the initial, in everything else. The data is coming in two lines in the initial because I had put a page break. After two lines, only two lines are coming there, so you can break it as per your wish. Now you have put this break wrongly. So what can you do, go to the break point, reset all the pages, now do control p, then your data will come in the same way. Basically, suppose you have to put any type of break anywhere, you have to show the entries till here, you just go here and break it and then Press control and see that you have got so much data. If you want to leave then simply go to break and reset all pages. After that press control and see that all your data is coming in the normal way. So in this way, if you want, you can also insert a break. After that comes print tiles. Okay, sorry. After that comes background. Suppose you have this Excel file which is visible behind you, which is Excel like this. If you want to insert something in the entire Excel, it looks beautiful. If you want then you can put it, we don’t use it, but it is not used that much, but if anyone wants to do something creative, then you can do it. Let’s say I take the logo from here, I don’t have any pictures like this, we can take a picture from here, so see, this is how the logo will be placed, it is present in the entire workbook, it is present in the entire meaning sheet and if you want to remove it, then just delete the background and it will also be removed. Okay, after that comes the print tiles. Inside the print tiles, there are many settings which help you in printing in different ways, like if you click on the print tiles, then look inside the print tiles, there is the page, there is the margin, there is the header, there is the footer, there is the sheet. Let us know about the page. Suppose my data is not being adjusted. Now I want to adjust it, so I have two options. First of all, look at the orientation. I have done the scaling. You can also do the scaling here. Will read, if the option here has come inside it, then you can read there also, after that the print quality is OK, fine margins are there, which I have read, the header is the footer, which we will read and all the things inside the sheet sheet, whatever we have to change, look at what is there now, print area, print titles etc. You already know that turning on the grid lines means that if you want that whatever I want to print, the grid lines should be visible, then you can turn it on, you want that the black end. If the data is in white then you can turn it on. If you want draft quality or heading of row and column, then you can turn it on. We do not want that. Down the over over the down. The way you want to order the pages, you can do it. Now we have done the down the over, which is right and you do OK. Now look, you come by controlling p and see that the colors have gone from the heading because you had taken black and white as an option there. Now if you do not want black and white, then you can print it. Go to the tiles , go inside the sheet, turn off black and white and do OK. Now turn control panel and see that the colors have come back. It is totally up to you how you want. From here, go to the print tiles. If suppose you do not want the grid lines, you can remove them. Okay, now I will tell you one more thing that suppose you turn the control panel and here the heading is appearing on your first page but the heading is not appearing anywhere on the second page or third page. In such a case, you If you get worried about not being able to see the data, then in such a case, you can get your heading repeated again and again here. You will go to the print tiles and look inside the same sheet. It is written here, ‘Row to repeat at top’ or ‘Column to repeat at the bottom’. There is nothing on the left like if I want to repeat, then I will not take that. If your data is horizontal then you can take it. Right now our data is vertical, so we need row repeat. We have to do this, we will select it, select it and do OK. Now look, now you control p, after that look, you go to any page, look, I look below, I am on page 20, 21 , but all your headings are appearing in every page, so this In this way, you can put any heading you want to put in every page. If you want to remove the heading, then go to the print tile in the same way and remove it and do OK. Now when you control p, your heading is no longer coming here. If you want to put it, then you can go and add it. Okay, here you guys have learned this setting, now we are left with two settings of the page which are Chch is page which we will learn inside scaling and from here we will Okay, so now let us learn both of these things. First of all, let us learn our header footer . What are header footers? Suppose, let’s take a page here. Here we have taken a page and inside the page you will see that there may be a name of your company at the top or anything else you want in every page. If you want, you can write the page number at the bottom. So what we write above is what we call header which we write in the space above. And what we write in the space below, we call it footer, so it is okay, you can also customize your header footer inside your document, so how will it be, like in the page layout, first I go to my data, it can be in two ways, either I can go to the print tiles and from here I can go to the header footer and write here. Ah, either I can choose from here what I want and or else I can write a custom header here, I want it in the center, I want it in the left, I want it in the left. I want it on the right. I want it on the right. I want it in the center. Suppose I want to write Accounts Expert. I wrote Accounts Expert and OK. And here in the footer, I want to write pages. So look, I will not do custom footer, I will take pages from here. Page one, page two, page one. Took and I have given OK. Now I will take a preview tomorrow. I will do a p here just because we don’t have space. Look, page three is also being written and accounts export is also coming on top. So let’s do one thing, this is the margin and we keep it narrow, so see here Accounts Expert is written below. If you are going to page one next, then Accounts Expert is remaining as it is because we had customized it and the pages are going as you are moving. Look, it is going on in every page of yours. Okay, you can do it in this way. If you want to customize the footer, you can do it. As of now, Accounts Expert is visible in the middle, if you click left and right. If you want, you can do it from there itself, there was one way, see what is the second way, you get different views here, you will also get it in the View tab and here also, you go to the page layout view and directly from here, if you want, you can write something else, like let me say here, I write Accounts Expert in small letters in short, earlier it was written there or wait, I write Accounts Expert Accounts Expert app.com, which is our website, okay. We wrote this and entered it and after that I have come to the normal view. Now I did control p, so look, now above here the account is written as expert.com which is a website and see it is being written in every page. Okay, so in this way you have two ways. Either you can write directly by going to the page layout view or you can go to the page layout and see that the page layout is the same and this is also the page layout, so the thing is the same but as per your choice, what do you remember? What do you want to use, then you can either do the page layout from here or go to the print tiles and customize it by going to the header footer here. You see it visible here. If suppose you want to remove it, now you say that you want to remove it, then the methods of removal are the same. Either go to Easy Out there and remove it from there or remove it from here, then they will be removed. Okay, I will keep it here now, so here we have done the whole group of people with page setup, now the thing is. Now comes scale to fit. Suppose I control p. So look here, 64 pages are being made. I don’t want it in 64 pages. I want it in 50 pages. Look, to do it in 50 pages. There is anything to be done in 50 pages. Look, what is the maximum that can happen? One, I can reduce its margin. Okay, I don’t want to reduce the margin because the data has to be shown in a small way. So what can I do after that, which is the data, the size of my data. If I can reduce the size, then how will I know how much to reduce the size? Look, I have two options either I keep reducing the size myself, like I kept reducing the size in this way, it is okay and after that now if I control it, then it will be more. It is able to take entries. Look, my data has become smaller. Now it is able to take more entries. Is it okay or what can I do like custom scaling? I will tell you, wait for a second, click on it here, the same window comes, you come here, either I told it what size to take, I don’t want to tell it the size, I don’t want to tell it the size, I keep it at 100, just keep it at 100 for a second, I I want to tell you how many pages I need to fit in, I need it in 50 pages, now you do it, okay, now according to you, he has taken 62 because he knows because I told him that brother, I need it in 50 pages, now brother, you see, after how many pages you need to do it, will you give me the correct answer, if you give me the correct answer, then now it is 50 pages for me in 20 pages, okay, because we had made the height wise, we fit in two pages. Will do one second one and wide by okay t and from here we will do 25 and okay let’s see once let’s look at it now it has come to 50 pages and it did it comfortably and what it has done is scaling on 81 has shown that whatever multiple we get na I took the multiple that the width of two pages and the height of it in 25 pages adjust it in this way you can adjust it from here also you can adjust it from here also You can do this or go to the print tiles and from there you can also do the page settings from here. You have all the options from where you have to do it. It’s totally up to you. After that you get grade line views and print view. If you want, you can turn it off or turn it on. You will see the same according to whether you have put borders or not. If you have not put borders, let’s say Control A, I do Alt H B A, I do Control A, Alt H B A, I did one second. So my data is gone, even though I am on control, see grid lines are coming, I have removed them then why grid lines are coming then why should it not come because in our page layout the grid line is on, now I have removed it, now I press control, then see now grid lines are not coming, if I turn on these here, now I press control, then see now grid lines are coming, so even if you have not put a border, turn on grid lines, that border kind of off you. It will be visible okay, same with the heading, if it is in view, if I have removed it, then press control, it has come in this way, now the heading is not visible to you, whatever heading comes above, you turn it on, these headings have come, okay, bring forward etc., all these things are the same, we have covered the main ones in the print settings here, now what we are going to do next is that we will do the formula just like the formula, so this one. We are not going to tap the tab. Now what we will tap will be the review tap and then we will tap the view. As its name is, its work is basically giving you review by doing things and helping you in doing things. The first one comes for spelling. Let’s say I take some data here, let’s take a small data like I took this much ta, copied it, brought it here and pasted it and just I did it like this, okay, control A, did Alt OCA, now assume. Take, I make some spelling mistake in electronic, removed this in fashion, removed this in fashion, okay now suppose I want to get it checked, I took this and after that press f7, either press f7 or click on spelling, the thing is the same and it is giving me a suggestion here that look, you wanted to write electronic here, did you write it wrong or wanted to write electric or wanted to write electronics or wanted to write electronica. I remember yes I had to write electronic so now you chose this one. After that see, you have the option Ignore once or everywhere if there is a mistake then ignore all but I don’t want to ignore it, I have to change it. Now the question comes whether the same mistake is still happening somewhere else too. So suppose we do one thing only at one place, I do it here at the same place, copy it, do it here too, do it here too, okay look now, selected the data, pressed f7, now it is saying ‘Electronic Aana’. Okay, if I ignore the one here, then you have understood the thing. If you accept that I make a change here, if I make a change, then it is fixed here, it has not happened in other places, it has not happened in other places, it is showing for other places, if I do change all, then it has been changed everywhere, okay, now it goes to the next page until it is clear that everything is there. The spelling is correct, it will keep telling further, it is saying here, do you want fashion, yes, I want change all, so it was everywhere, now it is saying spell check complete, you are good to go, now you can go, it is absolutely correct, so whenever you feel that your spelling is a mistake, you can check your spellings, it will suggest you that it is a spelling mistake and now you can correct it, inside the complete data, after that comes to you Thesis What is the thesis? It is a synonym in a way, suppose you have written a word, you have written answer and answer is such a basic thing, don’t you want me to write some advanced word for it, I will write answer here and will search for it, that is why I told you that you can call answer as response, you can also say reply, you can also say reaction, you can also say resolution statistics, you click on this, how many words are there inside this workbook, first look inside the workbook statistics. First of all it is telling about the current sheet, which sheet is open, about that sheet, the end of the sheet is g17, the cell with the data is 39, the tables are zero, the formula row is Sheets four, the cell with the data is that many cells and after that it is telling about the workbook, so whenever you want to know anything about your workbook, you can go for the workbook statistics, after that comes to you, check accessibility, now what is good and what is bad inside my report. It is better for me to search for a person to know this than I ask Excel itself to tell me what is better or not so I will click on check accessibility here so it told me here so what is it telling me hard to read text contrast so where is it saying here it is difficult to read okay so here it will suggest you current text color is hard to see consider a high contrast color so That the text is clearly visible because here if I had made dark green color here then it would have become more visible okay like I have crossed it out okay sorry we will go to the review to check accessibility okay so this is our clear missing all the text so see here the text is missing so it is telling me okay after that our rest of the things it is telling me okay the default sheet name is saying there are three sheets which have the default sheet name so you are seeing. If you don’t give the names of the sheets , then we won’t know which sheet depicts what, what does it tell, so in this way it has checked and told me and it will make me correct all the things one by one so that the report I make is at least a little better, doesn’t it help me, that is your check Accessibility Translate is normal, we do not use New comment Add a comment which is the same thing that we learned from shift f2 and then notes Notes: You have already learned where we had added the protect sheet. Here we had protected the sheet inside the format inside the home tab. The same protect sheet is now inside the review. There are so many options that they are found in many tabs, some will be found in the home tab too and some will be found in other tabs too. If we do the same work then there is no problem in that. We have done hide ink. Suppose I am using pe ink here, I have used pe ink here, anything. Ink has been used. Now suppose I want to remove it, then it gets hidden. Hide all ink on sheet or delete all ink on workbook. It gets deleted from the entire workbook. It gets deleted from this sheet or it gets hidden. If I delete from the sheet, then I deleted it from the sheet. Okay, so here we have completed our review tab. I am doing a little tab. If you are also like me, then I have completed my review tab. While practicing, you want to write. I use the pen tab. If you also want to do the same, then I am telling you for that. See, this prop is your pen, there is a brush whose thickness you can increase or decrease, so you can do this normally, like I am writing, you can write anything in this way, okay, after that you also get this pen, this eraser comes with you with which you can erase anything, after that this marker comes. With which you can highlight anything, after that suppose you want to delete the whole thing, then you select it like this, you can move it here and there and can also delete it, after that this arrow comes. Suppose you want to use the arrow instead of the pen, then you do the arrow. If you do not select the arrow, then it remains only a pen, after that comes to you Ink to Shape, so what will you do in Ink to Shape? Suppose you have created a shape like this. After rounding and then in Ink to Shape, I select it for a second and then I go to Ink to Shape, then see it has been converted to shape and it has literally been converted to shape, you click on it, see that the shape format will come, I will make another one and tell you like I have made it here in this way, now I will select it first because my selection will be from this and after that I will click on Ink to Shape, then this is my right. The angle triangle has been formed and now let’s say here I select it with arrows, then see the shape format comes here. Okay, ink to math. Just like we had written the equation, it is exactly the same that you can write the equation here, which we have learned in the equation. Replay of these, let’s say here I have done Tanu single here, anything like this, I have done anything like this and I want to see the ink spread, so look like I have moved my ink in this way. This has come in the format of video, okay, I erase it and okay, we can also delete it, so this was your draw tap, it was very easy, I thought that if you use it, then you should give an overview for once, so this was our draw tab, now we have moved towards our view tab, but still there is one thing left in it, so that is for that one thing, so we will definitely see it, rest I will tell you the most in the view tab. First you get the views: Normal Page Break View, Page Layout, Custom View, then you get this thing from here, so you do not need to worry about going there, you will go to the View tab, then you will see that the work is being done in an easy way, we should do it in an easy way only, so you can see it directly from here, after that, Grid Lines, lad, all the grid lines I was turning on and off till now, I was doing it with the shortcut key T, Alt , you can do it from here. You can also turn it off. Look, I had turned it off for now. Now it has turned on. Do you want to remove the formula bar? Remove the formula bar. Do you want to remove the grade line. Do you want to remove the grade line? Click on these three dots and do the Always Show ribbon here, now the ribbon has come back. Now from here you can turn off the grid lines and the formula bar and also the heading, so in this way, if you want, you can show the entire data on the entire screen, you can also make changes for the ribbon, you can remove the grid lines, remove the formula bar, remove the heading, okay, after that you get the zoom option, so you can use the zoom option. It is better if you explore from here itself, then you will click here, see here, you have to do 100%, 100%, if you want to zoom, then this list has come, if you have to zoom a lot, then you have to click on this, then it is in this way, it is better if you explore directly from here, if you want that list, then click on this, then this list will also come, so you do not need to waste your time by going to the view tab. You can do it directly from here, after that comes a new window. Suppose, the way I taught you, inside the format for the sheet, inside the home, you can copy it from here, then as it is, a sheet will be created. Similarly, if you want, as it is, a workbook will be created. Now our workbook or insert tab is basic. If suppose I make a new window, then the insert tab has come to basic two. Now suppose I want to get it arranged. So I have arranged all, how do you want to arrange it? Horizontal Vertical, I want to arrange it vertically. Okay, so look, all the files that were open have been arranged vertically in this manner. I did not want to arrange in this manner. It’s OK, I did not want so many files. Where were we, we were here. Okay, and we have arranged all the files for once, so in this way you can arrange . Only after this, you will get this view side by side, which view do you want with this, which class do you want with this, so these two views have come, now there are a lot of files synchronizing, if I do this, view side by side, due to there being a lot of files, this is not happening right now, you can also see it in the same way in the other wise, by moving here and there, OK, switch window, switch window, now we are free. First of all, let’s see what is the switch window? Suppose, I can directly jump to any file from here, but if I am confused from there, then I can see it directly from here. Like, if I want to go to Insert Basic, then I have come here. Okay, I right clicked on it, it came completely. After that comes Freeze Pin. What does Freeze Pin do? If you see, now I go down, my heading is not visible, so I am not able to see which thing is which, so if I want to freeze my heading, so how can I do that, whatever you want to freeze, you select the area below it, after that you go to the freeze pane and do the freeze pane, after that see, okay, we have selected the area wrong, we said okay, unfreeze from here and here, come here, from here and after that you come here, okay, now do the freeze pane, freeze pane, then see, this is how your data is being done, okay, directly here too and you If you want to unfreeze , then unfreeze your beans will also be done from here itself. Okay, at the same time, you have the option here, freeze top row directly. Even if you do this, it will become the top row. You do not need to select anything. Suppose you want to freeze the first column, then you see the top row is also there. If you go here and there, your date will remain as it is so that you can see this date is this and the rest of the things will remain like this. You have to unfreeze. Unfreeze it, okay, so in this way you can see your data, so here we have completed our view tab, now what we will do, let’s see what we will do now, I will teach one formula, I will teach two to three formulas that if you are looking at the data, then how are these data created, if you want to learn this, then now you can learn this in a very accurate way. See, first of all, what do we need, first of all, we should know this. Suppose I want the serial number, then I have given the serial number. After that I wrote the number , I want a party name, so I wrote the party name, after that, suppose you want any amount, then write the quantity, write the quantity, after that you want the rate, you write the rate, after that you want the amount, you write the amount, I make one data, I make another data and tell you, let’s make two data. Okay, what can you do for serial number, normally you will write serial number and just drag it as much as you want serial. You need a number, here you can take 10 serial numbers, which is enough and take one more, okay, we are making 10 entries for the party name, now let me tell you for the party name, you can use Chat JPT, all two here too, you can integrate your AI but we will do that later, but now we will use Chat JPT, what will you do, go to your account, write Chat JPT here, you will enter, after that you will You will go to the official Chatpati from open, you will click on it and here without logging in, you can do whatever you want with it, you will tell him give me 10 random Indian business names, then he will create it and give it to you and now you can copy it, okay copied and you go to your data here, after that paste it here, then you have these names, quantity for quantity and rate, amount for amount, then this will come quantity to rate. But for quantity * rate, if you need some values ​​here, then here we will apply a formula, what is the formula? One is Rand formula, all the formulas are Rand, all the formulas are random, okay, what is random now, we will apply the random formula equals to rand between one, so let me explain the formula to you, first let’s do one thing, Rand formula, what does Rand formula do? It gives a random number between one and one, put rand formula, tab it, what is it saying, I just don’t want anything, I just turn off the parentheses, turn off the parenthes, hit enter, then look, it will give a random number, okay, what does rand between do? Equals to rand between tab, it asks you, in between which range do you want the number, like I want a number between 100 to 200, so I asked what is bottom, what is 100 up. Top what is 200 pence of enter so it gave me the middle of that now you notice this changed rand formula whenever you apply it or do any activity the whole formula changes like suppose I have written a here it has changed write anything here d whatever I am doing this will keep on changing so this is a draw back of it but I will also teach you how to correct it okay so first we rand You will fill your data here using ‘Between’, after that I will teach you another formula. ‘Between’ tab, after that at the bottom you have to write which is the quantity, neither 500 is good, you can write 50 to 150, Pens of Enter, so here we have written the quantity, what can we do in the rate, Equals to Round, ‘Between’ tab, after that at the bottom, take 1000 in the highest. Take 5000, turn off the pens and enter it and double tap here. Here you can put any formula of yours. If you put the formula here and just check then you have created the data here. Now what is its biggest draw back is that it will keep on changing, so what will you do to ensure that it does not change. Select all the data, select both of them, do Control C and go to the same place where it is, do not go anywhere else, do Control Alt v at this place and in which Now change it, this is the formula, convert it into values ​​and do OK, then see that now the values ​​are written here and the values ​​do not change, the formula changes because there is a reference in it, so now it will not change. Now you can do whatever you want, after that you can do whatever formatting you want in it. If you do not feel like doing formatting, simply press Alt O A. This is a shortcut key of your auto formatting. Where you can use any key and give OK, its formatting is done, you just correct its alignment, then look, you have data ready, you get worried like this, let’s create another data, here I will take the rest from here, I have taken this thing, instead of party name, I will take student name, okay and here I want student name, here we will call only four GPTs, give random 10 Indian names. With first and last name, okay, we have entered and it will give us, okay copy it from here, come here and paste it, so it comes to us, now we will write here Hindi, here we will write English here, we will write maths here, we will write science here, we will write total here, okay now look, I need marks here, I know I need 10 rows, 10 rows have to be filled, four columns have to be filled, total, so I will get it later, so here we will put the formula. We will tap the array, see how much is required per day, how much data is required, 10 is required, 10 entries are required, then write 10, how many comma columns are required, Hindi, English, Math Science, four columns are required, four commas are minimum, if there are marks then minimum can be zero, maximum can be 100, minimum row can be maximum 100, if you want to keep some more minimum maximum then you can keep comma, now it is asking for integer, see if you want that Decimal number will also work in the result, so put false for me, but if you want it or not, I don’t want decimal number to work, then put true that I should get complete integer, then it is totally up to you, what do you want, I have to do true because I want complete number, I turned off the parens and entered, then look, it came in one go, but there is a problem with it, do anything, if there is a change, then there should be no change, what did we think for that, what did we do to select this data? We will do Control C, we will do Control Alt v, we will enter, and see, in this way your data has now been converted into values, now you do not have to do anything, here you press Alt equal to 2, here it comes Control A, do Alt o A, press A here, let’s say I want this formatting, I have done the formatting, okay, your data is completely prepared, so in this way we prepare the data for ourselves, now we will enter our advanced formula. Let’s move towards advanced formula. First of all, I am going to take the formula that we have. If I talk about ifs, then look, we have done no ifs. Okay, so now we are talking about ifs. What is ifs? What is ifs? It is the one where there is multiple condition. When we talked about ifs, what did we clearly write when we talked about ifs that brother, single condition is single. We had written the condition, just like when we talk about ifs, we have this plural word, so now we have a multiple condition, now it can be any multiple, which is more than one, okay, so here we go with a normal scenario like now see, here the rating is given and here the name of the party is given, so what is inside this scenario, we take two things because there is more than one. We have to see the condition that if the rating of a person is below three or equal to three then we call him good and if he If it is above three, then what do we call it? We say excellent. Okay, we can keep these two things that if it is like this, then this is this, if it is like that, then this is the condition here, so what can we do here, we can put ifs formula, ifs tab, okay, this thing, no, we can do more than one, just because now you have made only a single condition, so now we do with two conditions, okay, so what will we apply logical test here. What logical test will be applied, who has to be checked, who has to be checked, you see these things, no, I have already made you know that now all the terms will come, you have already done the logical test, now you do not have to do it again, now you have understood it, so we have to check the rating, we have checked the rating, what have to be checked, is it greater than equal to 3, what if it is greater than equal to 3, then first let us take the Smollett one. Is it equal to 3 then what do we have to write that it is good and if this rating is greater than 3 then what do we have to write that it is excellent. The value of true value false does not come in it. It just has to be told directly in it that write this, then see it has come in good, you double tap, see it is five, I make it four, then see it has come in excellent, I make it six, that’s it. If I give a five, then see if it comes in excellent, then in this way you can do these things. If suppose you have multiple conditions, how will you do it in this way, then you may have to apply more look ups, you may have to apply Will tell, okay, I take it like this and delete it, okay, I had prepared this report, on this side, I have taken the names of all the parties, on this side, I have taken January, February, March, this is my data, inside which I have a look, let me tell you, date, month, name, category, product name, everything is okay, what do I have to do now, I want to know the total of the particular party, right now the same party must have bought many times, so I want to know in January. How much did you buy in February, how much did you buy in March and there is date and month written next to it, so I can find out this too, so here generally when it comes to sums, I take a sheet here. See, when we talked about sum if, if you remember, okay, we saw that you had a sheet with 10000 entries given by your manager, in which North, North East, West South entries were given, so you sum them. Now the same manager is saying to you that yes, it is okay that you have taken out North, now in North also tell me how much in January, how much in February, how much in March, how much in June, now he had single condition in North and put one more condition, how much in January, how much in February, so now what have you got, multiple conditions have become multiple conditions, so there are multiple conditions, so it seems ifs, that is why we will put even ifs, okay even. If you apply Ifs then you get the same things. See Equals to Sum Ifs tap, what comes out of that, Sum Range Sum Range, what to sum, Criteria Range, Criteria Range One, Criteria One. Look , let me tell you a little difference for once, so that you can understand well, here we will first put Sum F. Sum F, here was our range Criteria and here was our Sum Range, okay and here what will we do, Equals to Sum Fff, now this What is taking even range criteria range one criterion neither then criterion range two criteria two and so on because if you can take more than one then tell me one thing tell me one thing let me first ask what is this range in which you look for so here what is the criterion range do you look for the criteria no there is more than one criterion here so I have written criterion one and here I have written criterion range one. It is the same here, there was only one, so there was no need to specify whether there is one or two. Here the specification is done only because there is more than one criteria here, so here I wrote criterion one, here I made the criteria range one, here also you used to select the range first and then select the criteria, here also you are selecting the range first and then You will select the range of criteria, then a criteria of the same will come, okay, here the sum range was given, it was given in the last place, here you have given the sum range earlier, the only difference is that everything else is the same, now we will put the sum ifs, earlier I have shown you the data, we will put the sum ifs here, let’s do the data, yes, okay, we will do the sums, let me go here for once and I will put this data in one go or else one. Let’s put it in both the bars one by one, first find out the answer for one time, then find out the whole answer together because cell referencing, now we have got the hang of it, now we are talking about advanced things, so equals to sum, ifs tab, sum range, we need the sum range in our data, obviously we will take the sum of sales price, we have taken the comma, after that look at this formula, read the criteria range, one criteria, what is the names, is the names of the names. If you are searching for the names then in which name then you have taken the named range, okay comma, what is the criteria, what is the criteria, you go here, Bharat Innovation is in even F, comma, after that, criteria range two, now you have January, February, March, this was also your condition, so now you will go here and where will you get to see this, whatever you have made for this month, you got this, after that you have f2, okay, don’t fix it now, comma, after that you have this. Here, who has to be checked, I have to check January, enter two answers, it may not be of Bharat Innovation, it is good, this is the way we enter this data, now what is it, I tell you how to calculate complete, in this there may be only zero answer, no sale was done in January, that is why it is here, then I delete it from here, they will sum the complete of complete, if that means we will tab all the completes, will give the sum range here. What will come, we have to take our amount, so from here we will take the sale price, this is the entire amount taken, tell me one thing, the even range is going to be the same for all, did we do this thing in Even F also, yes, it is going to be the same for all, fix it with f4, fix a comma after that, what is the criteria range one, what is your name, then what will be the range, there will be a column with its name, we have taken the name, is it going to be the same for all, with f4, it is going to be the same? Fix comma after that, if your criteria comes then what is the criteria? Whatever you are going to search, you are going to search all these names, na select all of them in one turn, comma after that, second, what are you going to search, this is January February, so first of all you have to take the range, then you will go inside your data, you will take the range from here, from where will you get this monthly range, have you selected this, is it going to be the same for all? It is going to be the same , fix it with f4, do the comma, I think, okay, I think, I will tell you later, okay, now what criteria do you have to take, so this is all in one go, if you want the answers of January, February, March, then select all of them, do not take the total till December, enter the complete answer till December, our data was such that selective sale was going on, so see, the entire sheet has been filled in this manner, so if you also want, then it is in this manner. Let’s see what we have applied, you may think that I have done it very fast, but if you apply, then do it very slowly with patience, reading each and every thing and understanding each and every thing. I will once again revise it to see what I did. First of all, I had to sum the range, so whose sum had to be done, I had to sum the amount inside my main sheet, Criteria Range, Criteria Range, what was to be taken, brother, I had to see according to my party name. Where will I find the party name? Inside the party name, in the main data, there is criterion one which we are looking for, criterion two in our months and criterion two which is inside our report, so in this way we have applied this formula and have prepared our sheet. Through the formula, if you were to apply the filter yourself, how much time would it have taken, then here you can create it directly, so here we have completed all the ifs. Well, there is a very small formula which is left with us, which is sub total, so we would like to see it further and see what is the benefit of sub total. I just want to tell you that, so I do one thing, I take a little data from here, let’s just take this much, okay, we will copy and paste it here separately, let’s do old OC. Now what do I do, I sum here. To do this, what do I have to do here? To make even, what do I have to do here? Tell me, I have to do alt equal to. I made alt equal to enter, so here I have got even. I do a little formatting on it. Okay, here I have got even. Now what do I do here? With control shift A, I apply a filter here. After applying the filter, I do any filter. I have to check the decor, so I did the decor and OK. So now I am not getting even here, then it is a big problem, so what do we do in such a case, we put sub total here, instead of sum, whenever we work, we should use sub total, what benefit does sub total give us, put sub total, do the tab, see what sub total says, it has a lot of options, so you can use any one in it, what do we have to do now, we have to sum, how much is the sum, is it nine pe, or I go like this. Should I tab or directly write nine like this, comma after that is sum like the formula of sum seems to be reference one reference to that means he is asking for the number then you will give the range from here, you will enter then your total will come, now you see, press control shift A, after that you take dicker from here and do ok, then see now it will show you the sum of whatever you want to sum, you can do car excrement from here, do ok then see it will show the sum. So this was your sub total formula which helps you a lot, so whenever you are working on any of your big data, you know that I have to apply a filter on it, later if I want to check the total then apply sub total instead of normal sum and it will give you a better result, so here we have completed our sub total formula. It is about advanced formula and not about look up. How can it be like this, what we are doing now. They are going to do their look up formula, what are they going to do? Look up formula is ok, look up formula, now why did I say this, so let me tell you its logic too. Look, we do three formulas, we do look up, A is look up and Bring it, search it, bring it, now you will say, what does this mean? I don’t even understand it. Suppose this is your manager. The manager has a complete data in which there are lakhs of entries. Now the manager has selected you out of 1 lakh entries. He has given you this and here he has made a report in which there are 100 entries in it and has told you to extract the data of these entries and give it to me. Take this data of 1 lakh entries. Take this from inside it. There are 100 entries, take them out and give them the specifications. Take out these 100 entries and give me these 100 entries. Will you apply a filter or not? Will you find out from there? No, this is a very time consuming process. So, what do you do? Do you use the look up formula? What will the look up formula do for you? We will go inside this data and will give you the answer of these 100 entries from this data. Okay, so now you understand this. If I talk about lookup formula in general, then how does lookup formula help you? If you want to extract some small information from big data and you want to extract some information from big data, then lookup formula is used. Now you will say that ma’am, lookup formula is used, so what is this and lookup H lookup And look up then comes to us A look up and then comes to us What is horizontal data? Do you remember I had made a special on you in which you were transposing the data, then the horizontal data had come, your that is your horizontal data is fine and single access data, why are we saying that, we will understand further, now suppose you have understood, why is it called v look up, why is it called h look up, both the formulas are the same, I do it like this, both the formulas are the same, if v lookup comes When I went, h lookup came. The only method is that when the data is vertical then apply v look up and when the data is horizontal then apply h look up. Now I am talking about these two, so h look should not feel left out, it should feel the most modernized. Why should it feel? One, x look up is a new formula, it is not in every version, it is in the versions after 2019 and the x look up is optional. Whose alternative is v for look up and h for look up, it is okay if you don’t know v look up, h look up doesn’t come, no problem, x look up comes, all the work will be done, if v look up comes and the rest don’t come, then there is a problem because h look up will not happen, h look up comes, even if v look up does not come, there is a problem, but if The same will be useful, this is an alternative and I would say it is an easy alternative if you have not learned V look up. Suppose you are in an interview and in his system only V look up works. Let’s see, I am going with a scenario that this is your big data or this big data with lakhs of entries, party name is written here, category is written here or product name is written here, region is written here, contact number is written here, is it okay in some way, this is your A column, B column, C column, D column, E column is okay and now you have to find the data inside it, so here you are making a report inside which the first name is written Raju, now you have to bring its contact details, what should you bring? If you have to bring the contact details, then basically you have to find Raju, who do you have to find, if you want to find Raju, then how does the look up formula work? When suppose this data, suppose I am creating a dummy data here, inside this data, this one here, I do not want to spoil anything, so I am creating it here. Suppose Raju is standing here, that means there is a person standing here who has to find Raju. Okay, so he should know that he is searching for Raju. If I I will not tell him that I need Raju’s contact details. I need Raju’s contact details. Will he search ? That’s why whenever they start the formula, they should know who they are looking for. Whom we are looking for, we call it look up value. What do we call look up value look up? What do you call look up value? Look up means whom to search for, go and bring whom to bring, that value, Raju is the look up value when your formula is started. If that person goes inside and searches, then he should know in advance that he should keep roaming around for a while, then you will tell him that wait, I had to find Raju, it will not happen like this, so when he starts the formula, right from the beginning, he should know what is the look up value, if we want to find Raju, then from here itself, our first question arises, what comes out, I write down here, the first question that comes out is that our look up value is extreme. It should be on the left because look, there is vertical data, so first it will go to the first column, first it will go to A. How do you read AB, CD, this is how you read, that’s how you check, isn’t it a systemic way? Check B first, then check C, then check A, then check G, then check G. Don’t do it like this. It will go to the first column, then to the second column, then to the third column, then to the fourth column, then to the fifth column. He will go and then he will find out, oh here is the contact details and I wanted the contact details from here and that too of Raju, he will find Raju here only, this Raju is here and after that he will go and check the contact details in each and every column, then the first requirement is that your look up value should be in the extreme left, if your look off value is not in the extreme left, because see, if any person starts searching for something. If you do it, it will go left to right, it will go left to right, you are going A B C D, if you are looking at yourself then you are going left to right, then if your look up value is not left to right, if your look up value is not in the extreme left, then your look up will never give the answer and mainly people make the same mistake. They know how to apply V lookup but they do not understand the parts of V lookup, that is why. If it doesn’t work then you understand its meaning now. If you apply it then you will understand better. Second second comes to you, what is Ajman? No duplicate look of value. Now let’s say no in this. No duplicate data. Data can be duplicate. Look up value should not be duplicate. Meaning if I say there are two Raju’s then you will not get confused about which Raju either tell him in a simple way Raju Sharma Raju’s anything but if you tell him only two same person’s name is in it then get confused. This will happen, then it will bring wrong data, that is why the look up value should not be duplicate. If the subsequent data is duplicate, then it will work. Look up value should not be duplicate. These two conditions are there. If these two conditions are satisfied, then you can apply V Look Up on that data. It will bring you the answer and give you the answer. Now see what all the things are there inside V Look Up. Now V Look Up works like this, now I will tell you more about the look up. Here, if A look up happens, A look up happens, in v look up, what does it do? It is checking each column. In H look up, it will just go to each column and check. It will go to the first row, then it will go to the second row, then it will go to the third row, then it will go to the fourth row. So the movement here is from up to down. Okay, this is the only difference, it is the same ajman, that is everything. Now let me tell you both the formulas here like what is the Equals to v look up tab. Look up value table array column index number and range look up So let’s write it and after that tell you like here we look up what is coming inside it look up value table array what is coming after that column index number and what comes after that after the column index number your true or false ok I will also tell you the look up h look up also here and tell you by writing h what is the meaning of look up h look up look up value now you will be able to understand the difference in this. Look up table array raw index number and true and false. Now see the difference between these two. Look up value. Look up value. Whom to search? Whom to search? So whom did we have to search there? If we had to search Raju, then Raju is yours. Look up value is the table array in which we have to search and in this we give the entire table so to search in which we do not give any specific thing. Like within the range, Pressa easily used to say, search in the party name, it is not there. If you give the complete data in which you want to search then the complete data is complete data but remember that the range should be on the extreme left which is your look up value. This is what I told you. Look at the column index number. In V Lookup, it checks in each and every column, hence the column is the index number. Inside it is the raw index number. What is the difference between the two, in which the answer is written, the column with the answer or the raw number and you tell this number by counting yourself and After that you get True or False True. You use Approximate to match whether you want an approximate answer or not. We will put False because we need an exact answer. Okay, now let’s go ahead and see if you understand. I will look at our data first. Name is Category. Product Name is Region. City is everything. After that you come here to v look up. Here we will apply the formula for Harmony Foods is equal to two. v Look up tab one second I had to zoom it a little bit here equals to v look up tab look up value Harmony Foods are looking for comma table array table array is where we have to tell all the data to it so you take your data and remember whenever in the table array, your look up value should be in the extreme left, there is no look up value in the extreme left because he will start looking from the left, your look up value will not be found in the left. And if it will not give you the answer, then from here on the extreme left our look up value, we have selected the data, comma, after that it says the column index number, what answer do we want, do we need a category, count the category, on the first page comes the name, on the second page comes the category, then what is your column index number, so you have taken two, comma, after that, what do you have to do, should I put true or false, we will get the exact match from true. If we want the answer then we will take the exact answer, tap on it and close it from here and enter, then see our answer has come here, okay now I will tell you by adding one more thing in it like I have added the serial number here, serial number and here I do one and here I have done this and made it a fill series, I take this and go to home. I took this format post, I clicked on it, once again and I am here to tell you that we look up, which is the mistake that people generally make and after that they say we look up doesn’t seem to look, we look up tab look up value look up value, we have to search this: comma table array table array, take the table array, they take it from the serial number, so you take it from the serial number, now tell me one thing, is your look up value in the most extreme left or not? That’s why the answer will not come, I am telling myself right now, the answer will not come, but let’s look at the column index number. First of all, there is the serial number. One second number is the name. On the third number, there is the category. If you want a category, then you will write three, comma, after that, false tab. Panis of enter. The answer will not come. Will A not come? Now the answer will come. Look at the answer. Equals to V. Look up tab. Look up value. Look up value. You have to search for a value. We are here. Okay sorry, had to take a look up value, I put back equals to v look up tab look up value, we took the look up value, comma, after that we will take the table array, table array, we have to take it here, now we cannot take the table array from here, what will we do, we will take it from here because what we need is in the extreme left, whatever look up value we need in the extreme left, we have searched from here, comma, after that now we will take our column index number, then the column index number. Now should I write two or should I write three because there is also a serial number, so we always have to count from where the range starts. Now where does our range start, it starts with the name, so the name is the and the category is the two. Whichever range you give, it seems to be the same, its data does not know the data before and after it, so that is why if you write two from here, then write two directly here, make a comma, do false, tap on the pencil. Turn it off and enter, you will get the answer. Okay, understand. Now suppose you can drag this. If you drag, will the answer come? What if the wrong answer has come? This is the wrong answer for you. Okay, so how will you bring the correct answer. To get the correct answer, see, we need the product name here. If I am doing it here, then it is 2 to 2, so ours was that, 2 is our category, so this is this . How to fetch the answer because it has look up value a2 and here it has taken our look up value b2, it has taken the look up value fashion, so what look up value is our fashion, otherwise you cannot do this, so now if suppose I have to do something simultaneously, then how can I do it, so either I have this method that I keep changing the column index number for each one, three for this, four for this, five for that, so this is a time consuming process. How can I put equals to we look up tab look up value comma, after that we will take the table array table array, now we will take it by name only, you know why we are taking it by name and whether the table array is going to be the same for all or not, then we will fix it with f4, comma, now tell me one thing , what answers do I need in the column index number, what answers do I need, I need category, product name, region, city, state, meaning if I count again. If I start doing 2 3 4 5 6 7, I want the answer till seven, then should I do it one by one because I write two manually and it is fixed, so when I drag, there is not even three in place of two because it is fixed, so what will you do in such a case? 7 Turn off the curly brackets, after that, remove the comma, remove the tub, turn off the parenthes, enter, your answer will come in one go, it is correct, see how correct it is, a2 is its look up value, a2 is its look up value, a2 is its look up value, ok, I still have one complaint from here that I had not kept this or that, so if you want, you can fix it, what can I do now ? I select it and just drag it over here, then see, it will give me all the answers, okay, this was one method, but this method with curly brackets does not work in the old versions, so in such a case, you can put a column formula here, what can you put a column formula, if I delete it here, then I tell here, the column formula will appear here, equals to and look up tab, look a value look a. Value taken comma table array will take table array you took and it is going to be same for all so fixed it with f4 now look column index number we cannot take curly brackets but We have to take something like this that if it starts counting automatically, then we will put the column formula here, then what will we do in the Column Formula tab, after that, if we want to count from here, then we will come to our V Lookup and wherever it is, then we have to take it, okay, after that we have to turn off the parentheses, put a comma, after that, false , turn off the parentheses, enter, so see, it has given me the answer, okay, so one way is also there, if in your If the curly brackets don’t work then you can use the column formula. Okay, this was your nested formula. Nested formulas are when you put another formula inside a formula. Here we have put a column formula inside a formula so that we get the answer. So this was your nested formula. So in this way we put our and look up. If I had to put H look up, for H look up also I have If there is data to be passed, then what do I do? If this data is visible to you, if it is in horizontal form, then we will apply H look up, okay, but before that, H look up is normal, it is used very less, so now what we will learn is that we will learn X look up, look inside Can’t go here, can’t go there, it should be on the left. There is no ajman, it does all the work with ease. Second thing, let me tell you what values ​​are written inside x look up . Array, just like you did not do in range, you used to directly choose the party name. Now in this also, directly choose and return array. What is the meaning of written array? Answer, just as in that, you did not do it by taking the same range. You used to take the same range or return it. Meaning, we have to tell what is the answer, find out what is the answer, what type of search is to be done and who has to do this search. Okay, so now we will put our Look up is done very easily, so we will directly take care of equal to We will fix the comma, after that return array answer, what is the answer, what is the answer, what is the answer, what is the answer, if we want the category answer, then we will take the category answer and enter, then see here, I should have fixed it because it is going to remain the same for everyone, enter and just double tap it, then you have the answer for everyone, but what should we do so that it gives the answer for everyone, so tell me one thing about us, if I have for everyone. If we want an answer then our look up value is going to remain the same and when the look up value is Y then the look up array is also going to remain the same, the only answer is what we have to change, what do we have to change in the written array, what should we do in the written array so that we have all these answers, right? We have to set it in this way, so let’s put it again. Let’s check once in which way we put it. We can see by putting lots of combinations, then look up X. We will tab, we will look up value, we will take comma, we will look up array, we will go to our data, look up array means where we will find it, where we will find it in the name people, we will find it in it, we fixed the comma with f4, now we need return array, in return array we need answers, from category to gender, so I selected till gender and the selection is done till the bottom, now it has come from c2 to h30 331. If I enter it directly, it will give me the answer. Is it Maharashtra Pune Male Gender Is it correct We check Voman Dress Yes is it correct and then now I drag it and bring it down Is it giving me the correct answer Fashion Suit South Kochi And see what answer was coming here I delete it and it was getting the answer here All West Vadodara Gujarat That means our X look up is wrong here Is it wrong They check so that If we want to understand it right, then look here there is a2, here a2 a3 a4 a5 is coming, it means it is coming right. But here also this thing is coming fine, that means the look up value is coming fine, the look up array is fine, now it comes to the point, now tell me one thing, if we want to find the harmony force, then our range is from c2 to h33, okay, here our same will remain the same, here it is from c3 to 332, here it is from c4 to h33, it means c should remain common and the numbers are increasing, the numbers are increasing, but We have to keep the number number the same. We also have to keep the number the same, so what will we do, we will put a dollar in front of C so that C is fixed, let’s try once and in front of H, now let’s see by entering. Hey, I should have done it here, let’s fix it with A4, let’s try and see only by doing, we will know where what mistake we are doing. When we entered, then see, now it is here. Now I go and drag it, then there is no impact on the answer, why not if I am here? If we had taken leti, what would have come to mean that C was already fixed, we should not fix C, we have made this mistake, now let us fix two and see, we put dollar in front of two, fix it with f4 and here also we fix it with f4, okay let’s enter, so what we did here is that the number is changing, right basically C and h remain the same, the rest of the numbers are changing and see your answer has come, what were you doing? Change of s and h to c and h was the same but the number was changing. Now I will try to explain it again so that if you understand it better then equals to If you want the answer then take the answer till gender but remember to press f4 so much that your numbers get fixed. C and H are fixed anyway but these numbers should also be fixed because the range is going to be the same for everyone and you press enter, you will get the answer and after that you can drag it because if you have not fixed the look up value then it will keep moving and you will keep getting such answers, then in this way From this you can apply ​Yes, let me do HMC like this, here I will write any name, like what we do is that inside this filter, we create a drop down with data validation, okay, I am going to teach you this later on, but for once here, let us create it, okay, so here we have the name, we will write any name here and after that we will have its formula, meaning its data will come in it, no matter how many times it is written, everything will come, so first of all for this. We need that whatever is your data in which you are going to search, I am going to search which also has duplicate entries inside it, so if there are duplicate entries inside it, then we are going to search in it, we keep this data here, it is okay for once, we are going to search inside it, now the thing is that we have to keep the same heading there and the other wise, our data will not come in the right way but remember that according to whom you are searching, your heading should start from there. If you want then we will take comma from here, copy it and go to our filter here and paste it here, so in this way your data has come here, now we will put the formula here, Equals to Filter tab, after that we will take the array, inside the array you have to give the complete data, so you will give the complete data from here. Well, the data you have to give is to be given by name, it is not necessary, you can give the complete data, you have given the complete data, comma after that it says Include according to whose name you are looking for. According to whom you are looking for according to the name,

    then you will select it, you will do equals to and what should it be equal to, what should this cell be equal to, this cell should be equal to this cell, whatever you are searching should come inside this, enter it, so here just because we have to take it like this, in the date format, okay, so here he has brought me all the entries, whatever his Look, if the entries were not completely copied here, then here it has completely copied and brought it from the date, so all the entries that we had to take, all the headings which were to be taken should have been taken from the date, so it has locked it and if I say some other name from here, then look, it has locked the entries for that too, if I do something else, it has brought it’s entries and given it. You click any of them, it will bring all the entries and give it to you, okay. So in this way, if you want, you can apply a filter formula, if you have duplicate entries, then it brings that too and gives it, so this was your filter formula, you see, making a search box, this is what it means to make a search box, in this way, you create a box, write your name in it and your complete data comes below, then they say that the search box has been created, the name is written above and the complete data is below, so this is what happens, that search box is fine, next we move ahead. Look, till now you were working with this actual data and what was inside it. There was a look up value in the extreme left. There was a look up value in the extreme left. Now I do this work with the look up value. Whatever is there, I bring the shift category here. Hey brother, no problem, do control plus, sometimes things do not work, control v and delete this, okay. Right now I say that I want a category according to the name, then you will say that there is no look up value in the most extreme left, otherwise how will we look up? I will apply Datchi’s formula. Now how does the index max work, which is an index? Equals to the index tab. So look, what is required in it. Are arrays required? Raw numbers are required. Column numbers are required exactly the same way as we use in Laka etc. Raw numbers are required, are column numbers exactly the same? How does this work? It works on the intersection, basically it will find the data in two ways here, it will also find your vertical data, then it will also find the horizontal data, where the intersection will come, it will bring you the answer. Okay, so now how will we use this intersection, how will we do all the things, let us see, we will put the equals to index formula here, we will tab it, we will give it, we have to give the complete data, so we will give the complete data from here, it does not matter, you complete it. Give the data, don’t think that brother, yes, if it is a serial number, then don’t give it. Give a comma. After that, the raw number. If your data is vertical or horizontal, if it is vertical, then you can give the raw number in the vertical. What can’t you give, then instead of the thing that you cannot give, I am telling it in a very simple way. I have not gone into much detail because you will get confused. The formula is like this, that is why I am telling a very logical thing, the vertical data is raw. You can give numbers, you can not give, you know that we are applying a different formula of combination, then put the match. If there was horizontal data, then we could have given the raw number, then we could not give the column number, then there we would put the match formula in place of the column number, now here we will put the match formula in place of draw, put the match formula, do the tab, what does the match say, look a value, what to search, then you see what to search here, we have to search this name, isn’t it the name? You have to search comma, after that look up array, where will you get this name, it is exactly the same as you will get this name, right here inside this column, comma, after that you want exact match, less day, greater day, obviously exact match, do zero, turn off the parentheses, so till here you have put the column number, you have not put the column number, now you will tell him what is the answer, so you had chosen from the serial number, right? If you want answer category, then 2 is your column number. Is there anything left after that? Will we use comma? No, there is no need to do anything after that. Turn off the pennis and enter, then it has given me the answer. Fashion is ok, can I drag it? Try it by dragging. No, why can’t it? Why can’t it because the answer has already been given? I have given it a column number. Can I bring it like this? Yes, I can bring it like this, but here I have to do it. We will have to check the match because even inside the match we have given a look up value, is it correct? We will have to check that thing once again for the product name. What did we do? We took the array and took the array. We will select the entire data from here and the array is going to be the same for all. Yes, so it has been fixed. Comma after that, can you give R number in the raw number and vertical data? No, apply the match formula. Tap Do after that look up value. What is the look up value? You see, you need according to the name. You have taken the name. You have taken the comma. The look up value has to be changed again and again, so we will not fix the look up array. Look up array. Where will you get it? It will be found here in the name. So you have taken the name. The look up array is going to be the same for all. Yes, so you fix it. After that, we need zero exact. Take off the commas. Do the comma. After that, what do you need? Column index number. What do you need the answer to? Now you need the product name. The product name would have come anyway. There was no need of a match. There was no need of an index, but you tell me. 1 2 3 4. Forth on the fourth number and enter. Here the answer will come. Woman dress. Just drag it over here. So you have all these answers. Now we can drag it. Can’t we? Okay, so in this way you can use the index match. I just wanted to tell you a little bit, you all. Work can be done with v look up Lo, even if I change my heading in this way, your answer should change. Now this work cannot be done in V Look Up, why because there is column index number in Select it, OK, you have selected it, put a comma, after that the field means what is the answer you want, what is the answer saying, what do you want, give it whatever is written in this field, it is not there because we can change it, so give that comma, after that criteria criteria, you already know what we have to find, but here we give the criteria with the heading, when we enter, then this answer has come, now look, I am here. If I am changing it then look, the answer will change, this is me, no one of any kind will give you any error here, let’s put it once more like D gut did tab did what did we do in the database, we give the complete data in the database, give us your whole load data, okay, these are multiple criteria, then it comes in handy, you gave a comma after that, what is it asking from you, you will check this field field, whatever is written about it, give a comma after that, criteria. So the only criteria here is that it has to be given along with the heading, enter it, your answer will come , you check it, you change it, then see that it is getting changed, okay, so in this way we apply the D Gut formula, after that you get D Sum, D Sum also works in multiple criteria, so we will put Ds here, like Sum If is an upgraded version of Sum If, so if DCM is to be applied, DCM. Put the sum, if it seems easy, then put that, there is an alternative to that, tap the database, take the database, we have to get the complete data in the same way, we have taken the complete data, after that do the comma, after that it is saying tell the field, then from here we will tell the field, we want the amount answer, so we took this comma, after that it asks us in D Sum to tell our criteria, so now the D Sum is such that within which we have to give the criteria along with the heading, we have If you enter the given then this answer will come, okay what you have to do, everything is the same, you have to give the same database, you have to give the same fields, you just have to keep in mind that whatever criteria you give, you will give it along with the heading, so here we have completed two more formulas, f is d sum and d is gut, after this let’s do a formula which is large and small. Basically, assume that you have this data and you want to know that it is rank wise and not rank wise. We are extracting but give those five numbers which are the highest or give those five numbers which are Smollett, then in such a case you can apply the formula, see here you put large equals to large tab, after that array means from which you have to find, then you have to search from this, so we have taken this comma k means which values ​​12 2 3 4 5 This is what we need, top one is needed, top two is needed, top three is needed, then you take this and enter. If you do, the top five values ​​will appear before you. Similarly, the opposite will be given that if you want small then small will also come, just tab it, you have to give an array, give it a comma, tell him the meaning of top small, he will tell from the bottom, he says no, your rank came from the bottom according to that which is the lowest, according to that, he has gone away telling, so it was very simple but it should have been done, so I got it done for you, after that it comes to you, a we are mostly at our place. We have covered all the formulas that we need to know in advance. In this, I will teach you one more formula which is the finance formula. Finance formula. I want to explain it to you in complete detail. So let’s complete it with a case study. See, here we will take a very simple example. Suppose you have bought a phone. Okay, you bought the phone and you bought that phone for Rs. ₹ lakh. It’s okay. And on which interest of NM 12 is going to be charged, now you figure out how much its installment will be, so 1 lakh and you are going to pay it in 1 year, you are going to pay it in one year, then you see how much you will pay within 1 year, 1 lakh, then you have to pay the principal amount of ₹ 1 lakh, so its cost is ₹ 1 lakh, plus its discount on ₹ 12 means interest of ₹ 1 lakh on 12, then you will have this amount. How much becomes 112000, it becomes okay, now you have to divide this amount by 12, that much will be your installment. For example, for once, let us take 8000, that is, your 8000 is being made, so within 8000, you know that you have withdrawn only a little of 1 lakh, this is also the 12th installment, so your 8000 is being made. Your principal amount is also going inside it and along with it, your interest amount is also going there. Right, whenever you have to calculate the installment that how much money will I have to pay, then you apply PMT. PMT calculates the installment and gives it. When out of this installment, when you want to separate how much interest has gone and how much principal amount has gone, that means brother, I have paid how much principal amount and how much interest has been paid, then I will calculate the interest amount. For this, you apply IPMT and calculate PPMT to know the principal amount, then I can say that whatever is logical for you is fine, there is no such equation, PMT is equal to IPMT plus, PPMT means your installment, what is formed from the principal amount in interest plus, so this is how the formula works. Now let us see one or two things in the formula here. What are one two things, one two factors, one. So what is the factor that principal amount is the principal amount which is the main amount on which you have bought it. Okay, secondly, what is the rate rate? The amount of interest you have to pay, the interest you have to pay, now the interest you get generally, when P is written, that means enum means for the whole year. If I write this on 12, it is for the whole year, then how much will it be for the month, because of our formula. If it asks us in months then Ch is 12 but divided by 12 then it will be % of every month. Okay, after that it asks for time. Time means in how much time you have to repay it. Suppose if you have to repay it in years, then our formula asks us in months. So 2 * 12. We will answer 24 that we have to repay it in so many months so that because your installment goes, it goes as monthly installment. If it does not come for this reason, then what will we do here? Now apply our formula and see, here it comes to you, you can see what is the loan amount, it is a loan of 1 lakh, your interest is being charged, so how did you withdraw this much monthly, if you have done it at 10/12, then the monthly installment has come, sorry, the monthly interest has come, the loan term is said to be five years, so the period month should obviously be 60. It is 5 * 12 for 60 months, so now if you want to withdraw the installment, then what will you apply? PMT, will you tap? You have already calculated the rate, so you take the article, calculate it in advance, divide by 12, otherwise you will have to put a comma in the formula, after that on n, on n, what will be the time taken, to be repaid in 60 months. Comma after that, PV means the principal value will be this much. Enter, then you have this answer. Principal amount is an outside world, meaning we have to give this value, it is outwork. If you show this value as negative inside your formula, then this value will come positive. Otherwise, you can also keep the installment in negative. You have to know the principal amount. Now that you know the installment, you want to know that if my installment goes, then it will be in that. How much will the principal amount go to, then we will tab PPMT, we will take the same rate, comma after that, what are you asking but for how many years it is going to last, that is, we have to find out the number of years, how much principal amount we are paying in a year, or in that one comma, how much is the total going to be, go after 60 months or comma, what is the PV after that, enter lakhs, then see, this amount from this installment is your principal value and right there. If you take out the interest on pay then IPMT tab, after that you will give the same rate. You have to take out the year on the comma, but the year comma is once in a year and after that what are you doing on N meaning your months comma after that enter your PV then this much is your interest. If you total both of them then which is 21 24. This much is your installment going. This much principal amount goes inside the installment and this much amount of interest goes. So here we have done the basic, meaning it is basic, if you understand it well, then it will be basic. Other wise, you will get confused in this also. In the basic funda way, I have given you the finance related formulas here, so here we have covered all the formulas from basic to advanced. Now we will move towards our main topic which is going to be our pivot, where we will learn from reporting, where we will learn about dashboard. After all this, we will tap the data tab and developer, now let’s move on to it, so if you have watched this video till now, then I can definitely say that now you must have understood Basic Excel and Advanced Excel very well. Unfortunately, we have to stop this video here and the reason is that youtube2 If I am explaining pivot table to you, making you a dashboard, making you make a power query or making you make an AI tools and in the middle that video has to be ended there. That’s why we will bring part two of this video where we will cover all the similar topics, be it your pivot table, charts, dashboard, power query, DAX, VBA, macros, AI tools, all of them are going to be covered in part two of this, so you will stay with us, as well as all the content I have used here, you can access it on the app on top of our app. Go above and check the free content there, you will get all the sheets. Apart from this, if you want to do professional training, do live professional training, then you can join us. We deal in accounting software, data analytics and finance, so all the software related to this, you can explore them on our app, on the website or if any query comes, then you will meet directly on call or whatsapp2, till then you will get your Don’t forget to give feedback because from your feedback we get to know how we should bring content to you and how we can deliver the best for you. So let’s meet in the next video till then goodbye.

    By Amjad Izhar
    Contact: amjad.izhar@gmail.com
    https://amjadizhar.blog

  • Adobe Illustrator: Shape Creation, Selection, and Design Techniques

    Adobe Illustrator: Shape Creation, Selection, and Design Techniques

    The provided text offers instructions and demonstrations for using various tools and techniques within a graphic design software. It begins by introducing basic shape tools, their manipulation through anchor points and handles, and methods for applying color fills and outlines. The text then explores selection techniques, including basic selection, group selection, and a magic wand tool for selecting similarly attributed objects, along with a lasso tool for freehand selections. Zoom functionalities and document setup options are also covered. Subsequently, the text guides the user through creating several design projects: a layered ribbon, a 3D chocolate bar illustration using effects and rendering, and a visiting card design incorporating masks, gradients, and image placement, concluding with a basic Ludo board creation demonstrating grid splitting and pathfinder operations.

    Adobe Illustrator Course Review

    Quiz

    1. According to the instructor, who is this Adobe Illustrator course designed for? This course is designed for absolute beginners who have no prior knowledge of Illustrator, as well as individuals with some basic understanding who want to learn advanced techniques. The instructor emphasizes teaching from the very basics in a traditional yet interesting way.
    2. Name at least five types of designs that can be created using Adobe Illustrator mentioned in the video. Adobe Illustrator can be used for designing logos, creating cartoon characters, flyer designs, business card designs, invitation card designs, letterhead designs, brochure designs, book cover designs, certificate designs, social media ad designs, banner designs, and mobile UI designs.
    3. What is the key difference between vector-based and raster-based graphic designing software? Vector-based software, like Adobe Illustrator, uses mathematical equations to define shapes as paths or lines, allowing them to be scaled infinitely without losing quality or becoming pixelated. Raster-based software, on the other hand, uses a grid of pixels, which can become pixelated and lose quality when zoomed in or scaled up.
    4. What are the minimum system requirements mentioned for installing Adobe Illustrator on a PC? The minimum system requirements include a 64-bit processor, 8GB of RAM, and at least 2GB of hard disk space. A monitor with a minimum resolution of 1024×768 pixels and a 1GB GPU are also recommended.
    5. How can a user access a perfect circle or square shape while drawing in Adobe Illustrator? To draw a perfect circle, the user should select the Ellipse Tool and then press and hold the Shift key while dragging the mouse. Similarly, to draw a perfect square using the Rectangle Tool, the user should press and hold the Shift key while dragging the mouse.
    6. What is the purpose of the Direct Selection Tool (shortcut ‘A’) in Adobe Illustrator? The Direct Selection Tool allows users to select individual anchor points or path segments of a shape. Once selected, these anchor points can be moved, and their handles can be adjusted to modify the shape of the path or round corners individually.
    7. Explain how the Shaper Tool (Shift+N) can be used to create and merge shapes in Adobe Illustrator. The Shaper Tool allows users to draw rough shapes, which the software then interprets and converts into perfect geometric forms. It can also merge overlapping rough shapes into a single combined shape. Additionally, drawing a zigzag line across multiple shapes with the Shaper Tool can merge them together.
    8. Describe one method for zooming in and out of the artwork in Adobe Illustrator. One method for zooming is using the Zoom Tool (shortcut ‘Z’). Clicking and dragging from left to right zooms in, while dragging from right to left zooms out. Alternatively, simply clicking and holding with the Zoom Tool will continuously zoom in on that area.
    9. How can the Magic Wand Tool be used to select objects in Adobe Illustrator? The Magic Wand Tool selects objects based on similar attributes, such as fill color, stroke color, stroke weight, opacity, etc. Double-clicking the Magic Wand Tool icon opens a dialog box where users can specify which attributes and the tolerance level for similarity to use for selection.
    10. What is the function of the Pathfinder panel in Adobe Illustrator, and name one of its shape modes or pathfinders? The Pathfinder panel contains a set of options that allow users to combine, subtract, intersect, divide, and otherwise manipulate overlapping objects to create new shapes. One of its shape modes is “Unite,” which merges two or more selected objects into a single object.

    Answer Key

    1. This course is designed for absolute beginners who have no prior knowledge of Illustrator, as well as individuals with some basic understanding who want to learn advanced techniques. The instructor emphasizes teaching from the very basics in a traditional yet interesting way.
    2. Adobe Illustrator can be used for designing logos, creating cartoon characters, flyer designs, business card designs, invitation card designs, letterhead designs, brochure designs, book cover designs, certificate designs, social media ad designs, banner designs, and mobile UI designs.
    3. Vector-based software uses mathematical equations for shapes, allowing infinite scaling without pixelation, while raster-based software uses pixels that can pixelate upon scaling.
    4. Minimum requirements: 64-bit processor, 8GB RAM, 2GB hard disk space, 1024×768 resolution monitor, and a 1GB GPU (recommended).
    5. Hold the Shift key while using the Ellipse Tool for a perfect circle and the Rectangle Tool for a perfect square.
    6. The Direct Selection Tool (A) allows users to select and manipulate individual anchor points and path segments of a shape to make precise modifications.
    7. The Shaper Tool (Shift+N) creates perfect shapes from rough drawings and merges overlapping rough shapes into one. Drawing a zigzag across shapes also merges them.
    8. Using the Zoom Tool (Z), drag left to right to zoom in and right to left to zoom out; or click and hold to continuously zoom in.
    9. The Magic Wand Tool selects objects with similar attributes (e.g., fill color, stroke weight), configurable through its settings.
    10. The Pathfinder panel manipulates overlapping objects to create new shapes; “Unite” is one mode that merges selected objects.

    Essay Format Questions

    1. Discuss the advantages of using vector-based software like Adobe Illustrator for graphic design compared to raster-based software, referencing examples from the video.
    2. Analyze the instructor’s teaching approach in the video excerpts. What methods does he use to engage beginners and those with some prior knowledge of Adobe Illustrator?
    3. Describe the process of creating the ribbon design in Adobe Illustrator as explained in the video, highlighting the key tools and options used.
    4. Explain the steps involved in creating the 3D chocolate design in Adobe Illustrator, focusing on the use of 3D effects and material options.
    5. Outline the process of designing the Ludo board in Adobe Illustrator, emphasizing the use of the Split into Grid function and Pathfinder options.

    Glossary of Key Terms

    • Anchor Point: A point on a vector path that indicates a change in direction. Handles extending from anchor points control the curve of the path.
    • Artboard: The workspace in Adobe Illustrator where you create your artwork. Multiple artboards can exist in a single document.
    • Vector: Graphics composed of mathematical equations defining lines, curves, and shapes. They can be scaled infinitely without loss of quality.
    • Raster: Graphics composed of a grid of pixels, where each pixel contains color information. Raster images can become pixelated when scaled up.
    • Interface: The visual layout of a software application, including menus, panels, and tools, that allows users to interact with it.
    • Toolbar: A strip of icons or buttons in a software application that provides quick access to frequently used tools and functions.
    • Shortcut Key: A key or combination of keys on a keyboard that performs a specific command or action in a software application.
    • Selection Tool (V): The basic tool in Adobe Illustrator used to select entire objects or groups of objects for manipulation.
    • Direct Selection Tool (A): A tool used to select and manipulate individual anchor points or path segments of vector objects.
    • Ellipse Tool (L): A tool used to create circles and ovals (ellipses).
    • Rectangle Tool (M): A tool used to create rectangular and square shapes.
    • Shaper Tool (Shift+N): A tool that allows users to create perfect geometric shapes by drawing rough approximations, and also to merge shapes intuitively.
    • Pathfinder: A panel in Adobe Illustrator that contains options for combining, subtracting, intersecting, and dividing overlapping objects to create new shapes.
    • Unite: A Pathfinder option that merges two or more selected objects into a single object.
    • Minus Front: A Pathfinder option that subtracts the topmost object(s) from the objects below them.
    • Intersect: A Pathfinder option that creates a new object from the overlapping areas of two or more selected objects.
    • Divide: A Pathfinder option that divides overlapping objects into separate, distinct shapes.
    • Zoom Tool (Z): A tool used to increase or decrease the magnification level of the artwork view.
    • Magic Wand Tool (Y): A tool that selects objects based on similar fill color, stroke color, stroke weight, opacity, or blending mode.
    • Stroke: The visible outline of a path. Stroke attributes include color, weight (thickness), and style.
    • Fill: The color, pattern, or gradient applied to the inside area of a closed path or object.
    • Gradient: A smooth transition between two or more colors.
    • Opacity: The degree to which an object is transparent or opaque. A lower opacity value makes the object more transparent.
    • Blend Mode: Options that control how colors of overlapping objects interact with each other.
    • Group (Ctrl+G): A command that combines selected objects into a single unit, allowing them to be manipulated together.
    • Ungroup (Ctrl+Shift+G): A command that separates objects that were previously grouped.
    • Align Panel: A panel that provides options for arranging selected objects relative to each other or to the artboard.
    • Distribute: Options within the Align panel that control the spacing between three or more selected objects.
    • Rotate Tool (R): A tool used to turn objects around a specific point.
    • Reflect Tool (O): A tool used to create a mirrored copy of an object across a specified axis.
    • Pen Tool (P): A tool used to create precise paths with anchor points and Bézier curves.
    • Direct Selection Tool: Allows for the manipulation of individual anchor points and path segments created with the Pen Tool.
    • Split Into Grid: A feature that divides an object into multiple rows and columns of equal or specified dimensions.
    • 3D and Materials: A feature in Adobe Illustrator that allows users to create three-dimensional effects on vector objects by extruding, revolving, or inflating them, and to apply materials and lighting.
    • Inflate: A 3D effect that adds volume to an object, making it appear puffed or rounded.
    • Expand Appearance: A command that converts live effects, such as 3D effects and strokes, into editable vector paths and shapes.
    • Eye Dropper Tool (I): A tool used to sample the color or appearance attributes from one object and apply them to another.
    • Clipping Mask: An object whose shape masks other artwork so that only the area within the mask is visible.
    • Brush Tool (B): A tool that allows users to paint paths with various artistic brush effects.
    • Symbol: A reusable piece of artwork stored in the Symbols panel. Instances of a symbol can be placed multiple times without increasing file size significantly.
    • Mockup: A representation of a design in a real-world context, often used to present design concepts to clients. This often involves using software like Adobe Photoshop to place flat designs onto three-dimensional objects or scenes.
    • RGB: A color model that uses red, green, and blue light to produce a wide range of colors, primarily used for digital displays.
    • CMYK: A color model that uses cyan, magenta, yellow, and black inks, primarily used for printing.

    Design Software Tools and Techniques: A Briefing

    Here is a briefing document summarizing the key concepts and tools discussed in the provided sources:

    Briefing Document: Introduction to Design Software Tools and Techniques

    This document provides an overview of the fundamental tools, panels, and techniques demonstrated in the sources for creating various designs, including visiting cards, flyers, social media posts, infographics, and even 3D objects. The software being used appears to be a vector graphics editor like Adobe Illustrator.

    1. Interface Overview and Workspace Customization

    • The interface includes an Application bar at the top, displaying the software icon, home button, and menus (File, Edit, etc.).
    • On the right side of the Application bar, you can find options for search, arranging documents, switching workspaces, and window controls (minimize, maximize, close).
    • The Document tab shows the document name, zoom percentage, and color mode (RGB or CMYK).
    • The Toolbar is typically located on the left side and contains various tools for creating and manipulating designs.
    • Panels are usually on the right side and offer options and settings for different aspects of the design process.
    • Workspace refers to the arrangement of the toolbar and panels. You can:
    • Choose from pre-set workspaces (e.g., Essentials, Printing, Web) via the workspace dropdown or the Window menu.
    • Create custom workspaces by arranging panels and toolbars as needed and saving them via the Window menu > Workspace > New Workspace.
    • Arrange panels by dragging and dropping them, grouping them together (indicated by a blue border), or attaching them to the top or bottom of other panels (indicated by a blue line).
    • Separate panels by clicking and dragging them away from their current group.
    • Toolbars can also be customized. You can:
    • Detach toolbars and move them around.
    • Access basic and advanced toolbars via the Window menu > Toolbar.
    • Create custom toolbars by going to Window > Toolbar > New Toolbar, naming it, and then dragging tools from the complete list (accessed via the three dots at the bottom of a toolbar) into your custom toolbar.
    • The Control Toolbar (or Control Panel) is typically located below the Application bar and displays options relevant to the currently selected tool.

    2. Document Setup

    • When creating a new document, you can specify its dimensions, color mode (RGB for screen, CMYK for print), and raster effects (PPI) (72 PPI for screen, 300 PPI for print, 150 PPI for medium).
    • Bleed area (the area extending beyond the page boundaries) can be set during document creation.
    • Document Setup (File > Document Setup) allows you to modify settings like units (e.g., pixels, mm, cm), bleed, and more even after the document has been created.

    3. Basic Tools and Shape Creation

    • Selection Tool (V): Used for selecting and manipulating objects.
    • Direct Selection Tool (A): Used for selecting and manipulating individual anchor points and path segments of an object.
    • Rectangle Tool (M): Creates rectangular shapes.
    • Clicking and dragging creates a rectangle.
    • Holding Shift while dragging creates a perfect square.
    • Clicking once on the artboard opens a dialog to specify width and height.
    • Rounded Rectangle Tool: Creates rectangles with rounded corners.
    • Ellipse Tool (L): Creates elliptical shapes and circles.
    • Holding Shift while dragging creates a perfect circle.
    • Polygon Tool: Creates polygonal shapes.
    • Clicking and dragging creates a polygon.
    • Use the up and down arrow keys while dragging to increase or decrease the number of sides.
    • Pen Tool (P): Used for drawing precise paths and shapes by creating anchor points and Bézier curves.
    • Shaper Tool (Shift + N): Allows you to draw rough shapes, and the software will convert them into precise geometric shapes. It also allows for merging shapes by drawing a connecting line through them.
    • Zoom Tool (Z): Used for zooming in and out of the artwork.
    • Click and drag to zoom into a specific area.
    • Dragging from left to right zooms in, and right to left zooms out (animated zoom, may depend on graphics card and settings).
    • Ctrl + 0 (or Cmd + 0) zooms to fit the artboard in the window.

    4. Object Manipulation

    • Selecting Objects: Use the Selection Tool to click on objects to select them.
    • Transforming Objects:
    • Resizing: Drag the handles (small squares at the corners and sides of a selected object) to change width and height. Corner handles resize proportionally by default; holding Shift while dragging a side handle can also maintain proportions.
    • Rotating: Move the mouse cursor slightly outside a corner handle until a curved arrow appears, then click and drag to rotate. Holding Shift while rotating snaps to 45-degree increments.
    • Copying Objects:
    • Ctrl + C (Copy) and Ctrl + V (Paste).
    • Ctrl + C (Copy) and Ctrl + F (Paste in Front).
    • Pressing the Alt key while dragging an object creates a copy.
    • Ctrl + D (Transform Again) repeats the last transformation (including moving and copying).
    • Arranging Objects: Use Object > Arrange to change the stacking order of objects (Bring to Front, Bring Forward, Send Backward, Send to Back).
    • Grouping Objects (Ctrl + G): Combines selected objects into a single group for easier manipulation.
    • Ungrouping Objects (Ctrl + Shift + G): Separates objects that were previously grouped.
    • Aligning Objects: Use the Align panel (Window > Align) or alignment options in the Control bar to align selected objects to each other or to the artboard (Horizontal Align Left/Center/Right, Vertical Align Top/Center/Bottom). You can designate a key object for alignment by selecting multiple objects and then clicking on one of them again (a thicker outline will appear) or by using the “Align To Object” option in the Align panel menu.

    5. Color and Appearance

    • Color Modes: RGB (Red, Green, Blue) for screen-based designs, CMYK (Cyan, Magenta, Yellow, Black) for print.
    • Fill and Stroke: Objects have a fill color (the inside) and a stroke (the outline). You can set these using the Swatches panel, Color panel, or the options in the Toolbar.
    • Eye Dropper Tool (I): Used to sample color from existing objects.
    • Gradient Tool (G): Creates smooth transitions between colors. Gradients can be applied to both fill and stroke.
    • Opacity: Controls the transparency of an object (0% is fully transparent, 100% is fully opaque). Can be adjusted in the Transparency panel or the Control bar.
    • Stroke Panel (Window > Stroke): Allows you to customize the appearance of strokes (weight, cap, corner, align, dashed lines, etc.).

    6. Pathfinder Panel (Window > Pathfinder)

    • Provides tools for combining, subtracting, intersecting, excluding, dividing, trimming, merging, cropping, and outlining shapes.
    • Unite: Merges selected shapes into one.
    • Minus Front: Subtracts the topmost object(s) from the bottommost object.
    • Intersect: Keeps only the overlapping areas of selected shapes.
    • Exclude: Keeps all non-overlapping areas and removes the overlapping area.
    • Divide: Splits overlapping shapes into separate objects.
    • Trim: Removes the parts of an object that are hidden behind other objects.
    • Merge: Similar to Trim but also merges same-colored, non-stroked adjacent objects.
    • Crop: Keeps only the area of the topmost object that overlaps with the objects below.
    • Outline: Converts objects into their outline paths.
    • Minus Back: Subtracts the bottommost object(s) from the topmost object (not explicitly mentioned but implied by “Minus Front”).

    7. Working with Text

    • Type Tool (T): Used for adding text to the artwork.
    • Text attributes like font, size, color, weight (bold, regular), and line spacing (leading) can be adjusted in the Character panel (typically found within the Properties panel or under Type > Character).

    8. Advanced Techniques

    • Offset Path (Object > Path > Offset Path): Creates a new path that is offset from the original path, either inside or outside. Positive values create an outer offset, and negative values create an inner offset.
    • Split Into Grid (Object > Path > Split Into Grid): Divides an object into multiple rows and columns with specified numbers and gutter spacing.
    • Magic Wand Tool (Y): Selects objects with similar attributes (e.g., fill color, stroke weight). Double-clicking the tool icon opens options to customize the selection criteria.
    • Lasso Tool (Q): Allows freehand selection of anchor points or objects.
    • Clipping Masks (Object > Clipping Mask > Make or Right-click > Make Clipping Mask): Uses one object (the mask) to define the visibility of other artwork. Only the parts of the artwork that lie within the mask are visible. The masking object needs to be on top of the objects being masked.
    • Document Raster Effects Settings (Effect > Document Raster Effects Settings): Controls the resolution for raster effects applied in the document.
    • Drop Shadow (Effect > Stylize > Drop Shadow): Adds a shadow effect to objects, with options for mode, opacity, offset (X and Y), and blur.
    • Image Placement (File > Place): Imports external files (images, other documents) into the Illustrator document. Linked images (indicated by a cross) are linked to the original file. Embedding an image (using the Embed button in the Control bar when the image is selected) makes it part of the Illustrator file, breaking the link to the original.
    • Mockups: Visual representations used to present designs in a realistic context (often done in separate software like Adobe Photoshop by placing the design onto a mockup template).
    • Expand Appearance (Object > Expand Appearance): Converts live effects (like 3D effects or strokes) into editable paths and fills.
    • Reflect Tool (Object > Transform > Reflect or Right-click > Transform > Reflect): Flips an object horizontally or vertically.
    • View Modes (View > Outline, View > Preview): Outline mode shows only the paths of objects, useful for precise alignment and identifying overlapping objects. Preview mode shows the final appearance with fills and strokes.
    • Guides (View > Rulers > Show Rulers, then drag from rulers): Non-printing lines used for alignment and layout. Guides can be locked/unlocked and precisely positioned.

    9. Data Recovery

    • The software has an automatic save option (Edit > Preferences > File Handling) that can be configured to save recovery information at specified intervals (e.g., every 2 minutes) to prevent data loss in case of crashes. You can also set the location for these recovery files and whether to save backups on the cloud.

    This briefing document covers the main topics discussed in the provided sources, offering a foundational understanding of various design software functionalities and workflows. Remember that practice and experimentation are key to mastering these tools and techniques.

    Adobe Illustrator Course: Answering Your Questions

    Here is an FAQ (Frequently Asked Questions) based on the information in the sources:

    Q: What is this course about? A: This course is a complete course on Adobe Illustrator. It aims to teach you graphic designing from the very basics to more advanced techniques.

    Q: Who is this course for? A: This course is designed for absolute beginners who have no previous knowledge of Illustrator, as well as people who have some basic knowledge but want to learn advanced techniques. Even if you have never opened Illustrator before, this course is for you.

    Q: What software is used in this course? A: The software used in this course is Adobe Illustrator.

    Q: Do I need prior knowledge to take this course? A: No, you do not need any previous knowledge to learn from this course. It starts from the very basics.

    Q: What will I learn in this course? A: In this course, you will learn how to create logos, design and create cartoon characters, design flyers, business cards, invitation cards, letterheads, brochures, book covers, certificates, social media ads, banners, and mobile UI designs, among many other things. You will also learn to create objects, write text, and design various elements like 2D restaurant designs, strawberry cream chocolate designs, ribbon designs, 3D chocolate designs, infographics, visiting card designs, ludo designs, social media posts, pattern backgrounds, christmas candy designs, 3D text designs, abstract backgrounds, 3D rainbow designs, and isometric building designs.

    Q: Is Adobe Illustrator difficult to learn? A: According to the instructor, Illustrator is not a very difficult software. This course aims to make it even easier and more interesting to learn.

    Q: Is this course free? What is the “small fee”? A: The instructor is offering this course for free, and no money is required. The “small fee” requested is to like the video, leave a sweet comment, and share it with at least one friend.

    Q: Why is this course different from other courses? A: This course is different because it aims to teach Illustrator in an interesting and practical way, not just the traditional way. You will learn to make designs and patterns along with understanding the tools and options needed to create them.

    Q: What if I miss a tool or option in the videos? A: You are advised not to skip any part of the video because the instructor will explain how each option or tool works in detail and then use it in a design without repeating its basic working again in future videos.

    Q: How can I easily access specific topics in the course? A: Timestamps of topics and chapters will be provided in the description box of the video, allowing you to learn any topic easily without hassle.

    Q: How can I ask questions or get in touch with the instructor? A: Links to all the instructor’s social media channels are provided in the video description box, where you can talk to the instructor and ask questions. The instructor also mentions starting online live classes soon, and you can potentially join those. You can also contact via instagram2.

    Q: What are the career prospects after learning graphic designing? A: There is a huge demand for graphic designing skills in the market, and this demand is increasing locally as well. Learning this skill can help you earn money in top sectors such as Brand Design, Marketing & Advertising design, Packaging design, Web end user Interface Design, Print & Publication Design, Lettering and text design, Graphics Illustration, Data Visualisation, and Infographic Design.

    Q: What are RGB and CMYK color modes used for? A: RGB (Red, Green, Blue) color mode is used when you are designing something that will be used on a screen, such as social media posts or for platforms like youtube2, as screens on mobiles and computers use RGB colors. CMYK (Cyan, Magenta, Yellow, Black) color mode is used when you are going to take something for printing, like a visiting card, flyer, banner, or flex.

    Q: What PPI should I use for screen and print? A: For screen use, you can take 72 PPI (pixels per inch). For printing, you would typically take 300 PPI. A medium setting might use 150 PPI.

    Q: How can I customize the workspace in Illustrator? A: You can customize your workspace by choosing from preset workspaces (like Essentials, Printing, Web) from the workspace dropdown or by going to Window > Workspace. You can also create your own custom workspace by arranging panels and toolbars as you like and saving it via Window > Workspace > New Workspace.

    Q: What are panels and toolbars in Illustrator? A: The toolbar is usually on the left side and contains all the document tools used to enhance your designs. Panels are typically on the right side and contain options and settings that you will use in the future for various aspects of your design work.

    Q: How can I save my work automatically in case of a crash? A: You can set up automatic saving by going to Edit menu > Preferences > File Handling. Here, you can turn on the “Automatic save” option and choose the interval (e.g., every 2 minutes) at which your file’s recovery information will be saved. You can also choose to save backups on the cloud.

    Q: What are basic shapes in Illustrator and how can I create them? A: Basic shapes include rectangles, rounded rectangles, ellipses, and polygons, which can be found by clicking and holding on the Rectangle Tool icon in the toolbar. * To create a rectangle, select the Rectangle Tool (M), click and drag on the artboard. Hold Shift to create a perfect square. Clicking once on the artboard allows you to enter specific width and height dimensions. * The Rounded Rectangle Tool creates rectangles with rounded corners. * The Ellipse Tool (L) allows you to draw ellipses; hold Shift to draw perfect circles. * The Polygon Tool lets you create polygons; while dragging, you can use the up and down arrow keys to change the number of sides.

    Q: How do I resize and rotate shapes in Illustrator? A: * Resizing: Select the shape with the Selection Tool (V). Drag the handles (small squares) at the corners and sides to change the size. Holding Shift while dragging a corner handle maintains proportions. * Rotating: Select the shape. Move your mouse cursor slightly outside a corner handle until a rotation handle (curved arrow) appears. Click and drag to rotate the shape. Hold Shift during rotation to snap to 45-degree angles.

    Q: How do I change the fill and stroke color of an object in Illustrator? A: When you select a shape, you can see the Fill Color and Stroke (outline) Color options in the Toolbar, the Swatches panel, or the Color panel. Click on the fill or stroke swatch to choose a color. You can also adjust the stroke weight (thickness) next to the stroke color option. To remove fill or stroke, you can select the “None” option, often represented by a white square with a red diagonal line, in the color options. You can switch between applying color to the fill or the stroke by clicking on the respective swatch to bring it to the front or by pressing the ‘X’ key.

    Q: What is the Magic Wand Tool used for? A: The Magic Wand Tool (Y) is used to select objects that have similar appearance attributes, such as the same fill color or stroke weight. Clicking on an object with the Magic Wand will select all other objects in your artwork that share similar properties. You can customize the selection criteria by double-clicking the Magic Wand tool icon.

    Q: What is the Pathfinder panel used for? A: The Pathfinder panel (Window > Pathfinder) provides a set of tools to combine and manipulate shapes in various ways. It can be used to unite shapes, subtract one shape from another, find the intersection of shapes, exclude overlapping areas, divide shapes, trim overlapping parts, merge shapes with the same color, crop shapes, and create outlines of objects.

    Q: What is the Offset Path function in Illustrator? A: The Offset Path function (Object > Path > Offset Path) creates a new path that is offset by a specified distance from the original path. You can create a path that is larger (outside) by using a positive offset value or smaller (inside) by using a negative offset value. This is useful for creating outlines, insets, or bleed areas for printing.

    Q: What are Guides used for in Illustrator? A: Guides are non-printing lines that help with alignment and layout in your artwork. You can create guides by showing the rulers (View > Rulers > Show Rulers) and then clicking and dragging from either the horizontal ruler (for horizontal guides) or the vertical ruler (for vertical guides) onto your artboard. Guides can be moved, and you can align objects to them. You can also precisely position guides using the Control bar when a guide is selected.

    Q: What is a Clipping Mask in Illustrator? A: A clipping mask is an object whose shape masks other artwork so that only areas that lie within the shape are visible. To create a clipping mask, you need a masking object on top of the objects you want to mask. Select all the objects and then go to Object > Clipping Mask > Make or right-click and choose Make Clipping Mask.

    Q: What is Drop Shadow in Illustrator? A: Drop Shadow is an effect (Effect > Stylize > Drop Shadow) that adds a shadow behind an object to give it depth. You can customize the shadow’s mode, color, opacity, offset (X and Y direction), and blur in the Drop Shadow dialog box.

    Q: How do I place an image in Illustrator? A: To place an external file (like an image) into your Illustrator document, go to File > Place. Select the image file and click “Place.” You can then click and drag on the artboard to size the placed image.

    Q: What is embedding an image in Illustrator? A: When you place an image in Illustrator, it can be either linked or embedded. A linked image maintains a connection to the original file. An embedded image becomes part of the Illustrator document itself, breaking the link to the original file. Embedding is done by selecting a linked image and clicking the “Embed” button in the Control bar. Embedding ensures the image will always be visible in your Illustrator file, even if the original file is moved or deleted.

    Q: What are Mockups and why are they used? A: Mockups are visual representations used to present designs in a realistic context. For example, a visiting card design can be placed onto a mockup of a hand holding a card or a card lying on a desk. Mockups are often created in separate software like Adobe Photoshop by placing the design onto a mockup template. They help clients visualize how the final product will look.

    Adobe Illustrator Basic Tools and Techniques

    Based on the information in the sources, let’s discuss the usage of basic tools in Adobe Illustrator:

    Basic Shapes Tools

    Illustrator provides several basic shape tools that serve as fundamental building blocks for more complex designs. These tools are usually grouped under the Rectangle Tool in the toolbar. To access them, you can click and hold on the visible shape tool icon.

    • Rectangle Tool (M): This tool allows you to draw rectangular shapes by clicking and dragging on the artboard. To create a perfect square, hold down the Shift key while dragging. You can also create a rectangle of a specific size by selecting the tool and clicking once on the artboard; a dialog box will appear where you can enter the desired width and height.
    • Rounded Rectangle Tool: This tool creates rectangles with rounded corners. Similar to the Rectangle Tool, you click and drag to draw. The roundness of the corners is predefined by the tool. You can also create a rounded rectangle with specific dimensions and corner radius by clicking once on the artboard after selecting the tool.
    • Ellipse Tool (L): This tool is used to draw elliptical shapes. To draw a perfect circle, hold down the Shift key while dragging. Like the Rectangle Tool, clicking once on the artboard after selecting the Ellipse Tool allows you to specify the width and height of the ellipse. A red line might appear in the center while drawing with the Shift key, indicating you are creating a perfect circle.
    • Polygon Tool: This tool allows you to draw polygonal shapes. After selecting the tool, click and drag on the artboard. While dragging, you can change the number of sides of the polygon by pressing the up and down arrow keys. Pressing the up key increases the number of sides, while the down key decreases it. You can create a triangle (minimum sides) this way. Holding Shift while dragging will constrain the rotation of the polygon.
    • Star Tool: This tool is used to draw star shapes. Similar to the Polygon Tool, you click and drag to create a star. You can change the number of points on the star by using the up and down arrow keys while dragging.

    Selection Tools

    These tools are crucial for selecting and manipulating objects you create.

    • Selection Tool (V): This is your primary tool for selecting entire objects. You can click on an object to select it. Once selected, handles (small squares) appear around the object. Dragging these handles allows you to resize the object. Moving the mouse cursor slightly outside a corner handle will reveal rotation handles, which you can use to rotate the object. Holding Shift during resizing from a corner maintains the object’s proportions, and holding Shift during rotation snaps the rotation to 45-degree increments.
    • Direct Selection Tool (A): This tool allows you to select individual anchor points on a path or shape. Anchor points are the points that define the shape of an object. By selecting individual or multiple anchor points (you can select multiple by holding Shift), you can move them, thus reshaping the object. When you select an anchor point with the Direct Selection Tool, you may also see handles extending from it. These handles control the curves of the paths connected to that anchor point. By dragging these handles, you can fine-tune the shape of curves. You can also use the Direct Selection Tool to round individual corners of a shape by clicking on the corner and dragging the appearing circular widget inwards. Holding Shift while dragging a corner widget allows you to round multiple selected corners simultaneously.
    • Lasso Tool (Q): This tool allows you to make freehand selections of anchor points or objects. You simply click and drag to draw a freeform shape around the areas or objects you want to select. Only the objects or anchor points fully or partially enclosed within the lassoed area will be selected.

    Drawing Tools

    These tools are primarily used for creating paths and more intricate shapes.

    • Pen Tool: The Pen Tool is a fundamental tool for creating precise and complex paths. It works by placing anchor points that are connected by path segments. Clicking with the Pen Tool creates straight path segments. To create curved paths, you click and drag, which creates direction handles that define the curve’s shape. You can adjust these handles to refine the curve. To create a sharp corner after drawing a curve, you can hold down the Alt key and click on the last anchor point to remove one of the direction handles.
    • Shaper Tool (Shift+N): This tool allows you to draw rough shapes, and Illustrator will attempt to recognize and convert them into precise geometric shapes. You can also use the Shaper Tool to merge overlapping shapes by drawing a scribble through them.

    Viewing and Navigation Tools

    These tools help you navigate and examine your artwork.

    • Zoom Tool (Z): This tool allows you to zoom in and out of your artwork. Select the tool and click on the artboard to zoom in. To zoom out, hold down the Alt key while clicking. You can also click and drag the Zoom Tool to zoom into a specific area. Double-clicking the Zoom Tool in the toolbar will fit your artboard to the window (Ctrl+0 is a shortcut for this). You can also control the zoom level using the dropdown menu in the status bar at the bottom of the window. Illustrator offers animated zoom for a smoother experience, which can be enabled in Edit > Preferences > Performance by checking the “Animated Zoom” option.
    • Hand Tool (H): While not explicitly detailed in the source, the Hand Tool is typically used to pan or move your view of the artboard, especially when you are zoomed in. You can temporarily activate the Hand Tool by holding down the Spacebar while using another tool.

    Color and Appearance

    • Fill and Stroke: When you draw a shape, it has a fill color (the inside color) and a stroke color (the outline color). You can see and change these colors in the Toolbar, the Color panel, or the Swatches panel. Click on the fill swatch or the stroke swatch to select which attribute you want to modify. Then, you can choose a color. The stroke weight (thickness of the outline) can also be adjusted. To remove the fill or stroke, select the corresponding swatch and then choose the “None” option (a white square with a red diagonal line). You can switch between applying color to the fill and the stroke by clicking on the active swatch or by pressing the ‘X’ key.
    • Eyedropper Tool (I): This tool allows you to sample the color (including fill, stroke, and other attributes) from an existing object and apply it to another selected object. Simply select the object you want to change, then select the Eyedropper Tool and click on the object with the color you want to sample.

    Selection Techniques

    • Single Selection: Click on an object with the Selection Tool (V) to select it.
    • Multiple Selection: Select multiple objects by holding down the Shift key while clicking on each object with the Selection Tool.
    • Group Selection: You can group multiple selected objects together using Ctrl+G (Object > Group). Once grouped, they behave as a single unit when selected and transformed. You can ungroup them using Ctrl+Shift+G (Object > Ungroup). The Group Selection Tool (nested under the Direct Selection Tool) allows you to select individual objects within a group without ungrouping. Double-clicking with the Selection Tool can also allow you to isolate and edit within a group.
    • Magic Wand Tool (Y): As mentioned earlier, this tool selects objects with similar attributes. You can adjust the tolerance for similarity by double-clicking the tool icon.
    • Select by Area: You can click and drag with the Selection Tool (V) to draw a selection marquee around multiple objects, selecting all objects fully or partially within the marquee.

    Understanding and practicing with these basic tools is essential for working effectively in Adobe Illustrator and building more complex designs, as highlighted throughout the sources when creating ribbons, chocolates, visiting cards, and infographics.

    Illustrator Shape Creation Techniques

    Based on the information in the sources and our previous discussion, here’s a breakdown of shape creation techniques in Adobe Illustrator:

    Creating Basic Geometric Shapes

    Illustrator offers a suite of basic shape tools, fundamental for building artwork. These are typically found grouped under the Rectangle Tool (M) in the toolbar [Me].

    • Rectangle and Rounded Rectangle: To draw a rectangle, select the Rectangle Tool and click and drag on the artboard [1, Me]. To create a perfect square, hold down the Shift key while dragging [1, Me]. Similarly, the Rounded Rectangle Tool creates rectangles with rounded corners using the same click-and-drag method [1, Me]. You can create a rectangle or rounded rectangle with specific dimensions by selecting the tool and clicking once on the artboard, which opens a dialog box for entering the width and height [1, Me]. For a rounded rectangle, this dialog also allows you to specify the corner radius.
    • Ellipse: Select the Ellipse Tool (L) and click and drag to draw an ellipse [1, Me]. Holding the Shift key while dragging will create a perfect circle [1, Me]. You can also specify the dimensions of an ellipse or circle by clicking once on the artboard after selecting the tool [1, Me].
    • Polygon: Choose the Polygon Tool, then click and drag on the artboard [1, Me]. While dragging, you can change the number of sides of the polygon by pressing the up and down arrow keys [1, Me]. Holding Shift constrains the rotation of the polygon as you draw [Me].
    • Star: Select the Star Tool and click and drag on the artboard [Me]. You can change the number of points on the star by pressing the up and down arrow keys while dragging [Me].

    Modifying Basic Shapes

    Once a basic shape is created, you can modify it in several ways:

    • Resizing and Rotating with the Selection Tool: With the Selection Tool (V), click to select a shape. Handles (small squares) will appear around it. Dragging these handles will resize the shape. Holding Shift while dragging a corner handle maintains the shape’s proportions [1, Me]. Moving the cursor slightly outside a corner handle reveals rotation handles, which allow you to rotate the shape. Holding Shift during rotation snaps it to 45-degree increments [1, Me].
    • Direct Selection Tool for Anchor Points and Corners: The Direct Selection Tool (A) allows you to manipulate individual anchor points of a shape [1, 2, Me]. Clicking on an anchor point selects it, and you can then drag it to reshape the path [1, Me]. When an anchor point is selected, direction handles may also appear, which you can drag to adjust the curves of the path segments connected to that point [2, Me]. The Direct Selection Tool can also be used to round corners individually or in groups. After selecting the corner(s), a circular widget appears, which you can drag inwards to round the corner [1, Me]. Holding Shift allows you to round multiple selected corners simultaneously [Me].
    • Shaper Tool for Intuitive Drawing: The Shaper Tool (Shift+N) provides a more intuitive way to create shapes by allowing you to draw rough approximations of geometric forms, which Illustrator then refines into precise shapes [3, Me]. This tool also enables you to merge overlapping shapes by drawing a scribble across them [3, Me].
    • Specifying Dimensions After Creation: You can also modify the dimensions of a selected shape after it has been drawn. With the shape selected and a shape tool active (like the Rectangle Tool), you can often see dimension fields in the Control panel at the top of the screen, where you can directly input the desired width and height [Me – based on general Illustrator knowledge, though not explicitly stated in the sources for post-creation modification].

    These techniques provide a solid foundation for creating and manipulating shapes in Adobe Illustrator, as demonstrated in the various design tasks outlined in the sources.

    Illustrator: Understanding Fill and Stroke

    Based on the information in the sources and our conversation history, here’s a discussion of color fill and stroke in Adobe Illustrator:

    Whenever you draw a basic shape in Illustrator, it inherently has two attributes: a fill color and a stroke color (which is also referred to as the outline color).

    Fill Color:

    • The fill color is the color that occupies the interior area of a closed path or shape.
    • You can change the fill color of a selected shape in several ways:
    • By using the Color panel.
    • By using the Swatches panel (referred to as “color options are available with it”).
    • By using the toolbar, where you can see the fill color swatch. Clicking on this swatch will open color options.
    • By using the Eyedropper tool to sample a color from existing artwork and apply it as the fill.
    • Illustrator provides various color modes and options for selecting fill colors.
    • You can also choose no fill for a shape, which will make the inside of the shape transparent. This option is usually represented by a “None” swatch in the color panels and toolbar.

    Stroke Color:

    • The stroke color defines the color of the outline or border of a path or shape.
    • Similar to the fill color, you can modify the stroke color of a selected shape using the Color panel, Swatches panel, and the stroke color swatch in the toolbar.
    • You can also choose no stroke for a shape, which will make the outline invisible. This option is also represented by a “None” swatch.

    Stroke Weight (Thickness):

    • In addition to the stroke color, you can also control the weight or thickness of the stroke using the Stroke panel. The higher the weight value, the thicker the outline will be. You can usually access the Stroke panel from the Window menu.

    Applying and Interacting with Fill and Stroke:

    • When you select a shape, the fill and stroke color swatches are visible in the toolbar. The active swatch (either fill or stroke) is usually displayed on top, indicating that any color changes you make will be applied to that attribute.
    • You can switch between the active fill and stroke swatches by clicking on the inactive swatch in the toolbar or by pressing the “X” key on your keyboard. This allows you to easily change either the fill or the stroke color of the selected object.
    • The Arrange menu allows you to control the stacking order of objects. This can be relevant when dealing with filled and stroked shapes that overlap.

    “None” Option:

    • The “None” color option is available for both fill and stroke. When you apply “None” to the fill, the interior of the shape becomes transparent. When you apply “None” to the stroke, the outline of the shape disappears.

    In the context of shape creation techniques we discussed earlier, understanding fill and stroke is crucial because every shape you create will have these attributes. You can then use the various methods described to customize their appearance according to your design needs, as seen in the ribbon and chocolate bar examples in the sources. For instance, the ribbon design utilizes both solid colors and gradients for the fill, and the chocolate design applies fill colors and later explores 3D effects that interact with these initial color choices.

    Adobe Illustrator Object Manipulation Techniques

    Based on the information in the sources and our conversation history, there are several techniques for object manipulation in Adobe Illustrator. These techniques allow you to move, resize, rotate, arrange, group, and otherwise modify objects within your artwork.

    Selecting Objects:

    The first step in manipulating any object is to select it. You can do this using the Selection Tool (V) [1, Me]. Simply click on an object to select it. To select multiple objects, you can either click and drag a selection marquee around them or Shift-click on each object you want to include in the selection [5, Me].

    Moving Objects:

    Once an object or multiple objects are selected, you can move them by clicking and dragging with the Selection Tool [1, 5, Me].

    Resizing Objects:

    To resize a selected object, use the Selection Tool to click and drag one of the handles that appear around the object’s bounding box [1, 3, Me].

    • Dragging a side handle will change the width or height independently.
    • Dragging a corner handle will change both the width and height proportionally.
    • To maintain the object’s original proportions while resizing with a corner handle, hold down the Shift key while dragging [1, 3, Me].

    Rotating Objects:

    With an object selected using the Selection Tool, move your cursor slightly outside one of the corner handles. The cursor will change to a curved arrow, indicating that you can now rotate the object by clicking and dragging [1, 3, Me].

    • Holding down the Shift key while rotating will snap the rotation to 45-degree increments [1, 3, Me].
    • The Reflect Tool (O) can also be used to create a mirrored copy of an object across a specified axis [7, Me]. You can access its options by double-clicking on the tool.

    Arranging Objects (Stacking Order):

    When you have multiple overlapping objects, you can control their stacking order using the Arrange menu (Object > Arrange). The options include:

    • Bring to Front: Moves the selected object to the top of the stack.
    • Bring Forward: Moves the selected object up one level in the stacking order.
    • Send Backward: Moves the selected object down one level in the stacking order.
    • Send to Back: Moves the selected object to the bottom of the stack.

    Grouping and Ungrouping Objects:

    Grouping allows you to treat multiple objects as a single unit [1, 5, 8, Me]. To group selected objects, go to Object > Group or use the shortcut Ctrl+G (Command+G on Mac). Once grouped, you can move, resize, and rotate the entire group as one.

    To ungroup a selected group, go to Object > Ungroup or use the shortcut Ctrl+Shift+G (Command+Shift+G on Mac). This will separate the objects back into individual elements. The Group Selection Tool allows you to select individual items within a group without ungrouping it entirely.

    Aligning Objects:

    The Align panel (Window > Align) provides options for aligning two or more selected objects relative to each other or to the artboard [9, Me]. You can align objects horizontally (left, center, right) and vertically (top, center, bottom). You can also distribute objects evenly with specified spacing. The “Align To:” option in the Align panel allows you to choose whether to align to the selection, the artboard, or a key object.

    Reflecting Objects:

    The Reflect Tool (O) allows you to create a mirrored copy of an object [7, Me]. Select the object, activate the Reflect Tool, and then click and drag across the axis you want to reflect the object over. Holding the Alt key while clicking will open the Reflect dialog box, allowing you to specify the axis and create a copy [7, Me].

    Other Manipulation Techniques:

    • The Direct Selection Tool (A), while primarily used for editing anchor points and path segments, can also be used to select and manipulate individual objects within a group (as mentioned earlier) or to move individual anchor points to reshape an object [7, Me].
    • The sources demonstrate using the Pen Tool to create and manipulate paths, which is a fundamental aspect of object creation and manipulation.
    • The concept of Offset Path (Object > Path > Offset Path) is introduced, which creates a new path that is offset by a specified distance from the original path, either inside or outside. This is a form of manipulating the shape and size of a path.
    • The Pathfinder panel (Window > Pathfinder) provides various options for combining, subtracting, intersecting, and dividing overlapping objects to create new shapes. These are powerful tools for manipulating the forms of your artwork.
    • Transformations like scaling, rotating, reflecting, shearing, and distorting can be accessed via the Object > Transform menu or by right-clicking on a selected object [Me – based on general Illustrator knowledge].

    These object manipulation techniques are essential for creating complex artwork and achieving precise control over your designs in Adobe Illustrator, as exemplified by the steps involved in creating the ribbon and chocolate bar designs in the provided sources.

    Adobe Illustrator: Understanding the Zoom Tool

    Based on the information in the sources, here’s a discussion of the Zoom functionality in Adobe Illustrator:

    The Zoom tool (Z) is a fundamental tool in Adobe Illustrator that allows you to magnify or reduce your view of the artwork on the artboard.

    Accessing the Zoom Tool:

    • You can select the Zoom tool by clicking on its icon in the toolbar. The icon typically resembles a magnifying glass.
    • The shortcut key for the Zoom tool is the “Z” key. Pressing “Z” on your keyboard will activate the Zoom tool.

    Methods of Zooming:

    • Click and Drag:With the Zoom tool selected, you can click and drag on the artboard to zoom in on a specific area.
    • If animated zoom is enabled (discussed below), dragging from left to right will zoom in, and dragging from right to left will zoom out.
    • Single Click and Hold:You can also single-click and hold the mouse button with the Zoom tool to continuously zoom in on the clicked area.
    • Zoom to Fit Artboard:The shortcut Ctrl + 0 (Command + 0 on Mac) allows you to quickly zoom to fit the active artboard within your window.
    • Zoom Levels in Interface:The current zoom level is displayed in the document tab, showing the percentage of zoom.
    • You can also find zoom controls and the current zoom level displayed in the status bar located at the bottom of the application window. You can often zoom in or out by clicking on or interacting with the zoom percentage in the status bar.

    Animated Zoom:

    • Illustrator offers an animated zoom feature that provides a smoother visual transition when zooming.
    • For animated zoom to function optimally, it relies on your system having a compatible graphics card and the necessary drivers installed.
    • You can enable or disable animated zoom in the Illustrator Preferences. To do this, go to Edit > Preferences > Performance. In the Performance settings, you will find an option labeled “Animated Zoom”. Make sure this option is ticked (enabled) to use the animated zoom functionality. If your system’s graphics card is not recognized, this option might be deactivated.

    Reversing Zoom Direction (Zoom Out):

    • To zoom out with the Zoom tool, you can press and hold the Alt key (Option key on Mac) while using the tool.
    • If you are using the click-and-drag method with animated zoom enabled, pressing Alt will reverse the direction; dragging left to right will zoom out, and right to left will zoom in.
    • Single-clicking with the Alt key held down will zoom out.

    In summary, Illustrator provides versatile zoom functionality through the dedicated Zoom tool and keyboard shortcuts. You can precisely control your view of the artwork for detailed work, and the animated zoom feature, when available, offers a smoother user experience. Understanding these different zooming methods allows for efficient navigation and manipulation of your designs, as is implicitly necessary when working on details in the ribbon or precisely placing elements in the chocolate bar and social media post examples from the sources.

    Adobe Illustrator Complete Course (7 Hours) in Hindi

    The Original Text

    Hello friends are you a best If you are searching for illustrator code then you You have come to the perfect video welcome back to Once Again to Your Graphic Designing Channel This is Ashish and you are watching Simplified [music] Tuts complete course of my previous college But you gave me so much love and support For which I thank you very much from my heart You guys liked my video very much And since then my They were demanding a lot that Sir we should get the same If you need another course on Adobe Illustrator You guys can read the complete course of Edo Illustrator Who is this course for This complete course is designed This course is for absolute beginners You do not need any previous knowledge to learn You don’t need it if you have ever done it before today Even if you haven’t opened Illustrator There is no problem, this course is I’m going to teach you from the very basics and People who have a little knowledge of the basics But they have advanced learning and techniques Even if they want to learn, the course is perfect for them This course is going to be taught in the traditional way I did not learn it in a little interesting way I will learn it so the video is a bit long if you are serious about graphic designing If you are interested in learning then this you can see the complete course what you will do in adobe.com logos Designing and creating cartoon characters flyer design business car design invitation card design letter head design brochure design book cover design certificate design social media ad design banner design mobile Designing UI Design and much more we use it for so much now After watching something you might feel that Illustrator is very difficult but it is Illustrator is not a very It is an easy software and in this video I am going to By making it even easier and more interesting I am going to teach you what you will learn in this In this course on Adobe Illustrator, we will You will learn how to create objects how to write text 2d restaurant design strawberry cream chocolate design Ribbon Design 3D Chocolate Design infographics design visiting car design ludo design social media post design pattern background design christmas candy design 3d text design abstract background design 3d rainbow design isometric building design ho ho main to I am tired of talking but you have so much to tell You are going to learn just one thing from this single video Now you can make a complete course like this inside You all know that there is a lot of time and It takes hard work so that’s why I first do this Placing the course in the youtube2 section But because of your love I was I couldn’t do that and now it’s for you I am offering this course for free, no money required I am not charging you anything but a small fee that’s one thing i would request of you Before watching this course, watch a video Please like and leave a sweet comment Do it and share this with at least one friend Please share the video so that it can be seen on youtube3 With the help of this video, more and more of them could reach children who were older There is no fee of lakhs of rupees in institutes After this course I can fill it for you adobe.com I will bring the course if you do it for free I want to become something by learning graphic designing and want to make a good earning So you can subscribe to this channel Career after learning graphic designing you guys know that graphic There is a huge demand for designing skills in the market There is more demand and its demand is now local The market is also increasing so if you If you learn a skill then earn money from it It might make things a little easier for you Top sectors where graphic designers work the demands are very high such as Brand Design Marketing & Advertising design packaging design web end user Interface Design Print & Publication Design lettering and text design Graphics Illustration Data Visualisation Infographic Design Why This Course Is This course is different from other courses because in this video, we By not studying Illustrator in the traditional way In an interesting and practical way We will learn different in this course you will learn to make designs and patterns which will You will also learn to make designs as well along with whatever tools are needed to create that design and the options being used You will also get to learn tools and options. You will go but you have to pay attention to one thing In this entire course, you will get this video There is no need to skip anywhere because How any option or tool works What is its working, I will tell you in detail I will also explain that thing in a design and I will not repeat its working to you again. I will do it in some other design because What if the video is longer? so if you skip the video and you missed that tool or option So how is the design going to be made in future You will not understand this complete To make access to the course easier, all Time stamp of topics and chapters will be provided to you will be found in the description box With the help of this you can learn any topic in this entire course. cover the topic anytime without any hassle You can easily see the details of this course To increase the practical I have used this In the description box of your video Gave links to all social media channels if so you can talk to me there And if you have any questions, you can you can ask me and I will as well I would like to tell you one more thing that you There were a lot of requests coming that Sir If we want a personal class from you then Very soon I will start online live classes also When I am starting, the kids who listen to me live If you want to take classes, take it directly from me He wants to read my message directly can do instagram2 I would like to introduce myself My name is Ashish and I have been here for the past 133 years Designing and Multimedia Development I am associated with many Indian and multinational Companies, Government departments and I have also worked for freelancing houses. If you have done it then let’s talk too much Gone are the talks here and there Keeping distractions aside, Ado Starting the creative journey of an illustrator If you want to purchase Illustrator, do you want to buy it? If you want it then you can visit their official website You can get it from here, for that you simply have to Go to the browser and search adobe.com I have already made it for you if you want it Go to my videos section can you see that video rector Things That Matter Versus Graphic Designing now what is a vector See, a vector is something where we This is how a straight line or path is drawn What is a raster where we have pixels If you design something through Our Adobe software is our There is vector base designing software and such If we talk about rester then our This is our raster based designing Now what are the vector software The files come as if it were our AI file EPS has been filed or if we use Coral If you are working on drawing then use Corel Draw The file is also from our vector base software A file is like this if we talk about raster If we do this, our JPG will become PNG. Whether it is GIF or PSD or Tip file All of this is ours Raster base graphic designing software Now there is a difference between the two files What are our vector files? yes she is quite good at illustrations and so on for our raster files They are good for photographs The file size of both is If we talk about the file size of vector then yes it is smaller in comparison to The file size of the raster is smaller than that of our vector There are files, you can zoom them as much as you want our files are not pixelated but raster files are those which are works on a pixel base so whenever If we zoom in on them then they will become pixelated. We start working on vector files you use it as your own for visiting us I want to make a card, I want to make a flyer, I want to make a logo have to be created for there while the raster file we use our own Good for editing photographs So, you must have understood this much that What are vector based software? What are raster base software? What is the difference between the two, now that it Our software is vector base graphic designing software is Illustrator is basically our software adobe.com so this is our vector base graphic designing software and its Inside we can design anything you want that is related to vectors such as logos Your books are now graphic novels. Gone are the newspapers and now comes flex designing Mobile AI or Mobile UI Designing is done, we have it all here you can design it and all Softwares are what we have adobe.com [music] How to install Illustrator on your PC For this we need some basic system Requirements are needed such as If we talk about our processor then The minimum processor we should have is It must be 64 bit even if it I am using intel’s 11 just like that If we talk about RAM then the minimum you need is 8GB RAM is required to use this software to the butt If it is recommendable then it is better If we talk about hard disk then you have You should have minimum 2GB space here You can use SSD on SSD what happens in your software which She is working, she becomes very fast like this If we talk about the resolution of the monitor If you do this then you want a minimum resolution of 1024 by 768 pixels. You can use a monitor, but you If we use more pixels than this Like 1920 or 1080 or more So that is a better thing for you, the more you will get to see good results If we talk about GPU then Here you can use minimum 1GB GPU. you can do it butt If you recommend it then it is quite good when you When you give good effects in 3D If you give effects here then yours is it software or your system Does not hang, does not lag [music] If you already have Illustrator in your PC it is installed then well and good but if you If you want to install it then you You can purchase from their official website for that you simply have to So this search page of theirs should open The website starts to open look here later you will find it The menu of Creativity and Design and You As soon as you click on this, you will see You can find the list of all the software here goes because I have work as an illustrator so I’ll click on Illustrator up and as soon as you click here So the separate page of Illustrator is It starts to open and after a while This page would have opened in front of you As soon as you click on the free tile here If you do it then see, you have everything here Instructions come as to how much it costs How long do you have the software for? You will get to use it for seven days remains free, after that you will have to pay $22.99 Monthly payment has to be made for this software to use it or you can use it You can also use it by making one time payment yes ok simply click on this as you like You will give me your email ID next etc. have to be entered, details have to be filled up There is a need to fill up the name etc. and You have to pay with your card you have to make online payment and then After that you can use this software you can do it because in my system it The software is already installed so I I’ll simply open it and go in your Start menu and here If I click on the software then it See our software here It has started to open and only a few You can download this software in seconds here It will open and come, see it here Our software is open whenever You will open Illustrator for the first time So its interface will look something like this going to be seen Let me tell you that I am here on the latest I am using the version which is exactly It arrived this year, in fact, just last month If it has come then I will download the same version here I am using if we are here for help go to the menu and I’ll show you my You can see more about Adobe Illustrator here. we will find that here I am using version 28.2 which is 64 bit software is fine so whenever If you open the software here You can see some interface here goes [music] The interface is very simple, some black You get to see this interface in color You can find some menus here for There are some options available for the new file To create as well as to download the app you can click here There is a menu available here There are options here, some will make you happy Presets are added to your new file to create it as if the letter was done post card became common and here You can also add more presets by clicking on More if we can see it then what do we do first? I am going to open a new file here. I’ll take it and after that we’ll go here to those Let’s clear the rest of the options as well if have you done any work before On Illustrator, here you will find Recent The files are also shown at the bottom because Right now I have fresh installed it I have done it for you then I have There is no new file or any The previous file is not showing up [music] so what do we do here I am here I click on new file and you can save the file Shortcut key to open a new file you can use control-n or You can also save the file by going into the File menu. If you can open it then like we are here If you click for new document then Here you will see a box opening Here we will get some presets Groups are visible as if on mobile There is a group, there is a web group, there is a print group Film and Video Group is an Art and There is an illustration group inside each group. There are lots of ready-made presets Just for example if I come on mobile So look here, I have made something for you The presets are visible if we go to View All If you click on it, see more here You can see a lot of presets are like this if we come to print See, you can make something in print also The presets are visible if we go to View If you click on it, you will see it here More presets visible What Presets Basically Are Presets are our predefined file sizes or the size of the files that contain our width their height their color mode in them How much do we have to bleed them here? What should be the orientation? Everything should be known in advance. it remains pre decided just for For example, suppose we click here Click on the letter under print So look at the size of this here The page size is the size of its artboard You can see the size here Similarly, if you accept us for website design If we want to do it then we will come on the web so here Look at the website you will find different You will see the sizes already created. If we are there then we don’t have to make those things We already have them again and again It remains set and we can use it Similarly if you want we can make your custom here We can also create presets for that What do we have to do simply here have to come and give the details of the preset happens here we have to give the name Suppose we give the name of the preset here Diya my new preset is ok and after that we You have to give its width and its height You can see the width and height here now It is available in pixels since we have The unit on the screen is selected by pixels If you want you can also view different units here You can choose, just for example we are here Click on it and you will see it here are points are picas are inches are feet You can use these from millimetre to centimetre If you can get something for printing You would like to create a document such as If it is a visiting card, a flyer or a brochure Then you can use millimetres or centimetres there. you can use it but if you flex Do you want to make a banner or something? Or are you looking to make a board outside? to install our units there They are in feet or feet and inches. people use like if we here If you choose centimeter then you You will see that here the value of width is equal to the height The value of everything is in centimeters here we come here converted into You can take the width as per your wish We can take the desired height, suppose we have here Its width is 11.5 cm and We have gained height Its 88.5 cm so now look here We can see this here in centimeters. it looks like we can take orientation here Whatever we document here What is the orientation of what you are going to create will it be in landscape or portrait This will be the first one you see This is our portrait mode and this is what happens after You can see this is our There is landscape mode, then here we Art Bolt option is given Art what is a board like if we had Kids who are already following me Watch my old coal draw videos if you have already done that then what used to happen there There used to be documents which were pages which We actually do our work at the top of the page Similarly in Illustrator, on the top of the page We do work, we call it art board if yes then we have it in our default document So you get the same art board but you If you want, their values ​​or their numbers we can increase it here if you want art board or three art boards or more We can also buy art boards as many as we want You need an artboard for your document You can page it inside here, we have I have given it three values ​​here. We will get three art boards here when We will also create a new document After that look here you will see bleeding Option is available to bleed what is bleed We have a margin area for any What we use to create the design Just for example, if we If we talk about visiting cards then visiting What happens in the card whenever we If you design a visiting card then design After doing this it gets printed. After that it is cut If finishing is done then cutting is done in finishing If some area of ​​the paper gets cut out The area which is being cut out is our actually design or our metro we bleed here so that it doesn’t cut area we leave bleed area The design is also on the inside and Our design also extends to the outside The designs that we have on the outside are comes out in our cutting and which Our bleed area is on the inside That’s where we put our text area. which should not be cut out and taken out, then it We can give you the bleed area here You have as much as you need here A lock option is coming if you use it If you unlock it, then you can unlock all four of them You can enter different values If we click here, then here See, here we are only looking at the top value. increasing while our bottom and right or The values ​​of the left are not changing but if we pull the lock back here If you click, you will see that our All the values ​​are coming out equal and if we If we increase any one value then our all the values ​​increase equally There will be some or there will be decrees as well, then see We have the option of color mode here that whatever document you are going to create what should be its color mode now color what is mode we have color mode here But there are two, one is RGB and one What happens to CM Y now? What happens to CM Y now? it means CM YK cyan magenta yellow and black it’s basically Our printing purposes are used whenever we are going to make something like this which we will take in print As if it was a visiting card or a flyer Is it a banner or a flex? is it okay or is there any such thing which we have to take for printing If you want then we can change its color mode to CM Y and RGB means red green and blue so whenever we do something like this we’re going to design something that we will not take it for printing but We will use it as a screen like that social media posts were made as if take it if we will use youtube2 because which we also have our screens, whether they are be it of mobile or computer it takes colors it takes RGB colors so we will do it in RGB color only we will design it so that we actually get the color have we put them there for us to see If I get it, okay, I’ll put it here I will just buy the RGB color and then Afterwards look at the raster effect here which is seen in PPI If pixels are per inch then how many do we need If you want to take inches per pixel, we can take it from here let’s say if we’re taking for the screen then we take 72 or if we want to take it for printing So then we would have taken 300 ppi there Okay so now let’s take medium here So we can use 150 ppi As soon as we are here we create If you click then you will see that whatever We have put up the details here Look, our document is based on theirs It will be created and come, see now Since I had selected three artboards So we got three art boards here. These are the red lines that you can see this was our bleed area because I let it bleed a little there That’s why it is outside our page it is coming okay and this is what you need to complete We call it getting an overview Work space, now we will understand further that what is it How to change your work space And what you see here right now We will also learn here that what is this how does it work okay so now since we Stop all these things from here and now you are at the top You can see it wherever you get the file It is edited, you can see all this it is what it is we call it Application bar just above the application bar The software we are using Its icon appears here, we have a home The button is visible and here we have all the menus are coming okay if we If we go towards this on the right side then we will get There is a find or search option here. and after that we will arrange it here The document option is coming and a switch Switch workspace option is coming and After that we will minimize here. Use Maximize and Close here as well you can do it after that you will see it here Our document tab is showing Whatever document we have created His type can be seen here What is the name of the document and how much percentage It is zoomed in and that is our mode Is that RGB or CM or is that yours It is visible here so what are we doing now Let’s select any one of the artboards If I zoom in, then for that we have The shortcut key used is Ctrl + 0 So look, we are on top of one of the art boards We can zoom in here now But we also understand other things like Here you see on the left side The tool bar is visible here where You can find all of our document tools here You will see it on the right side We can see all the panels here These are the panels we will use in the future How will we use each panel? We will also learn those things from everyone What do we do first, its work here Let’s change the space and see the work space what happens like let’s say your own there will be a house there is a room in the house there is a room in the room You arrange things the way you want where should we put the chair and where should we put the table Where to place the sofa Where to place the TV Where do I have to keep these things, you arrange them you do it so that those things are according to your convenience According to you, you will get the same Which Manu should be where, which one? Where should the panel be, which panel do we need Which panel do we need? We don’t need all of these You decide something about your work space As soon as you enter here you can see the work space If you click, you will see the work here A complete list of spaces is available As automation became essential The essential classic has become a painting Printing is done, web is done just for For example we click here on the web then what will your software do from the web Whatever is related, we need to use tools You will find all those tools here he will arrange it and give it to us just like this if we come here and we’re here on printing If you click here you will see Look, your options have changed The panels have been changed and Now you are getting the options that you any such thing is used to design what you want to print I would like to take it with me if you want You can even have your own custom work space can you make it, what can we do to make it You can do it simply click here Well, these are the options you get here. if you don’t find it here So for that you go to the Windows menu and Look here, you get the work space and here also you will get the same Options are now visible since I want to create a new workspace We can click on New Work Space here. we will do it and we have to submit our work Let us assume the name of the space and give it here Provides Simply Fide tuts and let’s do it here ok So this work space of ours has been created here. Now that the things which we used to live in are gone, If you want to arrange it, we can do it, accept it if we come over to the panels here So we don’t have a properties panel here. I want you to tick here, look it has been removed from here it has been removed from here We don’t even need a stroke panel here So we clicked here on stroke Look above, that panel has also been removed from here now what do we need we need here We need a brush panel of color here We need a pathfinder panel here If you want a panel, then whatever panel you need Look, you will see it here Now you can arrange these panels as you wish. You can decide as per your convenience where we are we have to keep it okay so let’s say we Here, close all these panes on here first. okay we went here we did it We closed it here, we closed this as well I closed it all so that I could Can I explain it to you in very basic terms? Here is all this, see, we have closed it here I have done it for you, now look here We have some panels open here. We can arrange these panels if we want You can go from one panel to another you can also link it, you can also add it like Now look, here’s a panel, this is a Our panel is visible here now. Inside this one panel, you will see three The different panels are visible as follows: Transform panel align panels and paths Finder panel if you need to separate these as well So what will you do, simply click here Do it with the mouse and drag it out here If you click here, you will see these panels also. We came here separated, in the same way we separated them too You can see all our panels if we have come in separate forms then the panel If we want to create groups then we simply What to do with the name of your panel You have to click on the top and move it We have to take it to some other panel As soon as you are there inside the group portion of you take it with you, look can you see it here you will find one in blue colour What does it mean that the border is visible? that whatever panel you leave here right now When you release your mouse cursor it will Your panel will be set up here. Look, it is like this, if we have to see the panel You need to attach it at the bottom like us Just click here and at the bottom If you bring it then you will see its bottom I can also see a blue line in it This means that as soon as you see it here If you release it then you can see it here It will come attached at the bottom and will be attached The advantage we get from this is that we can use it as a we can move together see this we have Attach this transform here as well Look what we have done now, look at it when If we move this too then all of our All the panels will move together if we click here Click on it and see it on Collex All of you come here and collect yourself we will go click here expand Everything expands together and comes on top of If we click on close here, we will go If you give it then all of them will be close together Even if they are closed, they will be done in some way like this So we can arrange our panels here now suppose I have this panel here If you want to keep it, look, I’ll come here I’ll keep it like this under this If you want to keep it then I will bring it here I will arrange the panels in this manner You can arrange it according to your needs, ok Suppose if I were to put this here as well So I’ll bring it here and click on it. It would have come here, let me keep it here yes i clicked here here Everything has been arranged as per your convenience from here you can place it inside the panel here But you see three lines As soon as you click here, whatever You have selected the panel from that panel Whatever options you get related to You can see it here inside three lines okay if we have here If you click on it, then see the options here we can get it if we click here So we are getting options here. In this way you can also use these options You can use it inside your panels Everything to use his options We will use it later but right now we are here some are understanding its basics that who where are these things located so that we can Now if it is easy for us to use If we come here, on the left side Look, you can find the toolbars here. Tool bars are where you can Enhance your designs using the tools Now we create these toolbars If we want we can pick them up here too We can put it here if we want. You can place it anywhere else here we can use it like this also if we close it we can By chance if it closes then it will affect us Where can I get it from? Simply contact us You have to go inside your Windows menu and Look here you can find the tool bar and Here you get two tools, the first is basic Second advance if you click on advance If you do then you will see many here I get to see the options, what am I I’ll bring it back here and I can back this up by clicking here If we arrange it here then advance what happens to us many more options are available [music] You can even have a custom toolbar if you want You can make it like what is custom made You can go here to the Windows toolbar And here is the new toolbar we are using Like click here to see us Here it is asking for the name of the new toolbar Look, I have given my name here. I have given the name Ashish and click here diya ok so you see this here you A new toolbar is now visible Anybody here now lets you see the tools I can’t find where to get the tools from now. If you click on these three dots, you will see You should have a list of all these open. The tool from this list will do the trick They are useful to you, you can pick them up and keep them for your you can put it above the tool bar, suppose we Here you have to use a pen tool, we call it a pen. Click on the tool and move it with the mouse what will you do by dragging it here You will try to place it by clicking Do it and by clicking you can bring it here place it just like this if we need more Suppose you have to come here with tools too We need to bring the rectangle tool here You choose it and you can bring it here Drag and drop it like this Here we have to bring the text tool and drag And I dropped it here, see this It’s okay if we need to bring some more tools Let’s assume we need to bring the rotate tool as well We brought it here and dragged and dropped it. I did it so what happened now see this Create your own personal custom tool It has come after doing this where we want to place it If you want to do it, you can keep it there, suppose I want to put it here I want to put it here Let me put it under it or do you want to keep it outside i can keep it there also I might want to place it somewhere else Let’s say I want to place it here. I can put this here as well so that tool You can put it wherever you want to keep it simp you can keep it in place ok If you want it from here you can also do kolappan so now like you Look, here are some tools that You will look down and there will be a small arrow It is visible in some but not even It can be seen as seen here I am not able to see it, not here So if you are able to see it where You can see the arrow here like If you right click with your mouse then You will be able to see the options inside We’ll go and see if we right click here I did it so I used the options inside it If you click here then the other things inside it There are also options, you will get to see them And you will also get to see its shortcut key. will go here you will see another arrow who is getting photos like you click here See what you can do if you want to You can be moved anywhere else Like I have kept it here, I have kept it here many times It happens that we need some tools again and again. We have to use it again and again If you have to go and click on it then for ease so we keep it nearby so we Release it from here in some way If you have taken it, look here it has come If you want, you can also turn it off from here. you can close it here at the top, this You can see the strip, this is called We are looking for Control Toolbar or Control Panel What happens in the control panel is that whatever We have selected the tool related to that You keep seeing options there let’s say we made a choice here rectangle so look here you will see this option We are getting to see it here you have chosen the selection ok so now you These options are available here We have chosen the gradient here. Look. Now you get gradient options here. Now we have chosen the zoom tool Look, you will see this option here. If yes then what is there in control panel The options keep changing whichever tool you choose whatever you do according to your work You can see the options here okay if we talk about this page here If we talk about it then look here, you will get this You are getting this art board You are getting this Later here this is what you will find in the gray area You can see this is our canvas What is in the canvas that we can see in the rest of the elements which is useful for us or we’ll use it later we can put them on our canvas Above the artboard we place things that We want to print whatever you make. Whatever you design, whatever you The same will happen in printing on top of the artboard If you look below you will see Here you can see the status bar. This is where you will get the option for zoom and rotation. whatever the rotation of your artboard is and If you have made as many art boards as you want You may need to switch to one of those artboards. If you want to do that, you can do that too by clicking here can you switch it let me know in seconds We have to go to the artboard, third art If you want to go on board, you can do that here too. you can easily do that, then see here We get selection selection means What happens is that whatever tool we choose here Whatever has been done, its name can be seen here Let’s say we clicked on zoom here. If we did this, we could see the zoom If you choose text here then see We are seeing the type here If you click on the pen here, you will see us You can see the name of the Pen Tool here. Whatever is going on, we have put it on the tool bar here We would have chosen whatever tool we chose You can see his name here If it remains then it will be something like this here can keep things organized [music] it’s ok now that you complete this of mine Can you see the interface, it’s something black Appears in color or gray You can also change this interface if you want. yes, as per your convenience you can do that What to do in Simply Edit menu has to come has to come on preferences And here you get the user interface If you click here you will see You will find brightness options here. Most of all we go here, there is light color like that you look to see something like this Then you will get a little medium here There is light, then you have medium dark here and then there is a dark one so whatever you see here Use whatever suits your eyes You can choose the one you like from here I assume here is medium dark here Let me choose and then see here There is also an option for UI, whichever you want here Click the pay tool or the menu that appears. How big do you want to scale you can decide here You can pay, see the preview here It is visible, look, it is as much as it is If you want you can make it larger Here are some of your user interface options: We are here, as soon as you click on OK If you do, look at whatever interface you had He will change and come in front of you [music] After that we will understand here Consult your data recovery whenever you want Do you do any work on your software? So many times it happens that our software Sudden shutdown or crashes If so, in that case our data will be lost. May our hours of hard work not be accomplished What do you do to prevent it from getting damaged We will use a recovery option here. you do that come here to the edit menu Go to preferences and here you will see You get the option of file handling Like if you click here then here look you might get to see some things Whenever you install new software on your PC If you install it in I will already have all this It remains set, if you want you can change it from here You can do it now from here, see our here Pay automatic save option is on from here If you turn it off, then your file it will not be saved automatically whenever you When you save it, it will be saved and its recovery will be possible Also it will not be created here meaning a backup file you will not be able to turn it on after making it here Do you always have to keep this backup, after how long If it is made then you can choose it from here like look here it is written 2 minutes After every two minutes your file will be Its recovery file is saved there. It will happen and come if you want, whichever path it is You can change that too from here If you click here then whatever you see here You will choose your folder from that folder Save the backup file of the above file. It will keep happening like this if you stay above the cloud you are working you want that your The file should be saved on the cloud as well So you can turn it on from here, so your The file is on the local system as well Also saved on cloud server Its timing will also keep happening, you can check it from here you can choose after how much time he will come Your file will be saved, do it from here, OK So the recovery file of your file is also there It will keep getting saved there so alright Friends, after understanding so much, I we keep moving our things forward And now we will understand some basic tools here. that can make our work easier look what you have here tools The bar is given, now there are many tools here These are all the tools which we will discuss one by one We will understand when we slowly design If you create then whatever is in that design our tools are going to be used or whatever The options are going to be used, we will use them there but there are some basic tools that We should already know about it So now let us understand that what is that basic What are the tools and how do they work? like just for example you You can find some basic shapes here If you see, click here, right click So look, here you will get some basic information When I get the shapes, what do I do? I’ll click on this arrow here. If I click, as soon as we click on this arrow Click here to see these basics you get a fly out of shapes now this You can customize the fly out as per your choice You can place it anywhere like I told you It was already mentioned, now look here Some basic shapes are given here as You’re given a rectangle with a rounded Given Rectangle Given Ellipse Now in what way can we make these and How can we make some basic changes in these let us first understand that thing just for For example, we take a rectangle here. and we took it and look here in this way tried to draw a rectangle shape Whenever you draw a shape, you Look at my bottom right side, you will see that The width and height of the shape can be seen it goes okay its just present what is the size of time and as soon as we When we release this, you will see that here There are some anchor points available and here But you can see something like a round circle as well Now I can see what these things would be and how to use them which you Look here, this one is in square shape you can see these shapes speak handles with the help of these handles we are within our shape, in its size we can make changes like we have assumed If we hold this handle then we can move it to the right We can increase or decrease it on the side just like this You can also increase or decrease it downwards You can also find a left mill on the top side but the ones in the corners If you hold on to these corner handles So you can corner your shape as you like the bottom there or the both right and left can be increased or decreased like if we grabbed the top so then we grabbed the top which is the top portion and which is on our left We have reduced both of these portions from here or you can increase it or decrease it It’s alright if you need to rotate your shape If you want to do this, you can move your mouse cursor As soon as you bring it a little above this handle If yes, you will find rotation handles here. and with the help of this you can shape your you can rotate it easily, what do you need to do You simply have to click here and After clicking you will see this Whatever angle you want to rotate, you also have to specify the angle It is coming in writing and displaying it there You can rotate it at that angle yes if you rotate it at 45° If you want to move then press the shift button on the keyboard You can press the as soon as you click on your keyboard If you press the shift button then the shape you have It starts rotating at 45° above and if you don’t press the shift key So you can use it free handed at any angle. you can rotate it up alright now here Look, you will find a round shape in the middle. The circle is visible, its work is Change the corners of our shape Now as soon as we click here You will notice that your rounded corners which are the corners of your rectangle they are starting to get rounded here See, the more we will see this We will bring our corners inside as many as we can it will come more rounded and at the And look here you will see a red color show what does red do now They cannot be more rounded than this Our corner as soon as you select it with your mouse If you are released from jail then see this The rectal shape was something like this It will come back readymade, okay I will bring it back alright now i will correct it with this much after all this isn’t the only way is to draw our rectangle shape If you want, you can place the rectangle shape here you have selected it so if you want to make your art A single click anywhere on the board Even if you do it, you will have it in this way The popup opens and here you Enter the width and height of your rectangle You can, just for example we have said here I gave it 5/5 and we did it, ok so see this for you A rectangle of 5/5 size comes out near you. It’s alright, I’ll delete it from here. Now let me give you some idea of ​​the corners here. where we talked about rounding By clicking this button we have clicked here The corner was rounded but if someone A situation comes where we have to We don’t have to round the corners together just need to round a corner or we We just need to round two corners how to do it what will you do for that It falls here, click on it and select it you have to do it as soon as you see this here If you click on the point, you will see your picture here Look here, its selection will be made and it will come And now if you drag it inwards If you do it then you will see that the only thing which is yours The shape is just that which is a corner Your round is coming here like this If you want then we clicked here and We pressed the shift button and clicked here as well. if you have done it then what do we have now Now if the points have been selected If we drag this then you can see it here Both these points can be rounded off only. You can use the remaining two points you have I won’t have any effect on them I will delete it like this and it will be like this Look here you can find one What is the Rounded Rectangle Tool? the corners you already have they remain rounded you see this something here This way you get the rest All properties are available same to same To make the size bigger or smaller you can do the same If you will use its rounded And even if you want to increase or decrease you can do it from here rest you can if you here a single and If you click then you will get rounded A popup of the rectangle will also open here. it will come there you can see its width The height and the radius of the corner Tell me here how much you want to pay you can also use a shortcut method what happens is that I will do it first delete like this and after deleting I looked it up again here I drew it like this now after drawing it Look, I just released my mouse cursor. I didn’t release my mouse cursor it is not there and we have suppressed it which is ours The up and down keys on the keyboard I used it first I pressed up As soon as we press the up key here You will see that your corners are more The rounds will start taking place and as soon as If we press the down key then your corners their corner radius is less If it starts to happen then it will be something like this You can also round your corners here You can do whatever you feel like We need to round up, you can do that alright look like this you would have got it here Ellipse Tool You can also create Ellipse Tool It could be something like this, see now what have I done I sifili only my Select the mouse cursor and click on a Lips are made but what do you think that it forms a perfect circle If you look at it, you might feel that it’s a perfect circle but if you look at this If you look at the values ​​of the shape You will see here this value and this The value is not equal, which means that our It is a circle, it is not a perfect circle, then there are many It often happens that we find a perfect circle If we wanted it, we would not have done it this way how can we make it or we Input the exact values ​​here copy the value in both then our it will form a shape or else we can use it what do i do with my shift button yes, I will delete it from here And after deleting it I will post it here I delete it from sorry and after deleting it I we’ve pressed our shift button now if we If you draw a shape here then you will see that In the center of your shape you will find a sorry me I will redo it the way we draw it You will see your shape by holding down shift You can see a line in the center of the there is one do you see two lines okay the red line is towards the middle this red The line is showing you that right now you are You are making a circle, a perfect circle your draw is happening okay if it’s like this Suppose I would leave Schiff’s So now you will see what I have to say here you have to apply it when you absolutely have to do this If you see a line then it means that you This is a perfect circle you are drawing. it’s alright in the same rectangle as well if you would have noticed when I I chose a rectangle, if I shift then you will see that our It’s a rectangle, look it’s perfectly square It will come into shape where you will find a The diagonal line is also visible The diagonal line is displaying to you that The shape you are drawing now is a The perfect square shape is yours to draw Okay, if you want, you can see it here You are also given a polygon that you can choose So we can draw polygons in this way ho only when drawing a polygon if you Subtracting the number of sides it has If you want to increase then you should do that which is your up and down You can increase or decrease it as you like press the up key here So whatever your number of corners is, will increase and as soon as you press the down key If you press it, then your number of corners will be Those will be your decrees okay minimum you you can make it on top of the triangle so that your A triangle will be formed here it’s fine with polygonal, same as yours Look, a star shape is also given here. Through which you can become a star if you If you click here on the star then See, this is how you can become a star here you can use the same up and down keys If you do it then the number of the star which is off There are corners, will they increase or decrease Now whenever you draw a shape So you must have noticed one thing in every shape Here you can see some anchor points How can we get these anchor points now? Let’s work from these anchor points To do this you have to use Direct Selection Tool that you get goes to the top of your toolbar Above the position whose shortcut key is A Look for this button whenever you install any software I only learn about illustrator I am not going to review every single software I am talking to you, if you want to keep it long term You have to carry it and handle it professionally If you want to work on it then you need to use shortcut keys You must remember that the software is fine there is a shortcut what happens if you do this The first thing you get is the confidence that you better on that software you can hold the command as well if you If you go for an interview somewhere then there also You may be asked for a shortcut so that Your skill can be measured by How much work do you know or not So, remember the shortcut thing. It will have many benefits for you So here your direct section tool its shortcut key is a button, if you want So by pressing the A button on your keyboard If you can choose it then see it as soon as We have chosen the Direct Selection Tool here. then you will see that here we have By highlighting the anchor points here I am coming as well, I will see you here These are the points of the rounded corners They are also coming to you highlighted here it’s obvious that if you pay on rounded If you click then your corners will appear Rounds will start happening at your place ok if you click on any one All of them will happen but if you By selecting any one point in particular you’ll round it up like if I were here Let me click and now if I round this If I do, only one corner is our round If it will happen then you can do it this way or Then if you see this anchor point so since right now my diak is here section tool is selected so now if I do this If I click on the anchor point, you will see That this was your anchor point, select it It has come now what can we do with it What can we do now with its help can I change the position of this anchor point I can change something, look at it this way Whenever you change the position of your anchor point If you make changes then those changes will happen in your shape When this starts happening, then look, we should change our shape into this keep me here is the anchor point or this one is the anchor point to me If you want to keep it here or keep it here then do this method what can we do with our shape We can make changes in it whenever you want Clicking on a single anchor point So look, you have an anchor point here. You will get some options related to it starts like you can see here You are getting the option of a handle that if you have chosen it like you are here When you click, whatever your anchor point is its corners here are smooth You start getting corners or rounded corners It will happen as soon as we see here Clicked and saw our corners You see, it starts getting rounded here. I have gone as well as you can see here two Handles are also available with the help of handles We can change the shape of our anchor points. Let me change it a little bit here Let me zoom in okay and now look at it With the help of this anchor point, we Look, what we see in this anchor point of yours We can control its handle from here. With the help of its handle we can change its shape You can control it here with any handle We will increase or decrease that shape of ours it will change just like this if I look at this If I increase or decrease the handle from here then See, this shape of ours will change, right? This is how we use this handle here we can also use this The handle is used mostly Or mostly we will learn this using pen tool So next when we learn the pen tool We also mention this handle in great detail there. I will try to learn and explain it to you Now how does this handle work? but since we are just starting to learn a bit about the basics We are moving ahead with basic understanding so that whatever we want in the future Create designs for us there I don’t want any problems or whatever I make So that you can understand the thing a little earlier We’ve got the basics covered here alright if I hit control 0 here then what will happen with control 0 that whatever Our selected page is our entire page. If it opens and comes here then it will look something like this Look at the way, we are here on top of it as well We can work now, this is our talk Basic Shapes of Basic Shapes Now whenever we draw any basic shape if we make it then it is obvious that we with him we get two atrils whether we Make any shape, put two arils in it As soon as you get your first Atrica Fill Color And the second treebo is its outline color Or look at the stroke color, try to change it for what we do is that whenever you You draw a shape and you select it If yes, then you can see both of those things here. You can get it here as well Color options are available with it Also if you come over here to its a panel Come to the color panel and look here as well You get color options here So you can go from any one of the three places. you can go and work on your colour Just for example I work from here So if I take it, then like we clicked here If you do this then you will see the fill color here You get a lot of options in these If you click on any one of these options So look at your fill color there, it’s like that it will be applied if I click on this here Let me click and see our fill color is like this will go just next to it, see you here The stroke color is available on the stroke It means outline here If we get the outline color then from here we They also want color inside their outline we can put it here suppose we have put it here If you buy a blue color then see what your The outline is here in blue And just next to it, look at you here But you get stroke numbers that your What should be the weight of the stroke What does weight mean, what is its thickness The more you wait for it, the better it should be increase the thickness of your outline or whatever its thickness is it remains the same It will keep increasing, we will take it from here If we take 9 points then look at our The thickness is quite high here It is alright so something like this here Whatever shapes we are in, I am only in this I am not talking about this star, I am also talking about the shape, if you If you want to fill it then you can fill it in that manner you can, or if you want to do that No, we don’t need a fill or an outline If they don’t want it then how will they do it for that You also come here in the same position and Look here, you get the option of nun as soon as you click on none here So whatever is your fill color here or whatever The outline color gets removed from there This is the non-color option which you will get every time You will find a place if you go here Look, here also you have non color option You get the option of non-color here too you get it look this but if you from here are you working if you are working from here or if you are working from here then you have to get a thing has to be noticed now if you look a little Look carefully here and this blue The portion is the box behind you is coming on top of it, coming on top of it what does it mean that right now if you do any of this You will also make changes, even if they are related to colour If yes then all those changes will be made to your outline will be above will not be above Phil because Phil, now look at yours pressed down. If it is there then we need to activate it We’ll have to click on that fee or Then you look here, there is a switch button You can use this as well or the shortcut key As soon as you press X on the keyboard, Even if you press the button, you will see the colors they get switched between each other, see Now look, if I pressed x here, you will What happened was that the fill color was on the top It has come now, what does it mean to come up that we will not make any changes in it right now look we’ll put some color in it or if We will make some other changes in it, color Will remove or apply gradient? Even if we do that, we will do it all in our film I assume it will apply, double click here If I do it, you will see that you have color here The panel will open and we will start from here If you take any one of your colors then see You will get the feel here just like this if Let me click on outline and see outline is activated now if I go here I will double click on it so now what we have here You will get the color for the outline Look, here no one is ours You can choose the outline color from here. and if you like colors then you can If you want to switch then you can simply click here Click and see what your colors will be are they switched here or else Even if you press the X button on your keyboard Your colors would also switch. okay so something like this here we I can also apply colors to it I will do it here, click on delete and delete After that I want to talk about another shape I would love for you to come down here Just go down to our basic shape So look, you will find some tools here too. we go to one of which is shape The shortcut key for the shell tool and shaper tool is shift4 look we got a straight line Or if we had a if we made the box then we got a perfect If you got a square shape then what to do with the shaper tool that we make a rough drawing and The software helps us to get it in a perfect shape He makes it and gives it to me but that is not all the work This means that we can do a lot more work You can, just for example, I am doing it right now Let me delete them and I will go back from here Let me take the shaper tool from here and we’ll look at it here Draw a triangle in this way I did it and came back in the same way we made another corner here the draw was made and the third draw was made Did you come prepared or did we put this thing here If you draw a rectangle this way then Look, this too has come ready, now whenever we If you make shapes like this then you can create different shapes you can draw however you want You can also merge shapes with each other can i do it a little bit First let me zoom it in and after zooming What you have to do next is you have to make a zigzag You have to create a line, see yours here Right now the tool is selected here and now I Here if a zigzag line is drawn in this manner Let me create it here, look at this, something like this then what will your software do with those It will join all the shapes together fine after joining what is that you are in it You can fill the color, go here Get any color of your choice here And you can fill color in it but that’s not all if you think that no I need changes in a particular shape If you want to do it then you can do that also with this tool With the help of this, if you come across this tool then Whatever shapes you create with the help of this tool like you just make a single click here Look, first of all, what is a single click? You will have the option of fill color here. We get what we felt here You will get the fill color option here as well. It is available but if you give it here you click, double click I’m here Look what I do here I click OK then double click what happened that the shape we had It will come after being selected and the shape What does being selected mean that now we can Make separate changes to a particular shape we could say for example we went here We have filled the color here, okay? We wanted to make the shape bigger or smaller, so we Using this method, you can make the shape bigger or smaller ok or should i triangle it If we don’t want it then we can put its shape here You can also convert it into any other shape See, if we follow this method then we can do this work also. We can do this here with the shaper tool So many good things can be done you can do it very easily whenever When you select a tool, look at the tool What happens to you after you are selected? There are some options available at the top such as As I have already discussed with you It is told here, see you one There is also an option for document setup if you click here then this You got all the options when you I had created a new document there, right? But you used to get options but if you want You can make changes here even after creating it Like if you need to change units so you can do that here or else if You have to make some changes in the bleed like that if you look now I’m going to put this here Let me cancel it, I’ll zoom it in a little bit If I take it out, you will see me bleeding here If you can see it in this bleed If you want to make any changes then you can do that from here. Can you agree that I have to bleed here is 0.1 and ok so look at your bleed It was converted to 0.1 cm and came This is the document setup option You get it here as well Also if you go inside the file menu You can also see the document setup here. You get the option of shortcut key I have to remember the control and write it down somewhere You have to create notes of all the shortcuts and you must remember that, okay so If I click here, look here The same is true for your document setup he was there and will come in the open, okay Later, look at the edit art board here as well. Option is coming regarding art board Now if we read further then there we will Will cover up the option that finally edit art How does the board option work properly So this is something of ours, first of all here it is basic We have talked about shapes, now if we talk about here is our zooming option, look at the zooming option This point is a very important point This happens whenever we work on any document If you do it, it is obvious that you should do it again and again you have to zoom or make it smaller This is also a technique, you can use this technique You can also use it and quite a lot You can bring good things in it like that if we talk about zoom then you see The zoom tool is available here, which The shortcut key is z button, you can simply type If you click here then you will see your zoom The tool gets selected here. Now let’s talk about zooming in Illustrator. There are also ways if we click here Click and drag slightly So look, you will get to see some zoom like this will go okay if I do this from right to left If I bring it then you can see the zoom out and if taken from left to right If I go then you will be able to see the zoom in If it goes like this we can zoom in as well We can zoom out or if we zoom in here Just single click on it and hold it down So what will happen if that much portion is zoomed there It will keep happening but it is possible that in your Here I am zooming out from left to right or who is left to right to left this the way I’m zooming in on you What is the reason if it is not working that is if your system has graphic card If you do not install this then this animated zoom app will help you in giving you the best experience. this is what we call animated zoom this won’t work in your case now if it is not working and if you have Even if the card is inserted, how can we use it You can activate it, for that you need to go to is inside the edit menu and here you will find The Preferences option goes to Preferences All our settings inside the option of There are options for our software, right? We have all those options here and Out of all these options, which one we have to click it is there we have to click here As we speak, here on performance You will see your performance by clicking on it Some options are available here Now you will go here and see this option what is visible what is visible Animated zoom already ticked That’s why our zoom work happened there if we remove this zoom it is doing this and let’s do it ok and now I’m going to leave from here I press the z button on my keyboard so that Our zoom will be activated and you will See our left to right here Nothing will zoom in or out now Here’s a selection of what’s happening Now this selection is coming in full swing The more we make, the bigger our portion should be It will be done in some way now, right? If we press the Alt button here then Then it will just start to reverse Now if we click here, look at Our design is zoomed out here If it starts happening then what will happen with the odd button What happens is that we reverse our function We can zoom in if we press the all button if we don’t press then we can zoom in here We can do this and if we press the Alt button we can zoom out from here okay this is You can use the zoom in and zoom out feature If you want, click here above your status bar Come on, you can get it here as well, right? Now look at what we have here at 300 Here we zoom in at above 800. Look, our current design is at 800 But it will zoom out and appear in this way You can also zoom in or out from here. I’m back here I go to preferences above edit I go to perform from here and I Let me turn on animated zoom here. Now since I look here at the graphics card I’m using it so I have it The option is coming open if you have If the graphic card is not installed then this option It will come to you deactivated. you can’t tick okay so now that’s it After the work is done we will do some more things let’s talk about like what we just did We have talked about it, we have learnt the shape how to fill color in it how to outline can apply it how can i apply fill color We learned a little about Zoom okay and here we have some selection Now let’s learn about the techniques What about the selection technique, such as One thing is normal that we clicked here If we do it then ours will get selected or Then we clicked on the deck section here if we do it then what happens to anyone You can select a particular shape it is, look at it this way or we have written it here If you clicked, in this way we can click on any one You can select a single shape And if you right click here You will see group selection here Now you also get the option of group What selection works Let’s delete it and what have we done here did a shape made a shape something like this And we created another one and here we have two more shapes Okay now why did I make so many shapes? Now you can understand the reason behind this I will go and select two of these shapes I pressed both the shift keys Control has been selected, what have you done? These two have become groups See now after grouping this I selected it and I I have selected this as well, now I have taken control I pressed yes again, now what happened again The groups are done, I selected this too then control ji after that we also I selected it, then pressed control, now what happened? In the end all of them come together in groups. went but there was a difference in having all these groups There is a small point that I have made to all of these I haven’t grouped them together but I I grouped the first two then I grouped the third then I took the fourth one then I I took the fifth one this way I made multiples times I have grouped so if we Here, go to the group section and we click here a single click what will you see that we select a particular object We can ungroup inside the group We don’t have to do any You can select the object and Assume you can make any changes above We need to move it here, so we will move it We can move it if we press the control key If you give it a try, we have handles here. because of which we know what we are We can make small and big, we can also make small and big you can also rotate it so if If we want to display the handle then you Simply press the Control button from your keyboard have to press Now there’s one more thing, if we double click here do i clicked here twice then you Look what you saw in two clicks that one two three we have three objects selected have these two come why haven’t they come because what we did was we did it first We made two, then we selected the third one now if we click here again so see you have the number of times I click I will do it as many times as I want There was that group, you can see the group will get it okay so it’s very simple If you click here, you will see an object It will be selected and click twice Both came, make three, the third one also came, four Do it, the fourth one has also come, do it, five, do it, the fifth one also it came in the sequence in which you grouped it you must have done that in that sequence, see yours Groups will start coming here and the group After doing this you can make changes on it. It can be of any size or colour yes or anyone else Atril win tool is also called magic win tool what do we do for what does Let’s delete this and do it with some new one Let us come to the example, for that we come Let’s go to our art board number three Look up, I put a design here It is like an elephant, I want to make it bigger If I do it then use this method to win Magic What does the tool do? What does Magic Win do? which is of the same appearance there are atrbeeks, their job is to choose them Let’s say we clicked on the Magic Bond and we clicked on this color here like click on this color here If you do this then wherever this color has been used Choose that color everywhere in your design. He will do it now see what we have chosen here selection tool and if we move it from here If you do this then see, you can see it right yes look at this you only need that colour which was He has been selected and has come here very soon The best thing is when you do something like this assume that you are working on a design If we wanted to change its color then We don’t have to choose each object one by one. Simply go here to win your magic I take the tool and after taking it I now Here we can choose any color we want. and that color is everywhere at the same time The change will come only on the color not only this it is on top of the outline as well It works on other properties as well How does value work on top of the outline? Here, let us delete it from here and We made a rectangle here. We made lips here We made a star here, made a star, okay what did i do after making all the I selected it and above all I what stroke did you do by applying four point diya what is the stroke of all now The stroke of selected or all It’s common but I didn’t do that. Copied two more objects from this If you want to copy with the help of Alt button If there is any object then you can press the Alt key you can use it ok just copied it and The outline that I had above is I changed it, what did I do I have scored two points, okay, now we are coming Over our magic wind and here we are what do you do, click on this option As soon as we double click on this option above If you do then you will have it here The proper window will open and now Inside the window, you can tell it that How do we have to use it we want to use it for fill do we need this for stroke color Do we need to use it or stroke it Now it is time to use it for weight since The example that I have taken here is I took a stroke to explain it to you For weight, here we are going to consider stroke weight. We will choose and remove the fill color from here. will give okay and as soon as we click here If you do it then you will see that this All four objects are those which stroke yes he has come after getting selected but These are the two objects below, which These are shapes, they did not come selected why because what did he do here which was the same atril, means which was the same for everyone He had a point only from those attributes The object is selected now here His stroke was different so this If we wanted, we would not have come after getting selected You could have done these on the basis of colour also. Look, here we have the colors of both of them I changed that, I went here and I changed it I have given some color here now We chose stroke color and stroke weight we removed the h and now if we put If you click on it then you will be able to see only this Two have been selected because only The stroke color in both of these is It is same in all the other colors but stroke is different If you want in this way then here By applying different things You have to do it for Phil, for the stroke I have to do it for weight I have to do it for opacity what does opacity mean Transparency is fine, we will understand this further about the thing so if that is to be done then that You can also do something from here, alright We can do so much work from here with its help there is one last one look here leso here There is also a tool called Lasso Tool. What does it do? Let me undo this here. Undo it. Let me take this here and go to undo it After that look we have this shape again It will come now why did I bring this shape because this shape is quite it has to be complicated okay so now if If we do it with the selection tool then we will not okay but if we go from here to the Choose the tool and then we will do it If we draw a path in this way, I have written path here It was made in this way, now what will it do? Your shapes which are coming inside this path he will select only those who are there will not select it ok so see this So in this way we can also use the Lasso tool here What does the Lasso tool do? Whatever our shape is covered inside the path it selects only that which is being Pretty much whatever our complexion is They are quite useful that we can use them for any Make a selection of particular shapes here Can so this is how we are here We have learned about the basics that’s how we have to give color, right How to create a shape or how to make a selection How to use the zoom tool It is ok to use it so friends Let’s go a little further and share some of our Now we will learn to create designs The first thing we’re going to make is You are going to create the design of this ribbon How do we create this ribbon design? You can do this inside your software whatever you need to create the ribbon design tools or whatever options we have to cover up We will cover that along with this video We will continue doing this so that when we further use these tools Use it and then you will understand it So don’t skip the video at all. If you want to do it, okay create this design The options we will cover in doing this are: Our options are the rectangle tool which we How to Add Your Anchor Points How are we doing direct selection? How will we use the tool Arrange a How will we use the option Color Here’s how we’ll use the Pickle tool We will use the Pay Group command to paste We will use these fronts to reflect We are going to use the option here we are using vape arc here We will learn about the rotate command here we will learn to use it and at the same time here Also use Gauss Blur and its modes We will learn here and then we will How to lock your designs We also have them here within this design Allright is going to cover so many options We are going to cover this one single design so don’t skip the video at all If you don’t do this then let’s move ahead with our design towards but before making the design I I would like to ask you a question, your question is By using which of these options You can switch the fill and stroke colors between yourself. You all can do it too, please give me your answer Whoever has the correct answer, post it in the comment section I’ll give it a hard time, I hope you will Everybody please answer this because I am going to A while ago I explained to you this was how we can make this work let’s go As we move towards our design, this is what we see You’re done at the top and bottom of your artboard First, we need to make the ribbon it will be rectangle so we will go to our Click on the Rectangle tool and then click here We can draw a rectangle like this okay because look here I have It may be coming with color already filled it is that something like this comes into you If the color doesn’t get filled then what will you do You will simply go to your place and get the colour done above the panel or above the switches and of these You can use any option to get this You have to fill any color, you have to fill red If you want to fill in blue, you can take the color here

    come on alright so I will put red color here If I feel it then see this we have The color has been filled here and it has come here Later I will put its beans down here I’ll make a copy, what will we do about it Here we will press the alt button and Using the shift key, we can move it down here. We have created another copy of this We’ll make it a little bit smaller After doing this I will zoom it a little. I will do it and now we have an anchor here If we need a point then how can we find the anchor point You have to go to the pen tool Right click on the top and you will see it here You can find the Add Anchor Point tool on You can simply click on it and you will Wherever you find the anchor on whichever path I have to add a point now what is the path which You can see the line, this is the path Our place is where you will find an anchor on the path If you want to add a point, you can simply do that Just click once and see what we have The anchor point has been added here, now this anchor Which tool do you use to work on points? we use it here You can use the Direct Selection Tool Click here and you can use it to You can choose the anchor point and After that you can move it to any place you want you can move it there ok What do we do with it after moving it? let us quietly bring it here and do something place it this way okay look here we have it here I have placed the ribbon, if you need a little If it looks thin then it doesn’t matter, we will Let’s widen it a bit, some ways like this and let’s make it a little bit bigger alright aa it looks perfect to me now Your object is coming upwards that we don’t need this If we want the object to be pointing downwards then how can we do it will bring it and select this object go to the menu and look here You get the option to arrange, what is arrange arranges two or more At what position should we place the objects who has to be put on top and who has to be put down We have to keep it to perform this We use the option now see We have a lot of options here it is like bringing us to the front Bringing it to the top forward means one Bring the step up send backward means one Taking a step back or send to back means place it at the bottom so what do we do now If we do this, we will pay it backwards, then this Look what happened to our object below. And we came to this place here Well, here we are using solid color. You can use it here if you want You can also use gradients instead what will we do for that you can tell me here click on gradient okay and here Look at this also you get gradient Panel If you don’t see the panel here If it is, then it doesn’t matter, you can go to Windows and Look here you get the gradient You can activate it from here also use the shortcut key control f9 you can and as soon as you click here You will see the gradient that you have Now what would be the gradient that would be applied Gradient is a combination of two or more colors Whatever we mix, that pattern This is what is formed is called our gradient now If you want to change the colors in these Like look here, black is coming here pe white is coming gradient is there if If you want to change this then what will you do? Click on the point and here you double click as soon as you double click here You will see the colors here The panel will open up and you will see If you want you can choose any color you want here you can get that color here or else If you want you can get the color from here also. Look what we did here is a little We have used red color here. We’ll bring it here in the middle, red okay the color is okay and we have a point here and if we click then what will happen that we one more node here and it will come together ok we click on this node again and We go over to the colors here and we’re going to lighten up. So let’s make it dark here, okay? so right now it looks perfect The color you are seeing here is the same color as ours If you want it on this side too then what can you do for it You can choose it by using the color picker here. There is an option, you choose here and you what should I do, bring it here and click or click here ok as you like You will see this color of yours by clicking here it will also get pasted and come alright now this is it If you want color here too then it’s okay Look here, we have given you colored Eye dropper you simply click on it and If you click here then what happens The color which you applied here with eye dropper With the help of the same colors can be applied here as well I will come back after finishing it, now there is so much work After all this work we are done We have a little more work to do here Can you take the pen tool here? We chose the Pen Tool and after selecting the Pen Tool Later here we’re going to do a shape If we draw then how will we draw the shape I clicked here, we clicked here I did a click here, we clicked here And with one click, we have done it here in this manner By doing this we created a shape here, now in this We have to fill the shape with some dark color. so what will we do, we will go here and Choose a little dark color here like this we will do allright and the object will go back Under Arrange and Send Backward in the menu Look, this has come to our back Let’s select them both with Control G we will control the group from which it is called group Shortcuts to Ctrl+Shift happens to ungroup us if You don’t need to use group and ungroup shortcut keys If you want to do it through option then it doesn’t matter You come here to the Object menu and here also Look, you can see the group and ungroup here. you get the option, okay now you have to do it what is it, have to select it old key what would you do with it with the help of a here You can copy what we have copied there is another way what do you do Select this and you will simply get your tool Come to the bar and click the reflect tool here You have to choose as you are here You will choose reflect tool, see yours here You will get the Pay Reflect tool You have to double click here as soon as you If you double click here, you will see This panel will open and now you will see how If we want to reflect on this then we have done it here We have chosen vertical, okay, and here we have but what did you do to this, click on copy given as soon as you copy it here So what will happen, see a copy of it here It will be ready and now you can simply Select it from here and do it in this way You can move here, see our A ribbon design has already been made It is a very simple design, we have presented it here Let’s keep it on top and copy it down Do ok same design and now we have this The shape which has the center, we have made it Selected it and now we go here Inside the Effects menu here we find goes to the warp option okay and here You get the option of Arc as soon as If you click on the arc here, you will see You can find a lot of styles here okay so here we have looked at the first Style is our choice, arc and how much bend You can choose what you want to do from here The higher the value input here, the The more you do whatever shape you have, the more If you come here after getting a band then here we will give you 15 rupees per buck okay so look at this We got something like this shape Is it right, you could have kept another one here above oh sorry let me shift it up a bit Let me take it and we will look at the ribbon on top here Let’s make another copy, okay, let’s go again. The one in the center is our shape Select it and go to Effects go on the warp go on the arc and now The value we will input here is We’ll input minus 15 if we add minus here If we do it, what will happen from the bottom side it will start coming okay it will Look here, I gave you -1 If you do ok then see where you got this design it’s coming from it’s coming from down below alright now what are we going to do with this a little bit Let’s select this, move it a little bit outside and brings it towards the outside After bringing it, we will put it here a little Let’s rotate it in some way like this Just like this we can delete this shape. let’s give the same we selected it and Here we have doubled up the reflect I clicked and copied it here. okay so look here make a copy of this It has come and we have seen the shape here I brought it and pasted it, okay, this thing is for me We should have done it here as well which we will do a little bit If we forgot then what can we do here Let’s select it a little bit here Let’s rotate it and we have placed it here I locked it and pasted it, okay and this Let us delete this also here. I double clicked on Reflect and then copied it. and now what have we done, we have copied it I brought it here and placed it here ok look at this We have three ribbons created here. have arrived So now after creating so much I want to get a little more creative with this How will I do that with this center We have selected the object here I made a copy of it at the bottom, click All Right Copy After doing that we go to our Where do we find gradient over gradient? We will find you, we clicked here over the gradient and look here at our There are also some pre-made gradients If they are there you can use them too if you want you can do it now what did i do here I have chosen black and white, now I have chosen black After choosing and white we What did you do here in one center and another took the gradient and both the sides These are gradients, we have created them by clicking here We made it white by double clicking on it. And what happened to us in the center, a little Grey colour has come into place, alright Now what did we do with this, we went into effects and after going into effect, what it does first I will remove the outline that is there. Let me give it to you so I selected it Removed the outline and here we go inside our effects menu and here we have You get the option of blur and motion blur So whatever you want us to do here How to apply blur, we can see it here Let’s see it according to our own way, it’s ok It shouldn’t be too much, not too little there shouldn’t be any then ok so look at our This blur has been applied here What Blur does is blur it a little bit. Gives any of our shapes or images We can also apply the above to any You can apply this to the object Look, we have a gradient here. It has come after applying, now this much has happened Later now we have to change its mode which It has a color mode, right? We don’t know its color If you want to change the mode then click on the color mode for that we will have to come for our appearance panel When you click on the Appearance panel above you will do it if you don’t see it here So you can go through the window and get yours We can go to the appearance panel and here we can see its You can change the mode, we have many If there are color modes, you can apply them here If you can then we will go to our opacity up because my gose is blurring me We want to apply opacity on it, so here we have Clicked on opacity and look here We have given modes we simply What will you do, click on dark mode here we will give it to you okay look at this here The mode has been applied in this way we have a mode coming up here and this We will keep it a little higher and then a little lower and We’ll go to our Object menu and select Arrange inside and send backward what will happen with that Look at this, a little bit towards the back you will feel lighter You will get to see a glow if you want it You can apply the same glow to these objects as well I can copy them here as well took it downwards ok you need the same color If you want to apply, select it here You click on the eye dropper and you will see this Click on the shape and see the item from there You will get it after applying here Now you can apply blur to anyone except To do this, go to effects, go to blur, then go to gauss Blur then okay okay see apply here it’s done and you get the simple object arrange send to back and we will put it here Wherever we want to place it, a little bit While doing this you will do the same thing here also You have to apply, repeat the same thing First select this eye dropper take a look click here see here This shape has come into being which is yours The gradient was applied and has arrived And now you just have to apply blur here. okay have to do it and arrange it a little We have to give this thing to you by making it here it’s alright, you should have opened it a little and look here we have all three ribbons, We have come ready, make it a little bigger let’s take this and so that it can be seen clearly and By placing it in the center of the page and a little If we enlarge it then look at these All three ribbons have come here very close I have made a very simple design in an easy way I have shown you the cover up first so that you easy to understand and within this design Whatever tools we’ve covered, whatever we’ve covered I have covered the options, I think you are clear If you have any doubt in your mind, If any question remains then for that You give me what is mine egramswaraj.gov.in I keep posting it you will find things there too okay So this is how we design this ribbon I hope that we can create You might like this design if you have you understood anything yet and you I got some information from my video So please like the video and subscribe the channel Subscribe who have already If you haven’t subscribed, move on On to our next design which is our 3D chocolate design is quite interesting There is a lot of new design in it as well There is something to learn so let’s move on So friends on to your next day design Move on to your next design The next design we are going to make is We will make this 3d chocolate design look You are very interesting and very attractive The design looks very simple the design is and I would like to tell you very I will teach you this thing in interesting I am going to move forward with this On the design side, how is this design Before I learn it, I will tell you my I would like to ask a second question Question number two is which of these are you A Perfect Choice Using Option You can draw square shapes very easily I have asked you a simple question first It has also been told that when we find our shape there I was in class 2 and I told you this there The thing was explained, so everyone gave their answer Do comment me in the comment section Whenever you give your answer then there Please mention the question number so that I can So that we can know that you have answered this which question is that for ok Let’s start this design of ours The options we are going to cover in design Let me tell you that in this design we We will cover up the split into grid About Options About Arrange Options What is Pen Tool in 3D & Material We will learn the basic functionality here Also what is Expanse Appearance And we will also learn how it works We are going to move forward with our design So friends, we have come to our side above the artboard and create this design To do this we will first need to our rectangle so we’ll go to our over the rectangle tool and go here Draw a rectangle like this okay let’s draw this rectangle After that I will give its size here So I’ll give this one a size of 550 pixels by about 240 pixels okay so look we have one here It has come in square shape, okay Here’s a look at some of the colors I’ve already tried I have chosen it carefully so that it takes less time for you Now if I have to pick up a color to explain it After doing this you have to fill it here then I told you about a tool for that. Eye dropper tool The same eye dropper tool we If you use it here then we will take ours To get the eye dropper we simply click here we will do it on our color okay now we what will you do another copy of this here what can we do to copy If you want you can do control c control v yes but if we have to do it with the mouse then We will press the alt button and type something like this drag and drop method here So look what will be our object? Now it will get copied and come inside me I want to fill this color so I will fill this as well Let me feel it, okay, that’s enough now. Now in the chocolate design you saw that There is a lot of chocolate inside that chocolate design all his bytes were coming in the form of If we want to create those bytes then how? We will see there are two ways of doing this, either So you choose the rectangle tool from here. Make a perfect square shape from here okay and the way you make it is After that you can keep it here Give it and copy it using the Alt key And with Control D we can multiple it here. We make copies but what happened in this case that look we are giving you our proper here Please see here I can’t find the size look here it’s going out okay so we How many by how many shapes do we need here We cannot decide that by this method So what do we do for him? I will first delete it from here. For that we will use split into what does it do with the grid option What Split Into Grid does is it do a or objects that have more than one Divides into multiple rows and columns At the same time, if we want, whatever is inside it Our columns are prepared and published every day. which come in the form of our shapes We come as squires to them too You can decide the height and width and The cutter space between them is also We can decide there how to do it well let us first understand the You have to apply that thing on the object We have to choose it first and then After we’re done we’ll go to our object menu Inside here you get the path option and look inside it you get This Split Into Grid you can click on it as soon as you see it here click here you will see you have one here A popup window will open, click here the first thing we are being asked is to cry and the second is what is in the column row that you How many numbers of roses you need you can tell here You can decide what we do here First activate the preview option from here so that whatever work we do If we keep getting the preview then we will post it here Whatever number is in the row, put three more We enter the number of the column Seven is fine, from here if you want, you can see their height You can take the end width differently but since I don’t want the proper square I like the shape Now after that see, it comes here What is a gutter gutter space that you need to place columns in the middle of each square sheep in the middle of how much space do you need how much space do you need Here we call it gutter space You can give as much as you want here Here look at the gutter space in this way You can give it like I have seen here If I have taken five pixels then I am five pixels only I will take it here also so that both are equal Let us get the same space here on this side Let’s do that, okay, and look, we have a In one go we get a perfect square shape The grid has been assembled, what will we do now? Select them all and press Control G let’s group it with okay let’s group it I’ll make it a little smaller after that I am a little light, not much, a little small I will do it now, what do I have to do now This shape has to be aligned to the center of this shape How will I do that for that we will use will do the alignment of the alignment method What does alignment do to you whenever you working with lots of objects If it happens then we will have to give them has to be properly aligned in between so that they look good in their proper way If alignment is possible then we will do it for that How to use the alignment option you will do it with whichever object If you want to align them, select both of them If you want, go to the Object menu and click here But you still get the option to align okay or if you look here above the control bar, you can see here Also above the application bar you will see here Alignment options are available as well Also if you go to the Windows menu then here You will also get a proper alignment panel. You get it as soon as you click here You will see you aligning yourself here I can see the options okay so I If you want to align with this then look here You are given the horizontal center of the center end vertical center Now, before this, there is one small thing that you need to know you have to pay attention here see now if I What will happen if I align this? Was our shape that was kept here The shape has shifted down a little bit, right? This one also slid a little bit and moved up a little bit It moved a bit up and that too a bit down The move has been made but what if we don’t want it We want this shape to be what we have He should remain in his actual position Just this shape below, Go to its position and make proper alignment If it happens, what should we do for it? we need this object that If they have to define it then how do they do it Whenever you select two objects Come to the alignment option and you will see this one Click on the object means this object But do you need any object that you want You have to make something which you have to keep fixed You choose it based on the position, The option of the object which is your key You can find it here as well Look here above the alignment panel. if this is also activated then the time to activate What does it mean that it is about to be activated Whatever alignments you apply later, Aligns to your object okay so we’ll center it here Let’s take it and we’ll center it from here as well. If you take it then look at this, it’s just in the center fit snugly inside the Now we will go here to its left space and its top space both If we have to equalize it then we do it I can zoom out both the sides by pressing the alt key. Makes it equal properly according to his own hmm okay after doing this much the whole Let’s select group with Control-G and after grouping I am I will make two copies of it here. Why am I buying two copies right now? You will know further that I will open this window I’ll close the alignment and my Let me select the object and now we We will make it inside a 3D shape, see the 3D what happens if the kids who use adobe Do you know about softwares? adobe.com Come to the close menu and see you here You can get 3D end material here Click as soon as you click here You will see here with a window open a panel will open up and come now you come to the object here and here Click on Inflate as soon as you are here What will happen if you click on inflate This will create depth in your design Now we will learn how to control this depth All its options are given to you here Okay, so all these options are one way There are ways to experiment with these things that you can do Change it according to your requirement and you You will see the results here alright then look at the preset here so here there are many angles There are different presets so I can choose here I’ll do an isometric top like we Click here to see us in this way You will get to see the design later We will take the material that we have from here you can choose so look here A lot of different materials are given Okay, you can choose that too from here. yes but I don’t want this here But we will only change its roughness What is there in it that I feel a little a bit maybe inside the design so I am here I will give you 0.13 or 14 whichever you want to give. You can see it according to your design You can see it a little here Now after that you come to the lighting You can control the lighting here Can you tell me how your lighting will come How much will it come from which side will all these things come If you can tell us here then we will publish it here I would increase the softness to about 91 its rotation around the point is i I’ll take some here sa approximated around 92 and whose There is a shadow, I want shadow on this then I will Let me apply shadow, see you here to see the shadows too You will get a lot of trouble if you want to control the shadow So you can shadow yourself from here Where is it needed, at what distance and everything You can tell me something here yes, after all this work is done you will get this If you want to render the design then you can do it here Come here and click on render See it as soon as you click on the render The software takes some time Render to add effect to your design to do and you will see this after some time See your design rendered here It will come, see how wonderful it is You can see the effect here Isn’t it exactly like the actual reality Our chocolate looks something like that to you This is what you can see here, all right So now if we select this then Whenever we select this, you will see All the options will be activated here. You can go here and make changes to it but if you think that it is not our When the work is done, reduce the file size to reduce and what is above it Rendering is happening repeatedly, try to reduce it for what we will do go to the object And here click on expand appearance As soon as we click on this we will what will happen to that which is here in 3d The properties that were there will be gone now this age This has become an image which we can say somewhere but you can also pick it up and place it, it’s ok So our work is done Now we’ve picked up another shape from here. basically we’re going to do a little Make some changes to create another effect here This is going to be 3D, we will control this as well If we group them together, we get the objects To inflate we click back Look, you can see the depth here. it will go and now I will see here its depth I reduce it a little bit I got 5 points here and what is the Volume before that i come to the preset above and its isometric top which I applied Let me see you again just like that You will see an effect whose volume is I also turn the volume down to about 50 on K You may see something like this around here The effect of chocolate will be seen after that we go to our material I applied its roughness on top here I take it around 0.12, it’s ok In lighting on top of lighting we find this when the intensity etc. goes away then you From here you can control how much you How much intensity do we have to maintain and how much softness do we have to maintain So I give the softness here at 95 around and what is its rotation is your light Then you can see where you are best looking okay so i will put that on here I take almost around 88 okay over 88 degrees So you should take a look at this thing By experimenting, find out where that thing hits you You are looking best, then simply I’ll go here and click on Shadow. I am here I need shadows and shadows too How much distance do you need from here? would choose I’m alright and now we’re here to render. as soon as you click See, it will take some time again and then See our design afterward here But it comes here perfectly rendered See how lovely the design looks to you Well it looks very cute to me Visually it selects it back we go to the object and back If you click on expand parence then Look, we have two chocolates here. the design has arrived I have this to decorate me a little I’ll make it a little bigger and I’ll place something here okay So this much work has been done so much work has been done later i need one more byte here To cut that, I’m going to draw a rectangle here. I will come here we will return back to each other We will draw a square shape and I will color it. I will change this color, I want it okay and now we can grab the pen from here Look at the tool, what does the Pen tool basically do? The Pen tool creates a path and lets you The pen tool is a very important tool. There is a illustrator inside you, understand it It is because of the pen tool that we know Give more preferences to Illustrator and because of this tool we can do a lot of Designs can be made by creating lots of illustrations. if possible then what shall we do here Simply click here as soon as you You will see a click here You will find a path like yours here you will click next you will click next it will come there as a path if you Drag the mouse after clicking If you do it, you will see that path, that curve It will start to form in some way like this okay and look you have two handles here You are getting that if you work on these handles If you want to do this on your path then you can do that too You can and how will the next path be formed Look, I am showing you a preview of that as well. that wherever you click, that path you will see something that looks like that If we don’t want this path like this and we We want a new one here again If you get the handle, if you get the new path then so what we’re going to do is press Alt on this anchor point If you click on the button, you will see this Your handle has been removed from here And now you can create a new path here could be some way like this okay so look here we go back here So we have created a shape here, now this shape After making this I will try to make both of these I select the shapes properties I come to my panel and here you will find You get some options like I mentioned earlier I am selecting both of them I select it and look here You get the option of pathfinder Look here, you get a minus What does front minus front do above The object punches the object below It gives you the option of clicking here Look, you may see something like this shape Now I will convert this also into 3D We have to do the same thing using the option We will go to the inflation from here Choose the isometric top and then Then I go to material here But I set the roughness to 0.12 When you go around the lighting, the lighting I too will slightly comment here as per my own I will keep it where I feel it is best takes ok the one who has softness is me If I need it, I increase the shadow I’ll also put a shadow here and this much What do we simply do after doing something If you click on render here, you will see This design of ours should also be rendered It will come true, see you perfect here A very beautiful little thing, I want to give you a byte Now I am getting this color I’ll put it aside here lightly sa here i will shift it up okay i need a background here so We’ll click on the rectangle here and here a square something like this draw a rectangular angle now inside it I will first tell you how to do a gradient fill I’ve already figured out how gradients work. Simply click on the gradient You can find the panel gradient here You can click here to see this You get to see colors if you want If you want to change then you can change it okay here I’ll put it a little bit here Now I choose the gradient as per my convenience This object is coming upwards And my designs are below, which If she is hidden then what will we do for her go to object, arrange it and end If you send it back then see this The object will now be placed at the bottom I am done with these colours I will delete this and then delete it I’ll make one here later. Square shape something like this square Draw a rectangle and inside it We do a color fill ok let’s take any light color or I Let me okay it from here and we are here let’s take this color from ok it looks a bit dark so I I also turn on the light for that I go over the colors and give it a little oomph Let’s choose a light color, it looks good now I am getting round its corners Let me do something like this and let’s go Write it above your text and here Are D Let’s make it a little bigger and After enlarging it, I will place it here I will change its colour If you want to make it dark brown then choose that color dark brown i have done it look isn’t it The younger one can do this too hmm d i will write it down chocolate c H O C L A T Chocolate A little bit of it let’s make it bigger and after making it bigger I would like to change its colour A little lighter color, I think it’s right It will be fine, I will group these two. And I need to bring it to the center of it. So we will select both of those objects We will create this text so we will do it here I will click and this becomes my key object And now we’re going to put this here quietly If you can bring it to the center, then bring it to the center for i will click here harijan align center or see it has come to the center If you press it a little bit here then Look, we have a really nice one The design has come ready, select it I will use control ji to make it full I do the screen from control zero and Look at this, this is how you can see this 3D You can create a very simple design it is quite interesting and quite We get realistic effects if I just showed you an example The next step of chocolate is that we can make lots of You are going to create designs in this course Later I will show you many more designs I will make it and show you mine One more thing I would like to say is that I am very Starting his live classes soon So those kids who want to join me Do you want to take personal class from me? If you want to learn something different then tell me you can message me you can contact me on instagram2 You can also read this video to know more. In the description box I have given you a I have also given the form, so the children who Are you interested and want to join my batch? If you want to do it then you should fill up that form you can do it ok so i hope you like this You must have understood something, we are increasing our Next move on to designing and learning to make it so friends i hope that now You can understand whatever we have studied till now Whatever feedback you have will be coming in. Please let me know in the comment section By doing this it helps me in the future when also i will create new videos then your The feedback received will be valued greatly by the fair So let’s move on to our next design on the side where we’re going to learn info Graphics design is something that we are very Let’s create something with our illustrator You can make many designs inside but One of them happens to be infographics now Infographics can take many forms But we will give one example of that in today’s In today’s video you are going to read this In this video, we are going to make The design of infographics is quite simple The design is quite attractive and the design is And we are going to learn a lot of new things from this. Use this design in your topic The topics that we are going to cover from Our topics are show and hide ruler About Polygonal Pathfinder About Distributors in Shape About the Pen Tool About Modes About drop shadows and gradients We will discuss some of these tools regarding colours. If we have already read them then what can we do We will read a little more in detail Okay, we will take the option cover from this. We will also cover those options which you have not covered If you are done then let’s move forward turn to design and create your own designs but before that i want to tell you again I would like to ask you a third question Your question is whether in the options given below Which is one such color mode that You all are not available in Illustrator Give me your answer in the comment section Remember whatever you comment Please mention your question number next Do it so that I can know which one you have what is the answer to the question Let’s move on to our next design and come to the top of your art board So here we come to our artboard. up top and first of all we have to use here There will be some guides to bring the guides for this we use our ruler if this The ruler that you see here if You are not getting the display in your illustrator So for that you simply go to your view menu Come on and go you Rulersongs Showing ok now to get the guides what we do simply click here let’s do it and in this way here can bring you guidelines from above If you want to bring it then you can bring it from above also The meaning of guide lines is something like this or We use guide lines when we You are creating a design and There we have to show something like this or we have to keep it for ourselves so that we Where and what are you going to do? So basically for our guidance we use guides Many times we use If you make a visiting card then visiting What matter do we have in the card and till where? We have guides for that too when we design books If we are doing it then we can also do book design People use gutter space to keep margins use the guides there for okay that’s the way we are here You can now apply the guides whenever you want here If you come with pay guides then you are like Just select this, look here The control bar that you have is Here you will see some options getting activated. now they come to you see here I am getting alignment options so we what to do simply place it horizontally When you click on align center then this Which is our guide, right at our page We will now be placed in the center I’ll show you right now why you’re doing this hmm next we will need the tool here It will look polygonal so we go back to our basics over the shapes and let’s take it here Here we can see the polygonal polygonal with the help of What will you do then? If you create a shape I pressed the shift button on my keyboard what will happen with the shift that this shape of ours It will be created from both sides equally and when Also if you create shapes then I will tell you I told you one thing that whenever you make any shape You are creating and now you click I haven’t left it in that case if you think Do we not have it here which is at its corners If you want to increase or decrease their numbers then What do we use the arrow keys for? As soon as we see here we use the up arrow Press the key and see our number of sides will increase and as soon as we click on the down arrow If we press the key then our number of sides will appear they will start to decrease Alright so look at it this way here Let’s draw a shape on it Now after drawing this shape we will call it what will you do, rotate it a little bit so I pressed the shift key back And we look at it here in this way it has been rotated a little bit from Let’s take the color here so that I can know Let’s see how many degrees it has rotated it’s right here, it’s right now, come to us It is eight sides and we need it here six sides so here we have their numbers let’s reduce it from here also we can see it here See, you get the slider and with its help here you can reduce its sides now Look, we made a shape here. Let us move a little to the side and here we are But we need another polygon and with its help what we’re going to do is draw a triangle here If you want to create it, then see, we have created one here A triangle has been created and we will also we can do it here in the center or else we Alignment option can also be used here you can do it okay let’s make it bigger yes we have centered it back in color let me change it a little bit I can tell the difference between the two all right it’s coming this way now this We have created the polygon by moving it upwards If it has to come then we will go for it and Bring to Front in Arrange in Menu look it will come back up we will put it I selected the center and made it alright I should make it a little bigger A little bit in this and a little bit wider too I will do it and I will center it back alright this looks exactly right now Let me have another look at what I do now if I copy then what to copy We will press the Alt key and select our object okay see we have The copy has come here in colour I’ll change it again a little bit if I know this differently then alright so this Done now we will select both and Now we will go to our properties and Here we find Pathfinder and here Look at it, it is written click to minus Like front we will click here to see what will happen to the object above will punch the object below and If you cut it, we will see something like this It will come in its shape again, now we will see it here But if you create some copies then I will put them here his I pressed Ctrl+D to repeat find the three variables for And no, we only keep five copies. ok i will choose them all and I’ll make it a little bigger Something like this and wider is fine too In this way, I have selected everyone right now. I did a group using control ji After doing this I did this and this which We have a red triangle, I chose both of them I did it and after choosing I went to Pat I went to finder and here you see a You get the option to divide the path The options in Finder are quite simple There are options that I have covered for you here as well. I will give you a small video here I will make it and give it to you so that you can have some Once this becomes clear I will come to the side here I am going here to explain it to you one shape and here again another shape is created so I can explain pathfinder to you I can do a lot of work, look very carefully this is a very useful thing for you Now look at what you can see here so we have two shapes one red one Black and red are on top ok i will make another copy of this So that we can explain it to you by giving examples again and again So I chose both of them and we went It is available here in Windows and here We have a panel of pathfinder and we I have opened it here, okay, now see We have all these options here Which is the first option of unite like as soon as we click what will happen both objects merging together into one will create a single object back to endu I will do the next option is given to us What will happen to the minus front such as I just told you that the one above The object is the one that marks the object below what will he do, he will punch me back I chose the third option, we have it what does intersect mean which is the common portion between the two What is this that you see in the middle? portion this is our intersect portion like What will happen if we click here? The common portion between us will be we’ll find it inside the intersect okay a I selected both of them again and Here you get the exclude Just your opposite from Option Intersect If we click here, see what The portion in the middle will be deleted will go and whatever other shapes we give I will give you an example here I am taking only two shapes but it is not like that You can also create a path using more than two shapes. If you can apply finder then what is that will do it see he deleted the middle one and He has kept the other two shapes back I am doing from end to select again We have the Kia Next here What does Divide Option do? as soon as you click here What did this person do that you can see I also applied the intersect option and I also applied your trim. But let me ungroup this one. Control I ungroup with shift and see this This has also been trimmed and yours in the middle The portion that was there was an intersect portion as well you are getting the right ending back and the next one that we have here There is a trim option like here What will happen to us if we click? the object is it will be trimmed look something like this right next to our The merge option is given here like When you click, you will see this getting merged Here I go, let me ungroup this control See this from Shiftz Now see what happened in the merge option what does that do is our overlap part which We have a hidden part, which is the hidden part? Look at your black portion If we have a hidden portion then what does the disease do? As soon as you click on merge here So this was your hidden portion here See if there is any outline here it will be cut off If it were there then we would have got it by cutting it here too The caste is fine and it makes a path for us If I had given it, then in this way we would have merged here You can use this option, see this I am teaching you all these options so I’m teaching you pretty quickly but If you want, you can watch individual videos of all of them are also available on my channel Simply go to the playlist and click there You will get a complete guide to Adobe Illustrator The playlist is available there, I told you Every option that could be there I have mentioned here I may have left it out or I may have given you too much detail you might not have explained it to me because I am here I am covering up the designs there All those options are explained in great detail so the kids who have covered up with a lot of detail If you want to see every part from that then you can follow my playlist alright and look here you get it An option to crop, as soon as you crop So what will that person in between do? He will crop the portion and give it to him I’m going to undo this ok Selected both and now see here But I am showing the outline as it is here What will happen if you click on the outline We just get the outline here. It will come, see it, you will see it here only If the outline is visible then what does it do? it provides you with an outline any object Okay, so these were some of our basic options. The Pathfinder comes back with its own So this was our design on the design now. what do we need here what do we need Whatever this portion of black is, portion in this we only see triangle It should come in a cut so how will we do it Select all and see here You have been given the option to divide as you like If you click here then this whole group will be here it is coming in you ungroup it with control shift and see what happens Look, all these shapes were different You will get it and the red part too we’re deleting from y okay and this See, you will find it different You will get everything separately here hey larat this is how we keep it here I selected them all and now We fill the color here but color What should I do before filling it? I’ll pick up a copy of these here Come on and now we’re going to use the pen here. As soon as we take the pen tool of the tool here So here we’ll draw a path, okay? This is how I drew a path here and after drawing the path I What do I do first? Group all of these together okay so this is different and the rest All are in one group, we have selected both Let’s do it and here we see an option The divide option is given here If you click OK then what will happen to it I’ll ungroup from here. So look at this now it has come to us separately I will delete it and that portion The black one is ours, we would have done this as well delete and select all from here I’ll group it now with Control-G. what is this group, it’s time to group Later I am going to change its color a little bit. Now I would like to color it a little grey. I’m keeping it okay and in grey color After placing this I will also post it here I will place it Alright, so much of our work is done Now it is the turn to fill color in all these In objects, I want to fill color in them I would like to see some colors here Take out the samples if you have them If there are no samples then you can use it as per your choice Go to the color panel and select the colors accordingly. You can remove it and apply any color you want So I use the shortcut here key i pressed here eye dropper and look here I have filled the color I did it again and pressed it for shape and We chose our second shape and this is how i have arranged all the shapes here We selected one by one and we got all the filled the colour So see, I filled color in all the shapes. It’s done, now after filling the color it looks like this This is the shape that we have created here no what do we do with this we select it and after selecting it we will Let’s make the color white. Okay, now let’s make it white. After that I get its opacity which is There is transparency above, that needs to be applied So from where will we apply it, simply you go here see you have the command here you can find it here over the bar You can simply select the opacity option here. If you reduce the opacity then I will I will make its opacity around 4344 I can see some effect like this here. It will be fine now after all this work is done I need to go ahead and do some more here If you want to apply then now we can choose here will do my pen tool okay so I’ve done this So I took the pen tool and we’re going to draw a path here. we will do it in this way, see i have shown the path I am doing Dr see this i did this path now inside this I fill in the color, so I put it here I have filled the same color and created the path After that I take it to the back side I want to go so I click on the object I will arrange it and send it back to you We have got something like this here Its color will go a little more I wanted to make it dark so I used black We have done the rehearsal, now again we are its copy will do it up here But after copying it I am here I will take the die section tool and what are its corners It is with their help that I can place them here I will do this, I will place it here as well, okay and again I will copy it here I will copy it, you have to keep it very carefully Here again I will choose the tool here deck selection and again i am here to help you I will apply it here in some way like this Again I have put a copy here There are notes on this, I can select them and post them here but some way like this okay so now my work is done After doing so much work I am here I have filled everything with black color I want to do this a little differently so so what are we gonna do I bought this one I chose, I went to Colors and we did this here I applied some other color, it’s ok So I’ll see here which one I like the color, I have that color here I will apply for this so I have chosen this also I went here and we painted some color here applied okay again we went here and We again applied some color on it okay so we have a pyramid something like this The shape has come into being now, what am I I do, I have selected all of these it is grouped with control g and After grouping, now we can choose here We will use the rectangle tool and create it here a rectangle shape it like this I will move towards After doing so much like this what will we get there are corners, i’ll round them off I want to make it bigger like this and again now I would like to have some copies of this I’ll make it with a little bit of overlap so we We’ll go here and overlap it a little bit Now let’s create a copy here. Again second copy from control D then third Give the fourth copy to everyone and give the fifth copy to everyone I choose together and where is the top I would bring it a little bit closer to it and to hide it we put it here Now look here, I am not hiding because there is a round circle here so no one Never mind, we’ll just go here, this one We will select the circle point and We’ll straighten it out here okay Look, after doing so much, he came back and chose everyone went to object went to arrange and send to back so that it goes backwards isn’t it like this from here and now what are we going to do with all these I will make it a little smaller, I will make it a little lighter I want to make it smaller then Control D here I’ll make it smaller again using D. Then with the help of control D, press it again like this Control D and then Control D again so look Here also we followed the same pattern It’s done, now I need some colours here. Gradient colors to apply If I want then what can we do for that You will simply choose your object go to your gradient and do a single If you click, you will see the color feel here you have come after doing it, now look here and let me know If you are seeing color notes then you can add the color in it If you want to keep it you just click on it and Here you can use an eye dropper or whatever You have to choose the color as per your choice you can get your color from here okay look here i have colored it like this I chose a little bit and I felt that If both have become dark, then it doesn’t matter no we go to colors and one more Let’s light a little bit, it’s fine now This is how I change the colors in all I will do it So look, we have all these colors here. You have filled it up, now we have to go here You have to apply shadow which is called So how do we get the drop shadow? In illustrator, they also understand it so what do I do I put them all here I will select it from this rather I have chosen this The entire object is selected And now we go into the effects and Here we get the styles Option and inside it you get drop Here’s what Shadow does It gives us a shadow by applying it You can find out here what the shadow mode should be. You can choose the color of the shadow from this You can choose whatever you want from here You can choose how much blur should be there inside How much opacity and its x can you tell what should be the y axis and y axis you can also choose so look here i have written something here The way this blur is applied is drop I have applied shadow here Let’s give it okay and look what we have Some such design has come into existence now If I had to write something here, So we could have written that too, what would we have done for that Simply choose your text tool and I would have written 01 here and here I would have changed its weight as per my convenience If you want to make me a little bigger than that Let’s make it bigger and change the colour So you can change the color also, no problem There is no issue with that, here we have it I have come back after writing P.V. I have to write something more. So I can write that there is nothing like that I write it here share this video ok reduce the size I will take it in size 50, I like it But I place myself at this point If you want to write two numbers then press the odd key I did that and made a copy of this, okay? I did this Rotu and here I got something If you want to change it, can you write something? subscribe this channel just like that we are here but point number three point number four point Number f is the same way we can mention it here. you can see it this way, I have pressed alt I made multiple copies by pressing the key You have created it and now you can see your You can write whatever you want as per your wish You can write it here or post it I am doing five I am doing six okay and also in the text whatever chance you get You can easily do the changes you want to make here Can you do something like this or better than this You can also create a complete design for me I have faith in you guys that you can do something with this You can make any design you want good yes you can send me yours You can get the design reviewed simply has to come to my Upload it on the channel there I will do any design you have I will review it, if there are any shortcomings I’ll tell you what else is there it is worth improving ok and i Hope you liked this thing, then move on Onward to our next design which is One Ludo design is going to be quite a lot There is an interesting design and much more to offer You are going to learn something new, especially if You want to learn about distributor So much about align panel in linux You are going to learn in that part It is quite interesting, I am also quite I’m excited to make that thing So let’s move ahead to teach people moving on to our next part so friends this We are going to make this Ludo part The design is quite attractive and very You will learn something from this design How can you make this design inside? ho as well as in making this design Our options will be used, those are our options also we will cover up in this we will cover those in Topics to be covered in this design Those topics inside are ours, split into About Grids Stroke Fill and Panel About Mask Transparency About the Repeat Option in Path Finder in Windows 10 About the Alignment Panel Brush Option so these are all the things we cover about and with the help of these we will make this design will create so let’s start and Let’s start designing this Ludo of yours So friends, we have arrived to design this are on top of their art board and play Ludo To create one, first go here we need a rectangle so we’ll go inside your shapes and choose here a rectangle tool and here’s a rectangle we draw it okay inside this we If we fill any one color then we Go here and choose any color of your choice. that we have felt this alright this much After working now because of Ludo what happens inside is that there are lots of different Rose and columns are made up of If it is in square shape then it will work Here we will use it to do this of the split grid option which I am going to tell you about I have already told you earlier, so for that we will go to your Object menu under Path inside and here we find split Into Great option and by going here We divide it into 15 rows and 15 columns we will do it ok so look at what we have Something like this design will be made and will cost this much Later we have to choose the 6 box column here. if you want to do it then six is ​​fine here and si only on the bottom side then doti cha pa 6 This is ours 6 select the whole box I did it, I went to properties and we I have done it here, unite it, okay What will we do after we unite? by selecting the one below 6 times also and click here We will unite the same thing on the left as well same here too Now we are left with the middle portion This is the portion that you can see in me okay so in the meantime we are all here Select all the shapes we have We will do it and we will do it here as well unite alright after all this work All the other shapes we have are us We will delete it, why are we doing this Now you will find out more It will be okay, we have kept only this much left I have deleted everything and now I have put this here The God chose the shape and what did we do with it did it here with control C and control F we copied now why use control f If it happens you guys tell me quickly comment in the section that we control f why you and then we use make it a little smaller After shortening it I took it from here We took the Direct Selection Tool and this is what we did We have given a note on rotation here We selected this and we placed it lightly here. I rotated it sorry I have to do it for everyone So I rotated them all like this Now it is rotating inwards for us If we don’t want this then we have to press the arrow keys Press it, look, we have some rotation like this too it will start coming in form okay look We have some such rotation inside I came by making a cut towards it, then from here we we took the ellipse and we have something here Drawing circles then drawing a circle again copy and another copy below it I selected all and grouped them with Control G. And now we have chosen this shape and We made this and what to make Later we centered it here ok so basically making this an object and after that we are in alignment You can use the option of your Now we have done so much work inside the shape What we’re going to do is fill some color here. If you take it then for that I first took the middle one Select the shapes with your color I went to the page and I chose green color here. I thought this colour looks fine This is its outline, I am keeping it right now Now we will remove this middle shape later we chose this also from here and chose After doing this we lightened it a little Tax okay i took some light here blue I took color in type and whatever it is If there is an outline, I will remove it. I went to the outline here and I went to the outline here. I marked it as none, now it’s left We have a middle shape, what will we do with it? What we did here was take a pen tool I took the Pen tool and with the help of the Pen tool Here we have used the sorry pen tool with the help of we drew a shape here some way like this So after I drew this shape, I This shape and the one below is our shape Selected both and went to properties Here we have the options of Pathfinder Hey I think no one is showing right now Never mind, we will go inside our windows And from here you will turn on your pathfinder okay and here we’re going to use divide The option is fine after dividing Look what happened now, these two groups came together I have selected both of them went to object went to arrange send to backed it up and then what did we do with it I ungrouped it, see what happened now It has become a different shape and it has become a different shape This is what we wanted, now we have to do something We selected the shape and applied the gradient on it. If you want to apply then we will go for it The gradient will appear here above the gradient and we will apply the gradient here and We took some color here secondly, here we take one side A little dark green The color is fine, I will take dark green color I was And we take one side with light green color So we chose this one and we brought it here I took the light green color so look at our Something like this came to me in the same color We have to apply it here as well so we have used this I selected the shape and went to the eye dropper And we clicked here to copy it. I did it and came back but now this is a dark colour I need it on my left side what we did was we chose this and our went to the gradient panel and look here You are given an option to reverse What does gradient do? It connects colors together I flip it, look how it clicked what happened it got flipped now we have seen this whole We chose it and what is its outline is what we have I removed it again so look at this too The outline got removed and this is what is inside There is a shape applied, remove the outline on it as well If you do it then look at all these feet now The outline came back after being removed and we got some Such a shape is visible now, it is coming are below down side what are we going to do We have these shapes only which L These are the shapes, we chose them and here we are but I went to my eye dropper and I have this here also applied green color but in this If the outline is not coming then we are surprised If you need an outline as well, we have provided the outline here I applied it and all the other shapes I had I have selected these as well, okay, and whatever is on these It looks a little colored to me We don’t want it dark, we want it light let’s try to bring some light here I’ll just plead a little here, okay? It’s okay now, our work is done Now after doing all this what do we simply do Let’s make another copy of this shape Control C Control F and apply here Let’s do a gradient but we need black and white gradient so we’ll go here Now you will choose black and white from this We flip the color here and This is the white color after flipping I will make it as per its opacity Zero and this black color has opacity I will do it at 50 ok and after doing this we will Let’s make it a little smaller, sorry the one below I also got a shape, I think someone has disturbed me no one else we will copy this y p and Let’s turn it back around, okay, look at this It has arrived and I will remove its outline Let me do something for you, look at this gradient It is visible above this and the same thing We need it on our left and right side too We will choose this and to choose this Later we will copy it here And if we rotate this, then here we have I clicked on it and rotated it then what did we do with both these objects selected it and made it an object and what did we do to it here it is right We have aligned it from the end bottom, so look It has started to look like a box But the color that is coming in the middle, this I want this color, no one is here Let’s apply some color like this here But we are able to see the color, okay now we What would you do? Delete all the rest of them. which we have achieved by working hard there once I have taken this whole thing now let’s choose it from here group with control g and that’s it We have created copies on this diya larat same thing we picked up here and If you copy it here then look at one like this I came here after doing this but I think this After making the whole thing I felt like This is the shade we have provided here It’s still dark so I’m here for a bit I would like to work harder to get it back I ungrouped it from and this is its black it’s color, I went here and this is its It is black in colour, which was priced at 50, I bought it Tax on 20 here I gave it but something has happened in the outline yet No problem, I will choose this fill And I’ll make it to 20 just like that I selected this one as well and also we did it on 20 okay now look at it it looks very light It is giving ok now control g to group made a copy below and give it below Again we copied it here ok for that and we have copied the same thing here I have also done it, get up and look, now we have this Now it has come in its form that we are here I had applied a gradient, right, that’s what we are going to do We will ungroup this and then pick it up Take a copy here and apply it here as well I will do it but look what happened here has gone down has hidden down for him What will we do to arrange and bring it? We will make it two front, look at us here right now A very slight gradient is visible Now if we want this joke in others too then we Let’s delete the rest and this whole we could have done this as well by grouping from here Are Copy ok look we have created a shape I have already done it and if we have to come here like this if we wanted to make anything, star etc. then we would do that we could have made it we took the star and sorry star we made it here we made this up pressed so that its number of corners it is there and if it increases a little bit then this much After doing this, we filled it here. diya with some light color and it By selecting it, we centered it This has come to the center, this much of work is ours okay it’s ok I would stop here okay so let’s make a stop here so we selected this gradient But when we went to it, we applied a center gradient to it I don’t want the opacity there so I made this one 100 and this one too I made it 100 here and this black one This is the color, we can change it a little here sa here But let’s bring some dark color in green okay in green and let’s put this one on here. Let’s take black or black or darker green whatever looks good something like this and this I turn a little towards this side so that a little bit of The green portion is there, look more at the black Our potion seems less, look we have some It has come in such a shape that now we are talking about it If we copy then what have we done with this Selected the whole group with Ctrl+G and we’ve got this down here Pasted it like this and rotated it Let’s take it, okay, look, it will rotate and come back If it went away then this one also became ours, we just Just what you have to do is to change the color We ungrouped this with Control G Again we just selected this and Here only what do we do with it, color If we change it, we have done it here I took red, okay red and this one which was green, this I will also make the green a little darker red. okay i’ll take it a little bit of dark red alright this is enough, I have to copy the same here also If I wanted it, I selected it and We did it here as well, we just needed to color it All you have to do is flip the color See this color has flipped and here also I want the same color in red only If needed, we delete the rest Because we will make a copy of them here So that we don’t have to work hard again and again And in just one we are the changes If you do then I will take this out as well I’ll take this out as well and I’ll If I raid here then what will we do? I chose this and here we go color me and we gave it a red color on this Larat we want red color here also So I also gave red to the outline removes it and now let’s bring it over here and I’m going to add a little bit of light red color to it here I will give you as I gave above na to this light Okay, okay, and now we have a copy here. and these are the beans that we planted By applying gradient here, What will you do by grouping them together? and after grouping I will make these copies If you do this then Look it’s done, I think this is what happened here This thing should have come here as well Right, now look here, there is color here too. also we want the same in similar matching so We chose this as well and went here that we gave it red The colour is fine, now see if it matches I think red is a little more dreadful If it is gone then let’s give it some light red now It looks okay, okay, so this is what happened It became perfect while selecting the whole we have grouped it again with control g We copied it and did it again I rotated it and we will place it here Let’s do it perfectly equal to this I think after showing the place he hasn’t come yet We can place it absolutely perfect here. Let’s take it okay and if something is missing No one is in alignment, they can do that too yes later we chose it again ungroup with control shift g and let’s change its color back now let me If we want to use blue in place of red then we have put take blue colour took it right and here’s what we do You can take a little bit of dark blue here. Or get some black ones in matching colour Whatever you find appropriate, you can do it here You can take it according to your convenience, whichever suits you I think I’ll buy some dark blue I will take it, okay again we have the same copy here but I will do the same thing that we did before I am repeating the thing again and again, everything is fine so that’s the same thing we have done here select the whole go here and take the blue colour Look at you, the color has come to us I thunk I have this object in the center I am not able to see it, I don’t know why I selected it I grouped the whole thing and now the center I feel like I was not in the center or I will ungroup this one and this one too I will group it and we will do this also If the center is fine now then this is also not in the center I will ungroup this as well and After selecting this also select the center sorry did you make it so that the center is correct now Sometimes it happens that some things are missed If it goes, it doesn’t matter, we will move ahead Now you can improve the same thing here as well I deleted them all and took out one copy He took this out as well, he took everything out And here also we use blue color Something like this and after blueing This was a dark coloured one I picked that up here in gradient type did it and placed it yes but after that I had to put it here outline which has been removed so here we go will go and black outline sorry sorry sorry Sorry I will take black and outline it in black I will apply it, it is coming just fine, it came fine So this is Miss Palace, but no object no we can fix it, first fix it hey kev choose it and here it is and now place this one here as well place it on giving ok It is perfect now, I have selected both We did Control G and again we copied it to Y. we made it again we brought it here and placed it I did this and I painted it a little light blue too. If I want to give it in colour then no one has said that I gave you light and color and here also I If we want to give it a blue color then we will go to gradient and instead of red, will we make it blue? So we chose this and we chose this color If you picked it up and placed it here then this also comes All right again one last copy control Yes, and we will make a copy of this as well, like this We rotated it and we put it here as well If we ungroup then simply we have done this What did we do with the control shifts? I have ungrouped it and what about here too If we change its color then we will will go back to our gradient and Now instead of blue we will use some yellow here or in orange type okay or I’m from here I can also take color so look here we have Yeah, I took some color like this, orange is okay and Here we have selected this note. so what did we do here yellow it I took it okay look we have some It will come in such a color that we have done the same for this also. and here also we have We applied gradient to it If I flip it, look here it looks something like this The flip has come back, now what will we do? We have chosen it and now we are here If we fill the color here then we will go inside our color and here we take a color will take the allright in some way So I also took a yellow color here Now we have to apply the same thing here as well If you want to do it then it doesn’t matter, we will do it too Let’s take it out a little bit here first and We’ll take this out a little bit as well. I ungrouped this and here also We fill here with the same color that we used I filled it here and this is what we have in the middle we remove these as well so that We will place them later and its We have kept a copy of this here which is available here But the outline has been removed so there is no we put an outline here we go we are in the outline and from here we are Just apply a black outline, that’s fine for everyone We selected the group and here we a copy of this And like this we have created a copy below also. All the copies have been created, we have created it here We placed it and we added some color in it If we fill it then we went here and we First So this color fill of ours, we have used this and later we went a little and lit it did something this way then look at our This also comes here as an object Now all the work is done, a little bit is left If the shape was out, I would check it. I am wondering where did he come out from? what will i do i delete them and After deleting them I will try to re-install them again copy of it from I will make it right now it is perfect right now is selected and arranged at the bottom there is some problem somewhere it’s alright, see, get everything arranged and come Now it’s over, our work is done now If we have to do something more in this, then that too we can do that for him what should we do Simply we go to the pen tool and After coming to the pen tool, its middle part is point is we will click here and this With the help of mid point we can create a shape here we will draw it in this way ok so much After this we will call this object Let’s select it and we have added it here If we want to make a copy then what will we do for it Here we will go to the Reflect option and double-click on it. We will click and we will do it here One copy is fine, so what will happen? See its It has come here as a copy You will place it here on your left side sorry on top of the right side and so much after doing that we will go to our i think It doesn’t seem even remotely equal to me right now if yes then what do we do for it here Let’s draw a line between these two We will select the object and put it here Let’s see the center point, what is this center Where is the point? Look, find it here. I go to its center so I Let me move a little bit forward here and this I also move a little forward and this The line was ours, let us delete it And now what we’re going to do is combine these two shapes We will select the group with Control G. We will do whatever shape is below, we want it then you can delete it and after grouping what are we going to do with this go here above the reflect and the horizontal one here will make a copy okay so come and make that copy it is gone and what will we do is rotate it Let’s take it back and ungroup it and We will also ungroup everything and change the color here. Let’s do it, I have to do it here green colour so that’s me from here green colour I’ll take it sorry I’ll go here it came up on the dropper green ok and then We took this shape and in it we took We took our orange yellow color and then we took it took this shape inside it blue color and last I took this shape and inside it red All around me there were some more colors If you want to decorate it a little more, then that’s okay No, let’s make another copy of this control-c control-f and press it lightly I will make it smaller after making it smaller I would place it here at the bottom and I’m going to make its color a little darker I will give it to you, it will come back made like this, okay Sam I will copy it here I will go arrange and send it to the front break I’ll do the front then again another copy and another copy four I copied it to this, I would have done it Am Rotate and I’ll align it here center and this one from the top and we also put this one here If you want to give a dark color then what should we do shall we go here first let’s color it I’ll take this one and then go and buy this one make it a little darker We will give it to him, now it’s

    his turn also rotate them both then set them by doing this make it so that the object looks like this First we align it in the center and then Let’s turn this to the right and then this too We chose here we went to give it blue and after giving the blue we gave it to I also added a little bit of dark blue here ok that much is clear then we chose this here as well rotate this too did i choose both of them and made this We created the object center first and then Aligned it with the bottom. Okay, choose this as well. did and here we have given it first Gave red color and later we chose it So I made it a little dark here Look, we have a design like this here. When it is ready, look we have this one The final design of Lado has come out Even a small thing is left here Here we have to make a P, we have to make one arrow each ok so how do we make it here You will simply go to your circle or ellipse sorry and here is the ellipses we draw here and after drawing the ellipse we will grab your deck selection tool from here and Here we will select this note and delete it. will give and from here choose this note and I will delete it, just see this portion It will remain and what will we do with it here I will swipe what after swiping It will come and its color will be mine let me make it black okay now here’s a We need arrows, so where will we get those arrows from? We will get it for that we go with our brushes So we’ll go to Windows here. We get the brushes, look we have them A whole panel comes full of brushes and If you go to your library here If you go for brushes then look here you will see you get the options for arrows okay so you See which arrow will work best for you It will be ok sorry you could have found these arrows here so look here i would see some arrows that’s what I feel is right I like this The first one looks fine, I tried it first I clicked on that one, it’s ok, everything else is closed let me make it a little smaller And after making it smaller we will put it here Some can place it in this way whether so can you put it here or if I need it If I want to change the color I can do it too If I want to add a little opacity to it So I can also apply opacity like I have set the opacity to y% or this Let’s make it 30 and increase it a little bit ok and i will copy this and rotate it sorry I would have rotated it and I want to get it flipped so flip it what will you do for this here either By right clicking on the top right click Look what will happen here Transformation options will appear and here But we can still reflect on it okay This is simply what we will do here some way like this we will get it flipped and we will do something like this also on this can put what it is in a way The path which is visible in the design, you If you are seeing things like this If we want to copy this then copy it here We took one design and placed it here Then I made another copy of this and rotated it here. and placed it here, and we did another one copied it here and rotated it as well press here So our work is done, okay It was posted here as well, I wanted to post it here If needed, we can rotate it or place it here let’s do it okay here’s a copy of it by rotating y and again one last copy here and this one too by rotating Look at this Larat, he has come as Hamas To give it a final touch of loo I went all over and after grouping I’m going to go over the rectangle and from here go and draw a rectangle shape okay and inside of this here’s a Something like this would fill the grey colour and making a copy of this, control c control f a little bit we’ve got a big shape and made it and inside it also we put a little A light coloured grey colour tax and we sent it send to back and Where did we send this guy below as well? I went to arrange and sent it backward and see this The thing came ready made here, it’s a little small The other person will have to do it for both of them I selected it and I changed the outline to If I remove it from here then look at our If this designing has come to you As we have made a cut here like this If we want a cut here as well or we want a cut here as well can we do all these cuts cuts If we can match them together then I will do this I ungroup the whole design We select this portion of ours and only this one and what do we do about it here If you do a flip then look at this ok now Look, here also the cut is coming in the same way Here also the cut is coming in the same way And it is coming here also like this, isn’t it just this I will also have to group the person and I’m going to go here and flip it over Now look at all my cuts which are on one side I am coming prepared and if we get a cut like this If you need it here too, we can provide it here too We can simply go to our pen tool inside and we are here by going Let’s draw a shape like this will take it ok and I’m going to go over it a little bit here I will give you a color sorry I go here yes, I gave it some color and I Let me lighten this color a little and go send backward again in tax arrangement I do it backwards is it ok or more I have to do it again, so once What should I do? I back it up completely huh I went all the way back look he hid now what should i do now I will do the front word, what will happen with that? It will happen soon, it has come ready like this I would bring the same thing here too yes it is there then look here I brought it So if you want, I think this also seems fine to me and there is nothing to be done about it Let’s make it a little smaller and look at our I pass a final one and save it. Look, we have a final Lodo design ready It has already been done so I hope you like this design It feels good to learn something new You must have come across this design till now If you like the video, please Like the video and share with your friends Share it friend, I think your friend too There will be those who will have to learn these things from you I am working hard for this so please share the video Share and comment if you have any questions So ask me exactly so let’s move on to the next one towards the design that we’re going to make a What is the design of visiting card? how can we design visiting card you are inside your illustrator so let’s go Let’s learn how we can make it so we will make this visiting card The design of the card is quite basic. But you will get to learn a lot from this A visiting card inside design What things should we consider before designing We have to take care of those things too We will discuss and share this visiting card Options to choose from for designing We will use tools for those things We are going to discuss this visiting above also The topics we are going to discuss inside the card Those are our topics, offset path About the Color Panel Drawing About Modes About Gradient About Drop Shadow in Place Image about and mockups now in these Some of the things we have already discussed If it has happened then what we have already discussed we will leave them behind and the things that we We don’t know about those things Let’s talk about cheese so let’s start but before that i want to ask you a question I would like to ask you and I hope that you Everybody will attend this question Because it is a very basic question Your question is about using the Pathfinder tool We can use one of the options given below On which option do you apply enough This is a good question and a very basic one All of you please comment your answer to me In the section, just keep in mind that whatever Before you get your answer, you must ask your question Please mention your number so that I know Who has answered which question correctly and what I did something wrong, let’s start over and make it first of all take your wishing card Whatever we need, we need it here Where do we get a rectangle shape? For that we will simply go to our rectangle above the tool and do a single click here I will give you this now see what he is asking here he is asking us that whatever you What should be the width of the rectangle I want and what should be his height but If you notice one thing here, Look here it is showing PX That means if we are talking about pixels then we The visiting card which needs to be made is made by us make it in mm or centimeter okay so I can do it from here I will cancel it and give my units to you Let’s change it and we’ll go for it inside your document setup option and Look here, you have been given the units You can change the units from here If possible I would have taken it from here in mm hmm okay then okay so what is it now All the units we have are MM I have now come converted into If you make a single click here, you will see Now we are coming here after writing in MM You get yours here Size 90 and whose height we take let’s take 55 alright So look, we have a rectangle here. It has come in shape So let me zoom in on this a little bit Look, now we have a visiting card It has reached the size of but now it is here But look, our work isn’t over yet When we design something that that we have to take to printing You have to print it on the machine later Finishing has to be done in it and after We have to deliver the finishing to the customer so while designing such things we should Take care of margins and bleeds there now what happens is bleed like Look here, this is the size we just took this is our final size which means The visiting card will go into the hands of the customer We have mentioned here what its size would be. It is done but still we have to trim it here And if safe area is not mentioned then See how I take it selected and after selecting we What you will do is go to your Object menu we will go inside and inside the path and here See you get the offset path what the option offset path does is that whatever Our path is either outside that path or within that path By creating another path inside the path so what will we do here Here we will mention those areas which we If you want to take it for cutting purpose then see me I will take 2.5 mm area here. Okay, so look, here we have this showing you the preview now this is what you The outside border is visible, this is our offset is the area of ​​the path which we have written here it has happened, you should have done it ok now what has happened to this path i want to tell you a little I change the color so that all the colors If I knew it differently, I would have taken it hmm from here the red color is fine and the ones in the middle I will take the blue colour from here alright and now we’ll make another copy of this inside so for that I’m back I will select the one in between The path to the blue one is selected I went in and went to Offset Path and now we’re here Those who were getting 2.5 value in positive now If we take it in negative here then we Simply put a minus here, then it’s ok Look, we have one on the inside as well I have come here in the form of a box I will change the color and make it green hmm okay now this green box that you see this is our safe area, safe area what is the meaning of in which we find our contain the text or the design that we want that it should not go into cutting which we want the design to be there whenever we make it So that is our base for our design If you stay a little inside then this is ours The area which is red is ours it will come out in the cutting okay and this is what The area that remains is our final area. If any part is left then here we will do our writing Allright will design the card So what do we do? We take it from here. Here we can use the Pen Tool and the Pen Tool draw a shape So here we have a shape something like this So we have drawn this shape like this did you alright Right now since this red color was selected by me So my butt is coming in the red outline We will change it later for that There is no problem and we are here But we will draw another shape with our pen tool. That’s why we went there and we made notes of the same here. choosing here Put a shape on it and draw what okay look we have two here you have drawn the shape and now this line is if the proper one is not coming above the other then that How will we get to see it? We will go to our in view and click here You can see the outline clearly here It can be seen that these two lines are for that they are not overlapping with each other what can we do we can simply contact any one Direct selection will select the object We will choose the tool and with its help we will go here I will fix this okay now let’s see if So I’m bringing this thing over here what is happening is that whatever is happening with a magnet the thing that gets attached is not here If we get it then what will we do for it will go inside our view and here which Our smart guides are available here We will tick it now what will happen now see what I am doing then as soon as I put this path on this I will bring them together near the path it will get attached automatically okay so our It becomes very easy to work as a designer To place any path above another path so look we have this one here The design is coming ready now here is one If you need more designs then we are here for that But let’s grab the Pen Tool again and we’re right here We will click on it one more time and the same thing we have done here clicked on pay path clicked here And we brought it here and closed it. Just look at this, our path has come exactly right okay now look we have this little one They have come in three shapes and are going back from inside View and from here Preview Mode If you turn it on from here then look at our Come back with the same design again Now let’s talk about something here To fill the colors, we first started with the top I selected the shape and look here We have already prepared some colours. So I will use these here Okay, so I’ve selected one of the shapes here. selected and we’re here to see the gradient If we are going to feel it then we will go to our over the gradient and from here we can see the gradient You will turn it on and simply click here I will do it but just see if I click on it So what will happen if you see a stroke here He will come looking up because right now he is here What is stroke? It is active. We are here to help You will activate it and then click we will do it and look here we have two When colors have arrived, what are we now, the black ones? in the place of We will take this dark red and what is here It is white, instead we can choose this color ok ok now how to bring these colors We will decide from here, we will go Simply above your gradient tool and here Whatever we need, wherever we need it, we get it from there we’ll put it there okay something like this A little more and I’ll place it here I take it ok If you want to fill the same color here as well then We selected this object and we I took the eye dropper here and I clicked on this color and it will be filled in here. It is gone but what do we need which we is there a dark portion or we need it here What will we do with this? Reverse it to Y The Dark went up and the Light came down Its outline is fine and if we want We can remove it but before that we will Filling an object with a color If you want, we will go to our go to this grey panel and from here We will choose a color and we will take it and we would have taken the other colour sorry ya ok So look, we have a color fill here. It’s done now if we want to upgrade the colours a bit If you want to do it down or left or right then we will do it. We can simply tell which thing reaches where If I had to bring it, I would have put it here yes ok something like this This work of ours is done, now all three of them it’s an outline, I’ll remove it I went to the outline and I did a nun here The outline of all three was removed and came to us This shape has formed near me, now this shape What we need is inside this path How will we bring them, we will select all three from here we cut it After that we select this red out box Or should we choose the red rectangle? will do it and look here you have modes Let’s see what the first mode is That is the normal mode in which we are working After that the mode that we get here is It comes in behind mode which means at the back side and it comes in a draw inside mode if we will choose it what does it mean Now whatever we do will be working on it That means all of them will be inside this box it won’t work on top of it, it will work inside of it So now I’ll press control v here. because I had already cut it We pressed control v here, so look. What happened here was this our design Look at that, pasted inside this shape It has arrived just fine, just what we needed, but Now if we need to do any work on this then we what do you do to take it back to normal mode Let’s come and now if we double click here If we do this then we will reach its isolated mode What does it mean to be isolated? will reach inside and to go inside it After that whatever work we have to do, we will do it you can work on top so look here I am If I double click I can see it is isolated I have come to the mode and now we are here You can do the work as per your convenience, If we want to change things here, we you can change it so I am going to put this design here I will bring it till here and we will take this also till here Let’s write it like this, okay, so look at our Now it has come as a design We have to fill color inside this also If you want to fill a background color then so what we will do is we simply go over it We will double click, look here we will will come in and now we will select it Simply take your fill from here and We take the eye dropper from here and here But simply see as soon as we click The background color here is also Come here feeling satisfied Now if I have a different background here And on this side we need a different background If you want we can do that too very easily Simply what we have to do is we go from here Choose the Pen Tool and select the Pen Tool With the help of this we can simply create a path here yes look this way okay make this path and inside the path we have taken whatever color we want If we want to feel something, we can do it, So what do we do here, let’s look at it a little bit Let’s move aside and take it from here From here I used a dropper and this is the color we Let’s fill it here, look in this way ok and after filling it I will I will quietly place it here, now see When I placed it, it came on top of it is coming which we do not need, then so what we’re going to do is go to the object If you go to arrange and do send to back then See what happens next by going behind him It will be placed and come back, there is no problem If I want some gradient I get some If you want to adjust the colours etc then I can do it the way I want Let me lower it a little bit here okay and this color is a little behind and this color is a little sa inside ya l l right so look i come out of it I go control-click outside look at we have this outside here It has come to this side, now we have to put our We can also put logos etc. Look people, I have kept one here just like this if yes then I will place it from here Here but right look we have a logo here He has come but he is hiding behind, so what if no we’ll go to object in arrange We will go and bring it to the front and here but these people came, okay I group it from here Inside this I want a gradient color If I want to feel this then there is no problem no i take it here with an eye dropper And simply if I click here then this Look, this color will be filled and will come now If I write something below etc., the company If there is any name etc. then write that down as well According to me I will simply write it here I give you design sorry capital In I will change the design and font from here so this is it if I want to bold You could have made it a bit bolder are fine and minimize it to this y and place it on this y I do the design and if I want to write something here then write Take the logo So basically this is our point to explain it to you. This means that you have placed the logo here. Tax gave ok Your logo will be placed on this display will go here if you want, whatever is behind You can mention your services I’ll put it here in services Website design logo design Printing Works Bulk SMS Anything You Enter according to your own So the digital marketing tutorial is something like this You can mention the services you want from us If yes, then I have made it smaller and I will light it and change its color from yellow to white takes okay now here if I get a line on this If you want to increase the spacing then you can increase that as well for that we have to go simply to our inside the character and look at you here If you get spacing then that spacing is you You can increase it as much as you want from here you can increase it from okay so look at that I I have kept it here, now see, whatever I I will work on this green border I will do it inside, whatever I have The text is outside this green border Everything should not go inside it If you want then look this is ours, back’s is ready The portion has become ours, now I am like this I’ll copy it okay who is it now who if it’s engaged I can keep borders etc if I want Or else I can make it nun like this, okay It is there but the larat is not visible in this manner and in this I group the whole thing like this Group is done with control G, now here also If we want to do something then what can we do for it Can yes i have selected this in my design and if I flip this over, would i go here for the flip From here I right click I go to Transform and click Reflect I will click then ok and our design will be done. It has come after doing a flip, now I am bringing it here But I’ll keep it, okay, this is our name. If it is written etc. then I will delete it. and what do I do with this logo I can simply choose it from here I will place it here okay if I get it exactly within the border If you want to tie it up then we can do that too simply we will choose both the things and then In we will create this object so that its To the green one and here It’s done from the top, then right here If this is done right, then it is absolutely right it will come here after getting aligned ok After that if I get the QR code here also If you want to apply it then we can apply it as well For this we will use the place command now Look what the place command does place With the help of command we can remove any external thing You can bring it inside Illustrator It can be an image or even a file. can basically do the work of importing this is it I will simply go inside the file and Here you get the place command and We have to bring the QR from here I will bring the code here simply like this Let me click and see this image now If the file is there then look here, what do you see? Look here, I can see a cross in the middle what does this cross mean that it is now The image we have is not an embedded image Now what does embedded image mean See, whenever we do something inside Illustrator If you bring something from outside then basically A link to what happens is maintained Now this image is maintained through the link This is where I got this from bye from the folder I brought it from By going to that folder I can see this image If I delete this then this image will appear from my file will also get deleted, meaning you will see this here If it stops being visible then what will we do for it what do we do simply with this image We simply embed it here Click on Embedded now look here This person who was coming in the form of a cross should be removed what has happened now is that whatever is yours now This is the image, if I go back to my original location I should also delete his name from there should I change its color, should I change anything? Should I make any effect on this file of yours? you are not going to get it so okay I make it smaller and smaller After doing this I will post it here I will place it here ok I have placed a lot of logos on the side too I gave it to you to explain but I will give it to you as well I’ll place it here, a little bit inside towards and this is the space we have left If we write the name etc. here then we What do you do here? Use your text tool Choose and write the name here Suppose I wrote it on Mark If I bowl out Mark Smith then I went to this I bolded the mark I have placed it here Well, I would have done it with white colour. hmm now it is the turn of their designation I copied this to here, same thing and I put the project on y I selected the manager and downloaded it from here Took it in regular font and made it smaller Gave okay and look a little higher these things both It is not aligned yet so I will lightly Look, I’ll bring this thing here as soon as I can It will align itself and come to you properly so here it is so here my turn has come I would have made both of them famous, I would have made them bigger yes, our name is now after the name There are some other things as well, such as If there is a mobile number and an address, then that Let’s assume that we mention this thing also I want to write the address here so we will go here put anything in the tooth Your address here and after that we can put your phone number above here phone number I write it down on plus 00 whatever your number is I will write it on here I take it 3 4 5 6 78 OK Mobile number is your address Done after that email id comes then if @ email.com gives us the website which Website Co is ok dude and look this thing is here now But we need some icon which we can add in front of it can apply some more to make it look better So look at that we have some here I also have some icons on it now this I’ll tell you where you get the icons from. hmm look if you search on g okay You will find many such websites. You can download these icons for free here You can, but we will learn a little later. also that if we don’t have to create these icons ourselves If we have to make it then how will we make it, we will also tell you that further We will discuss it in the videos but right now we I imported them readymade here it is done to make things a little easier If it becomes easy and quick then it will come I got our address and I Bhaiya I placed the address here at the back If it is hiding in the object then it doesn’t matter Gaya arrange gaya bring to front kar gave and this is our paid ad here all I select it and go to Arrange and bring it I do it to the front so that everything is on top Display us Yours is done here your phone number is here Email and yours is here website and this was your address right I align four things evenly so I selected all the icons and we clicked on center here Diya, everything comes aligned in the center It’s time to apply colours We can even color them, no problem no, everyone selected this color, we got this one If we want to do it then we took our eye like this dropper and clicked here so look The color has been filled on this as well, it’s ok no look we have visiting here The basic design of the card is ready hey look at these colors these are from me Let me move it to the side and look at this, this is our The front design came closer, I will group it I do it and it comes to us from the back design okay now you have this design I have made it but you can keep this design like this You do not represent yourself in front of the customer So let us take this a little further in a better way They are taken to the customer as if What happens when someone cooks food in your house? so what happens after cooking the food that whatever you have on top of it They say that things fall apart, like did you put coriander or some other things too The things started to look good to him It is like this that we have here also A visiting card has been made, it looks a little If we take you to a more improved way what shall we make of it shall we make of it Mockup Now where is mockup made Mockup we Make your own f clicked on the Q and we placed it here I named it Front and I posted it on YouTube We exported it, okay, we backed it up like this Selected the one with Export Selection went to and we named it here back and we exported it to y see Both these things have arrived after being exported I save my file as y and I Let me minimize it to this, now So we come to our Photoshop and Here we had our own image of him and who These were front images, we placed both of them here I will do it, I already have a mockup If it is ready then what do we do for it Let’s go to the top of the File menu here and we’ll Let’s open both files from here. So here is my front and here is my back I open the front from here Let me copy it and paste it here. I will do it ok and after pasting it I would slightly equate it to this would adjust it hmm it’s ok So here I am going to put it at par with this [music] I made an adjustment here. Okay. I will click on the tick on this I am okay and just like that my back image was I copy this from and I’ll put it here I will bring it and paste it and this too I’ll make it a little bigger on this, okay? and after enlarging this also I am here But I will click on OK and give it a I saved it and I posted it on here too. I saved it and I saved everything in it I will close it ok I turned them all off, look at our The map we had here is here Look, it has come ready, so something like this way we can send this file to your to the customer in front so that he can see He might feel a little better that after all he is visiting Things that are a presentation of the card it gets a little better see make one There is a different thing and something is presented doing something different is a different thing so whenever we We make the thing and send it to a customer So we make some mockups like this They make them and send them so that they so that they can understand things better alright So I hope you understood this thing that how will the visiting card be what to design and how do we get mockups We are going to create mockups When we discuss further, we will will read no, okay write it down, but I know Let me know how you like this design Let’s move on to our next design and So friends, let’s learn to make it next The design that we are going to make We’re going to create this inside Illustrator Designing a social media post multiple times You Media post design in many sizes too it is made such as okay so let’s start with that but First, I would like to ask you a question The question is which of the following color modes will suit you Which color mode is such that we Who else uses the monitor for? sa color mode is such that we use it in printer There are four options for this One of the four options is correct, whichever you choose I think this is the correct option, you can answer it you can also comment me in the comment box Whenever you submit your answer, please tell me before that Please mention your question number so that If I can find out, let’s get started Design your social media post First of all we need a document here We need to create it, for that we go above the new file and here we have a Document has been uploaded 1000 ba 1000 of pixels and its color mode is RGB here which is absolutely correct I am going to put it here I will simply create it, okay then Look, we have a page or an artboard It has been created and now it has brought us here But whatever you want first, you will want that a rectangle we’ll go for that our over to the rectangle tool and here’s a we will draw a rectangle okay it will be placed on page Let’s do it all right in the center so something look this way we have a It has come in the form of a rectangle and that design The ground that you can see here To make it we can simply choose from here we’ll do a rectangle again and here’s a We will draw a rectangle and from whose corner we’ll round these off okay and this With the help of shift, we can do this in 45 If you rotate it by one degree then you will see this We place one of these here Let’s take a copy in this manner and make a copy and let’s take it this way okay look I have made three copies of this. Let’s select all three and After selecting it, we will add a color to it. Let’s fill it up and we’ll go for it to go inside your colors and here Later any one color from here to something like this this way i think it looks good Let’s do it here, ok, look at this color I have come here with this feeling, now I am surprised that what is in it The outline is also coming, I don’t want that so I’m going to go to the outline here and I’ll make the outline none okay so this Our outline will be removed and come back at the end Then we need one ellipse here, so For that we will draw a circle here. ok let’s place it like this Let’s take the circle to place the circle Later we will also need a border inside it. If it is right for your understanding then it is for that What we do here is simply We have marked the border here for estimation. took it ok And is its position correct or not? If we want to see it then you can go to view menu Come and look at the outline view and see what you have This border which has been made, with this border you You should see where the circle is placed If you see it, you can do it here as per your convenience I can adjust this okay I’ll go back I go to the View menu and from here Let me turn on preview mode now If we want to fill a color inside it, then we will Suppose you fill any one color Let’s take a slightly different color, let’s say I I filled the black waller which outlines it or whatever its stroke is, I am telling it here Now I will do it for you and I will give you one more gift If you copy then use control c control v we copied sorry control c control let’s start with F so that just above this we came after getting our place and then what should we do we will do it a little smaller we will make it more no i will just do something a little small like this okay so now this big circle this was the outline of what we will do now If we want to make it white then first We will put an outline of it here because We’ll make the color here white, okay and I want the outline a little thick so I’ll go on my own stroke and from here we take the five point stroke no this is right give us here inside this If you want an image then how do you get the image? For that go to the File menu and here will go to place option and wherever Your images are there, we we will go to that place we will go here it is on the desktop and here we have images I had kept it somewhere, so here it is ours Images So from here we can import the image Let me import two images like this I will do it, the first image is here, the second image is here Look at both of them, make a cross here. it is coming okay so what will we do We will embed it, we have selected it and clicked on embedded here Then we selected this as well and here we have I clicked on embedded, ok embedded I will tell you first what happens if you do this I have met everyone who knows me quickly Comment and tell us the use of embedded Why do we do this on our image And what will we do with this image here? Let’s keep it a little bigger, let’s make something like this in this way and we’ll do it backwards So for that we are going to go to the object here will go to arrange and send backward send backward now look it happened behind I’ll have to do it one more time so look at this went back and now we get this image in this circle I have to bring it inside that’s why I have taken this image because the thing that you you have to bring it inside something you take things backwards okay so what are we going to do here We will select the option and go here or Simply right click and here See you get the make clipping If you click here on the mask, it will What happened to your image, that clipping? she came wearing a mask Basically the image has arrived, right, after that Look, we have this image here. Let’s make it a little bigger I think so big ok And we can copy another one of this here. will use it further on the outside Now we have to fill color in it inside this whole box so for that we Let’s go in our color and go here Later we choose a color here. okay i think this looks fine ok look Here this color has come to us, which this is a circle this circle is very exact It is coming in dark colour so I am very surprised If you don’t want dark circles then what will happen? We will reduce its opacity If you want we can see the opacity given here We can make the opacity around 50. but okay enter and outline what it is or what Its stroke is thin and thick will do it around 7 point so right now I Looks better than ever before Larat after that whichever company here If you want to put a logo, you can do it Simply what do I do or a person does something like this let me make it okay and here I have written this We took the color and we can put any name here Let’s say we took this diya travel logo is ok change its font If we take it then we changed its fit to y Or if you want to make it a bit bold then go bold as well We can do this by taking this font and what do you do let’s make it bold okay Well you could have made it a little bigger like this let’s place it on this okay both The line spacing between the two is less for me if you want to do something then what will you do for that We’ll go to our properties panel, then Here we can see the properties of the text It is found and we find it here line spacing or the spacing between okay so he should reduce it here If we want to do it then we can do it as much as we need According to this, we keep it at our place 12 Let’s keep a point on it alright a little bit here we will place it towards the front and This is its color, I can change it from here Let me whiten it, look, in this way If you want to put a logo here then I just gave you a reference That brother, you can place your logo here you can okay here is your travel logo come as If we want to write something here then it will be If you are there then you can write it down as well Let’s make the image smaller, so here we have something If you want to write then we can write it on this we wrote it down on Explore The The Word is Ok Explore the Word Sorry R We have to remove it, make it a bit bigger Let’s change the font, we have to change the font here If you want to keep this then we have chosen this font did it and at the same time we will do this one a little I don’t want bold here so this We’ll keep the light here and the line below we bold it okay so that we can What should you focus more on, that thing Here we can see clearly think we’ll place it here and After placing it I see its color change If you want to do it then just do the color of the world I will change that this color is ok and this is the color I will keep it white, so I will use it I would choose white I am a brave man, at least bring this much with us Let’s go a little bit and make it bigger There is a little bit more to do in this so here we go Draw a rectangle on the and the color we want to fill in this rectangle is we will do it and fill the same color but this I don’t want to fill the color, I want to stroke it If I have to take it then I will stroke it I will take it and the stroke is a little thick four point around alright now we have to remove this run from here if we want to do it then what will we do for it For this we will simply go to our pen tool And from here we will choose the anchor point tool and we chose this note or this anchor We selected the point and we clicked here As soon as you click on the cut path Look, this path here is cut Will it come to us now, we don’t have this point here If we want it then what will we do for it If you remove it then look at this here point or this was his note, this was the line Look, that has been removed now, this timeline has come we want this outline to be It can be converted as a shape, any shape If we need to convert the outline into a shape If so, we will understand what we will do for it what will you do for him simply You’ll go to the Object menu and here See, the option of expand is given as per your requirement You will just click on expand and then press OK see what this is gonna be now this is a This is no longer a stroke but yours This shape will behave exactly like an object So after this much we will take it lightly Let’s make it smaller and place it here Along with this, you will find something like this here You will get to see the design alright then ahead Let’s move on and some more down here. if we make it then first of all we will make a We will draw a rectangle shape in this way We’ll give you a pen tool here. And we will create a new note here or We will create a new anchor point and click it After creating, now we simply dik Make changes to its shape using the session tool If we can, then we have done it in this way here changed it ok If I want to make it smaller then do it You can place it wherever you want inside the object I go first now inside the view and from here my smart The guide on is absolutely correct and here also we have I placed it in some way like this Look, this has come to us in a shape I want to change its color so we Its color will be slightly white here It will not be even slightly dark grey It will be very light grey, we have seen its colour here I have chosen it, we are here Rectangle One We’ll take the rectangle tool and here We drew a rectangle, its outline that’s me here sorry its joe corners I’ll round it up a little bit A great gift, a copy of it here but there is another copy of this here it is fine The two copies will be made smaller a little bit. And the middle one is a little bigger The shape is perfect right in its corner we will place this also in its corner in place We will do it, okay, we will select all three let’s do a group after grouping what am i going to do is put it in the center I will align it, it will come after getting aligned Let’s ungroup it from Control again. Shift will ungroup it again ok Then here we take a circle, an ellipse and here’s a through ellipse here’s a Draw a circle, fill it with any color let’s take it so that we can get an idea, then here Look, we filled this color here Let’s place a copy and place it here did that again another copy of this and here we placed this okay so look We have got three things ready References are outlined in all three That’s why I have written all three here The outline is placed We will remove the fine outline later Right now we just made an outline for understanding so that finally we can see that my object From where to where is it alright Having done this much, now we have to move forward and after moving forward here we will If we want to write some text here then we will But let’s write some text, suppose we I took it this is my silver plan I would like to bold this here okay So this is our bold one, this is silver on this one. This is our plan, sorry, its a copy we will do this but this is our gold on this y here But there is some other plan, suppose there is a diamond here Now let us consider its features If we want to write something we can write just then For example I mean I am on this for my reference I am writing on this for Am hotel Booking tourist guide fix it with everyone and make it light I will light it so that my main heading It looks a little different from that and is smaller too we have placed it properly then again Neither did we make a copy here nor something here takes the points ok right passport a visa okay let’s say we have this You have increased your points copy this place It’s done and let’s copy this to here he has got so much trouble if the center What we have to do is that the text is our center if it is there or not then we can do it What will we do for him easily? Simply You will choose your text and your object We will choose it and we have centered it choose this also like this did i center it then again in the last I chose this and centered it too. So that’s it, now we’ll add color inside it Let’s fill it by selecting all three Here inside it we have seen some such color But I put it on, okay, now we have it here too If you want to place images then we go here inside our place option and here we Let’s import some images okay So the first image is this, the second image is this The third image is this, we have put all three of them here we embed it so that our image If something were to happen to her, then There is some difference beyond our main image it shouldn’t fall into place, okay what should we give to it Do let’s put a little bit on the back side and let’s make this a clipping mask, okay? So one image is done, now comes the turn of the second one Make the image a little bigger, back it up as well and by selecting both of them we have put them here Clipping Mask Clipping Mask After that if you feel that we I want to do some work in images, that is up and down If you want to do something then there is no problem you can do that ok like this To the right and last we have this image if so then keep that too Use the shortcut key I did it and this also came back, give this also I’ve done the clipping mask, okay, so all three But our images have been put on all three We have made a plan about it it’s done well here’s what I have If we want a symbol also then we can use the pen tool for that Let’s use it and use the pen tool here But we drew a symbol like this gave ok and its which makes it a little smaller it is light like this it is ok here Let’s copy all three of them did it and got a copy here Come okay n here copy it down and this is it We placed the same copy here as well. it’s working like a bullet it’s alright after all this I will do something about it and in ips we can do that here we can draw a circle on you can control a copy of this c Control F and make it a little bigger Let’s do the image that’s in the power clip Let’s go and release it and it We don’t need the image here so this image we removed it okay just the one that circle That was what we wanted, even the circle got deleted is not it I want this circle here I want it gonna just ok and I will change its color let me do something, this color is ok and we will do this also do the back side I’m alright, let’s change its mode so we have already filled it and After filling, we have to modify it in some way If we want to change then what will we do for that we’ll go to our atible and here We go and see its opacity or any If we want to change the mode then we can change it so we took this overlay and We have to take the color which we want, approximately around 70 ok so look it looks like this it is coming ok you should copy this hey sorry we have to copy this We have copied it here as well and one of the same We have got the copy here Okay, after doing that thing at all three places if after all this it is coming to us Suppose we need to make something else here Someone else wants to make some design for him For this we took the pen tool and with the pen tool we here at I drew some shape like this, okay and that shape We filled the color inside this and let’s push this one back as well on the side so we have control here We used the end button and we used it for this I placed an identical copy on top of it at the back let’s flip it here We went into transformation and here we have When you reflect, you will see that the thing flips It will be done and we have kept it here It was placed in this manner and we also Here But in this way we have kept this thing now You are going out, right, we will fix it right now Don’t be worried about taking it I’ll tell you how to do it right How do we understand the things that are going out now? I want to control it, okay so she’s leaving now let him go there is no problem and We can also get a copy of the same if you want then down here sorry u should have taken a copy of this downwards and here we have the gradient Let’s feel it just a little better to create and we have great color here I felt I needed to buy a color, so I I’ll buy this one and whatever other colour I want that too I’m taking this right now then I I will make it dark go to this Okay, I will make it darker and darker After doing it I need to light it a little You will find that this thing has become darker ahead let’s light it a little bit, okay So look at this, there is something like this color shade for me An all right copy of this is visible Let’s flip it over, I’m here for that Sorry I went to transform reflect on it okay look at this it’s okay

    By Amjad Izhar
    Contact: amjad.izhar@gmail.com
    https://amjadizhar.blog

  • Human Nature and Religion by Allama Javed Ghamdi – Study Notes

    Human Nature and Religion by Allama Javed Ghamdi – Study Notes

    This Islamic theological discussion explores the concept of fitra, or human nature, as the foundation for knowledge and morality. The speakers examine how human nature, with its inherent capacity for both good and evil, influences various fields of study, including social sciences and religion. They argue that religious teachings build upon and refine pre-existing innate moral inclinations. The conversation analyzes how knowledge develops through observation, experience, and the ongoing refinement of human understanding. Ultimately, the speakers posit that religion provides divinely inspired guidance that complements and enhances humanity’s inherent moral compass.

    The Nature of Humanity: A Study Guide

    Quiz

    Instructions: Answer each question in 2-3 sentences.

    1. According to the text, what is the common ground between different philosophies, viewpoints, and religious inclinations?
    2. What is meant by “Fitrat,” according to the speaker, and why is understanding it crucial?
    3. How does the study of nature apply not just to humans but also to other aspects of existence, as described in the source?
    4. What role do sensory experiences and inner feelings play in the acquisition of knowledge?
    5. How does the speaker suggest humans develop moral and intellectual capacities, and how does this differ from the way animals or computers might learn?
    6. How does the source explain the concept of “shame” in connection to the story of Adam and Eve, and what does it reveal about human nature?
    7. According to the text, how do good and evil relate to human nature?
    8. How do individual differences in cultural expression and behavior relate to a universal human nature?
    9. What is the speaker’s perspective on how religious teachings relate to human nature?
    10. Why does the text suggest that prophets and revelations are necessary if humans possess a natural understanding of good and evil?

    Answer Key

    1. The common ground between different philosophies, viewpoints, and religious inclinations is their attempt to relate themselves to the fundamental nature of humanity. Although different in their individual arguments, they all seek to understand and define this shared human nature.
    2. “Fitrat,” as explained in the text, refers to the intrinsic nature of something, especially of a human being, as created by God. Understanding it is crucial because it serves as the basis for all knowledge, and any belief or knowledge is stronger when aligned with it.
    3. The study of nature applies to all things, including animals, objects, and even concepts. Understanding the nature of something involves examining its purpose, special qualities, and the methods used in its creation, encompassing everything from a mobile phone to the universe itself.
    4. Sensory experiences connect us to the external world while inner feelings connect us to our own internal state. This combination of external and internal data forms the basis of our knowledge, interpreted through intellectual processing.
    5. Humans develop moral and intellectual capacities by not just repeating and copying, but through an inherent ability to analyze and debate. Unlike a computer or parrot, a child can internalize basic concepts of good and bad and then independently apply them to new situations.
    6. The feeling of “shame,” in connection to the story of Adam and Eve, arises after the awareness of nakedness, indicating an inherent sense of modesty within human nature. It demonstrates that these feelings are not just externally imposed but are part of their intrinsic understanding of themselves.
    7. Good and evil, according to the text, are both present within human nature, with humanity having the potential for both. The capacity to choose between them is an integral part of what makes us human.
    8. Cultural expressions and behavioral differences are seen as regional variations within a broader universal human nature. The text argues for the existence of core human values that transcend cultural differences and are expressed in the same way everywhere, despite variations in surface expressions.
    9. Religious teachings, as portrayed, are a detailed explanation of the human nature already present in people. Religion provides a system for understanding and acting on these inherent characteristics in a way that aligns with divine guidance.
    10. The text suggests that while humans do possess an inherent understanding of good and evil, divine revelation through prophets is necessary to offer more detailed guidance and training for proper conduct, while also explaining the purpose and ultimate goal of our lives. It is suggested that, without this guidance, humans would have spent centuries to reach the level of understanding present in religious teachings.

    Essay Questions

    1. Discuss the significance of “Fitrat” (nature) as the foundation for all knowledge, and how it shapes our understanding of human behavior and existence. Explore the various levels of knowledge that are mentioned in the text, and analyze how they relate to each other.
    2. Evaluate the claim that human beings possess inherent moral and intellectual capacities. To what extent are these capacities innate, and how are they developed through learning, experience, and societal influences? Support your answer by using examples and observations drawn from the text.
    3. Analyze the relationship between religion and human nature, according to the source material. How does the text argue that religious teachings are rooted in the understanding of our fundamental being? In what way, if at all, is it suggested that religion is an imposition on or a corruption of human nature?
    4. Explore the concept of human tension as presented in the source, and discuss its role in the development of culture and civilization. How does this tension relate to the ongoing struggle between good and evil within human beings? Use the examples of respect for parents to help you explain.
    5. How does the text address the apparent contradiction between the presence of universal human nature and the diversity of human actions and cultures? In your analysis, discuss how various forms of knowledge (e.g., social sciences, religious teachings) are used to understand the relationship between the individual and the collective.

    Glossary

    • Bismillah Rahman Rahim: An Arabic phrase that means, “In the name of God, the Most Gracious, the Most Merciful,” often used to begin something.
    • Fitrat: The innate or inherent nature of something, especially in reference to human nature as created by God.
    • Jamaat: A community or group, often with a shared purpose or identity.
    • Aflak: The heavens or celestial bodies; the study of them.
    • Hadith: Sayings or actions of the Prophet Muhammad, used as a source of guidance in Islam.
    • Jabat: A word the text uses as an alternative way to refer to nature, or fate.
    • Mashe: Refers to the inclinations and tendencies of the human character.
    • Adar, Rasu, and Aqwaaba: Moral inclinations, as listed in the source material.
    • Mutaal is Nagji: A phrase used in the text to describe something as being studied, or seen as a point of discussion.
    • Mushahid: Observation or witnessing; a key component in the acquisition of knowledge, according to the source.
    • Phi (Induction): An intellectual process used to verify or to determine truth by collecting multiple perspectives and/or instances of the same thing.
    • Aqli Istam: Intellectual understanding or reasoning process.
    • Istam Baati: Inner knowledge that emerges from the mind.
    • Ilm Ifran: Insightful or spiritual understanding.
    • Kharij and Mashri: The ideas of what is exterior and interior, how these things influence feelings.
    • Ansar: A term meaning “helper,” and implying the core concepts of human nature as an aid to human life.
    • Taqwa: God-consciousness, piety, or awareness of one’s responsibilities before God.
    • Tabat Kha: A term related to purity, specifically of food and drink.
    • Akhlaq Aaliya: High morals, ethics.
    • Hifzoor: Keeping modesty, especially in reference to covering parts of the body.
    • Surah Ara: A chapter in the Quran.
    • Surah Noor: A chapter in the Quran.

    Human Nature and Divine Guidance

    Okay, here is a detailed briefing document analyzing the provided text:

    Briefing Document: Analysis of “Pasted Text”

    Introduction:

    This document analyzes a conversation, likely a recorded discussion, about the nature of human beings (“Fitrat”) and its relationship to knowledge, morality, religion, and the divine. The speakers explore how human nature, as understood through observation and experience, acts as a foundation for various forms of knowledge and how religion both acknowledges and refines it. The speaker most often referred to is Javed Ahmed Gadi.

    Key Themes and Ideas:

    1. The Universal Significance of Human Nature:
    • The discussion begins by emphasizing that every philosophy, viewpoint, and religious inclination attempts to understand human nature. This is viewed as a universal phenomenon.
    • “Every philosophy, every viewpoint, every religious inclination of the world declares itself to be similar by nature…”
    • Human nature is seen as the basis for all knowledge, because you cannot measure the world without understanding its maker.
    • The fundamental questions about human nature—its origins, purpose, and inherent capacities—are highlighted.
    • The idea that things are created with intention (by humans and by the divine) is used as a springboard for exploring “nature.”
    • The speaker emphasizes that when studying any created thing (animals, objects, humans), the focus is always on understanding its nature. This is described as “Fila ti fatar naha.”
    • “Whatever has been created has been done with some method, some style, some intention, some year.”
    • The study of human beings, including their behavior as individuals and their collective experiences, is essential for self-knowledge.
    1. “Fitrat” as Inherent Design:
    • “Fitrat” is described as the inherent design or principle upon which a thing is created by its creator. It is not merely an abstract concept but a set of rules and regulations inherent to human beings.
    • The Quranic phrase ‘fatar nasa alaha’, is used to emphasize this.
    • To understand something, one must understand the principle of its creation.
    • The importance of studying human nature, with the intention of suggesting how people should act, is emphasized.
    • Knowledge based on human nature has a strong foundation.
    • All forms of knowledge are rooted in this study of nature.
    1. Internal vs. External Knowledge and the Development of Concepts:
    • The discussion explores how knowledge is acquired and how concepts develop, questioning if they are learned externally or discovered internally through study.
    • The “creator” has placed intentions within beings that manifest over time.
    • The human creation of civilization, art, culture, books, etc., are examples of the manifestation of human nature. This would not have been possible by other creatures, such as dogs or cats, who do not have this inherent potential.
    • The human being is born with the capacity to learn, think, and develop morals, which is different from just mimicking behaviors. For example, children learn to apply concepts of good and bad beyond specific examples.
    • Human aesthetic sense is also an inherent quality.
    • Human senses connect with the external world, but also with the internal world of feelings, emotions, and self-awareness.
    • The communication of feeling (e.g. pain) is not just words, but a shared internal human experience.
    • Human intellect allows us to process and understand both internal and external data.
    1. The Role of Experience and Observation:
    • Knowledge develops through a combination of experience (“mushahid”) and observation. Experience and observation can be external, but also verbal (communication).
    • There is always the possibility of mistakes in observation or reflection, however, knowledge progresses through correction of these errors.
    • “Induction” (the testing and widespread application of observations) is necessary to achieve a more objective and accurate understanding of reality. This is an ongoing process.
    • This ongoing process of testing and verifying information is necessary for the expansion of human knowledge.
    • Through intellectual analysis and critical thinking, knowledge reaches a worthy state.
    1. The Internal Struggle of Good and Evil:
    • The concept of an inherent internal struggle within humans—the “courage of good and evil”—is highlighted.
    • This “courage” can lead humans to both good actions and evil actions.
    • Even those committing evil do not like to be the victims of that evil.
    • The community described in the Quran had lost sensitivity to these moral feelings. This does not mean, however, that they no longer possessed them.
    1. The Scope of “Fitrat” and the Foundation of Knowledge:
    • The “bravery” that Allah has given man can improve social, political, and worldly life, and all education has come from this.
    • This “Fitrat” is the base of human’s moral and intellectual existence.
    • All forms of knowledge, including science, social sciences, and the arts, are rooted in this inherent design of human beings.
    1. Religion as an Affirmation and Refinement of “Fitrat”:
    • The speaker asserts that Allah’s religion has been directly inspired into human nature, or Fitrat.
    • The religion received through prophets is a guidance inspired in the nature of humans.
    • Religion, as understood through the prophets, confirms the inherent human desire for worship, purity, and morality.
    • Religious practices (prayer, fasting, charity) are seen as an expression of humanity’s relationship with the divine.
    • The speaker says that religious content is based on four things: one’s relationship with God, purity of the body, correct diet, and high morals. All of these are present in human nature.
    • The religion refines it, that is, it comes and nurtures that seed of the Fitrat.
    • The Quran has revealed that this very human nature we are witnessing is the same one that was present in Adam.
    • Prophets are described not as creating human nature, but as coming to guide and cultivate it.
    • Prophethood is considered a blessing that ensures that a person is not left to go through an endless process of trial and error on their own before facing judgement.
    • It is through prophets that the knowledge of the Fitrat is converted into details.
    1. Adam’s Original Actions and the Revelation of Shame:
    • The story of Adam’s mistake and subsequent repentance in the Garden of Eden is reinterpreted.
    • It is argued that the feeling of shame and modesty was not imposed externally, but was a natural feeling that arose within Adam and Eve after their transgression.
    • The emphasis is on the internal realization of what should be covered, rather than the external order to cover it.
    • The Quran’s description of the incident is framed as an example of the innate nature of humans.
    • The specific commands of the Quran regarding dress code and modesty is not simply an external law, but rather a means of giving further detail to the manifestation of the Fitrat.
    1. The Ongoing Nature of the Discussion:
    • The conversation is presented as an ongoing investigation into the nature of human beings and their place in the world.
    • The speakers do not shy away from discussing the complexity of their ideas, including the origin of evil, the struggle of human will, and the nature of religious authority.

    Quotes of Particular Significance:

    • “Every philosophy, every viewpoint, every religious inclination of the world declares itself to be similar by nature, although all these viewpoints are different from each other and have their own individual… but they want to establish their relation with the nature of man.”
    • “This nature of man is interpreted as a bilam nature. Why is its subject so painful and important? How does this nature come into existence?”
    • “If you look carefully, whatever has been created has been done with some method, some style, some intention, some year.”
    • “The words of the Holy Quran Fila ti fatar naha, this is not related only to humans, the Jamaat also has a nature, the Prophet also has a nature…”
    • “When the creator of this universe created man, then on which principle was he born, ‘alaiha’ Unless you study what rules and regulations were followed, what time and place it happened, you will not have any knowledge about the human being.”
    • “See, the thing is that whenever you observe any creature, the creator of that being has created it with some special intentions and they are clearly present inside that being, they manifest with time.”
    • “The basic trait of a human being…that is, he has good qualities, he has morals, he is an intellectual existence…”
    • ” In fact, it does not take long before the differences between your likings and his likings start surfacing. If this is a thing to this extent, then this knowledge gets absorbed in a person. It has been done as if it is an inspiration within him…”
    • ” I also have senses; whatever goes on inside me, I express that as well. I see, I feel that too. Till today, whatever we have felt in our inner self, when we have expressed them, you have also immediately said that yes, I also feel the same way, then the feeling starts getting transferred to me.”
    • “…the feeling of modesty should be there only if you say pain in this way It is like he would be in a state of trouble, in a state of turmoil and then Allah would tell him to pick up the leaves and cover them. It is a beautiful example, it has not happened so much, the work has come into existence, a complete thing has come into existence.”
    • “My book Mizan must have come to your notice in which I have explained the life and times of my life While describing the outcome of the whole study, he has explained the entire religion, that is, the religion of Allah which has been received through the prophets. Humans also make religion and it is also made by studying the nature of humans.”
    • “Deen Allah This is the guidance of Tala which he first inspired in the nature of man. Now it is clear why I am saying this because this has been said by Allah himself, i.e. I did not say this on my own, it was said by Allah himself.”
    • “…the same nature was explained in detail. We started putting it in.”
    • “…it was necessary that if Allah has to answer me then I have to depart from this world today, Adam al-Salam also had to depart, he may live for 100 years or 1000 years, in any case I have to live and go before God If I have to answer then the education that was given in my nature had to be converted into details in my life for those details because I was about to be a part of the Quran that is why Allah guided me so Allah Ta’ala himself also says that this guidance I have done it, that is, after the ideological guidance, this is my favour.”
    • “Well then the picture is also such that it is thought that there was no one to interrupt nor was there any pure soul in him, brother And the Bhasas had gained an upper hand, well, and this happens many times, but all the people had died, so where did this fall of Lot come from, he was also the same, right?”

    Conclusion:

    The text presents a rich and complex discussion on human nature, its relationship with knowledge and religion, and the ongoing process of self-discovery. The conversation emphasizes that “Fitrat,” the inherent design of humanity, is a basis for knowledge, morality, and religious understanding. It highlights the importance of observation, experience, intellect, and the ongoing tension between good and evil in the human experience. The speaker uses these concepts to reinterpret religious narratives, and presents “Fitrat” as a key to understanding humanity’s relationship with the divine.

    Human Nature and Divine Guidance

    Frequently Asked Questions

    • Why is the study of human nature considered so fundamental across various philosophies and perspectives?
    • The study of human nature is seen as fundamental because it is the basis for understanding all created beings, their purpose, and how they function. Just as everything in the universe, from inanimate objects to animals, is understood by examining its unique characteristics and purpose, understanding human nature provides the foundation for understanding human behavior, societies, and even how humans relate to their Creator. This study allows us to understand how humans function, what motivates them, and how knowledge itself is acquired and shaped.
    • What does the concept of Fitrat (nature) signify, particularly in the Quranic context?
    • In the Quranic context, Fitrat (nature) refers to the inherent disposition with which God created humans. It is not merely a biological or psychological state but encompasses the moral and intellectual potential with which humans are endowed. The Quranic phrase “fatar nasa alaiha” signifies that humans are created with a fundamental nature that includes certain capacities and tendencies, and understanding this nature is crucial to human development and knowledge. It is the blueprint based on which the Creator created humans, and studying this blueprint is essential for acquiring knowledge about humans.
    • How does the concept of ‘nature’ relate to the acquisition of knowledge?

    The understanding of nature, be it of humans, animals, or any other aspect of creation, serves as the base for all knowledge. When studying anything, one examines its properties, how it functions, and its purpose. Knowledge is acquired by understanding these fundamental aspects. If knowledge is aligned with the nature of its subject, it gains a solid foundation; otherwise, it remains an unsubstantiated assertion. Whether it’s a lion or a mobile phone, understanding its nature is the foundation for our understanding of it.

    • Is human nature solely determined by external influences or does an inherent aspect of being exist?
    • While external influences such as language, culture, and education play a role, humans are not mere blank slates. They possess inherent capabilities and traits that emerge as they develop. These include moral inclinations (good/bad), an aesthetic sense (beauty/ugliness), and intellectual ability. External experiences reveal these predispositions but they are not created by it.
    • How do moral, intellectual, and aesthetic faculties manifest in a human being’s development?
    • Moral, intellectual, and aesthetic faculties are not just learned; they emerge naturally as a child develops. For example, the moral sense is innate. A child may begin to discern between good and bad after being taught a few examples and then they can independently apply these concepts to other situations. Similarly, aesthetic sense is apparent when they start showing a preference for beautiful things. The intellectual faculties manifest through a child’s ability to reason, question, and analyze. They are innate but develop with time and experience.
    • How does religious knowledge align with human nature according to the source?
    • Religious guidance, as given by prophets, aligns with human nature because it is divinely inspired and based on the inherent human disposition as created by Allah. The core elements of religion, like the worship of God, seeking purity of body and soul, and striving for high moral character ( akhlaq), resonate with these aspects of human nature. Thus, religious teachings do not contradict human nature but rather build upon and refine it. The nature was given first, and divine guidance came later to clarify it further.
    • What is the role of Taqwa (God-consciousness) and obedience in shaping human behavior, and how does it relate to human nature?
    • Taqwa, in this context, is not seen as something separate from human nature but rather as the ultimate aim of developing the inherent tendencies present in it. Practices like fasting, prayers, and other acts of obedience, are not simply arbitrary laws. They train and refine human nature and ultimately cultivate Taqwa. They are designed to elevate the person to a higher state of purity and moral excellence, making them more capable of realizing their true potential. This is similar to how athletes have to train their bodies to become better in their respective sports.
    • Why was prophethood necessary if humans already possess an inherent understanding of good and evil through their nature?
    • While humans are born with the inherent capacity to recognize right from wrong, prophethood was necessary to provide clear guidance, correct deviations, and offer a detailed framework for moral and spiritual development. It is similar to how a seed has the potential to sprout but needs a gardener to water and nourish it. Prophets help articulate the principles already within human nature and also provide a code of conduct to live up to the true potential of human nature. Prophethood, therefore, is considered a favor and a mercy that offers clarity and completeness to what humans are already predisposed towards. It is not a replacement for human intellect but is given so that human intellect is guided properly towards good.

    Human Nature and Divine Guidance

    Okay, here’s the timeline and cast of characters based on the provided text:

    Timeline of Main Events/Concepts Discussed

    1. Creation of Humanity: The discussion begins with the premise that all viewpoints consider human nature as fundamental. God created humans with specific intentions and qualities (“Fila ti fatar naha”) which define their nature. This nature is not limited to humans alone but applies to all things.
    2. Innate Knowledge/Fitra: Humans are born with an inherent understanding of their nature, which includes moral, intellectual, and aesthetic capabilities. This isn’t purely learned but is an innate potential.
    3. Development of Knowledge: The knowledge of human nature develops through experience and observation, both internal (feelings, sensations) and external (interactions with the world, learning). Knowledge is built upon this foundation, with language, etiquette, and training further shaping it.
    4. The interplay of innate ability and experience: The discussion highlights that humans are born with an ability to learn and improve, that the moral, aesthetic, and intellectual aspects of human beings are present from birth, with the capacity to grow and develop.
    5. Application of knowledge: Humans develop knowledge of the world through observations and experiences. They then build on this base through repeated observation, experimentation, and the induction of facts into established knowledge. This knowledge is not static but is always subject to revision through critical analysis.
    6. Moral Inclinations: Humans possess the potential for both good and evil, with the “courage” to choose between them. This capacity is part of their nature but can be influenced by desires and external factors.
    7. Religious Understanding: Religion is presented as guidance inspired by God within human nature. The core principles of religion include the relationship with God (through worship), bodily purity, and high morals. These principles are argued to be reflected in human nature.
    8. Prophethood: The concept of prophethood is introduced, with the idea that prophets (like Adam) were not ‘blank slates’ but were individuals whose human nature was aligned with the guidance they received from God. The revelation from God built upon the innate nature, like a gardener nurturing a seed.
    9. Adam and Eve’s transgression: The discussion brings up the story of Adam and Eve. When they ate the forbidden fruit, they felt a sense of shame, which is an example of an innate sense of morality. God does not arbitrarily impose morality, but it stems from within human beings, and the role of God and the prophets is to build upon this foundation.
    10. Dress and modesty: The feeling of shame was a manifestation of what was innate to them, thus they covered themselves with leaves. This was a foundational act, on which the future understanding of religious attire was founded.
    11. Ongoing Exploration of Human Nature: The discussion concludes with the recognition that the study of human nature is an ongoing process, requiring continuous analysis, and that human nature is complex, with both positive and negative aspects that can be shaped by individual and social forces.

    Cast of Characters with Bios

    • Mohammad Hasan Ilyas: The host of the program. He frames the discussion and poses questions to the guest. We know he is familiar with Islamic thought and is curious about the relationship between human nature and religious guidance.
    • Javed Ahmed Gadi: The main guest and subject of the interview. He is an intellectual, likely with a strong background in Islamic theology, philosophy, and comparative religion. He discusses the concept of human nature (“fitra”) from a religious perspective, incorporating both Quranic and philosophical arguments. He is shown to be able to articulate complex philosophical and theological points.
    • God (Allah): While not a character in the sense of a human being, God is a central figure in the discourse. God is presented as the creator of human nature, the source of religious guidance, and the ultimate judge. The text describes that God instilled “courage” (potential for both good and evil) in humans, and also reveals to them the details of religious practices.
    • Adam (Sayyedna Adam al-Salam): The first prophet of God and the first human being, Adam is presented as a figure who possessed the same innate human nature as we do. His story is used to demonstrate the link between innate human understanding and religious principles.
    • Prophets: (Mentioned Generally) This refers to a group of people who receive divine guidance and help to develop religious practices and morality. The text implies that all prophets built on the foundations of human nature, given by God.
    • Allama Iqbal: A poet, quoted to indicate that some things are universal to humanity, and others particular to certain contexts.

    Let me know if you have any other questions about this.

    Human Nature: Innate Qualities, Moral Inclination, and Knowledge Acquisition

    Human nature is a central concept in various philosophies and viewpoints, with each attempting to relate it to their own perspective [1]. The study of human nature is considered important and complex, with questions arising about its origin, its basis in individual abilities, and whether it is fundamentally innate or learned [1].

    Key aspects of human nature, according to the sources, include:

    • Innate Qualities: Human beings are created with specific intentions and qualities [2]. These inherent traits are not unique to humans, but also exist in other creatures [2, 3]. The nature of a thing is seen as a collection of its special qualities when viewed as a group [4].
    • Moral Inclination: Humans possess inherent moral inclinations including good qualities, morals, and intellectual capabilities [1, 3]. These traits begin to appear in childhood and develop over time [3].
    • Knowledge Acquisition: Humans have an inherent ability to learn, including language [2, 3]. Knowledge is gained through observation, experience, and reflection on both the external world and internal feelings [5, 6]. The knowledge that humans acquire is built upon a foundation of understanding the nature of things [7].
    • Fitra: The term “Fitra,” used in the Quran, refers to the principle upon which the creator made humans. It relates to understanding the rules, regulations, and circumstances under which a human being is born [4, 7].
    • Good and Evil: Human nature has the capacity for both good and evil, and humans have the power to choose between them [8].
    • Intellect: Humans are intellectual beings who process and analyze information, creating their own understanding of the world [6, 9]. This intellectual capacity allows them to form opinions and make judgments [3].

    The sources also discuss how human nature relates to religion and knowledge:

    • Religion: Religion is seen as a means for the moral development of human beings, building upon the inherent nature of humans [10]. Religious teachings include the importance of purity, worship, and morality, and these elements are also found in human nature [11, 12].
    • Knowledge of Nature: The study of human nature is essential for acquiring knowledge about the world and oneself [7]. Knowledge is gained through a process of observation, experience, and critical analysis [6, 13].
    • Prophethood: Prophethood is seen as a divine favor aimed at guiding humans toward their inherent potential [14, 15]. Prophets, starting with Adam, helped to explain and develop the details of human nature, as it was not an empty box but had the ability to sprout on its own [12, 16].
    • Human behavior and society: Human behavior and social sciences are born from understanding how human beings behave both individually and collectively. Knowledge of self emerges from the study of life and death, and this knowledge of self can be considered in the broader concept of human nature [4].

    The sources emphasize that human nature is a complex and multifaceted concept, with various factors contributing to its understanding.

    Fitra and the Foundation of Religious Inclination

    Religious inclination is a significant aspect of human nature, according to the sources, and is deeply connected to the concept of “Fitra” [1-3]. Here’s a breakdown of how the sources discuss this:

    • Religion as a Means for Moral Development: Religion is viewed as a path for the moral development of human beings, building upon their inherent nature [3]. The sources suggest that religious teachings are not arbitrary but are designed to resonate with the innate qualities and inclinations present in humans [3].
    • Connection to “Fitra”: The term “Fitra,” as used in the Quran, describes the principle upon which humans were created [2, 4]. This concept implies that humans have an inherent predisposition towards recognizing their creator and understanding the moral and ethical framework of existence [3].
    • Components of Religious Teachings: Religious teachings, according to the sources, consist of four key components [3, 5]:
    • Worship (Ibadah): This is the expression of the relationship between an individual and their Lord, which is developed through struggle, devotion, and support [5].
    • Purity: Maintaining purity of the body, including the food and drink consumed, is considered essential [5].
    • High Moral Character (Akhlaq Aaliya): The sources emphasize the importance of embodying the highest moral standards [5].
    • Relationship with God: The sources also discuss how the relationship with God is developed through worship, obedience, and support [5].
    • Universal Feelings: The feelings of cleanliness and the inclination towards morality are described as universal human feelings [5, 6]. Though expressions of these feelings may vary, the underlying inclination is present in all humans [6]. This suggests that the core principles of religion are not alien to human nature but are in fact deeply rooted in it [6].
    • Religion’s Foundation in Human Nature: Religion is seen as having its foundation within humans, with the key elements of religious teachings being present in human nature [6]. The sources suggest that religious knowledge is not separate from the knowledge inherent in human nature [7].
    • Prophets and Guidance: Prophets are seen as playing a key role in elaborating upon and guiding human nature [7]. They provide the details and practical applications of the inherent knowledge, acting as a gardener who nurtures the seeds of knowledge present within human nature [7]. This guidance is considered a divine favor, offering clarity and direction to humans in understanding and fulfilling their nature [8].
    • Accountability: Individuals are accountable for the inherent knowledge within their nature, and religious teachings provide the details and structure for this [9].

    In summary, the sources emphasize that religious inclination is a fundamental aspect of human nature, deeply rooted in the concept of “Fitra.” Religious teachings align with and develop the innate moral, ethical, and spiritual inclinations of humans [3, 6]. The role of religion and prophets is to provide guidance and clarity to the inherent human understanding of the world and one’s relationship with God [7, 8].

    The Creation of Knowledge

    Knowledge creation, according to the sources, is a multifaceted process that involves observation, experience, reflection, and critical analysis [1-6]. It is deeply intertwined with the understanding of human nature and the world around us [1, 2]. Here’s a detailed breakdown of the knowledge creation process, as described in the sources:

    • Foundation in Nature: Knowledge is built upon understanding the nature of things, whether it’s a physical object, a living being, or an abstract concept [1-3]. This involves identifying the special qualities, characteristics, and purpose of the subject being studied [1, 2].
    • Observation and Experience: Knowledge begins with observation and experience [5]. This involves using the senses to gather information about the external world [4, 7]. Experiences can be external, through direct interaction with the world, or internal, through introspection and reflection on one’s feelings [4, 5].
    • Reflection and Analysis: The information gathered through observation and experience is then subjected to intellectual analysis [4-6]. This involves processing, organizing, and interpreting the data [4]. Humans, being intellectual beings, have the capacity to evaluate and critique the information they receive [4, 6].
    • Induction: The process of induction is key to knowledge creation. This involves taking the knowledge that has been gathered through observation and experience and applying it on a larger scale [5, 6]. Induction involves looking for patterns and connections in the information to form a more general understanding [6].
    • Implementation and Verification: The knowledge gained through induction is then tested and verified through implementation [5, 6]. This involves putting the knowledge into practice and observing whether it holds true in different contexts [5]. The process is often repeated to refine the knowledge and correct errors [6].
    • Critical Analysis: A key part of knowledge creation is critical analysis [8]. This involves continually questioning and evaluating existing knowledge, looking for mistakes, and seeking more complete understanding [6, 8].
    • Mistakes and Corrections: The sources acknowledge that mistakes can occur at every level of the knowledge creation process, from observation to interpretation [6]. The repetition of observation and experimentation can help to correct these errors [6].
    • Subjectivity to Material Reality: Through the process of induction and implementation, subjective perception and current experience transforms into a material reality [5, 6]. This occurs when knowledge becomes widely accepted and seen as an objective truth [6].
    • Intellectual Processing: The intellect plays a crucial role in organizing and processing the information collected [6]. The intellect creates a framework for understanding the world by connecting the information, and this allows for the creation of a system of knowledge [6].
    • Expansion of Knowledge: As knowledge expands, the collection of facts and information also changes [6]. This leads to the further refinement and expansion of knowledge [6]. The pursuit of knowledge is ongoing, with the later stages of intellectual inquiry building on earlier findings [6].

    The sources emphasize that knowledge creation is not a passive process but an active one that requires intellectual engagement, critical analysis, and a willingness to learn from mistakes [4-6, 8]. It is also a cumulative process, with new knowledge building upon existing knowledge [5, 6]. The sources posit that human beings have an innate capacity to learn and understand, and the drive for knowledge creation is part of the human experience [1, 2, 4, 7].

    Moral Development: Nature, Nurture, and the Human Spirit

    Moral development is a significant theme in the sources, closely linked to human nature, religious inclination, and the process of knowledge creation. Here’s an overview of how moral development is discussed:

    • Innate Moral Inclination: Humans are born with an inherent moral compass, possessing good qualities, morals, and intellectual capabilities [1]. These qualities are not imposed from the outside but are part of human nature itself [1, 2]. This suggests that moral development is not simply a matter of learning from external sources, but also an unfolding of inherent potential.
    • Development Through Learning and Experience: Moral development is not static; it evolves over time through learning and experience [1]. As children grow, they learn to differentiate between good and bad and begin to apply moral principles to various situations [1]. The sources suggest this process involves a combination of internal reflection and external influences.
    • Role of Intellect: The development of morality is related to intellectual growth [1, 3]. As individuals develop their capacity to think and analyze, they also gain a deeper understanding of moral principles. The intellect helps individuals to evaluate their actions and to make informed moral decisions [3].
    • Influence of External Factors: Moral development is also shaped by external factors, including family, culture, and society [4]. For example, the sources describe how a child in Africa may develop different ideas of respect compared to a child in Delhi due to cultural norms [4]. This demonstrates that while humans have an innate moral sense, its expression can be influenced by environmental factors [4].
    • Connection to Religious Teachings: Religious teachings are considered a means for the moral development of human beings, building upon their inherent nature [5]. The sources emphasize that religion provides a framework for understanding and applying moral principles, guiding individuals towards ethical behavior [5, 6].
    • Purity as a Moral Concept: The sources emphasize the importance of purity, both physical and moral, in religious teachings, linking it to the concept of moral development [6]. This suggests that being morally upright involves maintaining purity of intention, action, and character [6, 7].
    • Universal Moral Values: The sources indicate that certain moral values, such as honesty, charity, and truthfulness, are recognized and valued universally [7]. This suggests that while there may be cultural differences in how these values are expressed, the underlying principles are common to all humanity.
    • The Capacity for Good and Evil: Human nature has the capacity for both good and evil, and moral development involves learning to choose good over evil [8]. This capacity is part of human nature and it is a constant struggle to choose the path of good [8].
    • Accountability: Individuals are held accountable for their moral choices, which underscores the importance of moral development [9].
    • The tension of human nature: The internal tension created by the capacity for both good and evil is what the sources describe as humanity, and from this tension comes culture and civilization [10].

    In summary, moral development, as presented in the sources, is a complex interplay between innate moral inclinations, intellectual growth, external influences, and religious teachings. It is a dynamic and ongoing process that involves a struggle to choose good over evil, and it is a fundamental aspect of what it means to be human.

    Divine Guidance and Human Nature

    Divine guidance is a central theme in the sources, closely tied to the concepts of human nature (“Fitra”), religious inclination, and moral development. The sources present divine guidance as a necessary component for human beings to fully realize their potential and understand their purpose [1, 2]. Here’s a detailed explanation of divine guidance, based on the sources:

    • Inspiration in Human Nature: The sources suggest that divine guidance is first inspired into the very nature of humans. This means that humans have an inherent understanding of the divine, and a predisposition to seek it. This is linked to the concept of “Fitra,” which is the inherent nature upon which humans were created [3, 4].
    • Prophethood as a Divine Favor: The sources emphasize that prophethood is a divine favor, and not a requirement for God [5]. Prophets are chosen by God to elaborate on and guide human nature. They act as messengers who clarify the inherent knowledge present in human nature, and provide the details of religious teachings [2].
    • Guidance Through Prophets: Prophets are presented as the means through which divine guidance is transmitted. They provide the practical applications of inherent knowledge, and nurture the human understanding of the divine. Prophets are like a gardener who comes and waters, nourishes, and trims the seed of inherent knowledge to make it grow [2].
    • Details of Religious Teachings: Divine guidance, as expressed through religious teachings, provides the details necessary for a moral and spiritual life. This includes aspects like worship, purity, and high moral character. These aspects are not imposed from the outside, but are connected to the inherent nature of human beings [1, 6].
    • Religion as Divine Guidance: The sources explain that religion, as revealed through the prophets, is the guidance of God. This guidance is not arbitrary, but rather, it is rooted in human nature. The purpose of religion is to bring out the inherent qualities and capabilities already present in humans [1].
    • Accountability and Divine Law: Humans are accountable to God based on the inherent knowledge placed within them [7]. Divine guidance helps in understanding and fulfilling this accountability. It is also important to note that this accountability exists in addition to the inherent capabilities humans have for creating knowledge [7].
    • Why Divine Guidance is Necessary: The sources pose the question: if humans have inherent knowledge, why is divine guidance through prophethood needed? The response is that humans, left to their own devices, take a very long time to acquire and implement knowledge, and can also make mistakes in the process. Divine guidance is needed to quicken the process and ensure that humans have a clear path.
    • The Example of Adam: The sources use the story of Adam to illustrate divine guidance. Adam, having made a mistake, received guidance from God, which led him to recognize his mistake and seek forgiveness. The story of Adam also highlights the innate feeling of modesty as an example of how humans are inherently aware of what is right and wrong.

    In summary, divine guidance is presented in the sources as an essential element in human existence, which is rooted in the inherent nature of humans. This guidance is provided through prophets and religious teachings and helps humans to understand their purpose, develop morally, and fulfill their accountability to God. It is a favor from God to humanity, that clarifies and quickens the acquisition of knowledge. The concept of divine guidance connects to many aspects of the human experience including, religious inclination, moral development, and knowledge creation.

    By Amjad Izhar
    Contact: amjad.izhar@gmail.com
    https://amjadizhar.blog

  • Riyadh Newspaper, March 28-29, 2025: Judicial Reforms, Energy Sector, Vision 2030

    Riyadh Newspaper, March 28-29, 2025: Judicial Reforms, Energy Sector, Vision 2030

    The provided texts from “20726.pdf” and associated web articles from alriyadh.com, dated March 28-29, 2025, encompass a variety of topics reflecting current events and developments in Saudi Arabia. Royal decrees announce new appointments in the foreign ministry and the military. Several articles highlight Saudi Arabia’s Vision 2030 and its impact on various sectors, including a significant push for tourism, the modernization of the judicial system through digitalization, and reforms in education with updated curricula and increased investment. The nation’s ambition to become a leader in integrated energy, including renewables and hydrogen, is also detailed. Additionally, the sources cover social initiatives focused on youth development and marriage support, cultural preservation efforts, the role of Saudi women in evolving professional fields, and issues such as firework safety and food waste. International news includes the resumption of conflict in Gaza, challenges in the US egg market, and the stabilization of Red Sea shipping routes impacting diesel costs.

    A Comprehensive Study Guide on Selected Articles from “Al-Riyadh” Newspaper (March 2025)

    I. Overview of Themes

    This study guide focuses on several key themes present in the provided excerpts from “Al-Riyadh” newspaper, dated March 28-29, 2025. These themes reflect significant aspects of Saudi Arabia’s Vision 2030 and current events. The primary areas covered are:

    • Economic Transformation and Diversification: The focus on developing non-oil sectors like tourism and renewable energy.
    • Social Reforms and Empowerment: Particularly the increased role of women in various sectors, including diplomacy and protocol.
    • Judicial Reform and Governance: Efforts to enhance the efficiency, transparency, and scope of the judicial system.
    • Human Capital Development: Initiatives in education, vocational training, and support for people with special needs.
    • Cultural and Heritage Preservation: Recognizing and promoting Saudi Arabia’s rich cultural heritage.
    • Philanthropy and Social Responsibility: The role of charitable organizations and volunteerism in national development.
    • Public Safety and Awareness: Highlighting the dangers of celebratory practices like using fireworks.
    • Regional and International Relations: Mentions of international partnerships and reactions to regional events.
    • Global Economic Factors: The impact of global events on local markets, such as egg prices.
    • Cultural Commentary and Arts: Reflections on cultural phenomena, historical figures, and literary works.

    II. Key Concepts and Topics

    • Vision 2030: Saudi Arabia’s ambitious long-term plan for economic diversification, social reform, and national development. Understand its core pillars and goals as they relate to the themes in the articles.
    • Tourism Development: Strategies for attracting tourists, developing infrastructure (e.g., NEOM, Red Sea Project, Amaala, Al-Qiddiya), and promoting cultural and historical sites (e.g., Al-Hijr, Al-Diriyah).
    • Women’s Empowerment: The increasing participation of Saudi women in the workforce, leadership roles, and traditionally male-dominated fields like diplomacy and protocol.
    • Judicial System Reforms: The restructuring of courts, modernization of legal procedures through technology (e.g., e-courts, remote hearings), and expansion of specialized courts.
    • Education and Training Initiatives: Efforts to improve curriculum, teacher quality, vocational training (e.g., MISK Foundation programs), and inclusive education for people with special needs.
    • Renewable Energy Development: Saudi Arabia’s push towards renewable energy sources (solar, wind), investment in storage technologies, and the goal of diversifying the energy mix.
    • Hydrogen Economy: The Kingdom’s ambition to become a major producer and exporter of clean hydrogen.
    • Non-Oil Sector Growth: The increasing contribution of non-oil activities to the national economy.
    • Protocol and Diplomacy: The evolving role of women in official events, diplomatic missions, and international engagements.
    • Volunteerism and Charitable Work: The growing importance of volunteerism in achieving Vision 2030 goals and the role of organizations in social development.
    • Cultural Heritage: Efforts to preserve and promote historical sites and intangible cultural heritage.
    • Public Awareness Campaigns: Initiatives to educate the public on safety issues, such as the dangers of fireworks, and responsible consumption.
    • Global Supply Chains: The impact of international events on local markets, as seen in the discussion of egg prices and Red Sea shipping disruptions.
    • Cultural Analysis: Understanding the significance of cultural figures (e.g., Juha), literary works, and traditions within Saudi and Islamic contexts.

    III. Short Answer Quiz

    Answer the following questions in 2-3 sentences each.

    1. What are two key non-oil sectors that Saudi Arabia is actively developing as part of its Vision 2030?
    2. According to the articles, how has the role of Saudi women in diplomacy and official events changed in recent years?
    3. Describe one significant aspect of the judicial reforms being implemented in Saudi Arabia.
    4. What is the MISK Foundation, and what is one of its key objectives related to Saudi youth?
    5. What are some of the major tourism projects mentioned in the articles that aim to attract international visitors?
    6. What are Saudi Arabia’s goals regarding renewable energy as outlined in the provided text?
    7. How has the Saudi judicial system incorporated technology to enhance its operations?
    8. What are some of the efforts being made to preserve and promote Saudi Arabia’s cultural heritage?
    9. What are the main concerns highlighted in the articles regarding the use of fireworks during celebrations?
    10. According to the articles, what are some factors contributing to the rise in egg prices?

    IV. Answer Key for Short Answer Quiz

    1. Two key non-oil sectors that Saudi Arabia is actively developing are tourism and renewable energy. The Kingdom is investing heavily in infrastructure and initiatives to attract tourists and diversify its energy sources away from oil.
    2. The role of Saudi women in diplomacy and official events has significantly increased, with more women being appointed as ambassadors and taking on leadership roles in organizing official events and diplomatic missions. This reflects a strategic shift towards greater female participation in national development.
    3. One significant aspect of the judicial reforms is the increased use of technology, such as the introduction of e-courts and remote hearings, to enhance the efficiency and accessibility of the judicial system for citizens and residents.
    4. The MISK Foundation is an organization established by Crown Prince Mohammed bin Salman that focuses on empowering Saudi youth through various programs and initiatives, including leadership development and skill-building to prepare them for the future workforce.
    5. Major tourism projects mentioned include NEOM, the Red Sea Project, Amaala, and Al-Qiddiya. These ambitious developments aim to create luxury destinations, transform islands, and offer diverse cultural, recreational, and wellness experiences.
    6. Saudi Arabia aims to significantly increase the contribution of renewable energy to its energy mix, targeting 50% of electricity generation from renewables by 2030. The Kingdom is investing in solar, wind, and energy storage technologies to achieve this goal.
    7. The Saudi judicial system has incorporated technology by establishing e-courts for filing cases and tracking lawsuits, offering remote hearing services (“Taqasi”), and generally digitizing legal procedures to save time, effort, and costs associated with traditional processes.
    8. Efforts to preserve and promote Saudi Arabia’s cultural heritage include identifying and registering historical sites (with 15 sites on UNESCO’s World Heritage List), establishing institutions like the Ministry of Tourism (formerly the General Authority for Tourism and National Heritage), and developing cultural and heritage projects like the Diriyah Gate.
    9. The main concerns regarding fireworks during celebrations are the high number of serious injuries, often affecting children, including severe burns, vision loss, and even amputations. Despite repeated warnings, these hazardous practices persist.
    10. Factors contributing to the rise in egg prices include a severe outbreak of avian influenza that led to the culling of millions of birds in the United States, disruptions in supply chains, and increased demand. Global events and potential trade issues also play a role.

    V. Essay Format Questions

    Consider the following questions for essay responses. Develop well-structured essays with clear arguments and supporting evidence drawn from the provided sources.

    1. Analyze the interconnectedness of economic diversification, social reforms (specifically women’s empowerment), and the goals of Saudi Arabia’s Vision 2030, drawing specific examples from the provided articles.
    2. Evaluate the significance of the judicial reforms highlighted in the articles for achieving a more just and sustainable future in Saudi Arabia, and discuss the role of technology in this transformation.
    3. Discuss Saudi Arabia’s ambitious plans for developing its tourism sector as a key component of economic diversification. What are the main strategies and projects being implemented, and what are the potential challenges and opportunities?
    4. Examine the role of human capital development, including education, vocational training, and initiatives for youth empowerment, in realizing the objectives of Vision 2030, as reflected in the provided newspaper excerpts.
    5. Analyze the ways in which the provided articles illustrate Saudi Arabia’s efforts to balance modernization and progress with the preservation and promotion of its cultural heritage and values.

    VI. Glossary of Key Terms

    • Vision 2030: The Kingdom of Saudi Arabia’s strategic framework launched to reduce the country’s reliance on oil, diversify its economy, and develop public service sectors such as health, education, infrastructure, recreation, and tourism.
    • Economic Diversification: The process of shifting an economy away from a single income source toward multiple sources from a growing range of sectors. In Saudi Arabia’s context, this primarily means developing non-oil industries.
    • Tourism Development: The planning, creation, and marketing of attractions, facilities, and services to cater to the needs and wants of travelers.
    • Women’s Empowerment: The process of increasing the capacity of women to make strategic life choices and to have control over resources and decision-making within the household and society.
    • Judicial Reform: The process of changing and improving the judicial system to enhance its efficiency, fairness, accessibility, and transparency.
    • E-courts: Digital platforms and systems used to conduct court proceedings, file documents, and access court information online.
    • Remote Hearings (Taqasi): The practice of conducting court hearings virtually, allowing participants to attend remotely via video conferencing or other digital means.
    • Human Capital Development: Investments in education, training, health, and well-being to enhance the skills, knowledge, and productivity of a nation’s workforce.
    • MISK Foundation: A non-profit foundation established by Crown Prince Mohammed bin Salman bin Abdulaziz Al Saud focused on empowering Saudi youth through education, culture, science, and technology.
    • Renewable Energy: Energy derived from natural sources that are replenished at a higher rate than they are consumed, such as solar, wind, and hydropower.
    • Hydrogen Economy: An economy in which hydrogen is used as a major form of energy storage and transport. Clean hydrogen is produced with low emissions.
    • Non-Oil Sector: The parts of a country’s economy that are not related to the production and export of petroleum.
    • Protocol (Marasim): The established rules of etiquette and procedure for official ceremonies, diplomatic occasions, and interactions.
    • Diplomacy: The practice of conducting negotiations between representatives of states or groups so as to settle or prevent conflict without recourse to war; the profession, activity, or skill of managing international relations.
    • Volunteerism: The practice of offering one’s time and services without expectation of payment.
    • Cultural Heritage: The legacy of physical artifacts and intangible attributes of a group or society that are inherited from past generations, maintained in the present, and bestowed for the benefit of future generations.
    • Public Awareness Campaigns: Organized efforts to disseminate information and raise consciousness about specific issues, such as safety precautions or health risks.
    • Global Supply Chains: The worldwide network of organizations and activities involved in the production and delivery of a product or service to the consumer.
    • Avian Influenza: Commonly known as bird flu, a highly contagious viral disease that primarily affects birds.

    Briefing Document: Analysis of Provided Sources

    This briefing document reviews the main themes and important ideas presented in the provided excerpts from the “Al-Riyadh” newspaper, dated Friday-Saturday, 28/29-3-2025. The articles cover a range of topics reflecting Saudi Arabia’s Vision 2030 and its ongoing transformations.

    Key Themes:

    1. Crown Prince Mohammed bin Salman as the Architect of Major Transformations: Several articles highlight the pivotal role of the Crown Prince in driving significant changes across various sectors in Saudi Arabia. He is consistently portrayed as the “maker of great transformations,” the “visionary leader,” and the “sponsor of the ambitious Vision 2030.”
    • “ولي العهد.. صانع التحوالت الكبرى” (The Crown Prince… Maker of Major Transformations) – This headline itself underscores this central theme.
    • The article on tourism mentions the “achievements of His Highness the Crown Prince” in positioning Saudi Arabia as a leader within the G20.
    • The piece on judicial reform notes the increased focus on developing the judiciary under the leadership of King Salman and the Crown Prince.
    • The article on women’s empowerment credits Vision 2030, spearheaded by the Crown Prince, for the “radical transformation” in women’s participation in the workforce and leadership roles.
    • The report on charitable work and youth development notes the positive impact since the Crown Prince’s succession, leading to increased volunteerism.
    • The energy sector article explicitly states that Saudi Arabia is moving towards a “major radical transformation” in the energy sector under the leadership of the Crown Prince.
    • The “A Nation Loves You” concluding piece directly addresses the Crown Prince, acknowledging his leadership in achieving progress.
    1. Vision 2030 as the Guiding Framework for National Development: The ambitious Vision 2030 serves as the central roadmap driving reforms and development across all sectors discussed in the articles.
    • The report on the Saudi economy mentions the Kingdom’s “Vision 2030” as the basis for its economic growth and diversification efforts.
    • The tourism article explicitly states that the development of the tourism sector is within the “framework of working on diversifying the economy within Vision 2030.”
    • The judicial reform piece highlights Vision 2030 as a “key turning point” in developing the judicial system, focusing on efficiency, integrity, and the use of technology.
    • The education article notes that scientific research is one of the “main goals of Vision 2030,” aiming to transform the national economy into a knowledge-based one. It also details initiatives supporting the Vision within the education sector.
    • The women’s empowerment article clearly states that “Vision 2030 [brought] a radical transformation in women’s empowerment policies.”
    • The energy sector transformation is explicitly stated to be “according to Vision 2030.”
    • The article on youth development and charitable work highlights the alignment of these efforts with the goals of Vision 2030, particularly in increasing volunteerism.
    1. Economic Diversification and the Rise of Non-Oil Sectors: A significant focus is placed on diversifying the Saudi economy away from its traditional reliance on oil, with tourism being prominently featured.
    • The introduction mentions the aim of achieving prosperity and well-being for all, suggesting a broader economic vision.
    • Tourism is identified as “one of the most important sectors for developing the national economy,” aiming to leverage the Kingdom’s unique geographical location and attract global tourism investments.
    • The article on energy discusses investments in renewable and clean energy sources, aiming for leadership in this sector and a reduction in emissions, indicating a move towards a more diversified energy portfolio.
    • The piece titled “Non-oil activities represent half of the economy with a growth rate of 52% of the real GDP” (headline) directly highlights the success in economic diversification.
    1. Tourism as a Key Pillar of Economic Diversification and National Identity: The development of the tourism sector is extensively discussed, emphasizing its economic potential and its role in showcasing Saudi Arabia’s heritage and culture.
    • The article details the Kingdom’s historical significance as a destination for Muslim pilgrims and the government’s current efforts to diversify the tourism offerings to include cultural, recreational, and sports tourism.
    • Major tourism projects like “NEOM,” “The Red Sea Project,” “AMAALA,” and “Al-Qiddiya” are highlighted as ambitious initiatives aimed at establishing Saudi Arabia as a prominent global tourism destination.
    • The development and rehabilitation of historical sites like “Al-Dir’iyah” and “Al-Hijr” (Hegra) are mentioned as crucial for attracting tourists and showcasing the Kingdom’s rich heritage.
    • The inclusion of 15 cultural sites on UNESCO’s World Heritage list and the safeguarding of intangible cultural heritage are linked to Vision 2030’s goal of strengthening national identity and economic diversification.
    • Dr. Emad Munshi, Head of the Saudi Tourism Association, is quoted emphasizing the government’s efforts to elevate citizens’ expectations regarding the entertainment sector, with significant investments being made.
    • Events like “Riyadh Season” and “Boulevard World” are highlighted for their role in showcasing Saudi culture to both domestic and international tourists.
    1. Judicial Reform as a Foundation for Justice and Development: The articles emphasize the ongoing reforms within the Saudi judicial system aimed at enhancing efficiency, transparency, and fairness, crucial for attracting investment and ensuring stability.
    • The headline “Judicial Reform.. Pillar of Justice and Development” clearly establishes this theme.
    • The report details the restructuring of courts, updating of legal systems, expanding specialized judiciary, and the adoption of digital technologies in legal procedures.
    • The goal is to ensure “prompt justice” and enhance the quality of judicial services.
    • Lawyer Ahmed Al-Fahila highlights the leadership’s significant attention to the judiciary to keep pace with economic, political, and social developments.
    • The increased use of electronic courts and “remote litigation” (” التقاضي عن بعد “) is noted as a significant development, saving time, effort, and costs.
    • The reforms are seen as embodying a “deep vision aimed at making justice a fundamental pillar for development and stability.”
    1. Investment in Education and Human Capital Development: The sources underscore the importance of developing education and skills to meet the demands of the future economy, aligning with Vision 2030’s objectives.
    • Scientific research is identified as a top priority within Vision 2030, with investments being made in universities and research centers to foster innovation and support student participation.
    • The development and reform of education, including curriculum development, teacher training, and creating suitable learning environments, are highlighted.
    • Initiatives like the development of kindergarten programs are mentioned as crucial for early childhood education and creating job opportunities.
    • The alignment of curricula with the needs of the labor market and the promotion of national values, technical skills, and cultural heritage are emphasized.
    • Efforts to support students with special needs through tailored educational environments and technologies are also highlighted, ensuring equal opportunities.
    1. Transformation of the Energy Sector towards Sustainability and Renewables: The Kingdom is presented as actively pursuing a shift towards renewable energy sources and enhancing its role in the global energy landscape.
    • Under the Crown Prince’s leadership, the energy sector is undergoing a “major radical transformation.”
    • The aim is for Saudi Arabia to become the “strongest country in the integrated energy industry in the world,” including dominance in oil, gas, refining, petrochemicals, and leadership in renewable and clean energy with advanced technologies and low emissions.
    • Significant investments in renewable energy projects (solar and wind) across the Kingdom are mentioned, with a target of 50% renewable energy in electricity production by 2030.
    • Saudi Arabia aims to become a major hub for energy storage, with significant battery storage projects underway.
    • The Kingdom’s participation in the international partnership to promote the hydrogen economy and fuel cells underscores its commitment to clean energy solutions.
    1. Empowerment of Saudi Women in Various Fields: The articles highlight the significant progress in empowering Saudi women and increasing their participation in diverse sectors, particularly diplomacy and public relations.
    • Vision 2030 is credited with a “radical transformation” in policies related to women’s empowerment, making them a fundamental part of the national development strategy.
    • The increasing role of women in protocol and official events, including leadership positions, is noted.
    • The number of Saudi women in diplomatic roles, including as ambassadors, and their active participation in international organizations are highlighted.
    • The Ministry of Foreign Affairs provides training to support Saudi female diplomats’ professional and academic advancement, aligning with Vision 2030.
    • The absence of regulations preventing women’s access to senior leadership positions in both the public and private sectors is emphasized.
    • The increasing presence and leadership of Saudi women in the field of public relations and corporate communications are also showcased.
    1. Youth Development and Engagement in Nation-Building: Several initiatives aimed at nurturing young talent and engaging them in the development of the Kingdom are discussed.
    • The eighth anniversary of the Crown Prince’s pledge of allegiance is marked with citizens expressing their pride, loyalty, and commitment to supporting the leadership.
    • The Crown Prince’s statement, “I am one of 20 million people, I am nothing without them, and I am the least and weakest example among them,” emphasizes his connection with the Saudi people.
    • The “Leaders” track of the Misk Foundation, including programs like “Qiyadat 2030” (Leaders 2030) and “Elite,” aims to identify and develop young talent for leadership roles across various fields.
    • The significant impact of the Misk Foundation in providing training hours and certifications is highlighted.
    • Volunteer work is recognized as having a major role in achieving Vision 2030 goals, empowering youth, developing their skills, and fostering social responsibility.
    • The increase in volunteerism since the launch of Vision 2030 is noted, with a target of reaching one million volunteers.
    1. Philanthropic and Social Initiatives Contributing to National Development: The role of charitable organizations and social initiatives in supporting vulnerable populations and contributing to the overall development of the Kingdom is emphasized.
    • The increased impact of charitable and social work since the Crown Prince’s succession is highlighted, attributed to principles of transparency and governance.
    • The rise in youth participation in volunteer and charitable activities is noted.
    • Charitable associations are seen as significantly contributing to sustainable development by activating the non-profit sector and aligning with Vision 2030 goals of an ambitious nation, a vibrant society, and a prosperous economy.

    Important Ideas and Facts:

    • Saudi Arabia is actively pursuing a comprehensive development agenda under Vision 2030, led by Crown Prince Mohammed bin Salman.
    • Economic diversification, particularly through tourism and non-oil sectors, is a key priority.
    • Significant investments are being made in infrastructure and mega-projects to support these goals.
    • Judicial reforms are underway to create a more efficient, transparent, and just legal system.
    • Education and human capital development are crucial for building a knowledge-based economy.
    • The energy sector is undergoing a significant transition towards renewable and sustainable sources.
    • Saudi women are increasingly empowered and taking on leadership roles across various sectors.
    • Youth engagement and development are vital for the Kingdom’s future.
    • Philanthropic and volunteer efforts play a significant role in social development and achieving Vision 2030’s targets.

    Other Notable Points:

    • The articles reflect a positive and forward-looking perspective on Saudi Arabia’s progress and future.
    • There is a strong emphasis on national unity, pride, and the leadership’s commitment to the well-being of its citizens.
    • The date of the publication (March 2025) places these developments in the near-term context of Vision 2030’s ongoing implementation.

    This briefing document provides a comprehensive overview of the main themes and important ideas presented in the provided excerpts, highlighting the significant transformations taking place in Saudi Arabia under the umbrella of Vision 2030.

    Saudi Arabia: Vision 2030 Developments and Reforms

    Frequently Asked Questions Regarding Recent Developments in Saudi Arabia

    1. What are the primary goals of Saudi Arabia’s Vision 2030, as highlighted in these sources?

    Saudi Arabia’s Vision 2030 aims to achieve comprehensive and sustainable development across various sectors. Key goals include diversifying the national economy away from its reliance on oil, with a significant focus on developing the tourism sector. The vision also emphasizes enhancing the quality of life for citizens and residents through improvements in areas such as healthcare, education, culture, and entertainment. Furthermore, Vision 2030 seeks to strengthen Saudi Arabia’s global standing and promote its rich cultural heritage.

    2. How is the tourism sector being developed in Saudi Arabia as part of Vision 2030?

    The development of the tourism sector is a central pillar of Vision 2030. Saudi Arabia is working to attract a large number of international and domestic tourists by leveraging its unique geographical location, historical sites (including Islamic holy sites and pre-Islamic archaeological treasures like Al-Hijr), and natural beauty. Significant investments are being made in large-scale tourism projects like NEOM, the Red Sea Project, Amaala, and Al-Qiddiya, which offer diverse experiences ranging from luxury resorts to cultural and entertainment hubs. The Kingdom has also streamlined visa processes, including the introduction of e-visas for numerous countries, to make it easier for tourists to visit.

    3. What reforms are being implemented in the Saudi Arabian judicial system?

    Substantial reforms are underway in the Saudi Arabian judicial system to enhance efficiency, transparency, and fairness. These reforms include the restructuring of courts, the updating of legal systems, the expansion of specialized courts (now exceeding 20), and the increased use of digital technologies in judicial procedures. Electronic courts and remote litigation services are being implemented to expedite case processing, reduce costs, and improve accessibility for citizens and residents. The leadership is prioritizing the judiciary to ensure a just and transparent legal environment that supports growth and stability.

    4. How is Saudi Arabia transforming its education system to align with Vision 2030?

    The transformation of the education system is a key priority to support the goals of Vision 2030. Efforts are focused on developing curricula that meet the needs of the future job market, enhancing teachers’ skills, and creating a stimulating learning environment. Initiatives include expanding early childhood education, supporting students with special needs, and fostering scientific research and innovation in universities. The Kingdom aims to cultivate a generation equipped with the skills and knowledge necessary for a diversified, knowledge-based economy.

    5. What are the significant developments in Saudi Arabia’s energy sector, particularly in renewable and alternative energy sources?

    Saudi Arabia is undergoing a major transformation in its energy sector, aiming to become a global leader in integrated energy, including renewable and clean energy sources. The Kingdom is making significant investments in solar and wind energy projects, with a goal of achieving 50% renewable energy in the electricity mix by 2030. It is also focusing on developing a hydrogen economy and has joined international partnerships to advance this sector. Furthermore, Saudi Arabia is becoming a prominent player in energy storage solutions, with the development of large-scale battery storage projects.

    6. How has the role and empowerment of Saudi women evolved, particularly in light of Vision 2030?

    Vision 2030 has brought about a radical shift in policies related to the empowerment of Saudi women. Women are increasingly participating in the workforce across various sectors, including leadership roles in protocol, diplomacy, and public relations. The Kingdom has appointed female ambassadors and increased the number of women working in diplomatic missions. Efforts are underway to create a more inclusive and equitable work environment, recognizing women’s unique capabilities and contributions to national development.

    7. What efforts are being made to engage and develop Saudi youth for the future?

    Saudi Arabia is actively investing in its youth through various initiatives aimed at fostering their skills, leadership potential, and civic engagement. The Mohammed bin Salman Foundation (Misk) is playing a key role by offering a range of programs, including leadership development (such as “Leaders 2030”), talent nurturing (“Global Voices”), and skills enhancement initiatives. Volunteerism is also being strongly encouraged as a means for youth to gain experience, develop skills, and contribute to their communities, aligning with the goals of Vision 2030 to reach one million volunteers.

    8. What are some of the social and cultural aspects being addressed alongside Saudi Arabia’s economic and infrastructural development?

    Beyond economic and infrastructural development, Saudi Arabia is focusing on preserving its cultural heritage, promoting arts and culture (as seen with the success of the “Sharea Al-A’sha” TV series), and fostering social responsibility. There is a growing emphasis on charitable work and social initiatives, with increased participation from youth. The Kingdom is also addressing social issues such as food waste and promoting responsible consumer behavior, particularly during significant religious periods like Ramadan and Eid.

    Saudi Vision 2030: Kingdom’s Transformation

    Saudi Vision 2030 is a comprehensive plan aimed at transforming the Kingdom of Saudi Arabia across various sectors. It was initiated under the leadership of Crown Prince Mohammed bin Salman bin Abdulaziz Al Saud.

    Key Goals and Pillars of Vision 2030:

    • Economic Diversification: A central aim of Vision 2030 is to diversify the Saudi economy away from its reliance on oil. This includes developing non-oil sectors and increasing their contribution to the GDP.
    • Tourism Development: Vision 2030 has a strong focus on developing the tourism sector as a key driver of economic growth and diversification.
    • The Kingdom aims to become a prominent tourist destination.
    • Goals include attracting a large number of tourists, with a target of 150 million tourists by 2030.
    • Significant investments are being made in mega tourism projects like the Red Sea Project, NEOM, and Amaala.
    • The government has been working on governing the tourism sector with multiple entities involved in implementing the national tourism strategy.
    • The introduction of the electronic tourist visa in 2019 for 63 countries has facilitated international tourism.
    • The tourism sector is seen as a significant job creator for Saudi youth and is expected to increase employment opportunities and improve incomes.
    • The Saudi tourism sector has witnessed significant growth in tourist numbers and spending.
    • The Kingdom’s historical significance as a destination for religious pilgrims is being leveraged while also promoting cultural, entertainment, and sports tourism.
    • Judicial Reform: Vision 2030 emphasizes the importance of a fair and efficient judicial system as a cornerstone of justice and sustainable development.
    • Significant judicial reforms have been undertaken, including the restructuring of courts, updating legal systems, and expanding the scope of specialized judiciary.
    • Digital transformation in the judiciary is a key aspect, with the increased use of electronic courts and platforms.
    • The goal is to ensure the rule of law, enhance the investment climate, and improve the efficiency of the judiciary.
    • The focus of the new penal system is on the interest of the victim and the rehabilitation of the criminal.
    • Education Advancement: Transforming the education system is a high priority within Vision 2030.
    • Efforts include updating curricula, adopting modern teaching methods, and integrating technology in the educational process.
    • There is an emphasis on enabling teachers, fostering innovation and creativity, and preparing a capable generation for the future.
    • Support for scientific research is a key objective, aiming to transform the national economy into a knowledge-based economy.
    • Various initiatives and projects are underway to improve the quality of the educational process and align educational outcomes with the needs of the labor market.
    • Energy Sector Transformation: Vision 2030 aims for Saudi Arabia to become the strongest integrated energy industry in the world.
    • This includes maintaining its leadership in oil and gas while also focusing on renewable and clean energy and reducing emissions.
    • Significant investments and projects are planned in the renewable energy sector, including solar and wind power.
    • The Kingdom aims for 50% of electricity production from renewable sources by 2030.
    • Saudi Arabia is also focusing on developing the hydrogen economy.
    • Women’s Empowerment: Vision 2030 has brought about a radical shift in policies aimed at empowering women.
    • Women’s participation in the labor market has significantly increased.
    • There is a growing role for Saudi women in diplomacy and protocol.
    • The Kingdom has appointed female ambassadors and increased the number of women working in diplomatic missions.
    • Efforts are being made to develop policies in the field of protocol that meet the needs of diverse delegations.
    • Social Development and Volunteering: Vision 2030 recognizes the importance of social development and active citizenship.
    • Promoting volunteering is a key aspect, with a goal of reaching one million volunteers.
    • Volunteering is seen as a way to raise awareness of social issues, empower youth, and contribute to building society.
    • The non-profit sector is being activated and supported to achieve sustainable development goals.

    Other Notable Aspects:

    • Vision 2030 is driving overall development and progress in various sectors, including health and culture.
    • The Kingdom’s growing international role, including its mediation efforts such as the agreement between Saudi Arabia and Iran, is aligned with the Vision.
    • The Kingdom aims to enhance its global standing and play a leading role in various fields.

    In conclusion, Saudi Vision 2030 is a wide-ranging and ambitious plan that seeks to transform the Kingdom into a modern, diversified, and globally competitive nation while preserving its cultural heritage and values. It encompasses significant reforms and initiatives across economic, social, and political spheres, all geared towards achieving a brighter future for Saudi Arabia.

    Saudi Arabia: Royal Decrees and Vision 2030

    Based on the sources, while they don’t explicitly list specific Royal decrees, it is evident that Royal decrees have been instrumental in several key developments and the implementation of Saudi Vision 2030.

    Here’s a discussion of Royal decrees as implied by the provided text:

    • Appointment of Leadership: The sources indicate that the appointment of His Royal Highness Prince Mohammed bin Salman bin Abdulaziz Al Saud as the Crown Prince by King Abdulaziz Al Saud (may Allah have mercy on him) was a pivotal moment. Such a significant appointment would be formalized through a Royal decree. Furthermore, his position as Chairman of the Council of Ministers would also likely be established by Royal decree.
    • Foundation of Vision 2030: The launch of the Saudi Vision 2030, a comprehensive plan for the Kingdom’s future, under the leadership of Crown Prince Mohammed bin Salman, would have been initiated and mandated by Royal decrees. These decrees would have outlined the overarching goals, pillars, and the government’s commitment to achieving this transformation.
    • Implementation of Judicial Reforms: The extensive judicial reforms discussed in the sources, including the adoption of significant new legal systems such as the Personal Status Law, the Civil Transactions Law, and the updated Penal Code, would have been enacted through a series of Royal decrees. These decrees provide the legal framework for these crucial changes aimed at enhancing justice and development.
    • Advancement of Education: The ongoing efforts to develop the educational system by updating curricula, adopting modern teaching methods, and integrating technology, spearheaded by Crown Prince Mohammed bin Salman, likely stem from Royal decrees that mandate these transformations and allocate resources accordingly.
    • Policies for Women’s Empowerment: The radical shift in policies aimed at empowering women would also be driven by Royal decrees that have enabled increased female participation in the workforce and in fields like diplomacy and protocol.
    • Pledge of Allegiance: The commemoration of the eighth anniversary of the pledge of allegiance to Crown Prince Mohammed bin Salman signifies the importance of the initial Royal decree that appointed him to this position, which then necessitated the public pledge of loyalty.

    In summary, while the sources don’t provide the text of specific Royal decrees, they strongly suggest that Royal decrees are the authoritative instruments through which major leadership changes are enacted and the ambitious goals and reforms of Saudi Vision 2030 are mandated and implemented across various sectors. These decrees provide the necessary legal and governmental backing for the wide-ranging transformations the Kingdom is undergoing.

    Saudi Arabia Tourism: Growth and Vision 2030

    The tourism sector in Saudi Arabia is experiencing significant growth as a key component of the Kingdom’s Vision 2030 for economic diversification [Me, 9]. Our previous discussion highlighted the ambitious goals set for this sector, including becoming a prominent global tourist destination and attracting 150 million tourists by 2030 [Me].

    The sources provide further details on this growth and the strategies driving it:

    • Economic Dynamism and Investment: The tourism sector is described as one of the most dynamic sectors in the global economy, playing a crucial role in attracting foreign investments. The Saudi government has actively worked on governing the tourism sector, establishing six integrated entities to implement the national tourism strategy.
    • Surge in Tourist Numbers and Spending: Saudi Arabia achieved 60 million tourist visits in 2023 and aims to reach 109 million by mid-2024. This substantial increase in tourist numbers has translated into significant spending, reaching 15 billion riyals, representing a roughly 10% contribution in spending.
    • Job Creation and Human Capital Development: The growth in tourism is directly linked to increasing job opportunities and improving incomes for Saudi nationals. The government launched 100,000 initiatives in 2021 to create job opportunities within the tourism sector and to develop the skills of those working in tourism services through programs like “Ahlanha,” “Tourism Pioneers,” and programs focused on hospitality and travel skills. The number of people employed in the tourism sector reached 959,175 in the second quarter of 2024, showing a notable increase from the previous year.
    • Leveraging Cultural Heritage: Saudi Arabia’s diverse cultural heritage is a significant asset in attracting tourists. The Kingdom boasts hundreds of historical sites and landmarks, some dating back to ancient eras. The management of cultural heritage is closely tied to Vision 2030, aiming to strengthen national identity and diversify the economy. Heritage is playing a key role in attracting investments, creating jobs, and fostering national pride. The cultural heritage sector is projected to contribute over 47.9 billion dollars to the Kingdom’s GDP by 2030.
    • Strategic Initiatives and Regulations: The Ministry of Tourism has been instrumental in driving the sector’s growth, having covered a significant portion of its strategic steps since 2019 and launching 11 distinct tourist seasons. The ministry is also actively working with other governmental bodies to implement regulations that ensure quality services and protect the rights of tourists, thereby enhancing trust in the sector.

    In summary, the tourism sector in Saudi Arabia is experiencing rapid and substantial growth, fueled by the ambitious goals of Vision 2030, significant governmental investment and strategic planning, a focus on leveraging the Kingdom’s rich cultural heritage, and a commitment to creating job opportunities and enhancing the overall tourist experience [Me, 6, 7, 8, 9, 10, 11]. The increasing tourist numbers and spending indicate the success of these initiatives and the sector’s growing importance to the Saudi economy.

    Saudi Vision 2030: Cultural Heritage and National Identity

    The emphasis on cultural heritage is a significant aspect of Saudi Arabia’s Vision 2030, playing a vital role in the Kingdom’s plans for economic diversification and the strengthening of national identity [8, Me].

    • Driving Tourism: As discussed in our previous turn, Saudi Arabia’s diverse cultural heritage is recognized as a crucial asset for attracting tourists [8, Me]. The Kingdom possesses hundreds of historical sites and landmarks, some dating back to ancient eras, making it a unique destination for cultural tourism. The promotion of this heritage is a key strategy to achieve the ambitious tourism goals set under Vision 2030, including attracting a large number of international visitors [Me].
    • Preservation and Maintenance Efforts: The Kingdom is making significant efforts to preserve and maintain its rich cultural heritage, ensuring its longevity and showcasing its authenticity to the world. This includes safeguarding its ancient history and diverse traditions.
    • Economic Benefits: The focus on cultural heritage is not only about preservation but also about its economic contributions [8, Me]. It is playing a key role in attracting investments in the tourism and cultural sectors and creating job opportunities for Saudi nationals [8, Me]. Furthermore, the cultural heritage sector is projected to contribute over 47.9 billion dollars to the Kingdom’s GDP by 2030 [Me].
    • Strengthening National Identity and Pride: The management of cultural heritage is closely tied to the goals of Vision 2030, aiming to strengthen national identity and foster a sense of national pride among Saudis [8, Me]. By highlighting the Kingdom’s rich history and cultural significance, Saudi Arabia aims to deepen the connection of its citizens to their roots and heritage.

    In summary, the emphasis on cultural heritage in Saudi Arabia is a strategic move under Vision 2030, serving as a key pillar for tourism development, economic growth, job creation, and the reinforcement of national identity and pride [8, Me]. The Kingdom is actively working to preserve its historical sites and traditions, recognizing their immense value in achieving its Vision 2030 objectives.

    Saudi Arabia: Judicial Reforms and Modernization

    The sources highlight significant reforms within the Saudi judicial system, which are a key aspect of the Kingdom’s modernization efforts under Vision 2030 [13, Me].

    • Digital Transformation: A prominent feature of the judicial reforms is the digital transformation of the sector. This includes the launch of electronic courts, the activation of digital evidence systems, and the implementation of remote litigation. These advancements have positively impacted the speed of case completion and the efficiency of judicial work.
    • Enhancing Legal Awareness: Recognizing the scale of the expansion in judicial arenas, the Kingdom emphasizes the importance of enhancing legal awareness among individuals and institutions. This is crucial for ensuring that the public fully benefits from the ongoing updates and the digital transformation of the judiciary. Educational institutions and media play a central role in disseminating legal awareness through curricula, television programs, news reports, and awareness articles. Furthermore, legal education for investors and business owners is considered essential for supporting a stable investment environment.
    • Development of Legal Systems: The reforms include the modernization and adoption of key legal systems:
    • Personal Status Law: This law aims to organize family issues such as marriage, divorce, and child custody, contributing to reducing individual interpretations and enhancing fairness in family judgments.
    • Civil Transactions Law: This law regulates contracts and obligations, aiming to strengthen civil and commercial dealings between individuals and institutions, thereby fostering legal security and social stability. It establishes fundamental rules for the validity of contracts and covers various types of contracts, contributing to increased investor confidence, reduced legal disputes, and ensured justice and transparency.
    • Penal Code: The Penal Code has been updated to align with modern developments, focusing on achieving a balance between punishment and rehabilitation, ensuring the rights of defendants and victims, and enhancing public security. The updated code includes the classification of crimes and penalties, the introduction of alternative punishments like community service and rehabilitation programs for minor offenses, and measures to combat digital and electronic fraud.
    • Challenges in Digital Transformation: While the digital transformation offers significant benefits, the source notes that the judicial sector faces challenges, primarily the need to develop the technological infrastructure and update systems and technologies to keep pace with the important objectives of the reforms.

    As we discussed previously, these comprehensive judicial reforms would likely be implemented through a series of Royal decrees, providing the legal and governmental mandate for these significant changes aimed at enhancing justice, efficiency, and the rule of law in Saudi Arabia [Me].

    Two royal orders: Khalid bin Bandar as advisor to the Ministry of Foreign Affairs and the head of the military apparatus

    A royal decree was issued yesterday, the text of which is as follows:
    Number: A/366
    Date: 27/9/1446 AH
    With the help of God Almighty
    We, Salman bin Abdulaziz Al Saud
    King of the Kingdom of Saudi Arabia
    After reviewing the Basic Law of Governance, issued by Royal Decree No. (A/90) dated 27/8/1412 AH.
    After reviewing the Law of Ministers, Deputy Ministers and Employees of the Excellent Rank, issued by Royal Decree No. (M/10) dated 18/3/1391 AH.
    After reviewing Royal Decree No. (A/3/1414 AH) dated 14/3/1414 AH, we have ordered the following:
    Prince Khalid bin First: His Royal Highness Prince Bandar bin Sultan bin Salman bin Abdulaziz Al Saud is appointed as an advisor in the Ministry of Foreign Affairs with the excellent rank. Second: This order of ours is communicated to the competent authorities for approval and implementation. A royal decree was issued yesterday, the text of which is as follows:
    Number: A/367
    Date: 27/9/1446 AH
    With the help of God Almighty
    We, Salman bin Abdulaziz Al Saud
    King of the Kingdom of Saudi Arabia
    and Supreme Commander of all military forces
    After reviewing the Officers’ Service System, issued by Royal Decree No.
    28/8/1393 AH dated (43/AD)
    And after reviewing Royal Order No. (A/43) dated 1/2/1441 AH,
    We have ordered the following: And based on what was presented to us by His Highness the Minister of the National Guard.

    First: Major General Saleh bin Abdulrahman bin Samir Al-Harbi is promoted to the rank of Lieutenant General and appointed as head of the military apparatus.

    Second: His Highness the Minister of the National Guard must implement this order of ours.

    Sustainable future

    Since His Royal Highness Prince Mohammed bin Salman bin Abdulaziz Al Saud – may God protect him – assumed the position of Crown Prince, the Kingdom of Saudi Arabia has achieved a great leap in various fields. This comes as an extension of the process of construction and development that was begun by the founder of the Kingdom, King Abdulaziz – may God have mercy on him. The Kingdom was launched under a leadership that enjoyed a penetrating vision and determination that knew nothing about the impossible, carrying within it great hopes and broad ambitions for the renaissance of the nation. Based on the above, Prince Mohammed bin Salman enjoys a leadership personality and a strategic vision, capable of implementing and making decisions that serve the interests of the Saudi people, which made him – thanks to the directives of the Custodian of the Two Holy Mosques – King Salman bin Abdulaziz, and his Crown Prince Mohammed bin Salman, are widely supported leaders who are able to bring about positive change. The Kingdom has been able to achieve many major accomplishments, such as Vision 2030, which aims to diversify the Saudi economy, open up investment opportunities, reduce dependence on oil, enhance the role of women and youth, and promote new sectors through the implementation of mega projects. Today, the Kingdom stands out as a symbol of progress and development, relying on the concept of sustainable development as a fundamental pillar for achieving its future aspirations. This is achieved by achieving a comprehensive balance in various sectors, such as strengthening the economy, preserving the environment, and achieving the well-being of citizens. This is achieved by utilizing available resources efficiently and ensuring their sustainability for future generations. In this context, the Kingdom is implementing numerous major projects that contribute to enhancing sustainability.

    Partnership is trust

    Hani Wafa

    The Kingdom, with its balanced policy, broad stances, and direction toward peace, is considered a reliable and dependable partner in establishing a just, comprehensive, and lasting peace, which confirms and strengthens its role as a peacemaker in the region and the world. The roles it has played and continues to play in achieving the desired stability are well-known, as it employs its relations with influential global powers in order for peace to prevail. One of the most important Saudi peace efforts is the “Arab Peace Initiative,” which, if implemented more widely from its launch, would have made the Middle East more stable and more development and prosperity. However, the intransigence of Israelis, who consider peace a luxury based on force, rejected this initiative, even though it is a just and balanced initiative that restores rights to their owners and expands the foundations of permanent peace. The “Arab Peace Initiative” is not the only thing that confirms the Kingdom’s inclination towards peace. How many efforts has the Kingdom made for Arab reconciliation? Inter-Arab relations, and led to the stability of Arab-Arab relations, and defused crises that could have developed into undesirable stages. Hence, the talks on the Russian-Ukrainian crisis, which were held on the Kingdom’s soil under Saudi auspices, received global acclaim, and confirmed that the Kingdom is a country striving diligently to establish peace, not only regionally but also globally. This crisis cast a shadow over international relations and almost spiraled out of control on many occasions. The Washington Institute for Near East Policy
    in a report on the prominent diplomatic role that the Kingdom of Saudi Arabia is currently playing on the regional and international arenas, called on the United States to support and back this role. The report said: “Saudi Arabia’s stability, prosperity, and cooperation are fully consistent with the highest American interests in promoting security and economic prosperity in the Middle East and beyond, by strengthening confidence in partners who have been working with America since “For years,” the report confirmed the statement of Adam Boehler, US President Donald Trump’s envoy, who said: “Crown Prince Mohammed bin Salman has led the Kingdom toward development and construction, and the partnership between the United States and Saudi Arabia is strong and solid, and the Kingdom’s hosting of the Ukraine talks confirms the strength of the US-Saudi partnership.” The Kingdom’s pursuit of regional and international peace is an approach it pursues tirelessly so that security, stability, and sustainable development prevail.

    The Crown Prince soars in the skies of diplomacy

    Report – Azzam Al-Mashaal

    In the history of diplomacy and foreign affairs, the world has come to recognize that in times of global crises and grave events, the international community turns to seasoned leaders who are deeply involved in politics, have long-standing relationships with political and economic decision-makers, and have extensive experience in dealing with complex realities, such as Henry Kissinger, James Baker, and others. However, in this era, a young leader has emerged who broke the mold, penetrated the twilight, and dominated the diplomatic sphere. That is His Highness the Crown Prince, Prince Mohammed bin Salman, who gained the trust of the leaders of the great powers at an early age and in a short period of time, inconsistent with the nature and difficulty of the complex equations of international relations. This was the result of an unprecedented blend of wisdom and balance in dealing with foreign issues and bold domestic arenas that have become the focus of the world’s most important leaders, most notably US President Donald Trump, who pointed to Saudi Arabia, expressing his hope that the United States would be able to catch up, and explaining that Saudi Arabia would serve as a model and reference for the United States. His Highness the Crown Prince Mohammed bin Salman was able, in record time, to draw up consensus frameworks with the leaders of the G20 countries, ensuring the interests of all parties were met, despite the sharp differences and disagreements among the major powers within the G20. These countries found in Saudi Arabia a reliable strategic partner in achieving their development goals, and found in the young leader a spirit of determination that does not recognize the impossible and believes that joint action is the only path to achieving peace and prosperity for all. This spirit, possessed by His Highness the Crown Prince Mohammed bin Salman, enabled him, in a short time, to move beyond contributing to the transition to leading the transformation on the most important hot issues at the United Nations, foremost among which are sustainable development, energy security, climate change, quality of life, and social justice.

    Confident Steps
    The world today is pointing, according to the Kingdom of Saudi Arabia’s calendar. Its confident steps are confirmed by the recent International Monetary Fund report, which praised the Kingdom’s Vision 2030 and the achievements of His Highness the Crown Prince, which have placed the Kingdom of Saudi Arabia at the forefront of the G20 countries in terms of economic growth. Given the Kingdom’s pioneering experience in implementing economic reforms, the World Bank chose Saudi Arabia as a knowledge center to disseminate the culture of economic reforms globally. This tremendous momentum of achievements accomplished by the Crown Prince in record time should have placed him at the heart of events and enabled countries to secure their path. On the Middle East front, His Highness the Crown Prince, Prince Mohammed bin Salman, has moved towards a true peace between the Arab countries and the occupying Israeli state, through his tireless efforts to establish an independent Palestinian state with East Jerusalem as its capital, and emphasizing that the Saudi leadership will not establish any diplomatic relations with Israel without this. Within the framework of the independent Palestinian state, Saudi diplomacy, led by His Highness the Crown Prince and the shuttle tours of His Highness the Minister of Foreign Affairs, was able to obtain the recognition of the State of Palestine from a number of influential countries. In the same context, His Highness the Crown Prince urged more countries that love the Levant to recognize it. Within the Middle East, Saudi diplomacy, led by His Highness the Crown Prince Mohammed bin Salman, was able to achieve a historic agreement with the State of Iran. This was achieved by utilizing the advanced relationship that has developed between His Highness the Crown Prince and the Chinese President in recent years, and by exploiting China’s desire and need to be a participant in establishing the global order, which makes this agreement an important step in this direction. Regarding this historic agreement, veteran politician Henry Kissinger said during an interview he conducted before his death with David Ignatius, The Washington Post: “I see this as a fundamental change in the strategic position in the Middle East. The Saudis are now working to achieve a balance in their security by exploiting Saudi Arabia’s Chinese influence to consolidate the Levant in the Middle East.

    Saudi Wisdom
    Saudi wisdom, led by His Highness the Crown Prince, was not limited to the borders of the Middle East, as Saudi diplomacy became a focus of international confidence, especially at this stage, when the confrontation between nuclear powers has become a matter of immediate concern. Saudi diplomacy, led by His Highness the Crown Prince, Prince Mohammed bin Salman, is working day and night to achieve peace and stability, after the capital, Riyadh, was chosen as the headquarters of diplomacy and a venue for consensus to end the largest conflict in Europe since World War II. Since that historic moment, His Highness has been personally following the most minute details and communicating with the parties to the conflict in an atmosphere filled with trust and optimism. All parties interact positively and greatly with His Highness the Crown Prince, due to their perception of his sound judgment, sincere intentions, and sincerity of purpose. The best evidence of this is the visit of Ukrainian President Volodymyr Zelensky to Riyadh, which highlights the crucial role played by the Kingdom of Saudi Arabia as a mediator in the Syria talks, with the United States and Russia meeting for the first time and Ukraine’s demands now at the forefront of the negotiations. Regarding this visit, President Zelensky tweeted on his Twitter account: “A distinguished meeting with His Royal Highness Prince Mohammed bin Salman bin Abdulaziz Al Saud, Crown Prince and Prime Minister. I expressed my gratitude for his wise vision for Ukraine’s international position and support. It was very important for me to hear words of confidence in Ukraine’s future. We discussed all the main issues on the agenda – both bilaterally and in the framework of cooperation with other partners. I noted the efforts of His Royal Highness Prince Mohammed bin Salman bin Abdulaziz Al Saud, which contribute to bringing the true Levant closer together.” The Kingdom of Saudi Arabia provides a diplomatic platform of great importance, and we appreciate that.

    Strategic Diplomacy
    Regarding the US-Russian-Ukrainian negotiations in Riyadh, Barbara A. Leaf, former US Assistant Secretary of State for Near Eastern Affairs, said she was not surprised to see Saudi Arabia at the center of the talks – describing them as the result of years of strategic diplomacy. Likewise, the Saudi Ambassador to the United States, Her Royal Highness Princess Reema bint Bandar Al Saud, tweeted on her Twitter account:
    “Throughout its history, Saudi Arabia has served as a bridge for dialogue and a supporter of the Levant. His Highness the Crown Prince’s directives to host today’s meetings in Riyadh between the United States and Russia underscore the Kingdom’s leadership role and its enduring commitment to promoting global peace and stability.” This conflict between Russia and Ukraine requires a great deal of wisdom and guidance towards consensus to overcome a catastrophe that could return humanity to previous eras. His Highness the Crown Prince is the best person to lead this scene and manage its negotiations. This is a fact that all parties bear witness to, including the American side, which explained on his behalf at one of the dinners, Mr. Steve Witkoff, the Special Envoy to the Middle East, when he said: “We could not have imagined a better outcome.” Former US Chief of Staff Fred Fleitz also said: “Prince Mohammed bin Salman deserves the Nobel Prize, and it is truly difficult to find a great creator like him on the international stage.” The Inspiring Leader
    The Inspiring Leader, His Highness the Crown Prince, Prince Mohammed bin Salman, is establishing a new diplomatic doctrine under the title “All Roads Lead to Riyadh.” In doing so, he bears a great responsibility after wisdom and common sense were shattered and diminished among the great powers, and polarization has become the dominant force. His Highness the Crown Prince is leading the way, overcoming political and economic challenges to achieve a consensus that brings to mind the golden age of diplomacy during the time of Henry Kissinger and James Baker.

    The Crown Prince…the maker of major transformations Saudi tourism at the forefront of the global scene

    Riyadh – Sarah Al-Farzan

    Every year, the 26th day of the holy month of Ramadan marks the anniversary of the pledge of allegiance to the man of achievement, the architect of major transformations, and the sponsor of the inspiring vision, His Royal Highness Crown Prince Mohammed bin Salman bin Abdulaziz Al Saud – may God support and guide him. Under his wise leadership, the Kingdom of Saudi Arabia has witnessed radical transformations and reforms in all aspects of economic, social, and political life, positioning it steadily toward a prosperous future that will achieve greater leadership. On a related note, the eighth pledge of allegiance is the continuation of a journey replete with achievements that have consolidated and strengthened the Kingdom’s position across various fronts, propelling it to an unprecedented stage of growth and development, and propelling it to continue its journey toward a more prosperous future under the leadership of a supportive and conscious young vision. A Brighter Future
    Today, with the ambitious Vision 2030, the Kingdom has become a leading and pioneering nation.
    This is achieved through the successive developments it has achieved in numerous sectors, such as the economy, health, education, culture, and the arts. Among these is the tourism sector, which the Kingdom has forayed into with force.
    It has enjoyed its share of this tremendous qualitative development, as it is a fundamental pillar for the development and diversification of the national economy, far removed from its complete dependence on oil. It has also contributed to strengthening the Kingdom’s cultural identity. Furthermore, this tourism renaissance is linked to a vision that goes beyond imagination, as it aims to transform the Kingdom into a global tourism hub and a leading tourist destination. This is achieved by investing in its cultural and entertainment resources to provide ideal and integrated tourism services and experiences that combine authenticity and modernity.

    Pillar of the National Economy
    Tourism is one of the most important sectors for developing the national economy in countries, especially in the Kingdom, which is significantly striving to enhance the role of the tourism sector, given its unique and distinguished geographical location and its ability to attract global tourism investments. In general, tourism makes significant contributions to the growth of manufactured products within the country’s borders. In this regard, A. Ghramah Al-Sahri, a writer and economic analyst, stated: “According to the World Tourism Organization’s estimate, tourism contributes approximately 10% of the global gross domestic product.” While describing the tourism sector as “one of the most dynamic sectors in the global economy, as it contributes to attracting foreign investment to the country,” he said: “The government has worked to govern the tourism sector, with six bodies working together to implement the national strategy for the sector, which includes the Ministry of Tourism, the Tourism Development Fund, the Saudi Tourism Authority, the Tourism Development Council, the National Air Connectivity Program, and the Saudi Red Sea Authority. Each of these bodies has different responsibilities, in addition to the Entertainment Authority.” “Which organizes events, festivals, and competitions, which has a positive impact on the tourism sector.” Al-Sahri stated that: “Two years ago, specifically in 2023, Saudi Arabia welcomed 109 million tourists, and by mid-2024, it was able to welcome 60 million visitors from various countries around the world, with spending amounting to approximately 15 billion riyals, and recording a growth of nearly 10% in the number of tourists and spending, according to what was revealed by the Minister of Tourism (Ahmed Al-Khateeb).” He added, regarding job opportunities for young people, “Tourism works to increase employment opportunities, which will increase job opportunities for individuals and improve their income. This has included several initiatives that it has sought to implement.” In 2021, the Saudi government launched an initiative to create 100,000 job opportunities in the tourism sector, develop the skills of tens of thousands of tourism workers through training programs, and launch a human capital development strategy under the slogan “Ahlaha,” and the “Tourism Pioneers” program, which contributed to developing the skills of 100,000 citizens in the fields of hospitality, travel, and tourism. Building on previous efforts that serve the interests of the nation’s citizens, Al-Shahari stated, “In the second quarter of 2024, the number of people employed in the tourism sector increased, reaching a total of 959,175, a significant increase over the previous year. These achievements, proven by the huge numbers, reflect the initiatives our government has provided in 2021.” He added, regarding the Kingdom’s ongoing efforts to develop its economy, “The Kingdom seeks to achieve a number of targets related to the tourism sector within Vision 2030, within the framework of working to diversify the economy, with a huge number of tourist visits.”

    The Kingdom is a prominent tourist destination. The Kingdom has always been a prominent tourist destination throughout the ages, with Muslims from all over the world flocking to it to visit the holy lands of Mecca and Medina, to perform Hajj and Umrah, visit the Prophet’s Mosque, and to view historical landmarks and monuments. Over time, and with the influx of large numbers to the Kingdom, the government began planning to grow and diversify the tourism sector to include cultural, entertainment, and sports tourism, in addition to religious destinations. In light of these rapid transformations, particularly in the 21st century, In the twentieth century, the General Commission for Tourism and National Heritage was established, which grew and now became the Ministry of Tourism. It aims to develop the tourism sector and attract visitors from all over the world to the Kingdom. With its continued efforts to develop and change, in 2019, the Kingdom witnessed the launch of the electronic tourist visa, which included 63 countries and facilitated international tourists’ visits with easy mechanisms and fees. The Kingdom is currently working with concerted efforts to implement its future plans to create major tourism projects and develop domestic tourism, such as the “Red Sea” project, which it aspires to transform 90 islands into a luxury tourist destination, and the “NEOM” project, which is considered one of the The largest tourism and economic project, it represents a meeting point between the three continents, and the “Amal” project, which aims to establish a completely new and different concept of tourism centered around the elements of life such as comfort, health, and luxury. The “Qiddiya” project stands out as a destination that combines entertainment, natural attractions, and residential areas. The Kingdom also seeks to benefit from the components of each of its regions, whether its climate or its prominent historical monuments. “Al-Aqsa Governorate” is one of these areas that benefit from it, due to its distinguished history and ancient civilization, such as the city of “Al-Hijr”, as it embraces a group of archaeological sites and the headquarters of the Historically, the “Dadani” and “Lihyan” kingdoms, and in the capital, specifically in the home of the rulers, “Diriyah,” which has emerged with its heritage project, “Diriyah Gate,” which is considered one of the distinctive additions to the Kingdom’s vision objectives to attract the largest number of tourists to the heart of the capital. It is currently being rehabilitated and developed to attract 25 million visitors annually, and has become the largest heritage and cultural project in the world, strengthening the Kingdom’s presence on the global tourism map.

    Authenticity of Heritage
    The Kingdom is distinguished by the diversity of its cultural heritage, and it makes great efforts to preserve it and ensure its sustainability so that the world can see the authenticity of its heritage and its ancient history.
    From this standpoint, Dr. Fahd Al-Hassan, Vice Dean of the College of Tourism and Antiquities at King Saud University, said: “The Kingdom is distinguished by a heritage that distinguishes it from other countries. It possesses hundreds of heritage sites and monuments, some of which remain unknown even to Saudi citizens, while some date back to prehistoric times, and some represent chapters of the story of the development of Basra and its migrations from the Arabian Peninsula. The rock art sites, parts of which date back 12,000 years, are among the largest and most exciting rock art sites in the world, and represent the The historical record that documents the fine details of Saudi culture, and these arts tell extraordinary and timely stories of how Saudis adapted to changing circumstances with determination and creativity.” He added: “The Kingdom’s registered heritage list includes more than 350 sites, in addition to ten sites inscribed on the UNESCO World Heritage List, and the inclusion of 15 representative cultural elements on the UNESCO Intangible Cultural Heritage List.” Dr. Al-Hosn stated that “the recent political and social changes led by His Royal Highness Crown Prince Mohammed bin Salman have significantly impacted cultural heritage management policies in the Kingdom of Saudi Arabia. These transformations are also closely linked to the Vision 2030 initiative, which places cultural heritage as a fundamental element in strengthening national identity and economic diversification. The Kingdom’s Vision 2030 explicitly calls for the preservation of heritage as part of its efforts to diversify the economy through tourism.” He spoke about the contribution of cultural tourism to the development of the Kingdom’s economy, saying: “Cultural tourism has a pivotal role in diversifying the Kingdom’s economy, through strengthening the hospitality, retail, and local services sectors. It has clearly contributed to the Kingdom’s international appeal and positioned it as a global destination not only for Hajj and Umrah, but also for the richness and diversity of its arts and ancient traditions. In turn, the Kingdom’s active participation in cultural diplomacy has led to stronger global relations and increased international appreciation for its rich heritage. There is no doubt that the Kingdom of Saudi Arabia is moving forward at a rapid pace.” “A clear path towards leadership in cultural tourism, which will open up broader horizons for hosting international events, forums, and conferences, and attracting visitors to explore its diverse natural landscapes and rich cultural heritage. As a result of these efforts, the number of international and local tourists will exceed 100 million in 2025, spending more than $66.6 billion.” Dr. Al-Hosn: “Heritage today plays a major role in attracting investments, promoting sustainable growth for the national economy, creating job opportunities, attracting Saudi youth, and instilling a deep sense of pride in the nation. It is expected that by 2030, the cultural heritage sector will contribute more than $47.9 billion to the Kingdom’s GDP.”

    Reaching Global Prominence
    After the Ministry of Tourism announced its first steps in the tourism sector in 2019, which was the launch of 11 tourist seasons covering a large portion of the Kingdom’s regions, since that announcement, the Kingdom has witnessed qualitative and famous leaps that have propelled it to global prominence. In this context, Dr. Imad Mansi, Chairman of the Saudi Tourism Association, said: “The government is striving to raise citizens’ aspirations regarding the entertainment sector, and is pumping huge sums into this sector, with annual investment reaching approximately 4 billion riyals.” He added: On the other hand, the Saudi seasons, especially the “Riyadh Season,” which has become famous for its distinctive events such as “Boulevard World,” have been able to fully convey Saudi culture to foreign tourists, as well as to local tourists who cannot travel to all regions of Saudi Arabia. This is achieved by conveying customs and traditions, famous foods, and the dialects that are unique to each region, as well as the character of its heritage and its rich decorations. On the other hand, the entertainment sector does not only include events that entertain visitors; It also supports culture through the production of series and films, which have proven that Saudi Arabia is a producer, director, and supporter of young talents and capabilities, and exports its distinction to the world so that it can see and explore the cultural diversity that the Kingdom enjoys. These achievements made by the entertainment sector system are no less important than other sectors, such as the Ministry of Sports, which has penetrated and crossed the geographical borders of the entire world with its activities, and has also attracted tourists to enjoy its sporting events. The Ministry’s efforts are highlighted by the fact that it has more than 100 sports federations, each with specific responsibilities. Within the framework of what was previously mentioned, The Minister of Sports, His Royal Highness Prince Abdulaziz bin Turki Al-Faisal, seeks to transform the Kingdom into a global destination for sporting events. Dr. Mansi concluded his remarks by saying: “All the bodies established with the launch of the vision cooperate and work together to ensure the success of the tourism sector. No sector operates independently of another. They also receive significant support from higher authorities, which highlights the Kingdom’s efforts to continue its progress and impressive successes, and to develop strategies and plans to achieve the goals of its ambitious vision, especially in national tourism.”

    In this regard, Yousef Masnawi, a certified lawyer and arbitrator, stated the rights sought by the government to guarantee the right of tourists to enjoy an ideal experience on its lands, saying: “Our Kingdom has established an integrated legal framework that guarantees the rights of tourists on its lands in the security, financial, and service aspects. The Tourism System, issued by Royal Decree No. 18 of 1444 AH (2017 AD), includes… 0 2 2 (and its executive regulations, various controls that protect tourists and ensure they receive quality services,” accordingly, he added, emphasizing: “The Ministry of Tourism oversees the implementation of these regulations in coordination with other government agencies to ensure the strengthening of visitors’ confidence and the protection of their rights. The legal rights that benefit tourists are numerous, including, but not limited to, proper treatment and non-discrimination, with a prohibition on imposing undisclosed fees or refusing to provide services without justification, in addition to the right of residence, which includes not requiring a mahram for foreign women, and guaranteeing a refund in the event of cancellation or emergency closure.” Regarding the quality of tourism services and guidance, Mansouri adds: “Companies are committed to transparency, providing licensed guides and reliable information. Facilitated visa systems, such as the electronic tourist visa, which facilitates freedom of movement between regions, also stand out.” Mansouri added that regarding tourists’ financial rights, he said: “There is clear protection represented by setting prices and requiring the disclosure of large sums in accordance with anti-money laundering regulations. Transportation has been facilitated for them by regulating public transportation and vehicle rental, and ensuring that taxis and apps adhere to the official tariff.” In this context, He himself stated: “The regulations in our Kingdom guarantee the financial rights of tourists and protect them from exploitation. Service providers are not permitted to collect any amounts not stipulated in the agreed-upon price list. Service prices must be clearly displayed in Saudi riyals, including taxes and fees, in both Arabic and English. Tourists must also be provided with a detailed receipt when paying any amount for tourism services, showing the value of each service paid.” Masnawi emphasized that: “The Kingdom has been keen, through the continuous updating of regulations (such as the The new tourism law and its regulations aim to establish a comprehensive legal framework that protects the rights and dignity of tourists. Tourists in the Kingdom enjoy legal protection, whether in their place of residence, their travels, or their financial transactions. The efforts of ministries and agencies are integrated to ensure the implementation of these regulations. He pointed out that the primary goal of the Kingdom’s Vision 2030 is centered around diversifying the economic base, and that the tourism industry clearly plays a significant role in achieving the goals of the vision file. He added: One of the announced goals of the tourism sector is to reach 150 million tourists by 2030, and with its carefully drawn strategies and plans, it will be able to reach the number it aspires to even before 2030. He described the bright future of Saudi tourism as “becoming one of the best 7 distinctive tourist destinations on the planet.” The world level, and through its huge projects, it will surpass the ambitions that were set for it. In addition, it possesses the elements that surpass the rest of the countries, and without the slightest doubt, the contribution of the tourism sector may exceed 10% of the gross domestic product, and it will have a prominent role in leading major economic sectors that are directly and indirectly affected by the thriving tourism industry in the post-2030 period.

    By Amjad Izhar
    Contact: amjad.izhar@gmail.com
    https://amjadizhar.blog

  • Ethical Hacking and Penetration Testing with Kali Linux

    Ethical Hacking and Penetration Testing with Kali Linux

    The provided sources offer a comprehensive overview of cybersecurity in 2024. They explore foundational and advanced concepts crucial for aspiring cybersecurity professionals, including cryptography, risk management, security technologies, and ethical hacking methodologies. The texts detail various types of hackers, their motivations, and the ethical responsibilities of cybersecurity experts. Furthermore, the sources introduce essential tools like Nmap, Metasploit, and Wireshark, explaining their practical applications in vulnerability assessment and penetration testing. Finally, they discuss common cyber threats such as phishing, SQL injection, and cross-site scripting, alongside preventative measures and career paths in the cybersecurity field.

    Cybersecurity Fundamentals Study Guide

    Quiz

    1. Explain the concept of social engineering in the context of cybersecurity. Provide an example of a common social engineering tactic and why it is often successful.
    2. Describe the purpose of encryption in cybersecurity. Differentiate between symmetric and asymmetric encryption, highlighting a key advantage of each.
    3. What is a brute-force attack, and why can it be time-consuming? Briefly describe two other methods of cryptanalysis besides brute force.
    4. Explain the difference between a white hat hacker and a black hat hacker. What is the primary role of an ethical hacker within an organization?
    5. Outline the five phases of penetration testing. Which phase is considered the most crucial for a successful penetration test, and why?
    6. Define SQL injection and explain why it is a significant web application vulnerability. Provide a simple example of how an attacker might attempt an SQL injection.
    7. What is a Denial-of-Service (DoS) attack? How does a Distributed Denial-of-Service (DDoS) attack differ from a DoS attack, and why is it generally more challenging to mitigate?
    8. Explain what a botnet is and how it is typically created. What are botnets commonly used for in cyberattacks?
    9. Describe the main difference between a virus and a Trojan horse. Give one example of the negative impact each can have on a computer system.
    10. What is Wireshark, and why is it a valuable tool for network analysis in cybersecurity? Briefly explain what kind of information Wireshark allows a user to see.

    Quiz Answer Key

    1. Social engineering involves manipulating individuals into divulging confidential information or performing actions that compromise security. A common tactic is phishing, where fraudulent emails from seemingly trustworthy sources trick users into revealing passwords or clicking malicious links. This is often successful because it exploits human psychology, such as trust and urgency.
    2. Encryption transforms data into an unreadable format (ciphertext) to protect its confidentiality. Symmetric encryption uses the same key for encryption and decryption, offering speed. Asymmetric encryption uses separate public and private keys, simplifying secure key exchange.
    3. A brute-force attack involves trying every possible key combination to decrypt data, which can take a significant amount of time due to the vast number of potential keys. Two other cryptanalysis methods are dictionary attacks (using a list of common passwords) and rainbow table attacks (using pre-computed hash values).
    4. A white hat hacker (ethical hacker) works to find security vulnerabilities in systems with permission to improve security, while a black hat hacker exploits vulnerabilities for malicious purposes. The primary role of an ethical hacker is to identify weaknesses and recommend solutions to protect an organization’s assets.
    5. The five phases of penetration testing are reconnaissance (information gathering), scanning, exploitation, post-exploitation, and reporting. Reconnaissance is considered the most crucial because the quality and breadth of information gathered directly impact the effectiveness of subsequent phases by informing the choice of tools and attack vectors.
    6. SQL injection is a vulnerability that allows attackers to insert malicious SQL code into an application’s database queries. It’s significant because it can lead to data breaches, unauthorized access, and data manipulation. An attacker might try entering ‘ OR ‘1’=’1 into a username field to bypass authentication.
    7. A Denial-of-Service (DoS) attack aims to disrupt a service by overwhelming it with traffic from a single source, making it unavailable to legitimate users. A Distributed Denial-of-Service (DDoS) attack uses numerous compromised devices (bots) to flood the target, making it harder to block the attack source and increasing the volume of malicious traffic.
    8. A botnet is a network of compromised devices (bots) infected with malware and controlled remotely by a single attacker (bot herder). Botnets are typically created by exploiting vulnerabilities or using social engineering to spread malware. They are commonly used for DDoS attacks, spam distribution, and data theft.
    9. A virus is a malicious code that attaches itself to a host program and replicates by spreading to other programs, often causing system damage or data corruption. A Trojan horse disguises itself as legitimate software but contains hidden malicious functionality, such as creating backdoors for unauthorized access or stealing data.
    10. Wireshark is a network protocol analyzer that captures network packets in real time and displays them in a human-readable format. It is valuable for cybersecurity as it allows users to examine network traffic, identify security issues, troubleshoot network problems, and understand communication protocols at a detailed level, including source and destination IPs, protocols used, and data content.

    Essay Format Questions

    1. Discuss the evolving landscape of cyber threats and the increasing importance of ethical hacking in mitigating these risks. Provide specific examples of how ethical hacking methodologies can be applied to different types of cyber threats.
    2. Compare and contrast different types of social engineering attacks, analyzing the psychological principles that attackers exploit. Evaluate the effectiveness of various countermeasures that organizations and individuals can implement to defend against these attacks.
    3. Analyze the strengths and weaknesses of different encryption methods (symmetric vs. asymmetric) and cryptanalysis techniques. Discuss scenarios where specific encryption algorithms and cryptanalysis approaches are most effective or vulnerable.
    4. Evaluate the significance of penetration testing in an organization’s cybersecurity strategy. Discuss the different phases of a penetration test and the critical factors that contribute to its success in identifying and addressing vulnerabilities.
    5. Examine the technical mechanisms and impacts of Denial-of-Service and Distributed Denial-of-Service attacks. Discuss various strategies and technologies that organizations can employ to prevent and mitigate these types of attacks.

    Glossary of Key Terms

    • Academic Qualifications: Formal certifications and degrees obtained through educational institutions.
    • Algorithm: A step-by-step procedure or set of rules used to solve a problem or perform a computation.
    • Anonymization: The process of removing personally identifiable information from data to protect privacy.
    • Antivirus: Software designed to detect and remove malicious software (malware) like viruses and Trojans.
    • API Token: A unique identifier used to authenticate an application or user accessing an Application Programming Interface (API).
    • ARP Spoofing: A malicious technique where an attacker sends falsified Address Resolution Protocol (ARP) messages over a local area network.
    • Authentication: The process of verifying the identity of a user, device, or process.
    • Authorization: The process of determining what actions a user, device, or process is permitted to perform.
    • Bash Script: A series of commands written in the Bash (Bourne-Again SHell) scripting language, used for automation in Linux and other Unix-like operating systems.
    • Black Hat Hacker: An individual who attempts to gain unauthorized access to computer systems or networks for malicious purposes.
    • Block Cipher: A type of symmetric encryption algorithm that encrypts data in fixed-size blocks.
    • Bot Herder: The individual who controls a botnet.
    • Botnet: A network of compromised computers or devices (bots) controlled remotely by an attacker to perform malicious tasks.
    • Brute Force Attack: A cryptanalysis technique that involves trying every possible key or password until the correct one is found.
    • Buffer Overrun: A vulnerability that occurs when a program writes more data to a buffer than it is allocated to hold, potentially overwriting adjacent memory.
    • Burp Suite: A popular integrated platform used for web application security testing.
    • Caesar Cipher: A simple substitution cipher where each letter in the plaintext is shifted a certain number of places down the alphabet.
    • Capturing Data: The act of intercepting and recording network traffic or other digital information.
    • Certified Ethical Hacker (CEH): An individual who has the skills and knowledge to look for weaknesses and vulnerabilities in target systems and uses the same knowledge and tools as a malicious hacker, but in a lawful and legitimate manner.
    • Cipher: The result of encrypting plaintext; also refers to a method of encryption.
    • Ciphertext: Data that has been encrypted and is unreadable without the correct decryption key.
    • Command Line Interface (CLI): A text-based interface used to interact with an operating system or application by typing commands.
    • Content Delivery Network (CDN): A geographically distributed network of proxy servers and their data centers.
    • Cryptography: The art and science of concealing information to make it unreadable to unauthorized individuals.
    • Cryptanalysis: The art of breaking codes and ciphers; analyzing cryptographic systems to reveal hidden information.
    • Cyber Attack: A malicious attempt to gain unauthorized access to a computer system, network, or digital information, typically to disrupt operations, steal data, or cause other harm.
    • Cyber Security: The practice of protecting computer systems, networks, and digital information from theft, damage, disruption, or unauthorized access.
    • Data Breach: A security incident in which sensitive, protected, or confidential data is copied, transmitted, viewed, stolen, or used by an individual unauthorized to do so.
    • Data Encryption Standard (DES): A symmetric-key algorithm for encrypting digital data.
    • Decryption: The process of converting ciphertext back into its original plaintext using the correct key.
    • Deep Web: Parts of the World Wide Web whose contents are not indexed by standard search engines.
    • Denial of Service (DoS) Attack: An attack that aims to make a computer resource unavailable to its intended users.
    • Dictionary Attack: A cryptanalysis technique that tries to crack passwords by testing words from a dictionary.
    • Digital Signature: A mathematical technique used to validate the authenticity and integrity of a message or document.
    • Distributed Denial of Service (DDoS) Attack: A type of DoS attack where the malicious traffic originates from multiple compromised devices.
    • DNS Enumeration: The process of locating DNS servers and records for a specific domain.
    • Email Spoofing: The forgery of an email header so that the message appears to have originated from someone or somewhere other than the actual source.
    • Enigma: A famous cryptographic cipher device used by Nazi Germany during World War II.
    • Encryption: The process of converting data into an unreadable format (ciphertext) to protect its confidentiality.
    • Exploit: A piece of software, a chunk of data, or a sequence of commands that takes advantage of a vulnerability to cause unintended or unanticipated behavior on computer software, hardware, or something electronic.
    • Firewall: A network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules.
    • Fishing (Phishing): A type of social engineering attack where attackers send fraudulent messages designed to trick individuals into revealing sensitive information.
    • Forensic Analysis: The process of examining digital evidence to understand security incidents and gather information for legal or investigative purposes.
    • Hash Function: A mathematical function that converts an input of arbitrary size into an output of a fixed size (the hash value).
    • Hash Value: The output of a hash function; often used to verify data integrity.
    • Hping3: A command-line oriented TCP/IP packet generator and analyzer.
    • HTTPS: A secure version of the HTTP protocol that uses encryption for secure communication over the internet.
    • Hypertext Markup Language (HTML): The standard markup language for creating web pages.
    • Incident Response: The process of handling and managing the aftermath of a security incident.
    • Initialization Vector (IV): A block of bits used in cryptographic algorithms to randomize the encryption and decryption process.
    • Internet Protocol (IP) Address: A numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication.
    • John the Ripper: A popular open-source password security auditing and password recovery tool.
    • Kali Linux: A Debian-based Linux distribution designed for digital forensics and penetration testing.
    • Key: A piece of information used in cryptography to encrypt or decrypt data.
    • Key Generation: The process of creating cryptographic keys.
    • Localhost (LHOST): The IP address of the local computer (typically 127.0.0.1).
    • Macro Virus: A computer virus written in a macro language embedded in a software application.
    • Malicious Hackers (Black Hats): Individuals who exploit vulnerabilities in computer systems or networks for unauthorized or harmful purposes.
    • Malware: Software that is intended to damage or disable computers and computer systems.
    • Man-in-the-Middle (MITM) Attack: An attack where the attacker secretly relays and potentially alters the communications between two parties who believe they are communicating directly with each other.
    • Master Boot Record (MBR): The first sector of a storage device that contains code to boot the operating system.
    • Metasploit: A penetration testing framework that contains a collection of exploits and tools.
    • Network Architecture: The design and structure of a computer network, including its components and their interactions.
    • Network Packet: A small unit of data transmitted over a network.
    • Nikto: An open-source web server scanner that performs comprehensive tests against web servers for multiple types of vulnerabilities.
    • OASSP Broken Web Applications Project: A collection of intentionally vulnerable web applications used for security testing and training.
    • Onion Links: Special URLs used to access hidden services on the Tor network.
    • OpenVAS (Greenbone Vulnerability Manager): A comprehensive vulnerability management system.
    • Operating System (OS): The software that supports a computer’s basic functions, such as scheduling tasks, executing applications, and controlling peripherals.
    • Packet Filtering Firewall: A firewall that controls network access by examining the source and destination addresses, protocols, and ports of network packets.
    • Password Cracking: The process of attempting to recover passwords from stored or transmitted data.
    • Password Policies: A set of rules designed to enhance computer security by encouraging users to employ strong passwords and use them properly.
    • Penetration Testing: A simulated cyberattack performed on a computer system or network to evaluate its security.
    • Payload: The part of an exploit that performs the intended malicious action.
    • Peer-to-Peer (P2P) Model: A decentralized communication model where each node can act as both a client and a server.
    • Phishing: See Fishing.
    • Plaintext: Unencrypted data.
    • Port (Networking): A communication endpoint in a computer’s operating system associated with a specific service or application.
    • Proxy Chains: A tool that forces any TCP connection made by any given application to follow a chain of proxies.
    • Proxy Firewall: A firewall that acts as an intermediary between a network and the internet, handling requests on behalf of client systems.
    • Public Key: A cryptographic key that can be shared with others and is used for encryption or verifying digital signatures.
    • Rainbow Table Attack: A cryptanalysis technique that uses pre-computed tables of hash values to crack passwords.
    • Ransomware: A type of malware that encrypts a victim’s files and demands a ransom payment to restore access.
    • Reconnaissance: The initial phase of a penetration test or attack where information about the target is gathered.
    • Reverse Engineering: The process of analyzing a hardware or software system to understand its design and functionality.
    • Reverse TCP Connection: A type of network connection where the target machine initiates the connection back to the attacker’s machine.
    • Risk Assessment: The process of identifying, analyzing, and evaluating potential risks.
    • Root Access: The highest level of access control in Unix-like operating systems.
    • Router: A networking device that forwards data packets between computer networks.
    • RSA: A public-key cryptosystem that is widely used for secure data transmission.
    • Scanning (Penetration Testing): The phase of a penetration test where tools are used to identify open ports, services, and vulnerabilities on the target system.
    • Security Auditing: A systematic evaluation of the security of an organization’s information systems.
    • Server Message Block (SMB): A network file-sharing protocol.
    • Shell: A command-line interpreter that provides an interface to the operating system.
    • Shellcode: A small piece of code used as the payload in the exploitation of software vulnerabilities.
    • Simply Learn: (In the context of the source) An educational platform or website.
    • Sniffing: The process of monitoring and capturing network traffic.
    • Social Engineering: The manipulation of individuals to perform actions or divulge confidential information.
    • SQL (Structured Query Language): A domain-specific language used in programming and designed for managing data held in a relational database management system.
    • SQL Injection: A code injection technique used to attack data-driven applications, in which malicious SQL statements are inserted into an entry field for execution.
    • SSL Handshake: The process that initiates a secure communication session between a client and a server using the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocol.
    • Stateful Inspection Firewall: A firewall that keeps track of the state of network connections and makes decisions based on the context of these connections.
    • Subdomain: A domain that is part of a larger domain.
    • Substitution Cipher: A method of encryption by which units of plaintext are replaced with ciphertext according to a regular system.
    • Sudo: A program that allows a permitted user to execute a command as the superuser or another user, as specified by the security policy.
    • Superuser: A user with administrative privileges (e.g., root in Linux).
    • Symmetric Encryption: An encryption method in which the same key is used for both encryption and decryption.
    • SYN Packet: A type of TCP packet used to initiate a connection.
    • Target URI: The specific Uniform Resource Identifier (path) on a server that is being targeted by an attack.
    • TCP/IP: The suite of communication protocols used to interconnect network devices on the Internet.
    • Tor Browser: A web browser designed for anonymity and privacy, using the Tor network.
    • Trojan Horse: A type of malware that appears to be legitimate software but performs malicious actions when run.
    • Uncertified Websites: Websites that do not have valid security certificates, potentially indicating a risk.
    • Vulnerability: A weakness in a system that can be exploited by a threat.
    • Vulnerability Assessment: The process of identifying and quantifying security vulnerabilities in a system.
    • Vulnerability Scanner: An automated tool used to identify potential vulnerabilities in computer systems and networks.
    • VPN (Virtual Private Network): A network that extends a private network across a public network, and enables users to send and receive data across shared or public networks as if their computing devices were directly connected to the private network.
    • Web Server: A computer system that serves web pages and related content to clients.
    • White Hat Hacker (Ethical Hacker): A security expert who uses hacking skills to identify security vulnerabilities in systems with the permission of the owner, with the goal of improving security.
    • Wi-Fi Hacking Tools: Software and techniques used to exploit vulnerabilities in wireless networks.
    • Wireshark: A free and open-source packet analyzer used for network troubleshooting and analysis.
    • WPScan: A free, non-commercial vulnerability scanner for WordPress websites.
    • Zenmap: The official Nmap Security Scanner GUI.

    Detailed Briefing Document: Review of Cyber Security and Ethical Hacking Concepts

    Introduction:

    This briefing document summarizes the main themes, important ideas, and facts presented in the provided source material (“01.pdf”). The document covers a range of cybersecurity topics, from social engineering attacks and cryptography to ethical hacking methodologies, network security measures, malware, and practical demonstrations of penetration testing using tools like Kali Linux. Quotes from the original source are included to highlight key concepts.

    1. Social Engineering Attacks:

    The source emphasizes the human element as a significant vulnerability in security. Attackers often exploit natural human tendencies like curiosity and greed to gain access to systems or information.

    • Exploiting Trust: Attackers may pose as legitimate entities to elicit sensitive information. “if a person can interact with you let’s say they’re trying to take a survey and they approach you for a feedback on a particular product that you have been utilizing and they ask you these questions you wouldn’t think twice before giving those answers as long as the request sounds legitimate to us we are able to justify that request we do answer those queries so it’s upon us to verify the authenticity of the request coming in before we answer it.”
    • Phishing: This involves fraudulent emails appearing from trusted sources. “fishing as discussed would be fraudulent emails which appear to be coming from a trusted source so email spoofing comes into mind fake websites and so on so forth.”
    • Exploiting Curiosity: Leaving infected devices like USB drives in public places can lure unsuspecting individuals. “there’s so many physical attacks where hackers just keep pen drives lying around in a parking lot now this is a open generic attack whoever falls victim will fall victim so if I just throw around a few USBs in the parking lot obviously with Trojans implemented on them some people who are curious or who are looking for a couple of freebies might take up those pen drives plug them in their computers to see what data is on the pen drives at the same time once they plug in there those pen drives on their computers the virus or the Trojan would get infected and cause harm to their machine.”
    • Exploiting Greed: Scams like Nigerian frauds and fake lotteries prey on individuals’ desire for quick financial gain. “exploiting human greed we just talked about the Nigerian frauds and the lotteryies those kind of attacks the fake money-making gimmicks now basically this is where you prey upon the person’s uh greed kicking in and they clicking on those links in order to uh get that money that has been promised to them in that email.”

    2. Cryptography:

    Encryption is presented as a fundamental mechanism for data privacy and security.

    • Encryption Process: Cryptography involves scrambling data using algorithms to make it unreadable without the correct key. “one of the safest mechanism to keep data private and to keep yourself secure is using encryption now encryption can happen through cryptography what is cryptography cryptography is the art of scrambling data using a particular algorithm so that the data becomes unreadable to the normal user the only person with the key to unscramble that data would be able to unscramble it and make sense out of that data so we’re just making it unreadable or non-readable by using a particular key or a particular algorithm and then we’re going to send the key to the end user the end user using the uh same key would then decrypt that data if anybody compromises that data while it is being sent over the network since it is encrypted they would not be able to read it.”
    • Cipher and Decryption: Encrypted data is called a cipher. Decryption is the reverse process using the key. The source illustrates a simple substitution cipher. “the encrypted message is also known as a cipher the decryption is just the other way around where you know the key now and you can now figure out what that e correspondent to by going back three characters in the alphabet.”
    • Cryptanalysis: This is the process of decrypting a message without knowing the secret key. “decryption without the use of a secret key that is known as a crypt analysis crypto analysis is the reversing of an algorithm to figure out what the decryption was without using a key.”
    • Cryptanalysis Techniques: The source mentions three common techniques:
    • Brute Force Attack: Trying every possible key combination. “a brute force attack is trying every combination permutation and combination of the key to figure out what the key was it is 100% successful but may take a lot of time.”
    • Dictionary Attack: Using a list of potential keys (words). “a dictionary attack is where you have created a list of possible encryption mechanisms a list of possible cracks and then you try to figure out whether those cracks work or not.”
    • Rainbow Table Attack: Comparing encrypted text with pre-computed tables of hashes. “rainbow tables are where you have an encrypted text in hand and you’re trying to figure out uh the similarities between the text that you have and the encrypted data that you wanted to decrypt in the first place.”
    • Spam Mimic: The source demonstrates a tool that encodes messages into seemingly unrelated spam emails for obfuscation. “to begin with the demo of cryptography we are on a website called spammimic.com which will help us scramble the message that we created into a completely format which would be unrelated to the topic at hand so if I say I want to encode a message turn a short message into spam so what this does is want to send across a secret message you type in the secret message a short one and it will convert that into a spam mail you send it across so whoever is reading that spam mail would never get an idea of the embedded message within it.”

    3. Ethical Hacking:

    The source differentiates between ethical and malicious hackers and outlines the responsibilities of an ethical hacker.

    • White Hat vs. Black Hat: Security experts who work defensively are “white hat hackers,” while malicious attackers are “black hats.” “vulnerabilities and we report them back to the victim or to the client and help them uh patch those vulnerabilities that’s the main difference between a white hat and a black hat so security experts are normally termed as white hat hackers malicious hackers are termed as black hats.”
    • Responsibilities of an Ethical Hacker: These include:
    • Identifying and testing vulnerabilities. “first and foremost you have to create scripts test for vulnerabilities first have to identify those in the first place so there’s a vulnerability assessment identifying those vulnerabilities and then you’re going to test them to see the validity and the complexity of those vulnerabilities.”
    • Developing security tools and configurations. “your one of your responsibilities would be to develop tools to increase security as well or to configure security in such a way that it would be difficult to breach.”
    • Performing risk assessments. “performing risk assessment now what is a risk risk is a threat that is posed to an organization by a possibility of getting hacked… I do a risk assessment to identify which vulnerability is critical would have the most impact on the client and what would be the repercussions if those vulnerabilities actually get exploited.”
    • Setting up security policies. “another responsibility of the ethical hacker is to set up policies in such a way that it becomes difficult for hackers to get access to devices or to protected data.”
    • Training staff on network security. “and finally train the staff for network security so uh we got a lot of employees in an organization we need to train the staff of what is allowed and what is not allowed how to keep themselves secure so that they don’t get compromised thus becoming a vulnerability themselves to the organization.”
    • Implementing administrative policies like password policies. “the policies that we have talked about are administrative policies to govern the employees of the organization for example password policies most of the organizations will have a tough password policy where they say you have to create a password that meets a certain level of complexity before that can be accepted and till you create that password you’re not allowed to log in or you’re not allowed to register.”

    4. Penetration Testing:

    Penetration testing is a focused effort to exploit identified vulnerabilities in information systems.

    • Vulnerability Assessment as a Precursor: It involves scanning for potential flaws before attempting penetration. “now for penetration testing there is a phase called vulnerability assessment that happens before this vulnerability assessment is nothing but running a scanning tool to identify a list of potential flaws or vulnerabilities within the organization.”
    • Focus on Exploitation: Penetration testing aims to actively breach security defenses. “this is the part of ethical hacking where it specifically focuses on penetration only of the information systems… the essence of penetration testing is to penetrate information systems using various attacks.”
    • Attack Vectors: These can include phishing, password cracking, Denial of Service (DoS), and exploiting other identified vulnerabilities. “the attacks could be anything like a phishing attack a password cracking attack a denial of service attack or any other vulnerabilities that you have identified uh during the vulnerability scan.”

    5. Kali Linux:

    Kali Linux is highlighted as a popular operating system for both ethical and malicious hackers due to its pre-installed security tools.

    • Tool-Rich Distribution: It contains over 600 tools for penetration testing and security auditing. “what is Kali Linux and why is it used kali Linux is an operating system oftenly used by hackers and ethical hackers both because of the tool sets that the operating system contains it is a operating system created by professionals with a lot of embedded tools it is a DVN based operating system with advanced penetration testing and security auditing features there are more than 600 plus odd tools on that operating system that can help you leverage any of the attacks.”
    • Versatile Capabilities: These tools support various security tasks like man-in-the-middle attacks, sniffing, password cracking, computer forensics, reverse engineering, and information gathering. “contains like I said a hundred of hundreds of tools that are used for various information security tasks like uh computer forensics re reverse engineering information finding even uh getting access to different machines and then uh creating viruses worms to anything that you will 600 plus tools in the Kali Linux operating system.”
    • Key Features: Kali Linux is open-source, free, regularly updated, customizable, supports wireless network cards and multiple languages, and allows for creating custom attacking scripts and exploits.

    6. Phases of Penetration Testing:

    The source outlines five key phases of a penetration test:

    • Reconnaissance (Information Gathering): This crucial phase involves collecting as much information as possible about the target. “the first one is the reconnaissance phase also known as the information gathering phase this is the most important phase for any hacker this is where the hacker or the ethical hacker if you will will gather as much information about the targets victim or vice versa the vict the victim right… for example you want to find out the IP addresses the domains subdomains the network architecture that is being utilized you want to identify operating systems that are being utilized.”
    • Scanning: Using tools to identify open ports, services, and potential vulnerabilities based on the information gathered. “the second phase is the scanning phase once you have gathered enough information about the target you would then start probing the network or the devices that are within the scope of your test to identify open ports what services are running on those ports what operating systems and versions are being utilized by those machines.”
    • Gaining Access (Exploitation): Attempting to exploit identified vulnerabilities to gain unauthorized access to the system. “the third phase is gaining access based on the information gathered in the first two phases and the vulnerabilities that you have identified in the second phase you would then try to exploit those vulnerabilities to gain access to the system or the application this could involve using various techniques such as exploiting software flaws, weak passwords, or social engineering tactics.”
    • Maintaining Access (Post-Exploitation): Once access is gained, the focus shifts to maintaining that access and potentially escalating privileges. “the fourth phase is maintaining access once you have gained access to a system or an application you would want to maintain that access for a certain period of time to gather more information or to perform further actions this could involve installing back doors, creating new accounts, or pivoting to other systems within the network.”
    • Reporting: Documenting the findings, vulnerabilities exploited, and recommendations for remediation. “the final phase is reporting once the penetration test is complete you would document all of your findings, the vulnerabilities that you have exploited, the impact of those vulnerabilities, and your recommendations for remediation this report is then provided to the client to help them improve their security posture.”

    7. Vulnerability Assessment Examples:

    The source provides demonstrations of common vulnerabilities:

    • SQL Injection: This attack exploits vulnerabilities in how web applications handle user input to interact with databases. By injecting malicious SQL code, an attacker can bypass authentication or extract sensitive data. The demonstration shows how a simple SQL injection can bypass a login form (“single quote or 1= 1 space – space”) and how a different injection can dump database contents in a user lookup form (“single quote or 1= 1 space”). The source emphasizes that “the vulnerability will always lie in the application it is the developer’s prerogative of how to develop the application how to configure it to prevent SQL injection queries from happening.” Different types of SQL injection are mentioned: inband (error-based, union-based), blind (boolean-based, time-based), and out-of-band.
    • Password Cracking: The demonstration uses the “Kane enable” tool on a Windows 7 machine to extract password hashes and attempts to crack them using a brute-force attack. It highlights how Windows stores password hashes and the time-consuming nature of brute-force attacks.
    • Shellshock Vulnerability: The source demonstrates exploiting the Shellshock vulnerability on a Linux web server using Kali Linux and Metasploit. This involves using reconnaissance tools like Zenmap and Sparta to identify the target and the vulnerability, and then using Metasploit to execute a payload and gain remote access (“meterpreter session”).

    8. Network Security Measures:

    The document touches upon several network security technologies:

    • VPN (Virtual Private Network): VPNs encrypt internet traffic and mask the user’s IP address, enhancing privacy and security, especially on public Wi-Fi. The example of Jude at the airport illustrates the risks of using public Wi-Fi without a VPN, where a hacker could intercept her bank transaction details. “bank officials advise her to use a VPN for future transactions especially when connecting to an open or public network.” The process involves the user’s computer connecting to the ISP, then to the VPN server (which encrypts the data and provides a new IP address), and finally to the target server.
    • Tor (The Onion Router): Tor is presented as a network that anonymizes internet traffic by routing it through multiple relays. It hides the user’s IP address and location. The demonstration shows how to use the Tor Browser, check the apparent IP address and location, and access “.onion” websites (hidden services). “the tour browser is a very effective way of anonymizing your internet activity it works by routing your traffic through multiple relays across the world encrypting it at each step and making it very difficult to trace your original IP address or your location.”
    • Firewalls: Firewalls act as virtual walls, filtering incoming and outgoing network traffic based on predefined rules. They protect devices from unauthorized access and malicious data packets. “firewalls are security devices that filter the incoming and outgoing traffic within a private network… the firewall works like a gatekeeper at your computer’s entry point which only welcomes incoming traffic that it has been configured to accept.” Different types of firewalls are mentioned: packet filtering, stateful inspection, and proxy firewalls.

    9. Malware:

    The source discusses different types of malware:

    • Viruses: These are malicious programs that attach themselves to other files and replicate. Types discussed include boot sector viruses (affecting system startup), macro viruses (embedded in documents), and direct action viruses (activate upon execution and then exit). “for the first part we saw the main objective of the virus is to harm the data and information in a system… viruses have the ability to replicate itself to harm multiple files whereas Trojan does not have the replication ability.” Detection methods include system slowdowns, application freezes, data corruption, unexpected logouts, and frequent crashes. The MYDOOM virus is mentioned as a famous example.
    • Trojans: Trojans disguise themselves as legitimate software but perform malicious actions once executed. Types discussed include backdoor Trojans (providing remote access), click fraud Trojans (generating fraudulent clicks), and ransomware Trojans (blocking access and demanding payment). “for the Trojan we have stealing of the data files and information… Trojan horses are remote accessed and lastly viruses have the ability to replicate itself to harm multiple files whereas Trojan does not have the replication ability.” Detection includes frequent crashes, slow reaction times, random pop-ups, and changes in system applications and desktop appearance. The Emotet Trojan is mentioned for financial theft.
    • Botnets: These are networks of infected devices (bots) controlled remotely by an attacker (bot herder) to perform large-scale attacks like data theft, server failures, malware propagation, and DoS attacks. The creation process involves preparing the botnet army (infecting devices), establishing connection to the control server, and launching the attack. Architectures include client-server and peer-to-peer models. The Mirai and Zeus botnets are given as examples.

    10. Denial of Service (DoS) Attacks:

    DoS attacks aim to disrupt services by overwhelming a target with traffic, making it unavailable to legitimate users. “a denial of service attack is an attack that aims to make a computer or a network resource unavailable to its intended users by disrupting the service of a host connected to the internet.” The source explains Distributed Denial of Service (DDoS) attacks involve multiple compromised systems launching attacks simultaneously. Mitigation techniques include over-provisioning bandwidth and using a Content Delivery Network (CDN). A demonstration using the “hping3” tool from Parrot Security to flood a Linux Light virtual machine with SYN packets showcases the impact of a DoS attack.

    11. Wi-Fi Hacking:

    The source demonstrates capturing Wi-Fi handshakes and attempting to crack passwords using tools within Kali Linux (likely Aircrack-ng suite, although “Air Garden” is mentioned as a multi-use bash script). The process involves using tools to monitor wireless networks, capture the WPA/WPA2 handshake during authentication, and then using brute-force or dictionary attacks to try and decrypt the handshake file and reveal the Wi-Fi password.

    12. Security Tools (Beyond Kali Specifics):

    The source briefly introduces several key security tools:

    • Wireshark: A network protocol analyzer used for capturing and analyzing network traffic at a microscopic level, aiding in real-time or offline network analysis and identifying traffic patterns. “Wireshark is a popular open-source tool to capture network packets and converts them to human readable binary format it provides every single detail of the organization’s network infrastructure it consists of devices designed to help measure the ins and outs of the network.”
    • Air Garden: Described as a multi-use bash script for Linux systems to hack and audit wireless networks, capable of launching DoS attacks and supporting various Wi-Fi hacking methods.
    • John the Ripper: An open-source password security auditing and recovery tool supporting numerous hash and cipher types, utilizing dictionary attacks and brute-forcing. “john the Ripper is an open-source password security auditing and password recovery tool available for many operating systems john the Ripper Jumbo supports hundred of hash and cipher types including for user passwords of operating systems web apps groupware database servers network traffic captures encrypted private keys file systems and document files.”
    • Nmap (Network Mapper): A network scanning tool using IP packets to identify devices, open ports, services, and operating systems on a network.
    • Burp Suite: A powerful tool for web application security testing, used for configuring proxies, intercepting and inspecting traffic, and identifying vulnerabilities.
    • Metasploit Framework: A penetration testing tool used for exploit development and execution against identified vulnerabilities, providing a platform for launching attacks and gaining access to systems.

    13. Cryptography Algorithms in Detail:

    The source delves deeper into specific cryptographic algorithms:

    • Hashing: A process that creates a fixed-size output (hash value) from variable-sized input data. Hash functions are generally not reversible without extensive brute-force efforts and are useful for storing passwords securely by comparing hash values instead of plain text.
    • Symmetric Cryptography: Uses the same key for both encryption and decryption.
    • DES (Data Encryption Standard): An older symmetric block cipher with a 56-bit key. Despite its past prominence, its short key length makes it vulnerable to brute-force attacks. The source explains the Feistel structure it uses, involving multiple rounds of substitution and permutation. Different modes of operation (ECB, CBC, CFB, OFB, Counter) are also discussed. Its dominance ended in 2002 when AES replaced it as the standard.
    • AES (Advanced Encryption Standard): A symmetric block cipher with 128-bit block size and key sizes of 128, 192, or 256 bits. It became the NIST standard in 2002 due to DES’s short key length.
    • Asymmetric Cryptography: Uses separate keys for encryption (public key) and decryption (private key).
    • RSA: A public-key signature algorithm and encryption/decryption algorithm. The source explains the key generation process involving two large prime numbers, and the encryption and decryption formulas. It can be used for both securing data exchange and verifying digital signatures.
    • Digital Signatures: Used to verify the authenticity and integrity of data.
    • DSA (Digital Signature Algorithm): A public key signature algorithm. The source outlines the key generation, signature generation (using a hash function and random integer), and signature verification processes. It highlights DSA’s robustness and faster key generation compared to RSA.

    14. Ethical Considerations and AI in Cyber Security:

    The document touches upon the ethical use of hacking techniques, emphasizing the importance of permission and controlled environments. It also introduces “HackerGPT,” an AI language model trained in cybersecurity, capable of answering questions, providing code snippets for tasks like port scanning and log monitoring, and explaining security concepts like SQL injection and Burp Suite configuration. This suggests the growing role of AI in both offensive and defensive cybersecurity practices.

    15. Penetration Testing Methodologies (Types):

    The source categorizes penetration testing based on the tester’s knowledge of the system:

    • Black Box Testing: The tester has no prior knowledge, simulating an external attacker.
    • White Box Testing: The tester has full access to system details, simulating an insider threat or a highly informed attacker.
    • Gray Box Testing: The tester has partial knowledge, such as user credentials or limited architecture details.

    16. Installation of Security Tools on Kali Linux:

    The document provides a practical guide to installing essential penetration testing tools on Kali Linux using the sudo apt install command. Tools mentioned include Nmap, Whois, Dig (DNS utilities), Nikto, WPScan, OpenVAS (Greenbone Vulnerability Manager), and Metasploit Framework. It also demonstrates checking the versions of some of these tools.

    Conclusion:

    The provided source material offers a comprehensive overview of various cybersecurity concepts, ranging from social engineering tactics to advanced cryptographic algorithms and practical penetration testing methodologies. It highlights the importance of understanding both offensive and defensive security techniques and introduces the role of specialized tools like Kali Linux and the emerging influence of AI in the field. The inclusion of practical demonstrations and tool installation guides provides a valuable introduction to hands-on cybersecurity practices, albeit within ethical and controlled environments.

    General Cyber Security Concepts

    • What are some common social engineering tactics used in cyber attacks? Social engineering exploits human psychology to gain access to systems or information. Common tactics include phishing (fraudulent emails from trusted sources), exploiting curiosity (leaving infected USB drives in public places), and exploiting greed (Nigerian scams, fake lotteries). Attackers often impersonate legitimate entities or create seemingly plausible scenarios to trick individuals into divulging sensitive data or performing malicious actions. Verifying the authenticity of requests and being cautious about unsolicited offers are crucial defenses against these tactics.
    • What is encryption and why is it important for data security? Encryption is the process of scrambling data using a specific algorithm (cryptography) so that it becomes unreadable to unauthorized users. The original data can only be restored (decrypted) by someone possessing the correct key. Encryption is a fundamental security mechanism for keeping data private and secure, especially when transmitted over networks. Even if data is intercepted, without the decryption key, it remains nonsensical to the attacker. Various algorithms exist, and their complexity determines the difficulty of breaking the encryption.
    • What is cryptanalysis and what are some common techniques used in it? Cryptanalysis is the process of decrypting encrypted data (ciphertext) without knowing the secret key. It involves reversing the encryption algorithm to figure out the original message. Common cryptanalysis techniques include brute-force attacks (trying every possible key combination), dictionary attacks (using a list of potential passwords or keys), and rainbow table attacks (comparing ciphertext with pre-calculated hashes to find matches). The success and time required for these techniques vary depending on the strength of the encryption and the resources available to the attacker.
    • What are the differences between white hat, black hat, and gray hat hackers? Hackers are often categorized by their ethical intentions. White hat hackers (ethical hackers) use their skills to identify vulnerabilities in systems and networks with the permission of the owner, with the goal of improving security. They perform penetration testing and report findings to help organizations patch weaknesses. Black hat hackers, on the other hand, use their skills for malicious purposes, such as stealing data, disrupting services, or financial gain, without authorization. Gray hat hackers operate in a less defined area; they may sometimes act without permission but without malicious intent, often disclosing vulnerabilities they find publicly or to the affected organization.

    Ethical Hacking and Penetration Testing

    • What is penetration testing and what are the typical phases involved? Penetration testing is a specific type of ethical hacking that focuses on actively attempting to penetrate information systems using various attack methods. The goal is to identify and exploit vulnerabilities to assess the security posture of a system or network. The typical phases of penetration testing include:
    1. Reconnaissance (Information Gathering): Collecting as much information as possible about the target, including IP addresses, domains, network architecture, and operating systems.
    2. Scanning: Using tools to identify open ports, services running, and potential vulnerabilities based on the information gathered.
    3. Exploitation: Attempting to exploit the identified vulnerabilities to gain unauthorized access to the system or data.
    4. Post-Exploitation: Once access is gained, exploring the compromised system to understand the extent of the breach and potential impact.
    5. Reporting: Documenting the findings, including the vulnerabilities identified, the methods used to exploit them, and recommendations for remediation.
    • What is SQL injection and how can it be exploited? SQL injection is a web application vulnerability that allows an attacker to inject malicious SQL code into an application’s database queries. This can happen when user input is not properly sanitized before being used in a SQL query. By crafting malformed queries, attackers can bypass authentication, extract sensitive data, modify database content, or even execute arbitrary commands on the database server. Exploitation often involves using special SQL characters and operators (like single quotes, OR, 1=1) in input fields to manipulate the logic of the queries sent to the database. Different types of SQL injection attacks exist, including in-band (error-based and union-based), blind (boolean-based and time-based), and out-of-band.
    • What is a Denial of Service (DoS) attack and how can it impact a system or network? A Denial of Service (DoS) attack is an attempt to make a machine or network resource unavailable to its intended users by disrupting the service of a host connected to the internet. This is typically achieved by flooding the target with superfluous requests in an attempt to overload systems and prevent some or all legitimate requests from being fulfilled. A Distributed Denial of Service (DDoS) attack uses multiple compromised computer systems to attack a single target, amplifying the impact. DoS/DDoS attacks can lead to service outages, financial losses, and reputational damage. Mitigation strategies include over-provisioning bandwidth, using Content Delivery Networks (CDNs), and implementing traffic filtering and rate limiting.
    • What is Wi-Fi hacking and what tools are commonly used for it? Wi-Fi hacking refers to the process of attempting to gain unauthorized access to a wireless network. Common tools used for this purpose include Aircrack-ng (a suite of tools for packet sniffing, password cracking, and more), and tools within Kali Linux. Techniques often involve capturing the WPA/WPA2 handshake (a four-way exchange that occurs when a device connects to a Wi-Fi network) and then attempting to crack the password offline using brute-force or dictionary attacks. These tools can also be used for legitimate security auditing of wireless networks to identify vulnerabilities. It’s crucial to have permission before attempting to audit or penetrate any wireless network.

    Cyber Security Fundamentals: A Comprehensive Overview

    Cyber security fundamentals revolve around the essential principles and practices designed to protect computer systems, networks, and digital information from unauthorized access, use, disclosure, disruption, modification, or destruction. In today’s digital world, where cyber threats are pervasive, cyber security has become more critical than ever.

    Here are some fundamental aspects of cyber security discussed in the sources:

    • The Importance of Cyber Security: With the increasing number of cyber threats, safeguarding networks, applications, and data is a top priority. The demand for skilled cyber security professionals, particularly ethical hackers, is expected to grow significantly. Companies across various industries need these professionals to secure their systems. The potential financial impact of cyber attacks, such as ransomware attacks, which cost institutions billions of dollars, underscores the necessity of robust cyber security measures.
    • Ethical Hacking as a Core Component: Ethical hacking involves using the same tools and techniques as malicious hackers to identify and fix security vulnerabilities before they can be exploited. Ethical hackers, also known as white hat hackers, work with the permission of the system owner to stress-test their platforms and strengthen security. This proactive approach helps organizations prevent data breaches and save billions of dollars.
    • Understanding Threat Actors: It’s crucial to understand the different types of hackers.
    • Black hat hackers exploit security vulnerabilities for monetary gain, often stealing or destroying data. They operate with malicious intent and try to remain anonymous.
    • White hat hackers (ethical hackers) use their skills to identify and remedy security flaws to help organizations improve their security posture. They are authorized to act on the company’s behalf.
    • Grey hat hackers are a blend of both, who may snoop on systems without consent but inform the owner of vulnerabilities, sometimes for a fee.
    • Script kiddies rely on existing hacking tools without much technical understanding.
    • Nation-sponsored hackers are employed by governments for espionage and other purposes.
    • Core Concepts: A thorough introduction to cyber security involves learning the basic terminology, different types of threats, how these threats work, and the fundamental working principles.
    • Networking Fundamentals: A strong grasp of how the internet works, including operating systems, TCP/IP, OSI model, routing, and switching, is absolutely essential for entering the field of cyber security. Understanding network protocols (e.g., TCP/IP), network security principles, and firewall configurations is fundamental for identifying vulnerabilities.
    • Operating Systems Proficiency: Proficiency in various operating systems like Windows, Linux, and macOS is crucial. It allows cyber security professionals to safeguard the fault lines across different platforms as they directly interact with these systems daily.
    • Cryptography: Knowledge of cryptography, including encryption, decryption, cryptographic algorithms, and protocols, is very important in cyber security. Cryptography is the science of securing data through encryption to prevent unauthorized access. Techniques like AES encryption are used to scramble data, making it difficult for attackers to crack.
    • Risk Management: Understanding risk assessment, mitigation strategies, and compliance frameworks like GDPR and HIPAA is a key aspect of cyber security.
    • Cyber Security Laws and Ethics: Awareness of legal and ethical considerations in cyber security is also fundamental.
    • Essential Security Technologies: Familiarity with security technologies such as firewalls, intrusion detection and prevention systems (IDPS), antivirus software, and endpoint security is necessary. Firewalls monitor network traffic and block unauthorized access based on security rules.
    • Vulnerability Assessment and Penetration Testing: Hands-on experience with tools like Nessus, Metasploit, NMAP, and Burp Suite is crucial for identifying and exploiting vulnerabilities to improve security. Penetration testing simulates real-world attacks to uncover weaknesses in systems and networks.
    • Incident Response: Understanding security operations, incident response, threat hunting, log analysis, and Security Information and Event Management (SIEM) is vital for handling security breaches. Collecting system logs is a critical part of incident response and forensic analysis.
    • Secure Coding Practices: Knowledge of secure software development practices and common vulnerabilities like OWASP Top 10 is important for preventing security flaws in applications.
    • Staying Updated: The field of cyber security is constantly evolving, so staying updated with the latest threats and attack methodologies is crucial for effective defense.

    In summary, cyber security fundamentals encompass a broad range of technical knowledge, ethical considerations, and practical skills aimed at protecting digital assets from a growing landscape of cyber threats. A strong foundation in networking, operating systems, cryptography, and ethical hacking principles forms the bedrock of a successful career in this critical field.

    Understanding Ethical Hacking Principles and Practices

    Ethical hacking encompasses a range of concepts centered around proactively identifying and mitigating security vulnerabilities in computer systems, networks, and applications with the permission of the owner. It involves using the same tools and techniques as malicious hackers, but with the intent to improve security rather than to cause harm or personal gain.

    Here are some key ethical hacking concepts discussed in the sources:

    • Definition and Purpose: Ethical hacking is the process of taking security measures to safeguard data and networks from malicious cyber attacks. Ethical hackers use every tool at their disposal to try and breach security barriers and find potential vulnerabilities. The core purpose is to discover weaknesses or vulnerabilities in information systems in a legal and ethical manner. By identifying these flaws, ethical hackers help organizations to strengthen their defenses and protect against real cyber threats.
    • Ethical vs. Malicious Hacking: The key differentiator between ethical (white hat) and malicious (black hat) hacking lies in intent and authorization.
    • Black hat hackers exploit security vulnerabilities for monetary gain, aiming to steal or destroy private data, alter websites, or disrupt networks. They have malicious intent and try to hide their identities.
    • White hat hackers (ethical hackers) perform the same activities but with the consent of the system owner and with the goal of identifying and remedying security flaws. Their intent is to help the organization and improve its security posture.
    • Types of Hackers: Beyond black and white hats, there are also grey hat hackers who operate in a more ambiguous space, potentially snooping without consent but informing owners of vulnerabilities. Script kiddies use existing tools without deep technical understanding. Nation-sponsored hackers conduct cyber activities on behalf of governments, and hacktivists use hacking to promote political agendas. Ethical hacking primarily falls under the domain of white hat activities.
    • Roles and Responsibilities of an Ethical Hacker: Ethical hackers have several responsibilities, including:
    • Conducting security assessments to identify an organization’s security posture by evaluating existing security controls.
    • Identifying and testing vulnerabilities in systems, networks, and applications.
    • Developing tools and scripts to enhance security or to test for vulnerabilities.
    • Performing risk assessments to determine the potential impact of identified vulnerabilities.
    • Developing and recommending security policies.
    • Providing guidance on mitigating or resolving identified weaknesses.
    • Potentially training staff on network security best practices.
    • Documenting findings and compiling detailed reports on vulnerabilities and recommendations.
    • The Ethical Hacking Process: The typical ethical hacking process involves several phases:
    • Reconnaissance (Information Gathering): Collecting as much information as possible about the target system or organization, including network infrastructure, operating systems, and potential weak points. Tools like Nmap and Netdiscover can be used in this phase.
    • Scanning: Identifying open ports, services, and potential vulnerabilities using tools like Nmap and vulnerability scanners like Nessus.
    • Gaining Access (Exploitation): Attempting to exploit identified vulnerabilities to gain unauthorized access to the system or network, often using tools like Metasploit.
    • Maintaining Access: Establishing mechanisms to retain access to the compromised system for further analysis, which might involve installing backdoors or Trojans.
    • Clearing Tracks: Removing any evidence of the hacking activity to avoid detection.
    • Reporting: Documenting all findings, the vulnerabilities discovered, the exploitation process, and providing recommendations for remediation.
    • Essential Skills and Knowledge: A successful ethical hacker requires a diverse set of skills:
    • Strong knowledge of computer networks and protocols (TCP/IP, HTTP, etc.).
    • Proficiency in operating systems such as Windows, Linux, and macOS, including their server versions.
    • Understanding of programming and scripting languages like Python, Java, C++, PHP, Ruby, HTML, and JavaScript for developing scripts, automating tasks, and understanding web applications.
    • Knowledge of web applications and databases, including common vulnerabilities like SQL injection and cross-site scripting (XSS).
    • Familiarity with security technologies like firewalls, intrusion detection/prevention systems (IDS/IPS), antivirus software, and endpoint security.
    • Understanding of cryptography, including encryption and decryption techniques.
    • Awareness of common attack vectors and techniques, including malware, social engineering, and network attacks.
    • Strong problem-solving and analytical thinking skills.
    • Awareness of cyber security laws and ethics.
    • Ethical Hacking Tools: Ethical hackers utilize a wide range of tools for various tasks:
    • Network Scanners: Nmap is a key tool for network discovery and port scanning.
    • Vulnerability Scanners: Nessus and Acunetix are used to identify potential vulnerabilities in systems and web applications.
    • Penetration Testing Frameworks: Metasploit is a powerful framework with a vast collection of exploits for testing vulnerabilities.
    • Packet Analyzers: Wireshark is used to capture and analyze network traffic.
    • Password Cracking Tools: John the Ripper is used for dictionary attacks and brute-force password cracking.
    • Web Application Testing Tools: Burp Suite is a popular tool for testing web application security.
    • SQL Injection Tools: SQLmap automates the process of detecting and exploiting SQL injection vulnerabilities.
    • Kali Linux is a popular Linux distribution specifically designed for penetration testing, containing hundreds of pre-installed ethical hacking tools.
    • Social Engineering: This is a non-technical hacking technique that involves manipulating humans into revealing confidential information or performing actions that compromise security. Common social engineering tactics include phishing, pretexting, and exploiting human curiosity or greed.
    • Importance and Benefits for Organizations: Ethical hacking is crucial for organizations to proactively identify and address security weaknesses before malicious actors can exploit them. This helps in preventing data breaches, minimizing financial losses, and protecting reputation. Regular security audits conducted by ethical hackers help organizations stay ahead of cyber threats and ensure the integrity of their digital infrastructure.
    • Certifications: Obtaining certifications like Certified Ethical Hacker (CEH), Offensive Security Certified Professional (OSCP), and CompTIA Security+ can validate an ethical hacker’s skills and enhance their credibility.
    • Job Roles: The field of ethical hacking offers various job roles, including Ethical Hacker, Penetration Tester, Network Security Engineer, Cyber Security Analyst, Information Security Manager, Security Consultant, and Cyber Security Engineer.
    • Ethical Hacking and Penetration Testing: While often used interchangeably, penetration testing is a specific subset of ethical hacking that focuses on actively attempting to penetrate information systems using various attack methods. Ethical hacking is a broader field that encompasses not only penetration testing but also vulnerability assessments, policy development, and other proactive security measures.

    By understanding these concepts, individuals and organizations can better appreciate the role and importance of ethical hacking in the ongoing battle against cyber threats.

    Security Testing Tools for Ethical Hacking

    Security testing tools are essential for ethical hackers and security professionals to identify, analyze, and exploit vulnerabilities in computer systems, networks, and applications. These tools enable a proactive approach to security, allowing organizations to strengthen their defenses before malicious actors can cause harm.

    Here is a discussion of various security testing tools mentioned in the sources:

    1. Vulnerability Scanners:

    • Nessus: This is an automated vulnerability scanner designed to identify security weaknesses within hosts, operating systems, and networks. It uses a built-in database of known vulnerabilities and scans the target environment to find potential flaws. Ethical hackers use Nessus to discover a list of potential vulnerabilities that can then be further investigated.
    • Acunetix and Arachnne: These are examples of application scanners that focus on identifying flaws specifically within web applications. They help security testers understand potential weaknesses like SQL injection or cross-site scripting.
    • OpenVAS (Greenbone Vulnerability Manager): This tool provides a comprehensive vulnerability management system, performing scans to detect vulnerabilities across the target.
    • Netsparker: This is another automated web application security scanner that is configurable and helps secure web applications by identifying reported vulnerabilities.

    2. Penetration Testing Frameworks and Tools:

    • Metasploit: This is a powerful penetration testing framework widely used by both ethical hackers and malicious actors. It contains a vast collection of readymade and custom exploits that can be used to probe for and exploit systemic vulnerabilities in networks and servers. Ethical hackers use Metasploit to validate vulnerabilities identified by scanners and to simulate real-world attacks by crafting or choosing appropriate exploits. It can be used to gain access, and depending on the vulnerability, even run root commands.
    • Burp Suite Professional: This is a popular proxy-based tool used for penetration testing and finding vulnerabilities in web applications. It allows for the evaluation of web application security through hands-on testing.

    3. Network Analysis Tools:

    • Nmap (Network Mapper): This is a free and open-source utility for network discovery and security auditing. It can identify live hosts on a network, the services they are running, their operating systems, and the types of packet filters and firewalls in use. Ethical hackers use Nmap in the early reconnaissance phase to understand the target’s network infrastructure and identify potential entry points through open ports and services.
    • Wireshark: This is a free and open-source packet analyzer used for network troubleshooting, analysis, and security auditing. It captures network traffic at a microscopic level, allowing for detailed analysis of data packets. Ethical hackers use Wireshark to monitor network traffic during vulnerability scans and exploitation attempts, helping them understand the communication flow and analyze the success of their attacks.

    4. Specific Attack Tools:

    • SQLmap (SQL map): This is an automated tool specifically designed for detecting and exploiting SQL injection vulnerabilities in web applications. It can automatically craft and execute SQL injection queries to test for flaws and potentially retrieve data from databases.
    • John the Ripper: This is an open-source password security auditing and password recovery tool. It supports various password cracking techniques, including dictionary attacks and brute-force attacks, to test the strength of passwords.
    • Air Garden: This is a multi-use bash script for Linux systems used for hacking and auditing wireless networks. It can be used to launch denial-of-service attacks on Wi-Fi networks and supports various Wi-Fi hacking methods like WPS hacking and handshake captures.

    5. Operating Systems for Security Testing:

    • Kali Linux: This is a Debian-based Linux distribution specifically designed for penetration testing and security auditing. It comes with hundreds of pre-installed tools targeted towards various information security tasks, including vulnerability assessment, penetration testing, computer forensics, and reverse engineering. Its features, pre-installed tools, and customizability make it a popular choice for ethical hackers.

    The Role of Security Testing Tools in Ethical Hacking:

    Ethical hackers utilize these tools throughout the different phases of penetration testing:

    • Reconnaissance: Tools like Nmap are used to gather information about the target network and systems.
    • Scanning: Nmap is further used for port scanning, and vulnerability scanners like Nessus and Acunetix are employed to identify potential weaknesses.
    • Gaining Access: Metasploit is a key tool in this phase, used to exploit identified vulnerabilities. Tools like SQLmap and password cracking tools like John the Ripper might also be used depending on the identified flaws.
    • Maintaining Access: While not explicitly a “tool,” understanding operating system functionalities for installing backdoors (as mentioned in the context of malicious hackers) is relevant, although ethical hackers focus on reporting such potential avenues rather than maintaining unauthorized access long-term in a real audit.
    • Reporting: While there isn’t a specific tool listed for reporting, the output and findings from all the above tools are crucial for generating a comprehensive security assessment report.

    It’s important to note that the essence of ethical hacking goes beyond simply running automated tools. Ethical hackers need to understand the reports generated by these tools, analyze the findings, and potentially craft their own exploits or use existing ones in a specific manner to bypass security controls. They also need to be aware of security laws and standards to ensure their testing activities are legal and ethical.

    Network Security Core Principles and Key Tools

    Based on the sources, several key principles underpin network security. Network security is a set of technologies and processes aimed at protecting the usability, integrity, and confidentiality of a company’s network infrastructure and the data transmitted and stored within it. It involves preventing unauthorized access, misuse, modification, or destruction of the network and its resources.

    Here are some core network security principles derived from the sources:

    • Confidentiality: Ensuring that sensitive information is protected from unauthorized disclosure. Cryptography, such as encryption of data in transit (mentioned with HTTPS in and the use of VPNs with IPSec in), plays a vital role in maintaining confidentiality.
    • Integrity: Maintaining the accuracy and completeness of data, preventing unauthorized modification. Authentication Header (AH) within IPSec is responsible for data integrity.
    • Availability: Ensuring that authorized users have reliable access to network resources and data when needed. Protecting against denial-of-service (DoS) attacks (mentioned in the context of botnets in and cyber warfare in) is crucial for maintaining availability.
    • Authentication: Verifying the identity of users, devices, or applications trying to access the network. This ensures that only legitimate entities are granted entry.
    • Authorization: Defining and enforcing the level of access granted to authenticated users. This principle ensures that users only have access to the resources necessary for their roles.
    • Layering of Security (Defense in Depth): Implementing multiple security controls at different levels of the network to provide comprehensive protection. If one layer fails, others are in place to offer continued security. The sources discuss physical, technical, and administrative security layers.
    • Physical Security: Protecting physical access to network components like servers and routers.
    • Technical Security: Utilizing hardware and software-based controls such as firewalls, intrusion prevention systems (IPS), and encryption.
    • Administrative Security: Implementing policies, procedures, and user training to govern security-related behavior. Password policies and training staff for network security are examples of administrative controls.
    • Proactive Security: Identifying and mitigating vulnerabilities before they can be exploited by malicious actors. Ethical hacking and penetration testing are proactive approaches to security, where vulnerabilities are intentionally sought out and addressed.
    • Continuous Monitoring and Analysis: Regularly monitoring network traffic and security events to detect and respond to threats. Intrusion Detection Systems (IDS) and Intrusion Prevention Systems (IPS) are tools used for this purpose. Wireshark is a tool that allows for real-time and offline network traffic analysis. Behavioral analytics can also help detect anomalies in network traffic that might indicate an attack.
    • Policy Enforcement: Establishing and consistently enforcing security policies to guide user behavior and system configurations. Ethical hackers may analyze and enhance an organization’s security policies.
    • Risk Assessment: Identifying potential threats and vulnerabilities and evaluating the potential impact they could have on the organization. Ethical hackers often perform risk assessments to prioritize vulnerabilities based on their criticality.
    • Security Awareness and Training: Educating users about security threats and best practices to minimize the risk of human error being exploited. Training staff on what is allowed and not allowed helps secure the organization.

    Key tools that support these principles include:

    • Firewalls: Act as a barrier between trusted and untrusted networks, controlling incoming and outgoing traffic based on defined rules. They can be hardware or software-based.
    • Intrusion Prevention Systems (IPS): Continuously scan networks for malicious activity and take action to block or prevent it.
    • Virtual Private Networks (VPNs): Create encrypted connections over public networks, ensuring secure transmission of sensitive data. VPNs often utilize IPSec protocols.
    • Network Scanners (e.g., Nmap): Used for network discovery, identifying open ports and services, and potential vulnerabilities.
    • Vulnerability Scanners (e.g., Nessus, Acunetix): Automatically identify known security weaknesses in systems and applications.
    • Packet Analyzers (e.g., Wireshark): Capture and analyze network traffic for troubleshooting, security analysis, and understanding communication protocols.

    By adhering to these network security principles and utilizing appropriate tools, organizations can significantly reduce their risk of falling victim to cyber threats and maintain a secure network environment.

    Web Application Vulnerabilities: SQL Injection and XSS

    Based on the sources, web applications are a significant target for security vulnerabilities because they are often accessible over the internet or internal networks and handle sensitive data. The sources highlight several key web application vulnerabilities, their exploitation, and preventative measures.

    1. SQL Injection:

    • Definition: SQL injection is a code injection technique that might exploit security vulnerabilities occurring in the database layer of an application. These vulnerabilities are present when user input is improperly filtered and is inserted into SQL statements. This allows attackers to send malicious SQL code that can be executed by the backend database.
    • Exploitation: Attackers can craft malformed SQL queries by injecting special characters (like single quotes) and SQL operators into input fields such as login forms or URL parameters. By doing so, they can bypass authentication mechanisms, retrieve sensitive data, modify database content, or even execute arbitrary commands on the database server. The demo in the source shows how injecting ‘ or 1=1 — – into a username field can bypass authentication. Attackers may also try to induce errors to understand the database structure and version, which helps in crafting more effective attacks. Tools like SQLmap are designed to automate the process of detecting and exploiting SQL injection vulnerabilities.
    • Types of SQL Injection: The source mentions different types of SQL injection:
    • In-band SQL Injection: The attacker can receive the results of their attack directly through the same communication channel used to inject the code. This includes:
    • Error-based Injection: Exploiting database error messages to gain information about the database structure.
    • Union-based Injection: Using the UNION SQL keyword to combine the results of multiple queries into a single response.
    • Blind SQL Injection: The attacker cannot see the results of their injected queries directly but can infer information based on the application’s response (e.g., different responses for true or false conditions, or time delays). This includes:
    • Boolean-based: Observing different application responses based on true or false conditions in the injected query.
    • Time-based: Injecting queries that cause a time delay in the database response to confirm successful execution.
    • Out-of-band SQL Injection: Less common, this involves the attacker relying on different channels (e.g., email, DNS requests) to receive data from the database server.
    • Prevention: The source outlines several best practices to prevent SQL injection attacks:
    • Use Prepared Statements and Parameterized Queries: These ensure that user-supplied data is treated as data and not as executable code.
    • Object Relational Mapping (ORM): ORM frameworks can help abstract database interactions and reduce the risk of direct SQL injection.
    • Escaping Inputs: Properly sanitizing user input by escaping special characters that have meaning in SQL can prevent them from being interpreted as code. However, the source cautions that not all injection attacks rely on specific characters, and not all languages have equally effective escaping functions.
    • Password Hashing: While not directly preventing SQL injection, properly hashing passwords prevents attackers from easily obtaining plaintext credentials if a database breach occurs.
    • Third-Party Authentication: Utilizing secure third-party authentication mechanisms can reduce the application’s responsibility for handling sensitive credentials.
    • Web Application Firewalls (WAFs): WAFs can be configured to identify and block malicious SQL queries before they reach the application.
    • Secure Coding Practices and Software Updates: Using secure coding practices and keeping software and libraries up to date helps patch known vulnerabilities.
    • Principle of Least Privilege: Database user accounts used by the application should have the minimum necessary privileges.

    2. Cross-Site Scripting (XSS):

    • Definition: Cross-Site Scripting (XSS) attacks involve injecting malicious scripts (most commonly JavaScript) into websites viewed by other users. This happens when a web application does not properly sanitize user input before displaying it to other users.
    • Exploitation: Attackers can inject malicious scripts through various entry points, including:
    • Input fields (e.g., search bars, comment sections, forms)
    • URL parameters
    • Even malicious advertisements
    • Fake emails containing malicious links The injected script then executes in the victim’s browser when they view the compromised page. This can allow the attacker to:
    • Steal session cookies, allowing them to impersonate the victim and gain unauthorized access to their accounts.
    • Capture keystrokes and other sensitive information.
    • Redirect the user to malicious websites.
    • Run other web browser-based exploits.
    • Display fake login forms to steal credentials. The demos in the source illustrate different types of XSS attacks and how they can be executed by injecting JavaScript code into vulnerable web application components.
    • Types of XSS Attacks: The source describes three main types of XSS attacks:
    • Reflected XSS: The malicious script is not permanently stored on the web server. Instead, it is reflected back to the user’s browser as part of the server’s response, often through malicious links or submitted forms. The attack is only effective if the user clicks the malicious link or submits the crafted form.
    • Stored XSS: The malicious script is permanently stored on the target server (e.g., in a database, message board, or comment section). The script is then executed every time a user views the page containing the malicious content, potentially affecting many users. This type is considered riskier due to its persistent nature.
    • DOM-based XSS: The vulnerability exists in the client-side JavaScript code rather than in the server-side code. The attack manipulates the Document Object Model (DOM) in the victim’s browser, causing the client-side script to execute unexpectedly. The malicious payload might be in the URL fragment (after the #) or other client-side data sources.
    • Prevention: The source provides several methods to prevent XSS attacks:
    • Input Validation and Sanitization: Always screen and validate any user input before including it in HTML output or using it in client-side scripts. Sanitize user input by removing or encoding potentially harmful characters. Validation should occur on both the client-side and server-side.
    • Avoid Displaying Untrusted User Input: If possible, avoid displaying any untrusted user input directly on web pages.
    • Proper Output Encoding/Escaping: When user input must be displayed, properly encode or escape the data based on the context in which it will be rendered (e.g., HTML encoding, JavaScript encoding, URL encoding). Different contexts require different encoding rules, and sometimes multiple layers of encoding are necessary.
    • Content Security Policy (CSP): CSP is an HTTP header that allows website owners to control the sources of content (e.g., scripts, styles, images) that the browser is allowed to load for their website. This can significantly reduce the risk of XSS attacks by preventing the browser from executing malicious scripts from untrusted sources.
    • HTTPOnly Cookie Flag: Setting the HTTPOnly flag on cookies prevents client-side scripts (like JavaScript) from accessing them. This can mitigate the impact of XSS attacks that aim to steal session cookies. However, the source notes that this relies on browser support.
    • Automated Security Testing: Use automated testing tools to scan web applications for XSS vulnerabilities before release.
    • Regular Security Audits and Updates: Regularly audit code for vulnerabilities and keep all software and libraries updated to patch known security flaws.

    Relationship to Security Testing Tools and Principles:

    • Security testing tools like Burp Suite Professional and automated vulnerability scanners like Netsparker and Acunetix (mentioned in our previous conversation) are specifically designed to help identify web application vulnerabilities like SQL injection and XSS. Ethical hackers use these tools to probe web applications, identify potential weaknesses in input handling and output rendering, and verify the effectiveness of security controls.
    • The principle of proactive security is directly addressed by identifying and mitigating web application vulnerabilities through testing and secure coding practices.
    • Input validation and sanitization and proper output encoding are crucial aspects of secure coding, aligning with the network security principle of defense in depth by implementing security at the application level.
    • Continuous monitoring can also involve analyzing web application logs for suspicious activity that might indicate an attempted or successful exploitation of a vulnerability.

    Understanding and addressing web application vulnerabilities like SQL injection and XSS is crucial for maintaining the confidentiality, integrity, and availability of web-based services and the data they handle, which are core principles of network security. The OWASP Broken Web Applications project, as mentioned in the source, provides a legal and safe environment to practice identifying and exploiting these vulnerabilities to enhance security skills.

    Ethical Hacking Full Course 2025 | Ethical Hacking Course for Beginners | Simplilearn

    hello everyone and welcome to ethical hacking full course by simply learn in today’s digital world cyber threats are everywhere making cyber security more important than ever this course will teach you the same tools and techniques ethical hackers use to protect networks application and data from cyber attacks with cyber threats increasing the demand for ethical hackers is expected to grow even more by 2025 companies across industries need skilled professionals to secure their systems offering starting salaries around $70,000 in the US and around 6 to 10 LPA in India while experienced hackers can earn over $120,000 plus or 25 lakhs perom in India so in this course you’ll get hands-on experience with ethical hacking learn how to spot vulnerabilities and strengthen security systems so whether you’re new to cyber security or looking to sharpen your skills this course is your pathway to a high demand and well-paying career in ethical hacking but before we commence if you’re interested in stepping one of the most in demand fields in 2025 the advanced executive program in cyber security by simply learn is your perfect opportunity in just 6 months you’ll gain expertise in ethical hacking penetration testing ransomware analysis and advanced defense strategies through a hands-on industry relevant approach this program is offered in collaboration with Triple IT Bangalore and IBM features live interactive classes real world projects and industry recognized certifications so hurry up and enroll now find the course link description box below and in the pin comments data is the new gold imagine how much data is generated by just your smartphone every single day be it the pictures you click or the messages you send nearly 41 million messages are sent worldwide via WhatsApp every single minute so safeguarding your personal data against hackers has now become a top priority did you know that India leads the world when it comes to ethical hackers with 23% of the worldwide hacking population from India the top ethical hackers earn more than twice of what software engineers in India do but what makes ethical hacking such a demanding industry ethical hacking is the process of taking security measures to safeguard data and networks from malicious cyber attacks the hackers use every tool at their disposal to try and breach the security barrier and find any potential vulnerabilities the ethical ineth ethical hacking denotes the lack of malicious intent since these sessions are often permitted by the system owner or the network that is being hacked into to fix any compromised entry points before blackhead hackers discover and exploit them so what is a blackhead hacker you may ask a hacker who exploits security vulnerabilities for monetary gains like stealing or destroying private data altering disrupting or shutting down websites and networks is known as a blackhead hacker on the other end of the spectrum we have whitehead hackers who help people secure the networks by stress testing their platform against the most dangerous of cyber attacks that is with their consent of course but the most neutral of the bunch are greyhead hackers who may not ask for consent before snooping on a foreign system but they do inform the owner if they find any vulnerabilities sometimes in exchange for a small fee the security breaches have become less and less prevalent thanks to rigorous ethical hacking campaigns and corporate awareness programs the ability to fix critical security issues before black hat hackers leverage them has saved organizations billions of dollars google IBM Microsoft and virtually every major corporation are looking to protect the data so it shouldn’t come as a surprise that the ethical hacking and information security job market is set to rise by nearly 28% by 2026 with salaries going as high as $225,000 perom so that’s ethical hacking wrapped up in 2 minutes to catch more byite-size and detailed videos on different technologies subscribe to Simple Learn and stay updated scammers targeting institutions such as hospitals schools and government offices for ransom pocketed $1.1 billion last year compared with 567 million in 2022 cyber security experts act as a multi-level line of defense against cyber attacks through all internet activity securing individuals corporate giants tech multinational companies international agencies and even governments hence this extremely critical role demands a great pay and the demand for it continues to grow year after year with beginner level salaries averaging around $75,000 with years of experience it can go to above $200,000 for chief information officer level roles due to the extremely critical nature of this job role there is a demand across all verticals including defense healthcare banking tech and even education sector if you want to become a cyber security engineer in 2024 here is how you can jumpstart your career in this field we will split the entire learning path in three major sections beginning with core concepts level topics then we will move on to intermediate skill-based topics and eventually we will discuss what topics to learn in niche cyber security skills let us start with core concept level topics start with getting a thorough introduction to cyber security make sure to learn the basics of cyber security including all the important terminology types of threats how these threats work and what are the working principles in cyber security from there you can move on to mastering networking fundamentals this is an absolute must know to enter the field of cyber security you need to be thorough with how the internet works how the data highway functions right from the function of operating systems to understanding of TCPIP OC model routing and switching every single one of these concepts are critically important make sure to keep these skills handy at all times since they help in understanding the overarching concepts easily but it’s not just the networking part of operating systems that you need to know this is where the next important part comes into the picture operating systems proficiency in Windows Linux and possibly Macos operating systems allows you to work across all domains being adept in each of these helps you become better at safeguarding the fault lines across them this is critical for your day-to-day working since you will be directly iterating with these to perform your daily tasks it is not unknown that mathematics and computer science go hand in hand this extends to the field of cyber security too you need to learn cryptography where the knowledge of encryption decryption cryptographic algorithms and protocols is very important next up is risk management understanding risk assessment mitigation strategies and compliance frameworks like GDPR and HIPPA finally you should also understand cyber security laws and ethics awareness of legal and ethical considerations in cyber security let us now move on to two intermediate level skill and toolsbased topics security technologies familiarity with firewalls intrusion detection prevention systems antivirus software and endpoint security vulnerability assessment and penetration testing hands-on experience with tools like Nessus Metas-ploit NMAP and Burp Suite security operations incident response threat hunting log analysis and security information and event management secure coding practices knowledge of secure software development practices and common vulnerabilities like OASP top 10 cloud security understanding of cloud computing security principles and best practices including Oz Azure and Google Cloud Platform mobile security knowledge of mobile application security testing and best practices for securing mobile devices now that you have mastered core concepts and intermediate skills and tools based on your interest you can move on and choose one of the niche fields for learning niche cyber security skills industrial control systems security understanding of Scottis systems PLCS and protocols like Modbus and DNP3 app security knowledge of securing internet of things devices and protocols blockchain security understanding of blockchain technology and its security implications thread intelligence gathering analyzing and leveraging threat intelligence to enhance cyber security posture reverse engineering skill in analyzing malware and understanding its behavior red team blue team exercises participating in simulated attacks red team and defending against them blue team with that said we have reached towards the end of our video this learning path covers a broad range of topics and skills necessary for a cyber security engineer in 2024 starting from foundational concepts to specialized areas within the field you must make sure to stay updated and keep on aligning this learning path based on your requirements if you have any questions about this learning path or cyber security in general that needs to be answered make sure to let us know in the comment section below and we would be happy to help let’s understand what are the types of hackers so what are the types of hackers hacker is a technically skilled person uh who is very adept with computers they have good programming skills they understand how operating system works they understand how networks work they understand how to identify flaws and vulnerabilities within all of these aspects and then they understand and know how to misuse these flaws to get a outcome which would be detrimental to the health of the organization so there are six type of hackers that have been identified black hat hackers white hat hackers grey hat script kitties nation sponsored hackers and a hackists so blackey hackers are bas basically uh the malicious hackers who have malicious intent and have criminalistic tendencies they want to harm the organization by hacking into their infrastructure by destroying their infrastructure by destroying their data so that uh they can gain from it from a monetary perspective uh these guys are also known as crackers the main aspect of these uh people are that they have malicious intent they try to do unauthorized activities and they try it for personal gain another important aspect to remember is that a blackhat hacker will always try to hide their identity uh they will spoof their online digital identity by masking it by spoofing their IP addresses MAC addresses and try to remain anonymous on the network a white hat hacker on the other hand is also an ethical hacker or a security analyst who’s an individual who will do exactly the same thing that a black hat hacker would do minus the malicious intent plus the intent of helping the organization identifying the flaws and remedying them so that nobody else can misuse those vulnerabilities so they are authorized to act on the company’s behalf they are authorized to do that activity which would help the company identify those flaws and thus help the company mitigate those flaws improving on their security posture so these uh these kind of security experts or ethical hackers would help organizations defend themselves against unauthorized attacks greyhead hackers is a blend of both white hat and black hat hackers so here they can work defensively and offensively both they can accept contracts from organizations to increase their security posture at the same time they can also get themselves involved in malicious activities towards other organizations to personally gain or benefit from them by doing unauthorized activity script kitties are people uh who are technically not much aware about what hacking is uh they rely on existing tools that have been created by other hackers they have no technical knowledge of what they’re doing it’s just a hit or miss for them so they just get their hands on a tool they try to execute those tools uh if the hack works it works otherwise it doesn’t so these people are basically who are noobs or newbies who are trying to learn hacking or uh just uh people who with malice’s intent who just want to have some fun or trying to impress people around then we have the nation or the state sponsored hackers as the name suggests these hackers are sponsored by their government now this may not be a legitimate job but most of the governments do have uh hackers uh enrolled in their pay on um on their uh organizations to spy on their enemies to spy on various countries and try to figure out uh the aspirations of those countries so this is basically a spying activity where you are technically trying to get access to other count’s resources and then try to spy on them to figure out what their activities have been or what their future plans have been and then we have the activists who is an individual who has a political agenda to promote and they promote it by doing hacking so uh these guys what is the difference between a black hat hacker and a activist the black hat hacker may try to hide their identity activist will claim responsibility of what they have done so for them it’s a political agenda a political cause and they will try to hack various organizations to promote their cause they would probably do this by defacing the website and posting the messages that they want to promote on these websites so what exactly is ethical hacking then we have discussed the types of hackers we have identified a malicious hacker as a black hat hacker with the intent uh of doing harm to an organization’s network for personal gain we have discussed what the ethical hacker is so an ethical hacker would be doing the same activity but in an authorized manner so they would have legal contracts that they would be signing with the organization which would give them a definite scope of what they’re allowed to do and what they are not allowed to do and the ethical hackers would function within those scopes would try to execute those test scenarios where they would be able to identify those flaws or those system vulnerabilities and then they would be submitting a report to the management of what they have found they would also help the management to mitigate or to resolve those weaknesses so that nobody else can misuse them later on they might use the same techniques and the same tools that blackhead hackers do however the main difference here is that these guys are authorized to do that particular activity they’re doing it in a controlled manner with the intent of helping the organization and not with the intent of personal gains so who’s an ethical hacker again an ethical hacker is a highly intelligent highly educated person who knows how computers function how programming languages work how operating systems work they can troubleshoot they’re technically very adept at computing they understand the architecture they understand uh how various components in a computer work they can troubleshoot those components and they can basically be uh very good with programming as well now when I say programming we don’t want the ethical hacker to be a good developer of applications we want them to understand programming in such a way that they can create scripts they can write their own short programs like viruses worms trojans or exploits which would help them achieve the objective that they have set out for so uh here you can see the ethical hacker they are individuals who perform a security assessment of their companies with the permission of cons concerned authorities so what is a security assessment a security assessment is finding out the exact security posture of the organization by identifying what security controls are in place how they’ve been configured and if there are any gaps in the configurations themselves so an organization will hire a ethical hacker they they would give the ethical hacker the information about what information is or what security controls what firewalls what IDs IPSS introen detection or introen prevention systems antiviruses are already in place and then they will ask the ethical hacker to figure out a way to bypass these mechanisms and see if they can still hack the organization what is the need of an ethical hacker the need of an ethical hacker is proactive security the ethical hacker would identify all the existing flaws in an organization and try to resolve those flaws to help secure the organization from blackhead hackers so ethical hackers would prevent hackers from cracking into an organization’s network by securing the organization by improving on their security on a periodic basis and they would also try to identify system vulnerabilities network vulnerabilities or application level vulnerabilities that would have been missed or have already been missed and then try to figure out a way of plugging them or uh resolving them so that they cannot be misused by other hackers they would also analyze and enhance an organization security policies now what are policies policies are basically documents that have been created by an organization of rules that all the employees need to follow to ensure that the security of an organization is maintained for example a password policy a password policy would help users in an organization to adhere to the standards the organization has identified for a password complexity for example a password when a user is creating them should adhere to standards where they are using random words they are uh they contain the alphabet A through zed uppercase and lowerase 0 through 9 as numeric and special characters and they’re randomized so that the password becomes more more stronger to prevent from brute force attacks so what would an ethical hacker do at this point in time they would try to test the strength of the passwords to see if brute force attacks or dictionary attacks are possible and if any of these passwords can be cracked they would ensure that all the employees are following the policies and all the passwords are are as secured as the policies want them to be if there are any gaps in the policies or the implementation of the policy it is the ethical hacker’s responsibility to identify those gaps and warn the organization about it similarly they would also try to protect any personal information any data that is owned by the organization that is critical for the functioning of the organization and they’ll try to protect it by from falling into the hacker’s hands now what are the skills that are required of an ethical hacker these are the following skills so first and foremost they should have good knowledge with operating systems such as Windows Linux Unix and Mac now when we say knowledge about operating systems it’s not only about how to use those operating systems but how to troubleshoot those operating systems how these operating systems work how these operating systems need to be configured how can they be secured for example securing an operating system is not only installing a firewall and an antivirus but you need to configure permissions on an operating system of what users are allowed to do and what users are not allowed to do for example limiting the installation of applications how are we going to do that we need to go into the system center the security center of Windows and we need to configure security parameters over there of what are acceptable softwares and what are not same with Linux and uh Mac softwares operating systems so we need to know how we can secure these operating systems similarly all of these would have desktop versions and server versions of operating systems as a ethical hacker we need to know the desktop and server versions both how to configure them and how to provide services within the organization on these servers so that they can be consumed in a secure manner by all the employees at the same time they should also be knowledgeable of programming languages or scripting languages such as PHP Python Ruby HTML for programming if you will because web servers come into the picture so again they should not be great developers where they can create huge applications but they should be able to develop scripts understand those scripts analyze those scripts and figure out what the output should be of those scripts to achieve the hacking goals that they have set out for an ethical hacker should have a very good understanding about networking no matter whether you’re in application security you’re in network security or you’re in hostbased security since a computer will always be connected to a network either a local area network like a LAN or the internet we should know how networking works we should know the seven layers of the OSI model we should know which protocols work on those seven layers we should identify the TCP IP model and how OSI model can be mapped to the TCP IP model we should understand how TCP and UDP work how uh how each and every protocol is crafted how they are supposed to behave for us to analyze and understand any network-based attacks we should be very good in security measures so we should know where those vulnerabilities would lie what are the latest exploits available in the market and we should be able to identify them we should be able to know the techniques and the tools of how to deal with security how to analyze security and then how to implement security to enhance it as well along with that it is important that a security analyst or ethical hacker is aware of the local security laws and standards why is that because an organization cannot do any illegal activity whatever responses that they have whatever security mechanisms whatever security controls they will implement they need to be adhering to the local law of the land they should be legal in nature and should not cause undue harm to any of the employees or any of the third party clients that they are dealing with so the ethical hackers should be aware of what uh security laws are before they implement security controls or even before they start testing for security controls and all of these should be backed up by having a global certification or a globally valid certification related to networking related to security ethical hacking the law of the land anything and everything maybe even programming uh it’s good to have a certification in PHP Pearl Python Ruby and so on so forth why because most of the organizations when they hire ethical hackers look out for these certifications especially globally valid certifications so that they can be sure or they can be assured that the person that they are hiring has the required skill set so let’s talk about a few of the tools that a ethical hacker would utilize uh in their testing scenarios to be honest there are hundreds of tools out there what you see on the screen are just a few examples of them uh Nessus is a vulnerability scanner what is a vulnerability scanner it is an automated tool that is designed to identify vulnerabilities within hosts within uh operating systems within networks so they come with their readymade databases of all the vulnerabilities that have already been identified and they scan the network against that database to find out any possible flaws or any possible vulnerabilities that currently exist on the host or the operating system or on the network similarly there would be application scanners like uh Aunetics or Arachnne that would help you scan applications and identify flaws within those applications as well now all of these are automated tools the essence of ethical hacker is when these tools churn out the reports the ethical hack hacker can understand these reports analyze them identify the flaws and then craft their own exploits or use existing exploits in a particular manner so that they can get access or they can bypass the access security controls mechanisms that are already in place how can they do that with the tool called metas-loit you see that big M there on the right hand side that M logo is for a tool called metas-loit which is a penetration testing tool what is a penetration testing tool it is that tool that will allow a ethical hacker to craft their exploits or choose their exploits for the vulnerabilities that have been identified by Nessus since we are interacting with computers we will always be interacting using tools right so the first tool Nessus identifies the flaws and the possible list of vulnerabilities we do a penetration test using metasloit to validate those flaws and to verify that those flaws actually exist and try to figure out the complexity of those flaws and that’s where metasloit helps us do that wireshark would be used in the background while we are doing both the activities using Nessus or Metasloit to keep a track of what packets are being sent and by received on the network which will help us analyze those packets so whenever I run a Nessus scanner I would run a wireshark in the background it will capture the data packets and I can go through those data packets and analyze that data packets to identify what Nessus is actually trying to do similarly when I try to attack a machine using exploit on metas-ploit I will keep on wireshark running in the background to capture the data packets that have been sent and the responses that I’ve received from the victim so that I can also go through those packets and analyze the responses and analyze the attack whether it was successful to what extent was it successful and basically will also give me a validation a proof of the activity that has happened n MAP is another automated tool that allows me to scan for open ports and protocols so why would I use N MAPAP because pro ports and protocols become an entry point for a hacker to gain access to devices for example when we connect to a web server we connect through a web browser but we automatically connect to port 80 using HTTP and port 443 is using HTTPS so if I’m connecting to a web server using HTTPS it is safe to assume that port 443 on the web server is open to accept those connections similarly there would be other services that may be left open on the web server because nobody thought about configuring it or they misconfigured the web server and they left unwanted services running so end mapap will allow me to scan those ports and services and allow me to understand what services are being offered on that server so then I can start analyzing that server identify those flaws within those services and then try to attack them if the application that I’m analyzing is connected to a database and I want to do a SQL injection attack or if I if Nessus tells me that there is a SQL injection attack that may be possible on that particular application I can use an automated tool called SQL map or SQL map that would allow me to automatically craft all the queries that are required for a SQL injection attack and help me do that attack at the same time so here I do not have to manually create my own queries uh the SQL map tool would automatically create them for me what I would do is I would use Nessus to identify that particular flaw if Nessus reports that flaw I would then go use the tool SQL map configure it to attack that particular web server and when I fire off the tool it will then automatically start directing queries SQL injection queries to the database to see if those uh databases are vulnerable and if yes what data can be retrieved from those databases so all of these tools in a nutshell would help me hack networks applications operating systems and host devices and this is what the ethical hacker does they use these kind of tool sets they identify what attacks they need to do they identify the right tool for that particular attack and they write their exploits they create those attacks and then they start attacking analyze the response and then give a report to the management uh providing them feedback about how the attack was created or crafted what was the response to that attack and whether the attack was successful or not if successful they would also give recommendations of what to do to prevent these attacks from happening in the future so when we are doing these attacks or when we want to launch these attacks what is the process that we would follow so there are six steps that we would do as a ethical hacker if you’re just a hacker you probably wouldn’t do the sixth step which is a reporting step so the first step that would be done is the reconnaissance phase which is the information gathering phase which is very important from ethical hackers perspective or a hacker’s perspective because if I want to attack someone or something as a digital device I need to know what I’m attacking i need to know the IP address of the device the MAC address of those devices i need to know the operating system the build or the version of that operating systems applications on top the versions of those applications so I know what I’m attacking for example if I if I want to attack a server I assume it’s a Windowsbased server and I use a particular tool to attack it but it actually turns out to be a Linux based server my attacks are going to be unsuccessful so I need to focus my attack based on what is there at the other end so in my information gathering phase I want to identify all of that information once I have that information done I’m going to scan those servers using tools like end mapap that we just talked about and we’re going to try to see the open ports open services and protocols that are running on that server that can give me possible entry points within the network or within the device or within the operating system at the same time along with the scanning with end mapap I would run a vulnerability scanner the necess vulnerability scanner we talked about or aetics for applications and then I would try to identify vulnerabilities in those applications operating systems or networks once I have identified those vulnerabilities in the scanning phase I would then move on to the gaining phase where I would then craft my exploits or choose existing exploits and start attacking the attacking the victim at this point in time if my attack is successful I will probably have gained access uh by either cracking passwords or escalating privileges or exploiting a vulnerability that I may have found during the scanning phase once I have gained my access I want to maintain my access why because the vulnerability may not be there for long maybe somebody updated the operating system and hence the flaw was no longer exist existing or somebody changed the password that may I may have cracked thus I no longer have access so what do I do to maintain my access i install Trojans or backdoor entries to those systems using which I can secretly in a covert manner get access to those devices at my own will at my own time as long as those devices are available over the network so that’s where I maintain my access i have hacked them now I want to maintain my access so I install a software which would give me a backdoor entry to that device no matter what once I have done this I want to clear my track so whatever activity that I’ve been doing for example installing a Trojan a Trojan is also a software that would create directory directories and files once installed on the victim’s machine so I want to hide that if I have access data stores if I have modified data I want to hide that activity because if the victim comes to know that something has happened they would start they would start increasing their security parameters they might start scanning their devices they may take them offline thus my hack would no longer be efficient the reason I’m clearing my tracks is that the victim doesn’t find out that they have been hacked or they have been compromised or even if they do find out that they’ve been compromised they cannot trace the compromise back to me so I would be deleting references of any of the IP addresses or MAC addresses that I may have used to attack that particular device and this is where I will be able to identify where those logs were created where those traces are once I take off those traces the victim would not be any wiser of whether they have been compromised or who compromised their system and if I am successful at all of these stages or what to whatever extent the success that I’ve achieved in any of these stages I would then create a report based on that and I would report to the management about the activities that we have been able to do and whatever we have been able to achieve out of those activities for example we identified 10 different flaws there were 20 different attacks that we wanted to do what attack did we do what was the outcome of that attack what was the intended or or the expected output of that attack i’ll create a report which would give a detailed analysis of all the steps that were taken along with screenshots and evidences of what activity was conducted what was the output what was the expected output and I would submit that report to the management giving them an idea of what vulnerabilities and flaws exist in their environment or their devices that need to be mitigated so that the security can be enhanced so these are the six steps that the ethical hacking process would take uh just going through this the uh reconnaissance is where you’re going to use hiking tools like NM map edge ping to obtain information about targets there are hundreds of tools out there depending on what information you want then in scanning again N mapose these kind of tools to be utilized to identify open ports protocols and services in gaining access you’re going to exploit a vulnerability by using the metasloit tool that we talked about in the previous slides in the maintaining access you’re going to install back doors you can use metasloit at the same time uh you can craft your own scripts to create a Trojan and install it on the victim’s machine once you have achieved that clearing tracks is where you’re going to clear all evidences of your activity so that you do not get caught or the victim doesn’t even realize that they have been hacked and once you have done all of this we are going to create reports that are going to be submitted to the management to help them understand the current security evaluation of their organization so now let’s see how we can hack using social engineering now what is social engineering social engineering is the art of manipulating humans into revealing confidential information which they otherwise would not have revealed so this is where your social skill and your people skills come into the picture if you’re able to communicate effectively to another person they would probably give up more information that they intended to give out let’s look at look at examples right if you see on the screen fishing activity what is fishing we receive a lot of free emails on a regular basis we have always received those emails where we have won a lottery of a few million dollars but we have never realized that we didn’t purchase a lottery to win a lottery in the first place we have always had those Nigerian frauds where a prince died in some South African country and you out of 7 billion people on the planet have been identified where they want to transfer a few hundred million through your account and they want to give you 50% of that money in return as thank you some very basic attacks where you go on two websites and there’s a banner flashing at you saying “Congratulations you’re the 1 millionth visitor to this website click here to claim your prize.” All of these are social engineering attacks fishing attacks fake websites fake communications being sent out to users to prey on their gullibility most of humans always have that dream of striking it rich winning a huge lottery once and for all and living their life lavishly ever after but sadly in the real world that’s not that doesn’t happen that often and if you’re receiving those mails it is very important that you first research the validity of those those communications before you even want to act upon them so why are humans susceptible to social engineering because humans have emotion machines do not try pleading with a machine to give you access to a account that you have forgotten a password to the machine wouldn’t even know what you’re doing try pleading with a human sympathy or empathy where you could try to create a social engine injuring attack where you can plead with them saying if I do not get access to this account immediately I might lose my job and then that would put my family into problems somebody would feel empathy or sympathy towards you and help you reset that password and give you access to that account it’s how good the attack is and how convincing you are for the success of this attack to happen so what is a familiarity exploit attackers interact with victims to gain information which will benefit the attack uh to crack credentials as passwords if we want to reset our passwords what do we have as a mechanism to resetting passwords we have some security questions that we set up those questions are nothing but personal information that we would know but through a social engineering attack we it would be easily be able to uh gather the information that you have set for your security questions the security questions can be as simple as the first school that you attended you probably have that listed on your LinkedIn profile where a per person can just go in there and see your academic qualifications and identify the school that you were in right similarly it might also be a question what was your mother’s maiden name that’s a very good attack and that’s uh I mean if a person can interact with you let’s say they’re trying to take a survey and they approach you for a feedback on a particular product that you have been utilizing and they ask you these questions you wouldn’t think twice before giving those answers as long as the request sounds legitimate to us we are able to justify that request we do answer those queries so it’s upon us to verify the authenticity of the request coming in before we answer it fishing as discussed would be fraudulent emails which appear to be coming from a trusted source so email spoofing comes into mind fake websites and so on so forth exploiting human curiosity curiosity killed the cat right so there was there’s so many physical attacks where hackers just keep pen drives lying around in a parking lot now this is a open generic attack whoever falls victim will fall victim so if I just throw around a few USBs in the parking lot obviously with Trojans implemented on them some people who are curious or who are looking for a couple of freebies might take up those pen drives plug them in their computers to see what data is on the pen drives at the same time once they plug in there those pen drives on their computers the virus or the Trojan would get infected and cause harm to their machine then exploiting human greed we just talked about the Nigerian frauds and the lotteryies those kind of attacks the fake money-making gimmicks now basically this is where you prey upon the person’s uh greed kicking in and they clicking on those links in order to uh get that money that has been promised to them in that email so one of the safest mechanism to keep data private and to keep yourself secure is using encryption now encryption can happen through cryptography what is cryptography cryptography is the art of scrambling data using a particular algorithm so that the data becomes unreadable to the normal user the only person with the key to unscramble that data would be able to unscramble it and make sense out of that data so we’re just making it unreadable or non-readable by using a particular key or a particular algorithm and then we’re going to send the key to the end user the end user using the uh same key would then decrypt that data if anybody compromises that data while it is being sent over the network since it is encrypted they would not be able to read it so the encryption algorithm would be something like this now if you see uh the computer word once made into unreadable format would look like eq o r xv gt for a end user it wouldn’t make any sense but the person who has a key to unscramble that would be able to convert it back to computer and then understand the meaning of that word so this is just a substitution cipher that is being shown on the screen so what is the alphabet the key is alphabet + 3 so c plus three alphabets that becomes e o becomes m becomes o so the key that is utilized to scramble the data is the character that you are at the third character from there would be the corresponding key so the encrypted message is also known as a cipher the decryption is just the other way around where you know the key now and you can now figure out what that e correspondent to by going back three characters in the alphabet most of the times a certified ethical hacker must decrypt a message without knowing the secret key so let’s say a ransomware has affected your organization or has affected a device and you want to figure out uh or you want to decrypt that data now as a ethical hacker you wouldn’t be for paying a ransom uh to the hacker would you so it is now your prerogative of how you’re going to work around and how you’re going to try to crack the encryption mechanism how to crack the cipher to decrypt that message and see what’s within it right decryption without the use of a secret key that is known as a crypt analysis crypto analysis is the reversing of an algorithm to figure out what the decryption was without using a key so cryp analysis can be done using various formats the first one is a brute force attack second is a dictionary attack the third one is a rainbow table attack a brute force attack is trying every combination permutation and combination of the key to figure out what the key was it is 100% successful but may take a lot of time a dictionary attack is where you have created a list of possible encryption mechanisms a list of possible cracks and then you try to figure out whether those cracks work or not rainbow tables are where you have an encrypted text in hand and you’re trying to figure out uh the similarities between the text that you have and the encrypted data that you wanted to decrypt in the first place so in the brute force attack you’re trying every possible combination permutation of what the key would be in dictionary attack you have a word list that would tantamount to the key and if you’re you’re trying to match all the words listed in the text file or the word list to see if any of those words are going to work to decrypt that data here in the rainbow table the cipher text is compared with another cipher text you find out similarities and then you try to work or reverse engineer your way accordingly so let’s have a quick demo on cryptography before we end this session so to begin with the demo of cryptography we are on a website called spammimic.com which will help us scramble the message that we created into a completely format which would be unrelated to the topic at hand so if I say I want to encode a message turn a short message into spam so what this does is want to send across a secret message you type in the secret message a short one and it will convert that into a spam mail you send it across so whoever is reading that spam mail would never get an idea of the embedded message within it so if I want to type in a message here hi this is a secret message the password is askd at the rate 1 2 3 4 and I want to send this out to people or to one of my colleagues but I want to send it out in a secret manner so that others are not aware of this so when I press on encode what the algorithm would do is it will convert this message into a spam mail so my message hi this is a secret message the password is at the rate 1 2 3 4 or asd at the rate 1 2 3 4 gets converted into this now if you read it dear e-commerce professional this letter was specially selected to be sent to you this doesn’t make sense there is nowhere or no reference to the actual message that I’ve already said so if I copy this entire message and I send it let’s say via email to the recipient now the thing is that the recipient needs to know that I’ve encoded it using spam mimic the algorithm rem need needs to remain the same so once they know that it is spam mimic what they can do is now in this instance what I’m going to do is I’m going to open up a new browser and I’m going to go to the same website and at this point in time I’m going to click on decode when I click on decode I’m going to paste the message that I have just copied there we are and this message is now being copied into a different browser and if I decode this you will see that it will convert it back to the original message that there was so the key is there at spam mimic and uh it is embedded within the message so whenever we paste the message in the decode factor it knows what the key was and it can decrypt that message and give me the actual message that was embedded within it there we are the entire message this is what we created in the Google Chrome browser and in the Firefox browser we decoded similarly if I want to protect these kind of messages there is an aspen encrypt.com website where let’s say we use text encryption and I want to encrypt the same message this is a secret message the password is ASD at the rate 1 2 3 4 and then I give it a password to protect this message let’s say the word password and I use the cipher to scramble this by using let’s say AES which is the strongest cipher right now and I say encrypt so this is what the encryption would look like and basically uh if I don’t have the password over here if I decrypt it you would see that the error has occurred now if I type in the password over here and then decrypt it it will be able to convert that back into the unscrambled text and it will give me what the original message was this is a secret message the password is ASD at the rate 1 2 3 4 so if I want to keep my data secure from hackers I want to scramble it in such a way that they would not be able to crack it or it would be very difficult from for them to crack it and this is one of the first mechanisms that would be recommended by any ethical hacker and before we begin if you are someone who is interested in building a career in cyber security or to become an ethical hacker by graduating from the best universities or a professional who elicits to switch career with cyber security or ethical hacker by learning from the experts then try giving a show to simply learn postgraduate program in cyber security with modules from MIT Schwarzman College of Computing the course link is mentioned in the description box below that will navigate you to the course page where you can find a complete overview of the program being offered hello everyone and welcome to this video on the hackers road map at the simpleland YouTube channel as vast as the field of cyber security is there’s often an overflow of information about it at the same time for people who wish to know more about how to venture into the cyber security or ethical hacking space it is very important for them to know what’s the career progression what are the skills needed and how a person with no or bare minimum knowledge can take their first step in this amazing career well this video is for all those individuals who wish to pursue a career in the field of cyber security and ethical hacking whether you are an entry- level professional a college graduate or an experienced professional looking to understand how a career in the field of cyber security progresses and what additional skills and responsibilities would you need as you grow in the field then you are at the right place so let’s get started with our topic the hacker’s road map and before we begin if you are someone who is interested in building a career in cyber security by graduating from the best universities or a professional who elicits to switch careers with cyber security by learning from the experts then try giving a shot to simply lens postgraduate program in cyber security with modules from MIT Schwarzman College of Engineering the course link is mentioned in the description box that will navigate you to the course page where you can find a complete overview of the program being offered and if these are the types of videos you would like to watch then hit the subscribe button like and press on the bell icon to never miss on further content so stay tuned with us until the end of this video and don’t forget to register your opinion in the comment section below and now we will start with what is ethical hacking and how is it different from hacking so in the world of cyber security hacking can be broadly categorized into two types ethical hacking and unethical hacking ethical hacking involves using the same tools and techniques as malicious hackers to identify and fix security vulnerabilities before they can be exploited and these expert known as whitehead hackers work with a focus on security rather on theft and on the other hand we have unethical hacking that refers to unauthorized access to digital devices or networks with malicious intent performed by black hackers and additionally there are greyhackers who possess knowledge in offensive and defensive computer use sometimes working as security consultants during the day and engaging in blackhead activities at night it is important to understand these distinctions to protect against cyber threats effectively now we’ll see the objective or roles of an ethical hacker ethical hackers also known as whitehead hackers use their skills and expertise to identify vulnerabilities in system and network before malicious hackers can exploit them their primary objective is to simulate real world attacks and help organization strengthen their security measures the role of an ethical hacker involves several key phases and we’ll see those roles and key phases so they are responsible for reconnaissance scanning gain and maintain access clear their tracks document their findings and compile detailed reports so firstly they conduct thorough reconance gathering information about the target system or organization this includes understanding the organization structure network infrastructure and potential weak points and through scanning they identify the easiest and quickest methods to gain access to the network and gather further information and once access is gained ethical hackers maintain it allowing them to exercise their privileges and control the connected systems this step helps them identify any potential security flaws and weaknesses within the network they also work to clear their tracks covering their footsteps to evade detection and ensuring the security personnel cannot trace their activities and throughout the entire process ethical hackers document their findings compile detailed reports on the vulnerabilities discovered and provide recommendations to address and mitigate the identified security issues their vulnerability goal is to help organization strengthen their defenses prevent data breaches and protect sensitive information from falling into the wrong hands ethical hacking is a crucial aspect of cyber security as it allows organizations to stay one step ahead of cyber threats by leveraging the skills of ethical hackers businesses can proactively identify and address vulnerabilities ensuring the overall security and integrity of their digital infrastructure so now we’ll see the skills that needed to be an ethical hacker so now we’ll see the skills so the first skill is knowledge of computer networks then it’s the programming languages then the knowledge of web applications databases ethical hacking tools and knowledge of common attack vectors and techniques then what certificates that are required for an ethical hacker now we will start with knowledge of computer networks understanding computer networks is fundamental for ethical hackers this includes concepts such as IP addressing network protocols example TCP IP routing switching and firewalls a strong grasp of how networks function will enable you to identify vulnerabilities and potential entry points the next is programming languages proficiency in programming languages is essential for effective ethical hacking languages like Python Java C++ and scripting languages such as Pearl or Ruby are widely used in this field programming skills enable you to write custom scripts and tools automate task and exploit vulnerabilities and the next we have is web applications in today’s digital landscape web applications are often the target of attacks therefore a solid understanding of web application architecture protocols example HTTP and security mechanisms example SSL TLS is crucial knowledge of web programming languages like HTML CSS JavaScript and frameworks like PHP or ASP.NET is also beneficial then we have databases so databases store and manage sensitive data making them attractive targets for hackers familiarize yourself with database management systems DBMS such as MySQL Oracle or Microsoft SQL Server learn about database security including access control encryption and vulnerability assessment then we should focus on the skill to have a knowledge on ethical hacking tools so to perform ethical hacking task efficiently you should be familiar with various hacking tools these include network scanners example end mapap vulnerability scanners example Nessus password crackers jo the rier packet snipers wireshock and exploitation frameworks metasloit mastering these tools will enhance your effectiveness as an ethical hacker then you should have knowledge of common attack vectors and techniques that is understanding common attack vectors and techniques is vital for an ethical hacker this includes knowledge of different types of malware social engineering network attacks that is DDoS and web application vulnerabilities example cross-ite scripting staying up to date with the latest threats and attack methodologies is crucial for effective defense the next is certificates so obtaining relevant certifications demonstrates your expertise and commitment to the field certificates like certified ethical hacker CH offensive security certificate professional OCP or CompTIA security plus are highly regarded within the industry they validate your skills and can boost your credibility when seeking ethical hacking opportunities the C certification is a multiplechoice exam that evaluates your understanding of the penetration testing structure and the tools that are utilized inside it it gives job seekers the information security field a head start by ensuring that the certificate holder understands the fundamentals such as information gathering attacking computers or servers wireless attacks and social engineering so the objective CH is inform the public that credentialized individuals meet or exceed the minimum standards second establish and govern minimum standards of credentiality third professional information security specialist in ethical hacking so now we will have an exam overview so the exam name is EC council certified ethical hacker and the exam duration is 240 minutes and you will get questions that is 125 questions you will get in the exam and it is a multiplechoice question exam and the passing score you need is 70% and to register for the exam you should go to Pearson view or ECC exam center and eligibility criteria for CH is there are two ways to satisfy the eligibility criteria that is attend official CH training and this can be in any format example instructorled training computer-based training or live online training as long as the program is approved by EC council and attempt without official training in order to be considered for the EC council certification exam without attending official training you must have two or more years of documented information security experience ra non-refundable eligibility application fee of $100 submit completed CH exam eligibility form including verification from an employer upon approval EC council will email you a voucher number to register for the CH exam so this was all about the CH exam and now we will move to the steps to become ethical hacker so ethical hacking is an exciting and rapidly growing field that requires a combination of technical skills knowledge and a strong sense of ethics by following these steps you can begin your journey towards becoming an ethical hacker and contribute to enhancing cyber security so step one that is knowledge of computer systems and networks step two you should have proficiency in programming languages step three networking and security concepts you should have a knowledge of it third knowledge of web application and database fifth understanding of operating systems step six familiarity with ethical hacking tools step seven problem solving and analytical thinking step eight knowledge of common attack vectors and techniques step nine certifications so now we will elaborate all the steps one by one so we’ll start with knowledge of computer systems and networks so to become an ethical hacker it is crucial to have a deep understanding of computer systems and networks this involves familiarizing yourself with the inner workings of computer system network protocols operating systems and how different components interact within a network environment by gaining this knowledge you will be better equipped to identify vulnerabilities and assess potential security risk and the next is proficiency in programming languages so programming languages are an essential tool for ethical hackers by gaining proficiency in programming languages such as Python C++ Java JavaScript SQL Pearl and Ruby you will be able to develop your own scripts automate task and create exploit codes these programming languages provide the foundation for writing secure and efficient code as well as manipulating and analyzing data the next step is networking and security concepts to effectively assess and secure networks it is important to have a solid understanding of networking and security concept this includes familiarizing yourself with topics such as network protocols network security principles encryption techniques and firewall configurations understanding how data is transmitted secured and protected in a network environment will enable you to identify potential vulnerabilities and implement appropriate security measures step four knowledge of web application and database knowledge so in today’s interconnected world web applications and databases are common targets for hackers therefore it is crucial to develop a strong understanding of web application architectures web protocols and database systems pay special attention to common vulnerabilities specific to web applications such as SQL injection cross-ite scripting XSS and cross-sight request forgery CSRF by gaining expertise in these areas you will be able to effectively assess the security of web applications and databases and provide appropriate recommendations for securing them and the next step is understanding of operating systems so operating systems form the backbone of computer systems and are often targeted by hackers it is important to gain a comprehensive understanding of different operating systems such as Windows Linux or Mac OS this includes understanding system configurations file permissions user management and security mechanisms specific to each operating system this knowledge will enable you to identify vulnerabilities apply patches and secure operating systems effectively step six familiarity with ethical hacking tools ethical hackers rely on a variety of tools to assess and secure systems and networks familiarize yourself with popular ethical hacking tools such as Matt Plot Wireshark Nap Burp Suit Kali Linux Canvas SQL Ninja and Bobby these tools provide functionalities for vulnerability scanning network sniffing exploit development and penetration testing understanding how to use these tools effectively will enhance your capabilities as an ethical hacker now we’ll see the step seven that is problem solving and analytical thinking so being an ethical hacker requires strong problem solving skills and the ability to think analytically you will often encounter complex systems and face intricate security challenges developing your problem solving abilities and analytical thinking will help you approach these challenges systematically identify vulnerabilities and deise effective strategies to mitigate risk it is essential to stay updated with the latest security trends and technologies to enhance your problem solving skills and the step it is knowledge of common attack vectors and techniques so to defend against potential threats you must familiarize yourself with common hacking techniques and attack vectors used by malicious hackers this includes social engineering fishing attacks password cracking network based attacks and more understanding how these attacks work and the methodologies used will enable you to proactively identify and prevent potential security breaches and now the step nine that is certifications while certifications are not mandatory to start a career in ethical hacking they can provide a structured learning path and validate your skills and knowledge consider pursuing certifications such as certified ethical hacker CH Offensive Security Certified Professional OCP Certified Information System Security Professional CISSP Certified Penetration Testing Engineer CPTE and Certified Security Analyst ECSA these certifications demonstrate your expertise and dedication to the field enhancing your credibility as an ethical hacker now we’ll see the job roles in ethical hacking field so starting with like there are several job roles in ethical hacking such as here’s an elaboration on each job role in ethical hacking and we’ll see some of the major ethical hacker job roles so starting with ethical hacker so an ethical hacker is a skilled professional who legally attempts to penetrate computer system and networks to identify vulnerabilities and weaknesses they use their knowledge to strengthen the security infrastructure and protect against cyber threats and the next is network security engineer network security engineers specialize in securing and

    maintaining computer networks within an organization they implement and manage security measures such as firewalls intrusion detection systems and virtual private networks that is VPNs to protect sensitive data then we have cyber security analyst so cyber security analyst monitor and analyze systems for potential security breaches or incidents they investigate threats develop security protocols and implement measures to protect against attacks the next is penetration tester penetration testers also known as ethical hackers simulate real world attacks to identify vulnerabilities in computer systems networks and applications they conduct thorough assessments and provide recommendations for improving security the next is information security manager information security managers are responsible for overseeing an organization’s overall security strategy and ensuring the protection of sensitive data they develop and implement security policies manage security teams and handle incident response and the next is cyber security engineer so cyber security engineers design and implement security systems including firewalls encryption protocols and intrusion detection systems they also conduct risk assessments and perform security audits to maintain a security environment and the next is security consultant security consultants provide expert advice and guidance on security strategies and solutions they assess vulnerabilities develop security plans and assist organizations in improving their overall security posture in the United States these requirements are very high and this was all for this tutorial did you know that in August this year Google openly admitted that some of its Gmail accounts were hacked by an Iranian group fortunately the event was isolated and was taken care of but rarely are security breaches this easy to stop with more and more data moving to the cloud the prospects of hacks like these have grown in the past decade exponentially consequently organizations have now discovered the need to secure the digital infrastructure against various attack vectors fueling the need for ethical hackers in the IT industry see today’s video is all about how you can learn the ins and outs of hacking and cyber security irrespective of your learning background so welcome to our video on how to become an ethical hacker by simply learning before we get started ensure you’re subscribed to our channel so you always stay updated with the latest technologies and trends let’s first clear the air on an ethical hacker’s role the term hacking has inherently negative connotations however this will only be applicable until the duty of an ethical hacker is properly understood ethical hackers are the good people in the hacking field wearing the white hat so what exactly is the responsibility of an ethical hacker instead of utilizing their extensive computer expertise for criminal purposes ethical hackers find gaps in data and computer security for businesses and organizations worldwide to defend themselves against hackers with less than noble intentions ethical hacking is a subcategory of cyber security that involves lawfully breaking a system security mechanisms in order to discover possible threats and data leaks on the network ethical hackers can work for a corporation as independent freelancers in-house security staff for its website or its applications or as simulated offensive cyber security professionals as well all of these careers need knowledge of current attack methodologies and tools albeit the in-house expert may need to be knowledgeable about a single kind of software or digital asset but how can you hone your ethical hacking skills let’s take a look at few steps one can take while starting a career in this field the first step is getting comfortable with Linux there are operating systems catered specifically to ethical hackers like Kali Linux and Parrot Security both are based on Linux derivatives and have a plethora of tools to make your hacking workflow easy and relatively stress-free the better vers you are with Linux and its terminal the quicker you can achieve things when hacking the next would be to master the mother of all programming languages which is the C programming language since Linux and a lot of backend code are written in C having a strong hand over this programming language is very important it’s always helpful to learn a couple more relevant languages like Python or JavaScript which will help you dissect giant pieces of server code like butter remaining anonymous is vital in the hacking sphere since giving a malicious actor news of your existence on a target network can cause him then to flee or attack your device instead the usage of MAC address randomizers and proxy chains is highly beneficial and recommended when monitoring networks for criminal activity and speaking of proxies ethical hackers must understand networking fundamentals and exactly how they are established learning about various networks and protocols might help you exploit flaws an ethical hacker with an extensive understanding of networking tools such as Wireshark Nap and others can overcome field incidents relatively unscathed the fifth skill in our list is traversing the dark web using the famous to browser most of the internet is hidden behind the tour networks and getting a closer look at the people who often are at the forefront of the hacking industry in the dark web directly can help you familiarize yourself with a certain domain secrets while keeping you updated with the latest happenings in the cyber crime world a major advantage that can tip the scales in the favor of an ethical hacker is the knowledge of cryptography or encryption encryption is used in various elements of information security including authentication data integrity anonymity and others passwords and other sensitive information are always encrypted on a network a hacker must understand how to recognize and break these encryption standards exploiting vulnerabilities make you a better ethical hacker simply keeps you aware of the security measures that are kept in place as industry standards while handing you the most advanced penetration testing tools on the market learning how to scan networks and systems for vulnerabilities that might result in a security breach ethical hackers may also attempt to write vulnerabilities to exploit the system in question as a final tip join forums for conversations with other hackers worldwide to trade share expertise and collaborate discord Reddit Telegram and other platforms all have communities where you can join and collaborate with fellow learners to broaden your learning spectrum now that we understand some basic skills ethical hackers need to excel in this domain let us look at the road map one can follow to get started many ethical hackers begin their careers by studying computer science you can also acquire an A+ certification from compia by appearing for and passing two additional tests these tests assess an individual’s understanding of PC components and their ability to disassemble and reassemble a PC however before advancing in your profession you must gather experience and obtain a network plus or a CCNA certification the Network Plus certification certifies fundamental network expertise such as network administration maintenance deployment and troubleshooting the CCNA certification guarantees the same skills and strives for foundation level proficiency once qualified you can advance to the next level of your career in network support you’ll be responsible for monitoring and upgrading installing security software and testing for vulnerabilities you’ll obtain expertise in network security and your goal should be offered as a position as a network engineer as a network engineer you will build and plan networks rather than simply maintain them your focus should now be on the security part of your journey to becoming an ethical hacker this is the time to focus on earning a security certifications such as security plus or CISSP the US Department of Defense has approved the security plus acquisition which covers testing on critical areas such as access control identity authentication and cryptography the CISSP certification is a worldwide recognized security acquisition that validates the expertise of risk management cloud technology and application development the next step would be to start working in the information security division an information security analyst studies systems and network security engages with security breaches and strives to implement security solutions for this profession you should focus on penetration testing to gain hands-on experience is some of the most essential tools of the trade getting the certified ethical hacker or the CE certification should be your top priority the training will teach you all you must understand to become a productive and ethical hacker you will be engaged in a hands-on environment where you will be guided through breaking into a network and finding any security flaws after obtaining this certification you can begin marketing yourself as a professional ethical hacker we have already covered some skills one needs to learn when starting their journey however an ethical hacker has certain roles and responsibilities that must be carried out meticulously the first of which is threat modeling threat modeling is optimizing network security by identifying vulnerabilities and determining counter measures for avoiding or reducing an attack’s impact on the system a threat is a real or projected negative incident jeopardizing the organization’s assets the role of an ethical hacker is to give a thorough assessment of potentially harmful assaults and their potential consequences they can also conduct information security audits or a risk based evaluation of a company’s security these regular exercises assess security readiness identify IT system weaknesses and offer strategies for reducing future attack threats they also assess how successfully security related policies are implemented resulting in a report that includes discovered flaws and appropriate solutions ethical writers must be able to collect data detect vulnerabilities and coordinate risks to create clear and unambiguous professional reports these evaluations are frequently used to justify finalizing security asset expenditures the market for trained ethical hackers has never been this expansive according to various surveys the job outlook for ethical hackers and information security analysts is supposed to grow by 33% between 2020 and 2030 companies like IBM Google and Microsoft are always on the lookout for trained cyber security personnel in this climate of data breaches and security vulnerabilities we hope this video has cleared some doubts regarding where to start and what to learn during this journey when it comes to web app hacking it generally refers to the exploitation of applications by HTTP which can be done by manipulating the applications via its graphical user interface this is done by tampering with the uniform resource identifier also known as a URI or tampering with the HTTP elements directly which are not a part of the URI the hacker can send a link via an email or a chat and may trick the users of a web application into executing actions in case the attack is on an administrator account the entire web application can be compromised anyone who uses a computer connected to the internet is susceptible to the threats that computer hackers and online predators pose these online villains typically use fishing scams spam email or instant messages and bogus websites to deliver dangerous malware to your computer and compromise your computer security computer hackers can also try to access your computer and private information directly if you’re not protected by a firewall they can monitor your conversations or peruse the back end of your personal website usually disguised with a bogus identity predators can lure you into revealing sensitive personal and financial information a web server which can be referred to as the hardware the computer or the software which helps to deliver content that can be accessed through the internet the primary function of a web server is to deliver these web pages on the request to clients using the hypertext transfer protocol or HTTP so hackers attack the web server to steal credential information passwords and business information by using different types of attacks like DOS attacks SYN flooding ping flood port scan and social engineering attacks in the area of web security despite strong encryption on the browser server channel web users still have no assurance about what happens at the other end although wireless networks offer great flexibility they have their own security problems a hacker can sniff the network packets without having to be in the same building where the network is located as wireless networks communicate through radio waves a hacker can easily sniff the network from a nearby location most attackers use network sniffing to find the SSID and hack a wireless network an attacker can attack a network from a distance and therefore it is sometimes difficult to collect evidence against the main hacker social engineering is the art of manipulating users of a computing system into revealing confidential information which can be later used to gain unauthorized access to a computer system the term can also include activities such as exploiting human kindness greed and curiosity to gain access to restricted access buildings or getting the users to installing backdoor software knowing the tricks used by hackers to trick users into releasing vital login information is fundamental in protecting computer systems coming to our main focus for today let us have a look at the top five most essential ethical hacking tools to be used in 2021 at the top of the chain lies N MAPAP nap which stands for network mapper is a free and open-source utility for network discovery and security auditing many systems and network administrators also find it useful for tasks such as network inventory managing service upgrade schedules and monitoring host or service uptime it is most beneficial in the early stages of ethical hacking where a hacker must figure the possible entry point to a system before running the necessary exploits thus allowing the hackers to leverage any insecure openings and thus breach the device lmap uses raw IB packets in novel ways to determine what hosts are available on the network what service they are running what operating systems are installed what type of packet filters and firewalls are in use and dozens other characteristics it was designed to rapidly scan large networks but works fines against single host as well since every application that connects to a network needs to do so via a port the wrong port or a server configuration can open a can of worms which lead to a thorough breach of the system and ultimately a fully hacked device next on our list we have Metasloit the Metasloit framework is a very powerful tool that can be used by cyber criminals as well as ethical hackers to probe systematic vulnerabilities on both networks and servers because it’s an open-source framework it can be easily customized and used with most operating systems with Metasloit the ethical hacking team can use readymade or custom code and introduce it into a network to probe for weak spots as another flavor of threat hunting once the flaws are identified and documented the information can be used to address systemic weaknesses and prioritize solutions once a particular vulnerability is identified and the necessary exploit is fed into the system there are a host of options for the hacker depending on the vulnerability hackers can even run root commands from the terminal allowing complete control over the activities of the compromised system as well as all the personal data stored on the device a big advantage of metas-ploit is the ability to run full-fledged scans on the target system which gives a detailed picture of the security index of the system along with the necessary exploits that can be used to bypass the antivirus software having a single solution to gather almost all the necessary points of attack is very useful for ethical hackers and penetration testers as denoted by its high rank in the list moving on we have the Aunetics framework akinetics is an end-to-end web security scanner which offers a 360deree view of an organization security it is an application security testing tool that helps the company address vulnerability across all their critical web assets the need to be able to test application in depth and further than traditional vulnerability management tools has created a market with several players in the application security space ainetics can detect over 7,000 vulnerabilities including SQL injections cross-sight scripting misconfigurations weak passwords exposed database and other outofband vulnerabilities it can scan all pages web apps and complex web applications running HTML 5 and JavaScript as well it also lets you scan complex multi-level forms and even password protected areas of the site iconetics is a dynamic application security testing package which has definite perks over status application security testing frameworks which are also known as SAS scanners sas tools only work during development and only for specific languages and have a history of reporting lot of false positives whereas dynamic testing tools also known as DAT have the ability to streamline testing from development to deployment with minimal issues next on our list we have Air Gaddaden this is a multi-use bash script used for Linux systems to hack and audit wireless networks like our everyday Wi-Fi router and its counterparts along with being able to launch denial of service attacks on compromised networks this multi-purpose Wi-Fi hacking tool has very rich features which support multiple methods for Wi-Fi hacking including WPS hacking modes WP attacks handshake captures evil twin and so much more it usually needs an external network adapter that supports monitor mode which is necessary to be able to capture wireless traffic that reverse the air channels thanks to its open-source nature Air Garden can be used with multiple community plugins and add-ons thereby increasing its effectiveness against a wide variety of routers both in the 2.4 GHz and the 5 GHz band finally at number five we have John the Ripper john the Ripper is an open-source password security auditing and the password recovery tool which is available for many operating systems john the Ripper Jumbo supports hundred of hash and cipher types including for user passwords of operating systems web apps database servers encrypted keys and document files some of the key features of the tool include offering multiple modes to speed up the password cracking automatically deselecting the hashing algorithm used by the passwords and the ease of running and configurating the tool to make it password cracking easier it can use dictionary attacks along with regular brute forcing to speed up the process of cracking the correct password without wasting additional resources the word list being used in these dictionary attacks can be used by the users and allowing for a completely customizable process we also have a few honorary mentions in our list that just missed the cut netsparker for instance is an automated yet fully configurable web application security scanner that enables you to scan websites web applications and web services the scanning technology is designed to help you secure web applications easily without any fuss so you can focus on fixing the reported vulnerabilities the Burp suit professional is one of the most popular penetration testing and vulnerability finder tools and is used for checking web application security the term Burp as it is commonly known is a proxy based tool which is used to evaluate the security of web- based application and to do hands-on testing moving away from websites and applications Wireshark is a free and open-source packet analyzer which was launched in 2006 it is used for network troubleshooting analysis software and communications protocol development and education it captures network traffic on the local network and stores data for offline analysis vshark captures network traffic from Ethernet Bluetooth wireless networks and frame relay connections now that we learn about the different types of tools that can be used when conducting an ethical hacking audit let’s learn about some potential benefits of such campaigns and why organizations prefer to pay for such audits being able to identify defects from an attacker’s perspective is game-changing since it displays all the potential avenues of a possible hack one can only prepare for the known vulnerabilities as a defensive specialist but proactively trying to breach a network or device can make hackers think of techniques that no defense contractors can account for this kind of unpredictability goes a long way in securing a network against malicious actors another advantage of hiring ethical hackers is the ability to preemptively fix possible weak points in a company’s network infrastructure as seen on many occasions a real breach will cause loss of data and irreparable damage to the foundation of an organization being able to gauge such shortcomings before they become public and can be used exploited is a benefit most organizations make use of this is not to imply that such security audits are only beneficial to the organization paying for it when coming across companies that provide certain services a reliable third party security audit goes a long way in instilling trust and confidence over their craft if the ethical hackers cannot find any major vulnerabilities that can be leveraged by hackers it just accentuates the technical brilliance of the organization and its engineers thereby increasing the clientele by a substantial amount in this we are going to discuss ethical hacking and penetration testing so we’re going to talk about the concepts about what constitutes an ethical hack and what is a penetration test we’re going to talk about the different types of penetration test and how they can be done we’re going to talk about an operating system called Kali Linux and we’re going to talk about its usage and its importance in cyber security we will also be discussing the different phases of penetration test and how people or hackers would utilize these phases uh to gain their objectives we’ll also be discussing in what areas can we do a penetration test how to do those penetration tests we’ll be discussing a quite a few bit of penetration testing tools that are available in the Kali Linux space and then we’ll be looking at a couple of demos at the end of the session to understand how these tools in the operating system can be utilized for various hacks so let’s start it with what is ethical hacking now plainly defined ethical hacking is locating weaknesses or vulnerabilities of computers and information systems using the intent and actions of a malicious hacker the major difference is here that we are hired to discover those weaknesses in a legal and ethical manner that means first and foremost our intent should not be malicious we do not wish any harm to the organization and whatever we discover is reported back and not misused once we report back we would also be trying to help them out to mitigate or remove those weaknesses or vulnerabilities to enhance the company’s security posture so essentially we would have the same training or the same knowledge as that of a malicious hacker except that the intent is going to be different the intent is going to help the organization achieve security to protect themselves against malicious hackers and the second most important thing about ethical hacking is that we are authorized to do that activity i cannot in good faith hack somebody and then tell them you know what I just I just wanted to help you out and uh here are your vulnerabilities and uh this is the way you can prevent them i first need the authorization from the other party and only then can I perform a ethical hack so in this example hacker attacks an individual with malicious intent and makes misuse of whatever information they have gotten they steal the data they maybe fry the operating system hardware destroy it and thus uh they leave the victim without uh a device with authorization an ethical hacker can also attack the same individual minus the destruction of course and the intent is good so they’re willingly finding out the vulnerabilities and helping the victim plug them out so that they wouldn’t be a victim of a malicious attack now here the first thing is authorization from the victim and the second thing is the good intent where we do not misuse those vulnerabilities and we report them back to the victim or to the client and help them uh patch those vulnerabilities that’s the main difference between a white hat and a black hat so security experts are normally termed as white hat hackers malicious hackers are termed as black hats now the responsibilities of a ethical hacker are multiffold first and foremost you have to create scripts test for vulnerabilities first have to identify those in the first place so there’s a vulnerability assessment identifying those vulnerabilities and then you’re going to test them to see the validity and the complexity of those vulnerabilities so your one of your responsibilities would be to develop tools to increase security as well or to configure security in such a way that it would be difficult to breach performing risk assessment now what is a risk risk is a threat that is posed to an organization by a possibility of getting hacked so let’s say I as a ethical hacker run a vulnerability scanner on a particular client i identify 10 different vulnerabilities within those 10 vulnerabilities I do a risk assessment to identify which vulnerability is critical would have the most impact on the client and what would be the repercussions if those vulnerabilities actually get exploited so I’m trying to find out in risk assessment that if the client gets hacked with the vulnerabilities identified what is the loss they would be facing once they get hacked and the loss could not only be loss of data it could be financial losses it could be loss of reputation penalties they have to pay to the client for breaches or penalties that they may have to pay for pay the governments in case of breaches that happened that uh couldn’t be controlled another responsibility of the ethical hacker is to set up policies in such a way that it becomes difficult for hackers to get access to devices or to protected data and finally train the staff for network security so uh we got a lot of employees in an organization we need to train the staff of what is allowed and what is not allowed how to keep themselves secure so that they don’t get compromised thus becoming a vulnerability themselves to the organization the policies that we have talked about are administrative policies to govern the employees of the organization for example password policies most of the organizations will have a tough password policy where they say you have to create a password that meets a certain level of complexity before that can be accepted and till you create that password you’re not allowed to log in or you’re not allowed to register so let’s move on to understand what is penetration testing now for penetration testing there is a phase called vulnerability assessment that happens before this vulnerability assessment is nothing but running a scanning tool to identify a list of potential flaws or vulnerabilities within the organization once you have identified the list of those vulnerabilities you would then move on to penetration test this is the part of ethical hacking where it specifically focuses on penetration only of the information systems so you have identified that flaw maybe it could be a database with a SQL injection or it could be uh a buffer over overrun flaw or it could be a simple password cracking attempt your idea is to create those tools create those attacks and try to penetrate into those areas where security is weak uh the essence of penetration testing is to penetrate information systems using various attacks the attacks could be anything like a fishing attack a password cracking attack a denial of service attack or any other vulnerabilities that you have identified uh during the vulnerability scan so what is Kali Linux and why is it used kali Linux is an operating system oftenly used by hackers and ethical hackers both because of the tool sets that the operating system contains it is a operating system created by professionals with a lot of embedded tools it is a DVN based operating system with advanced penetration testing and security auditing features there are more than 600 plus odd tools on that operating system that can help you leverage any of the attacks man-in-the-middle attacks sniffing password cracking uh any of these attacks would be possible with all the tools available you just need to know how to utilize the operating system and its tools contains like I said a hundred of hundreds of tools that are used for various information security tasks like uh computer forensics re reverse engineering information finding even uh getting access to different machines and then uh creating viruses worms to anything that you will 600 plus tools in the Kali Linux operating system there are periodic updates that are given out to the operating system as well it is open source that means it is free to utilize you can even have the source code you can modify it if you want too there’s customizations available for all the tools you can download third party tools and install them if you want there’s a wide support for wireless uh network cards multiple languages are being supported at the time at the same time as well and you can create a lot of attacking uh scripts you can create attacking tools and you can write your own exploits as well on Kali Linux so this all all in all helps you create a very robust system where you can create your own attacks and then launch them against unsuspecting victims now that is illegal so as far ethical hacking is concerned once you have authorization you’re going to identify which tools to be utilized you’re going to get the appropriate permissions and only then are you going to attempt those attacks let’s talk about the phases of penetration testing now there are five different phases the first one is the reconnaissance phase also known as the information gathering phase this is the most important phase for any hacker this is where the hacker or the ethical hacker if you will will gather as much information about the targets victim or vice versa the vict the victim right so once you have that information you would then be able to identify what tool sets to include and how to attack the victim for example you want to find out the IP addresses the domains subdomains the network architecture that is being utilized you want to identify operating systems that are being utilized the network IP ranges that are being utilized and so on so forth you might want to identify employees within an organization for social engineering attacks in the future email addresses telephone numbers anything and everything that will help you validate and give you information about the target is something that you want to do in the reconnaissance phase at this point in time we are not going to question whether whatever information we are getting is useful or not only time will tell depending on the various attacks that we will be building up later on this becomes your baseline this becomes your database with all the information about the victim so that you can come back from later stages back to the reconnaissance phase to look at the information that you have gathered and then you can fine-tune your attacks once you have done that you’re going to uh then start the scanning phase based on the information that you have gathered you’re going to identify live machines within a network once you have identified the live machines you’ll scan them for open ports protocols and procedures any processes that are running and then we going going to identify vulnerabilities within these processes and within these open ports so in the scanning phase uh why do we need to find live machines because we want to find out the machines that have booted up have an operating system and are running on the network if an machine is not available on the network or is in a shutdown mode that machine cannot be hacked through a technical attack then it will be a physical attack where you physically go to the machine and then do whatever you want to do with it for a technical attack you will have to identify the machines that have booted up then you’re going to scan the open ports because that’s going to be our entry point and on the port would be a service that is running so you scan the service as well identify the version of the service and then do a vulnerability scan to identify if there are any vulnerabilities on those services that are running and then based on all of this information we are going to develop our attacks as we go on so once we have this we go on to the gaining access phase where we are going to attack and try to get access to our victim’s machines could be a social engineering attack based on the information gathering we have done in the technical assessment and scanning phase if we have identified a vulnerability we’re going to identify a relevant exploit and then use that exploit to try to gain access or we might just craft a trojan and try to uh execute that trojan on the victim’s machine to uh check if we can get access through that particular manner once we have the access could be even a simple password cracking attack which we have been able to accomplish and we have cracked the password of the person and now we have gained access to that person’s computer right but these attacks would be temporary for example we have cracked a password somebody changes the password every 30 days after that period our attack would be useless if a Trojan is executed we get a connection to that machine for once but then how do we get get a repeated connection over and over again if we want to reconnect to that machine so that’s where we come into the maintaining access phase where we install uh rootkits key loggers sniffers and things like that where we could get a backdoor entry to the victim’s machine if we have already been successfully installed a Trojan we would want to add the Trojan to the startup menu so that every time the operating system starts the Trojan gets automatically executed and thus we maintain the backdoor entry to that victim’s machine once we have done all of this all these activities are going to leave a trace in the victim’s machine so if you install a Trojan a Trojan being an application would create directories and files a virus would be destructive in nature if you’re executing a script it will leave some logs behind if we even log in through the cracked password that we have it will create a login entry at for that particular time stamp along with the IP address that we utilized in the covering tracks we are essentially trying to avoid detection by deleting traces of our activity that means that we need to identify where logs have been stored we need to address those logs and we need to delete them or modify them in such a way that our activity is not traceable so these are the five main phases of a penetration test gather as much information as you can scan for machines ports protocols and services running on the victim’s device try to gain access by password cracking trojans exploits for the vulnerabilities if any maintain that access by installing further software which will allow you to gain backdoor access to that particular system and then try to cover your tracks by deleting all traces of your activity once successful the victim will have no idea and you have a back door entry and you can monitor the victim to the extent that you want now in an ethical hacker’s perspective this penetration test can be done in multiple aspects so again understand the fact that we are doing an authorized activity we have identified the tools that we have to use identified the attacks we have got the appropriate authorization and based on that authorization we are conducting a penetration test the penetration test may be asked to be done in one of these manners first is the blackbox test the blackbox test is where no information is given to the ethical hacker about the IT infrastructure so they have no idea what it is they start right from the first phase of the information gathering gather as much information they can and based on the gathered information they try to create and launch attacks to see if they are going to be successful now not only does it test the knowledge of the penetration tester it would also test the security implementations that the organization has done to see whether they can identify the attack and prevent it in the first place so this is the simulation of a malicious hacker scenario where a malicious hacker having no idea about the organization first tries to gather information and then tries to attack that organization so no source code knowledge no technological knowledge nothing they’re just going to try to gather information scan those devices and then try to gain access the second test is a gray box test where some information is given or some knowledge of the IT infrastructure is given think of it from a employees perspective a regular employee in an organization who doesn’t have extra privileges like an administrator but is just a regular employee does that means that they got limited access within the organization based on which they get some knowledge of the IT infrastructure so this is an attempt of an insider uh simulation attack where a regular user may want to try to misuse the access that they’ve been given and then try to gather information or try to gain access to other devices which they are not authorized to the third test is white box where is full knowledge of the IT infrastructure that has been given so this is again a simulation of an insider attack a malicious insider if you will but at this point in time the person has complete knowledge of the infrastructure could be in an administrative position and then they are trying to leverage their access to see if they can get information or they can compromise any stuff any of the data so the three attacks would be the first one black box where we are simulating a external threat a hacker sitting outside the organization trying to gain access the gray box is an insider threat where there’s a regular employee who is trying to get access to infrastructure that they are not authorized for and then the third audit is a white box audit where there’s an administrator who has all the leverage all the access and the visibility within the uh infrastructure and then they are trying to misuse their access to see what else they can get from whatever access has been authorized to them now let’s look at the areas of penetration testing where all could we do a penetration test thus compromising the security of the application or of the server or of the user so first and foremost network services it finds vulnerabilities and weaknesses in the security of the network infrastructure so for example we have switches routers firewalls in the network all of these are devices that need a configuration if they have been not correctly configured or if they have not been correctly secured they would leave some vulnerabilities behind if we as ethical hackers are able to identify these flaws these misconfigurations these vulnerabilities we could then try to exploit them and try to gain access to the network and devices within that network by uh getting access to the network in the first place then we have the web applications web applications are nothing but softwares that are developed over or deployed over a web server and are made available over the internet or the internet for example uh websites that we visit or web applications like Facebook if you will right so if these applications have vulnerabilities within them we then try to attack the web- based applications and thus try to bypass authentication or get access to database or try to leak information through those applications if not then we try to attack the client side now web application is at the server level and is hosted by the deployer so that’s at the server side the client side is where we as users are using a computer with a browser and trying to interact with the web application now the browser and the operating system that we are utilizing would have its own vulnerabilities thus identifying a client side vulnerability and then exploiting it to either either hack the client or then piggyback on the client’s connection and try to get access to the server so either you could attack the network the web application or the client side itself or you could attack wireless networks this test would examine all the wireless devices which are used in a corporation most of the wireless would have laptops smartphones tablets fabts all of those connected to them if you’re able to access any of these devices through the wireless it would help you gain access to other devices on the wireless as well and then social engineering so this is where you’re trying to attack humans you’re tricking an employee of a corporation to reveal some confidential information knowingly or unknowingly by tricking them with uh fake mails or fake websites or malicious emails that you have sent to them uh which they have failed to recognize as malicious and they click on it thus getting victimized social engineering attacks are always uh successful because of the gullibility of humans empathy sympathy humans basically have emotions emotions can be toyed with and then taken advantage of if the person is not careful enough for example the most common social engineering attack that we see is the Nigerian fraud where we receive an email that someone somewhere has died and has left a huge estate behind a few hundred million and we have been identified as the person through whom they want to transfer the money to a foreign land to save on taxes what are the chances of that happening on a daily basis right how many princes are there so that’s something that we do not verify it’s just the I guess the greed if you will of striking it rich quickly that makes us believe these kind of emails uh we have also received emails of lottery tickets that we have won over a period of time without even having bought a lottery ticket so if you haven’t bought one what did you win but we don’t ask these questions we just get excited about the amount of money that we have won and then we try to bet on our luck and try to see if that uh email is going to fruify or is it just another scam so social engineering attacks are dime a dozen these days and we need to be very careful on what we trust on the internet let’s look at the penetration testing tools there are hundreds and thousands of tools out there most of these have been conseded and collected together and hosted on a operating system known as Kali Linux that we have talked about earlier now the predecessor to Kali Linux was backtrack backtrack is no longer continued it has been discontinued and Kali Linux has taken uh the place of backtrack within which are all the tools that you see on your screen metasloit is one of the most favorite penetration testing tools of hackers and ethical hackers uh there are a lot of inbuilt exploits over there and we’ll be doing a demo at the end of the session on this n MAPAP is the information gathering tool which will scan for live devices scan for open ports protocols and services beef would be an application testing tool that would help us uh find exploits within applications nessus vulnerability scanner is a network and a hostbased scanner that would help you identify vulnerabilities within such hosts wireshark is a network sniffer which allows you to capture network packets and and analyze them to see if there are there is any information worth capturing within those packets sql map is a automated tool used for SQL injection attacks so you don’t even have to craft your queries for SQL injection it will be done by the SQL map tool you just need to identify whatever is possible through the queries that this SQL is going to create and then based on the activity that you’ve identified you just need to redefine your search parameters to get access to the database we’ll be doing a demo on SQL map or SQL map as well and then there is John the Ripper john the Ripper is a tool that is used for password cracking so dictionary attacks brute force attacks are done using John the Ripper what is a dictionary attack a dictionary attack is an attack where we create list of all probable passwords store them in a txt file and run that list against the password tool to see if any of those passwords are going to match a brute force attack is trying the same attack but with every permutation and combination of the alphabet that we have and we’re going to try to figure out uh if we are able to crack the password at all so these are just some of the tools for every tool there are another supporting 100 tools or more than that uh like for NSS vulnerability scanner you’ll have college vulnerability scanner you have uh GFI LAN card and there are other lots of other softwares out there but these are some of the most commonly utilized tools let’s look at the metas-ploit attack metas-ploit is a framework of penetration testing that makes hacking very simple you just need to know how to utilize the tool you need to identify the vulnerability associated with a particular exploit and then run the exploit on metasloit we’ll be demoing this during the practical so there are active exploits and passive exploits in active exploit exploits a specific computer runs until execution and then exits uses brute force and exits when an error occurs in a passive exploit these exploits wait for incoming requests and exploit them as soon as they connect they can also be used in conjunction with emails and web browsers so in passive exploits we create a payload we uh like a reverse connection payload we send it to the victim once the victim installs that software the machine will then initiate a connection to us our machine will be in a listen mode and then we will once that software is executed at their end we would then try to connect and exploit that particular vulnerability this is the uh practical that we’ll be doing on metasloit so let’s move on with the demos and then we’ll see uh what we can discuss amongst them all right let’s have a look at some of the demos that we had uh talked about in the ethical hacking and penetration testing module we are going to look at three different demos the first one is going to be a SQL injection attack that we’re going to perform on this tool that we have the second one is a password cracking attack on Windows 7 and the third one is a meter reader based or a metastasoid based shell shock attack on a Linux based web server so let’s get cracking i’ve powered on this virtual machine uh which is the OAS broken web application it is a tool that is provided for people who want to enhance their skills and they can practice uh how to do these attacks in a legal manner so we are going to go to this site i’m just going to open up my browser the IP address is 71.132 and that’s the OAS broken web application that we want to utilize we’re going to head off to mutility 2 and we are going to look at a SQL injection attack where we want to bypass authentication now this takes us to the login screen so we can just try our luck here and see that the authentication mechanism works the account does not exist so the username and password that we have supplied is not the correct one so we want to ensure that there’s a SQL database and uh we can uh try to attack it and see uh if we can bypass the authentication now uh what we want to do is we want to create a SQL based malformed query that can give us a different output so I’m just going to type in a single quote over here and type login and you can see that this is now suddenly recognized as a operator and there’s an error that is given out compared to the login that we tried uh earlier when we used a proper textbased login mechanism it gave us the account does not exist but here the single code gave us a error and it shows us how SQL works this is the query that we had created now in the trainings that you have for ethical hacking there would be explanations of what these queries are all about how the syntax works here we just going to see if we can create a mal for query to log in as a user in this case so what I’m going to do is uh create the query over here and we’re going to give it a comparison so we’re going to give it a or 1= 1 spacey space and if you now click login you should be able to bypass authentication and you can see user has been authenticated and we now have admin access to this application now here the SQL queries need to be crafted in such a perspective that they’re going to work so there would be a lot of exercise in identifying what the database is there’s a Microsoft database an Oracle database and so on so forth and then you have to choose those proper commands but identifying that would come in the training right now we’re just looking at de at a demo this is how a SQL injection attack works now let me log out here similarly now we are in a login page the same query work wonders where it allowed us to bypass authentication so it also depends on what kind of a page I am and what query would be accepted at this point in time so here application understanding would also come into the picture where uh which function we are calling upon when we are connected to a particular page now this is a user lookup function right so again here we try the same method test that’s not going to work authentication error bad user on password and if we type in the same query over here single quote or and give it a condition single quote or 1= 1 space now here it is not going to log us in because this is not a login page this is a user lookup form so here it would instead give us a dump of all the databases that it has so you can see all the usernames and passwords coming in that are stored in the user lookup field so this is where the understanding comes in of which query to create at what page where depending upon the function that is being called right so that’s the SQL uh injection attack that we wanted to look at let’s move on to password tracking now this is a Windows 7 machine that we have i’m just going to do a very basic password tracking example we’re just going to log in now here the assumption is that we are able to log in we have access to a computer and we want to check out other users who are using this computer and see if we can find out their passwords so that uh we can log in as a different user steal data if required and we wouldn’t be to blame if there are any logs that are created so here we’ve got a tool called Kane enable that is installed right here now I’m already an administrator on this machine i’m checking out other administrators who share the same privileges or any other user who may be on this system whose password I can crack and thus I would be able to get access through their account and then do any malicious activity right so this allows me to go into a cracker tool and it allows me to enumerate this machine and identify all the users and passwords that are there in this particular machine right so I’m just going to click on the plus sign and I’m going to import uh hashes from a local system so where are these files stored where does Windows store its passwords in what format are they stored and what this tool does to retrieve those that’s something that we all need to know as a ethical hacker right so import the hashes from the local system click on next it’s going to enumerate that file and it is going to give you a list of all the users that are there so you can see the users or hacker admin test the one that we are logged in as and then there’s a user called virus as well and you can see that this is the hash value of the password that is being utilized now there’s a particular format uh for a hash value for Windows and how it stores but once we have these hash values let’s say if I want to crack this password there are various attacks that we can do for example a dictionary based attack or a brute force attack let’s try a brute force attack right nlm is the hashing mechanism that is used by Windows so we’re going to try to create an NTLM hash attack and here we’re going to use a predetermined rule set for example we are not sure what characters are being utilized over here so we just create an attack like this using all characters and uh lowerase A through Z uppercase A through Z numeric 0 through 9 and all the special characters let’s say the password is between 7 and 16 characters and this is the character set that we want to try the brute force attack on what is a brute force attack it is an attack where the computer is going to try each and every permutation and combination out of this character set and try to figure out if the password is going to be correct so if we click start it’s going to start with a particular characters and then it is going to identify if that NLM hash is going to work against this character and you can see the time is going to be phenomenal over here so it’s not necessary that this attack would be viable it will be 100% successful given the time frame however the time frame is huge enough for this attack to become a little bit redundant there are other attacks that we can do which can easily identify this data for us as well but that is something that we will look on in future videos so that’s how we can get access to users and passwords uh there are different mechanisms where let’s say we don’t have login access then what are we going to do how we can create a fake user login or how we can remotely access a machine and then try to get the same access and that is what we are going to try to do in the next demo on a Linux machine so what we are doing in a Linux machine could also be doable on the Windows machine with a different exploit so what I’m going to do is this is the Linux web server that I have that I’m going to power on i’m going to use a Kali Linux machine to hack that device and I’m going to just power off my Windows 7 machine give it a minute till it boots up now this is also a demo machine that we have which has its own preconfigured vulnerabilities so here we’ve got something from the pentesters lab uh and has a shell shock vulnerability implemented inside shell shock vulnerability uh affects Linux Mac and Unix based operating systems for a particular version of the bash shell bash is the bone again shell which is the command line interface in these operating systems so what we are trying to do here is we are going to use the Kali Linux machine try to find out the vulnerability over here and if it exists we are going to use metasloit to attack this machine now the first and foremost thing is we want to identify the IP address we have no idea what the IP address is we are in the same subnet so we are assuming that we’re able to connect to this machine so what I’m going to do is I’m going to open up a tool called Zen Map i’m going to open up a command line interface find out what my IP address is and my IP address is this with a subnet mask of 255255255.0 so I want to see if there are any other machines that are live in the same subnet and we are doing a ping sweep over here to identify which machines are live in a minute we’ll get all the IP addresses 71.1 2 133 254 and 128 we know that we are 128 at this point in time uh 254 is the DHCP server so we assuming that 133 is the machine that we want to look at and let’s then try to see if we can scan that machine 133 and we’re going to do an intent scan to find out which ports are open what services are running over there and if it is whether the pentest machine that we were looking for you can see of the start port 22 and port 80 and somewhere here it’s going to give us the ports that are open and the details about those ports and somewhere here it will tell us that this is the pentester lab machine that we wanted which is correct so now we want to do a vulnerability analysis on this what we are going to do is I’m going to use another GUI based tool called Sparta which I can just find out from here sparta uses two tools in the background end mapap tool and a tool called nikto so we’re just going to start scanning 1926 16871.133 was the IP address add to scope and over a period of time you can see all of these will start populating with information there we are that’s the Nikto tool coming in scanning on port 80 which is uh which means that it’s a web server using HTTP it tells us it’s an Apache HTT HTTPD2.2.21 and gives us the 22 port number as well if we head over to the tab of Nikto or let’s look at the screenshot first this is what the website would be looking like and Nikto gives us the options over here it tells us that there is a vulnerability over here for shell shock and this is the path where the vulnerability is going to exist so what we going to do we go back to the command line sorry we open up a new one minimize all these other windows and we’re going to open up Metasloit metasloit is a penetration testing tool that is used by most hackers and ethical hackers to test applications and test uh existing exploits and vulnerabilities so just give it a minute till it starts you can see there are already around 1,700 exploits right here uh we’re going to see all those exploits with these commands there we are sorry for the typo and it will just give us a list of all the exploits that are stored in metasloit in this version so all of these are Windows based if we scroll up we will be looking at other vulnerabilities as well or exploits the unique specs exploits Linax OSX multi exploits and we’re looking for a exploit for um multi-based Apache or HTTP let’s go up uh let’s look at So this is the one that we’re looking for apache mod CGI bash environmental executable so what we’re going to do is we’re just going to copy it go back to the bottom say use exploit and paste the one that we wanted press enter say show options so it’ll ask us to configure this i’m just going to configure it based on the knowledge that we have set our host which is the remote host the victim’s machine so we put in the IP address it asks us for the target URI so that’s the path that we saw set target URI to CGI- bin / status enter now with the exploit we need to find a payload that is going to give us the output that we want so we say show payloads and it will give us a list of all the compatible payloads with this exploit and we want to create a reverse TCP connection which is this so we know it’s a Linux operating system we want this uh payload to be set so set payload press enter that’s the payload coming in show options now that we have set the payload this is the options for the exploit and now we want to set our options for the payloads as well so we are creating a reverse TCP connection which means we are remotely executing code at the victim side and making the victim connect back to our machine which means we need to set up a listener so I need to put my IP address over here set local host or LHOST 192 16871 128 which was our IP address show options again just to ensure everything is fine which looks like it is and we then type in the word exploit so that it will start this attack i can see that it has created a meta session at the victim site and it has opened up a session so if I do a pwd now pwd is a Linux command for present working directory and it will show us that we’ll connect it to where dubdubdub cgi- bin do an ls it will list all the files that’s the status file over there do a cd backslash it will take us to the root of this machine and if you’re someone who is interested in building a career in cyber security that is by graduating from the best universities or a professional who sits to switch careers with cyber security by learning from the experts then try giving a short to simply learns post-graduate programming cyber security with modules from the MIT Schwarzman College of Engineering and the course link is mentioned in the description box that will navigate you to the course page where you can find a complete overview of the program being offered jude is waiting at the airport to hop on her flight back home when she realizes that she missed making an important bank payment she connects her laptop to the public Wi-Fi at the airport and goes ahead to carry out the bank transaction everything goes well and Jude completes her transaction after a couple of days she was wiped off her feet when she learned that her bank account was subjected to a cyber attack and a hefty amount was wiped from her account after getting in touch with the bank authority she learned that her account was hacked at the airport she then realized that the public Wi-Fi she used might have caused her this trouble jude wishes that had her bank transfer escaped the hacker’s eyes she would not have been a victim of a cyber attack bank officials advise her to use a VPN for future transactions especially when connecting to an open or public network like most of us Jude had come across the term VPN several times but didn’t know much about it and little did she think that the repercussions of not using a VPN would be this bad let’s understand how the hacker would have exploited Jude’s transaction in the absence of a VPN in this process Jude’s computer first connects to the internet service provider ISP which provides access to the internet she sends her details to the bank’s server using her IP address internet protocol address or IP address is a unique address that recognizes a particular device be it a laptop or smartphone on the internet when these details pass through the public network the hacker who passively watches the network traffic intercepts it this is a passive cyber attack where the hacker collects Jude’s bank details without being

    detected more often or not in such an attack payment information is likely to be stolen the targeted data here are the victim’s username passwords and other personal information such an unsecured connection exposed Jude’s IP address and bank details to the hacker when it passed through the public network so would Jude have been able to secure her transaction with the help of a VPN well yes picture Jude’s bank transaction to be happening in a tunnel that is invisible to the hacker in such a case the hacker will not be able to spot her transaction and that is precisely what a VPN does a virtual private network more often known as VPN creates a secure tunnel between your device and the internet for using a VPN Jude’s first step would be to install softwarebased technology known as the VPN client on her laptop or smartphone that would let her establish a secure connection the VPN client connects to the Wi-Fi and then to the ISP here the VPN client encrypts Jude’s information using VPN protocols data is encrypted to make sure it is secure next the VPN client establishes a VPN tunnel within the public network that connects to the VPN server the VPN tunnel protects Jude’s information from being intercepted by the hacker jude’s IP address and actual location are changed at the VPN server to enable a private and secure connection finally the VPN server connects to Jude’s bank server in the last step where the encrypted message is decrypted this way Jude’s original IP address is hidden by the VPN and the VPN tunnel protects her data from being hacked this explains how VPN makes your data anonymous and secure when it passes through the public network and the difference between a normal connection and a VPN connection after learning about this Jude was certain that she should start using a VPN to carry out her online transactions in the future this is also applicable to each one of us even if you work remotely or connect to public Wi-Fi using a VPN is the safest option in addition to providing a secure encrypted data transfer VPNs are also used to disguise your whereabouts and give you access to regional web content vpn servers act as proxies on the internet this way your actual location cannot be established vpn enables you to spoof your location and switch to a server to another country and thereby change your location for example by doing so you can watch any content on Netflix that might be unavailable for your region meet Jonathan he is an investigative journalist who occasionally researches and publishes news articles contrary to the government’s ideologies on one such occasion he could not access a global news website dealing with uncensored information it seemed his IP was blocked from visiting the news website with his IP blocked Jonathan turned to a popular proxy service that was able to unblock the news website thereby allowing an open internet to all users just like how your friend gives a proxy attendance for you a proxy server serves as a stand-in user to keep the real client private but what is a proxy let’s understand its working by taking a look at how Jonathan was able to access geoblock content without much hassle a proxy server acts as a gateway or intermediary server between a user and its destination website when Jonathan wasn’t able to access the news website he connected his system to a global proxy server once connected the proxy server assigns a new IP address to Jonathan’s system an IP address of a different country where the website is not censored following this process whenever Jonathan visits that website the website administrators see the new IP address assigned via proxy server and sees no reason to deny access to their account once the proxy server is able to access the website it’s passed on to Jonathan’s system via the same channel regarding accessibility to proxy servers you must first set it up on your computer device or network next check the steps required for your computer or network as each operating system has its setup procedures in most cases however setup entails using an automated configuration script there are plenty of free proxy services available on the internet however the safety of such proxies is rarely verified most free proxies will provide an IP address and a relevant port for connection purposes reputed proxy providers like Smart Proxy and Bright Data that run on subscription models will most likely provide credentials to log into when establishing the connection this extra step acts as authentication that verifies an existing subscription on the proxy provider server unlike free providers that are open to all when it comes to hiding IP addresses many people consider a VPN to be the primary solution while that’s true up to some extent there are a few things proxies do differently in the case of VPNs extra encryption is also carried out to create a secure tunnel between the user’s device and a VPN server a VPN is usually much faster more secure thanks to multiple layers of encryption and has little to no downtime proxies tend to be comparatively unsafe with the service owners having the exact IP address of the end user and having no guarantees regarding downtimes and reliability if you want to know more about how VPNs work do watch how Jude could have protected her banking credentials using VPNs in our detailed video linked above now let’s take a small quiz to check how much we have learned what can a VPN connection provide that a proxy service cannot a new IP address b multiple layers of encryption c access to Geobblock content d authentication credentials think about it and leave your answers below in the comments section and three lucky winners will receive Amazon gift vouchers what about the benefits of a proxy service though besides allowing access to blocked content proxies can serve as an efficient firewall system they can also filter content from third party websites allowing control over internet usage in many cases browsing speeds are stabilized compared to vanilla internet thanks to proper optimization of the base proxy server the element of privacy proxies provides is highly lucrative to people looking to hide their actual IP address from as many prying eyes as possible one can easily argue the benefits of using VPNs over proxies for added security measures however a few basic tasks don’t warrant maximum privacy for the user’s side as in other cases for example many consumers worldwide find proxy services more convenient since all major operating systems starting from Windows to Android allow proxy configuration without the hassle of installing new applications as is in the case of a VPN in addition there are services online that function as web proxies allowing users to access block content without any setup from their end they can enter the target URL and the web proxy will route data from its physical server this level of freedom is hard to come by in the case of VPNs making proxies an ideal solution for casual browsing with the next generation of internet exchanges focused on maximum privacy and security a variety of ways have been enforced to maintain them as such censorship has been shifted from the streets to the digital domain it forces the standard citizen to derive alternative ways to maintain anonymity a major weapon in this battle for privacy and security is the to browser an independent browser meant to browse the internet while relaying information through the to network it serves as a meaningful alternative to the standard internet browsing habits to better understand the purpose of this browser and such you must learn about the work of the to network featuring its own routing protocol the TO browser is an easy way to maintain anonymity while browsing without emptying one’s wallet let’s take a look at the topics to be covered today we start at the explanation of what is the to network and its significance in the working of the to browser we take a look at the onion routing protocol and how it transmits the data from the client devices to the to directories in order to circumvent government censorship moving on we learn a few features of the to browser and the distinct advantages the to network provides next we learn the difference between using a VPN and a tour to anonymize internet usage and finally we have a live demonstration of the to browser anonymization features in action let’s move on to learning about the to network to short for the onion router it’s an open-source privacy network that permits users to browse the web anonymously the to was initially developed and solely used by the US Navy to protect sensitive government communications before the network was made publicly available the digital era has disrupted the traditional way of doing things in every sector of the economy the rapid rise in development and innovation of digital products has given way to frequent data breaches and cyber thefts in response consumers are increasingly opting for products that offer data privacy and cyber security to is one such underground network that was implemented for the purpose of protecting users identities the to network is one example of the many emerging technologies that attempt to fill a data privacy void in a digital space plagued by cyber security concerns the to network intercepts the traffic from your browser and bounces a user’s request of a random number of other user IP addresses then the data is passed to the user requested final destination these random users are volunteer devices which are called as nodes or relays the to network disguises your identity by encrypting the traffic and moving it across different to relays within the network the to network uses an onion routing technique for transmitting data hence the original name of onion router to operate within the to network a user has to install the to browser any address or information requested using the browser is transmitted through the to network it has its own feature set which we will be going over later in this video as we discussed already the data passing through the to network must follow a unique protocol known as the onion routing protocol let us learn more about its unique characteristics in our normal network usage the data is transmitted directly the sender has data packets to transmit which is done directly over a line of communication with either a receiving party or a server of some kind however since the data can easily be captured while being transmitted the security of this exchange is not very reliable moreover it becomes very easy to trace the origin of such requests on many occasions websites with questionable and controversial content are blocked from the ISP this is possible since the ISP is able to detect and spy on user information passing through the network apart from ISPs there is a steady chance of your private information being intercepted by hackers unfortunately easy detection of the source and contents of a web request make entire network extremely vulnerable for people who seek anonymity over the internet however in the onion routing protocol things take a longer route we have a sender with the top browser installed on the client system the network sends the information to node 1’s IP address which encrypts the information and passes it on to node 2’s address which performs another encryption and passes it on to node 3 address this is the last address which is also known as the exit node this last node decrypts the encrypted data and finally relays the request to the final destination which can be another device or a server end this final address thinks the request came from the exit node and grants access to it the encryption process across multiple computers repeats itself from the exit node to the original user the to network obiscates user IP addresses from unwanted surveillance by keeping the user’s request untraceable with multiple servers touching the data it makes the tracking very difficult for both ISPs and malicious attackers now that we understand the way to works let us learn more about the to browser the to browser was developed by a nonprofit organization as a part of the to project in 2008 and its first public release was announced the to browser is a browser fork from the popular Firefox that anonymizes your web traffic using the to network if you’re investigating a competitor researching an opposing litigant in a legal dispute or just think it’s creepy for your ISP or the government to know what websites you visit the top browser might be the right solution before the top browser were developed using that network to maintain anonymity was a huge task for everyday consumers starting from the setup to the usage the entire process demanded a lot of knowledge and practice the to browser managed to make it easy for users to traverse the relay servers in to guarantee the privacy of the data exchange a major feature of the to browser is the ability to delete all browser history cookies and tracking data the moment it is closed every new launch of the browser opens an empty slate having your usage habits from being tracked and singled out a major feature that is the highlight of the to network is the availability of onion links only a small portion of the worldwide web is available to the general public we have the deep web that contains links that are not allowed to be indexed by standard search engines like Google and Bing the dark web is a further subset of the deep web which contains onion links to browser gives you access to these onion websites which are only available within the to network onion is a special use tople domain which designates an anonymous onion service which is also known as a hidden service similar to the links of the deep web these onion links provide services like online shopping cryptocurrency and many other products not available in the consumer internet space often being considered as a haven for illegal activities and sales on your links provide both information and assets in a private manner without the risk of spying by authorities browsing the web over to is slower than the clear net due to the multiple layers of encryption some web services also block to users tor browser is also illegal in authoritarian regimes that want to prevent citizens from reading publishing and communicating anonymously journalists and dissidents around the world have embraced store as a cornerstone of democracy and researchers are hard at work at improving towards anonymity properties let us take a look at some of the advantages of using the to browser over standard web browsers the highlight of using the to browser is to maintain anonymity over the internet the cause for such requests can differ from person to person but all of these concern are answered by the to network douting the information via multiple nodes and relay servers make it entirely difficult for the ISP to keep a track of usage data the entire to project is designed to be completely free and open source allowing the code for the browser to be inspected and audited by third parties helps in the early detection of faulty configurations and critical bugs it is present for multiple operating system starting from laptops to mobile devices a number of websites are blocked by governments for a variety of reasons journalists under authoritarian regimes have difficulty in getting the word out regarding the situation since the onion routing protocol transfers data between multiple servers of random countries the domains being blocked become available when used via to usage of these encryption messaging platforms is easily enforced using the to browser which otherwise would have been a difficult task under oppressive circumstances many people believe that a VPN offers the same benefits as the top browser let’s put both of them to the test and see the differences between them coming to the first point of difference to is completely free and open-source all of the code for the browser and the network can be audited and has been cleared for security concerns when it comes to VPN there are many different brands which have open- source clients but the same cannot be said for their counterparts some have partly open source while some have completely locked up their code so that they cannot be stolen further moving on to has multiple relay points in its data transfer protocol between the server and the receiver there are three different IP nodes that number can increase but it’ll always be more than two once the data is passed from the sender it goes through all of those relay points while in the case of a VPN the connection is made from the client device to the VPN server and then to the requested destination there is no other IP node that comes into work here thereby making the connection a onetoone between the client and a VPN as a next point since store handles multiple layers of encryption and the data passes through multiple systems along the way the performance is slow compared to a VPN where the performance is relatively fast due to the less number of nodes the data passes through similarly the multi-layer encryption of to is consistent if you use to browser every single request passes through the same layer of encryption and follows the same routing protocol in the case of a VPN different companies offer different levels of encryption some have multihop some prefer a single onetoone connection and these kind of differences make the choice much more variable finally the nodes and relays being used in the to network are volunteer there is no company holding over them so jurisdiction becomes relatively straightforward whereas in the case of VPNs many such VPNs are hosted by adware companies or are being monitored by central governments to note the usage information now that we have a better understanding of the to browser and its routing let us take a look at how the to browser can anonymize and protect our internet usage on opening up the to browser for the first time this is the page that you’re going to be welcomed with you have the option of connecting to the to network before we start our browsing so let’s press connect and we can see that it is connected coming to the anonymization let’s check my current location on Google Chrome currently is showing as Na’vi Mumbai in Maharashtra if we check the same link on the to browser we should get a different address now every link that we open in the to browser will be little delayed and the speed will be hampered because of the multiple layers of encryption like we discussed now as you can see it’s showing a German IP and the state of Bavaria this is how the anonymization works there is no VPN configured there is no proxy attached it’s straight up the out of the box settings that come inbuilt with the tour browser similarly we have an option of cleaning up the data let’s say if you want to refresh your location and you want to use a different ID for the next browsing session if you just restart it once and you can have to check it again we should be seeing a different country this time as you can see we have Netherlands right now so this is how you can keep refreshing your address you can keep refreshing your host location so that you cannot be tracked when in browsing the internet like we discussed we have some onion links that can only be used on the to network as you can see these kind of links do not open in the Google Chrome browser but once we copy these over to the tour browser as you can see we have opened the hidden wiki which is available only on the tour network this is kind of an alternative Wikipedia website where we can find articles to read and more information to learn similarly we have another onion link over here which is once again available only for the tour browser now these kind of delays are expected but they are a valid compromise because they maintain the anonymity that many people desire similarly we have found a hidden wallet which is a cryptocurrency wallet which is specifically for dark web members this operates over the tour network and this is used by mostly journalists and people who want to anonymize their internet transactions when it comes to dealing money all of the transactions that occur over the to network are almost impossible to track therefore these kind of cryptocurrency wallets are very big on the deep web this is just one example while having multiple different wallets for every single cryptocurrency available imagine our houses without a fence or boundary wall this would make our property easy accessible to trespassers and robbers and place our homes at great risk right hence fencing our property helps safeguard it and keeps trespassers at bay similarly imagine our computers and networks without protection this would increase the probability of hackers infiltrating our networks to overcome this challenge just like how boundary walls protect our houses a virtual wall helps safeguard and secure our devices from intruders and such a wall is known as a firewall firewalls are security devices that filter the incoming and outgoing traffic within a private network for example if you were to visit your friend who lives in a gated community you would first take permission from the security guard the security guard would check with your friend if you should be allowed entry or not if all is well your access is granted on the other hand the security guard would not grant permission to a trespasser looking to enter the same premises here the entry access depends solely on your friend the resident’s discretion the role of the security guard in this case is similar to that of a firewall the firewall works like a gatekeeper at your computer’s entry point which only welcomes incoming traffic that it has been configured to accept firewalls filter the network traffic within your network and analyzes which traffic should be allowed or restricted based on a set of rules in order to spot and prevent cyber attacks your computer communicates with the internet in the form of network packets that hold details like the source address destination address and information these network packets enter your computer through ports the firewall works on a set of rules based on the details of these network packets like their source address a destination address content and port numbers only trusted traffic sources or IP addresses are allowed to enter your network when you connect your computer to the internet there is a high chance of hackers infiltrating your network this is when a firewall comes to your rescue by acting as a barrier between your computer and the internet the firewall rejects the malicious data packet and thus protects your network from hackers on the other hand traffic from trusted websites is allowed access to your network this way the firewall carries out quick assessments to detect malware and other suspicious activities thereby protecting your network from being susceptible to a cyber attack firewalls can either be hardware or software software firewalls are programs installed on each computer this is also called a host firewall meanwhile hardware firewalls are equipments that are established between the gateway and your network links routers are a good example of a hardware firewall besides this there are other types of firewalls designed based on their traffic filtering methods structure and functionality the firewall that compares each outgoing and incoming network packet to a set of established rules such as the allowed IP addresses IP protocols port number and other aspects of the packet is known as a packet filtering firewall if the incoming network traffic is not perfed rules that traffic is blocked a variant of the packet filtering firewall is the stateful inspection firewall these types of firewalls not only examine each network packet but also checks whether or not that network packet is part of an established network connection such firewalls are also referred to as dynamic packet filtering firewalls our next type of firewall is called a proxy firewall this draws close comparison to how you give proxy attendance for a friend like how you take the authority to represent your friend the proxy firewall pretends to be you and interacts with the internet they come between you and the internet and thereby prevents direct connections this protects your devices identity and keeps the network safe from potential attacks only if the incoming data packet contents are protected the proxy firewall transfers it to you they’re also known as application level gateway the firewall can spot malicious actions and block your computer from receiving data packets from harmful sources in addition to preventing cyber attacks firewalls are also used in educational institutions and offices to restrict users access to certain websites or applications it is used to avoid access to unauthorized content it’s the year 2015 and Richard has just finished playing games on his computer after a long gaming session Richard tries to shut it down but find some random text file on the desktop that says ransom note the text file mentioned how a hacking group had encrypted Richard’s game files and private documents and he had to pay a ransom of $500 worth of Bitcoin in a specified Bitcoin address richard quickly checked his files only to see them being encrypted and unreadable this is the story of how the Tesla Crypt ransomware spread in 2015 which affected thousands of gamers before releasing the master key used for encrypting the files so what is ransomware for Richard to be targeted by such an attack he must have installed applications from untrusted sources or clicked an unverified link both of them can function as gateways for a ransomware breach ransomware is a type of malware that encrypts personal information and documents while demanding a ransom amount to decrypt them this ransom payment is mainly done using cryptocurrency to ensure anonymity but can also employ other routes once the files are encrypted or locked behind a password a text file is available to the victim explaining how to make the ransom payment and unlock the files for it just like Richard found the ransom note text file on his desktop even after the money has been paid there’s no guarantee that the hackers will send the decryption key or unlock the files but in certain sensitive situations victims make the payment hoping for the best having never been introduced to ransomware attacks before this gave Richard an opportunity to learn more about this and he began his research on the topic the spread of ransomware mostly starts with fishing attacks to know more about fishing attacks click the link in the button above users tend to click on unknown links received via emails and chat applications promising rewards of some nature once clicked the ransomware files installed on the system that encrypts all the files or blocks access to computer functions they can also be spread via malware transmitted via untrusted application installation or even a compromised wireless network another way to breach a system with ransomware is by using the remote desktop protocol or RDP access a computer can be accessed remotely using this protocol allowing a hacker to install malicious software on the system with the owner unaware of these developments coming to the different types of ransomware first we have locker ransomware which is a type of malware that blocks standard computer functions from being accessed until the payment to the hackers is complete it shows a lock screen that doesn’t allow the victim to use the computer for even basic purposes another type is crypto ransomware which encrypts the local files and documents in the computers once the files are encrypted finding the decryption key is impossible unless the ransomware variant is old and the keys are already available on the internet scareware is fake software that claims to have detected a virus or other issue on your computer and directs you to pay to resolve the problem some types of scareware lock the computer while others simply flood the screen with pop-up alerts without actually damaging files to prevent getting affected by ransomware Richard could have followed a few steps to further enhance his security one must always have backups of their data cloud storage for backup is easy but a physical backup in a hard drive is always recommended keeping the system updated with the latest security patches is always a good idea apart from system updates one must always have reputed antivirus software installed many antivirus software like Kasperski and Bit Defender have anti-ransomware features that periodically check for encryption of private documents when browsing the internet a user must always check for the lock symbol on the address bar which signifies the presence of HTTPS protocol for additional security if a system is infected with ransomware already there is a website no more ransom.org it has a collection of decryption tools for most well-known ransomware packages it can also help decrypt specific encrypted files if the list of anti-ransomware tools didn’t help the victim malware is a malicious software that is programmed to cause damage to a computer system network and hardware devices many malicious programs like Trojan viruses bombs and bots which cause damage to the system are known as malware most of the malware programs are designed to steal information from the targeted user or to steal money from the target by stealing sensitive data let’s take a look at the introduction for two different types of malware virus and Trojan firstly let’s take a look what exactly is a virus program a computer virus is a type of malicious program that on execution replicates itself they get attached to different files and programs which are termed as host programs by inserting their code if the attachment succeeds the targeted program is termed as infected with a computer virus now let’s take a look at the Trojan horse trojan horse program is a program that disguises itself as a legitimate program but harms the system on installation they hide within the attachments and emails then transfer from one system to another they create back doors into our system to allow the cyber criminal to steal our information let’s take a look how they function after getting installed into our system firstly we have virus programs the computer virus must contain two parts to infect the system first is a search routine which locates new files and data that is to be infected by the virus program and the second part is known as the copy routine which is necessary for the program to copy itself into the targeted file which is located by the search routine now let’s take a look at the Trojan horse functioning for Trojan horses entryway into our system is through emails that may look legitimate but may have unknown attachments and when such files are downloaded into the device the Troj program gets installed and infects the system they also infect the system on the execution of infected application or the executable file and attacks the system now that we understand what virus androgensions are let’s understand different types of virus androgens let’s take a look at different types of viruses the first one is known as the boot sector virus this type of virus damages the booting section of the system by infecting the masterboard record which is also known as MBR this damages the boot sector section by targeting the hard disk of the system then we have the macro virus macrovirus is a type of virus that gets embedded into the document related data and is executed when the file is open they also are designed to replicate themselves and infect the system on a larger scale and lastly we have the direct action virus this type of virus gets attached to executable files which on execution activates the virus program and infects the system once the infection of the file is completed they exit the system which is also the reason it is known as a non-resident virus let’s take a look at different types of Trojans the first type of Trojan is the backd dooror Trojan they are designed to create a backdoor in the system on execution of an infected program they provide remote access of a system to the hacker this way the cyber criminal can steal our system data and may use it for illegal activities next we have Cricost Trojan they enter the system by clicking the random pop-ups which we come across on the internet they attempt the user to give their personal details for different transactions or schemes which may provide remote access of a system to the cyber criminal and the last Trojan type is ransom tro this type of Trojan program after entering the system blocks the user from accessing its own system and also affects the system function the cyber criminal demands a ransom from the targeted user for the removal of the Trojan program from the device now that we understand some details regarding viruses and Trojan let’s solve a question the question is Jake was denied access to his system and he wasn’t able to control the data and information in his system now the actual question is what could be the reason behind his systems problem option A macro virus option B ransom Trojan option C back door Trojan give your answers in the comment section now let’s understand how to detect the activity of viruses and Trojan in our system to detect virus or Trojan activity in a system we can refer to the following points for viruses we have slowing down of the system and frequent application freeze shows that the infection of the virus is present in the system then we have the viruses can also steal sensitive data including passwords account details which may lead to unexpected log out from the accounts or corruption of the sensitive data and lastly we have frequent system crashes due to virus infection which damages the operating system for Trojan we have frequent system crashes and system also faces slow reaction time then we have there are more random pop-ups from the system which may indicate Trojan activity and lastly we have modification in the system application and change of the desktop appearance can be also due to the infection of a Trojan program next let’s take a look at a famous cyber attack for virus and a Trojan horse for virus we have the MYOM virus which was identified in the ER 2004 which affected over 50 million systems by creating a network of sending spam emails which was to gain back door access into our systems next for the Trojan horse we have the emote Trojan program which is specifically designed for financial theft and for stealing bank related information next we have few points for how to prevent virus entry or Trojan attack for a system the most basic way of virus protection is to using antivirus and do regular virus scan this will prevent virus entry in the system and also having more than one antivirus provides much better protection then avoid visiting uncertified websites can also prevent virus entry into our system then we have using regular driver updates and system updates to prevent virus entry for Trojan we have using certified softwares from legal sites to prevent any Trojan activity in our system and also avoid clicking random pop-ups that we often see on the internet and lastly using antivirus and firewalls for protection against Trojan horses is a good habit now that we have reached the end of the video let’s take a look what we learned for the first part we saw the main objective of the virus is to harm the data and information in a system whereas for the Trojan we have stealing of the data files and information effect of viruses is more drastic in comparison to the Trojan horses then we have viruses which are non- remote programs whereas Trojan horses are remote accessed and lastly viruses have the ability to replicate itself to harm multiple files whereas Trojan does not have the replication ability so let’s begin with what is SQL injection as the name suggest SQL injection vulnerability allows an attacker to inject malicious input into a SQL statement so SQL stands for structured query language which is a language used by an application to interact with a database now normally this attack is targeted towards a database to extract uh the data that is stored within however the vulnerability does not lie in the database itself the vulnerability will always lie in the application it is the developer’s prerogative of how to develop the application how to configure it to prevent SQL injection queries from happening a database is created to answer questions and if a question is asked it is supposed to answer it database needs to be configured for some amount of security but the vulnerability the flaw here for SQL injection will always lie in the application itself it is how the application interacts with the database that needs to be modified that needs to be maintained by the developer rather than just configuring the database itself so the attacker at this point in time when they send a query to the application will form a malformed query by injecting a particular command or an operator that is recognized by the SQL language and if that operator is passed through the application to the database then the database basically gets cracked or does a data dump because of that unwanted character coming in so this character needs to be filtered at the application level itself now let’s look at a quick demo so what we have done here is I have this virtual machine called OASP broken web applications virtual machine version 1.2 i’m going to power this on till this powers on I’m going to show you where we can download this uh utility from so you can just look for OASP broken web application project download you’ll find it on sourceforge.net click on the link you can download the broken web application project from here this is a 1.9 GB download and you can have a zip machine directly for VMware or Oracle virtual box now this is an application that has been developed by OASP which stands for open web application security project which is a not for-profit organization and uh periodically uh releases the most top 10 risks that an application uh will face for that particular year so they have given a web application uh with inbuilt vulnerabilities for professionals like us to practice upon to develop our skills upon because doing this in the real world is illegal i cannot go onto a website to demonstrate how a SQL injection attack works uh neither should you try your hands on it till you become very well rehearsed with it so till uh to upgrade your skills to upskill yourself please download this machine host it in a VMware workstation or Oracle virtual box and you can u then try your skills on it right so uh just going back to the browser here if I open up uh a new tab you’ll see that this machine has booted up and has an IP address called 71.132 so if I just go onto that IP address and I type in 1926 16871.132 and you’ll see the OASP broken web application project and there are a lot of training applications realistic intentionally vulnerable applications old versions of real applications and so on so forth so there is a lot of applications inbuilt over here that you can try your skills upon you are going to try to use the OAS utility over here uh this gives you the uh OAS top 10 risks for 2010 2013 2017 is the latest one so far uh but the difference between 2013 and 2017 is that some of these have changed but not all of them uh the order has changed a little bit but you can see that SQL injection is on the top A1 amongst the injection attacks right and you can see there are multiple types that have been given here the SQL injection for extracting data or SQL injection for bypass authentication or insert your injection uh uh attacks blind SQL injection and then there is a tool called SQL map which is available freely on your Linux machines Kali Linux or Parrot Linux whichever you want to use uh for your practice targets and so on so forth so if I just take you here for bypass authentication and this is a regular login page that an application may have right you look at a username you look at password you type that in and you log in so let’s say I don’t know a password here I’m just going to type in a username test password is ps I try to log in and it shows me that the account does not exist so the authentication mechanism does work I did try type in a username and password it wasn’t recognized with account does not exist now let’s try to type in a SQL query here i’m going to just give it a single quote which is an operator that is recognized by the SQL language which when uh the database tries to execute uh will cause the database to uh dump some data or to bypass authentication in this case and I’m going to give it a condition single quote or 1= 1 space hyphen space and I’m going to click on login now right now I’m not logged in at all and we tried our username and password and we weren’t able to login so now if I log in you will see that it gave me a status update saying the user has been authenticated and I’m logged in as admin got root so that is what these SQL queries can achieve i’m going to log out right now and uh we’re going to look at the basics of SQL injection so looking at that small demo looking now let’s look at what types of SQL injections are available so the first is inband SQL injection the there are two subtypes within inband error based injection attack and a union based injection attack the second type is blind SQL injection attack where there’s a boolean based and a time based attack and the third one is out ofbound SQL injection attack now what is inband SQL injection attack inband is where we either attempting the error based or the union based what is error based uh we send a query to the database we craft a query to the database and uh it generates an error me message and it dumps the error message right in front of us on the screen that uh makes us realize that there is a flaw and there there is some information that is dumped on the screen which we can then further utilize to craft our further queries as we go ahead whereas union based is the it is where we combine multiple statements at the same time so if you look at the URL earlier in the URL you would see a large structure in that URL uh we can try to add more two or more statements within the URL itself to combine them and then confuse the database into executing both the statements together and giving a data dump at the same time right so what would a error based uh SQL injection look like if I go back to the same database uh which is here right and if you remember the username we gave it a single quote or 1= 1 space – space we gave it the condition right so basically what it did was a single quote is an operator that goes to the database selects the default uh table in the user tables in this database column and then compares it to the condition that is given so the condition that we gave was 1 equals 1 which is always true so what it did was it selected the default uh user table that was available in the database and instead of comparing it to a password it compared it to the condition so if I give it 1 equals 2 where the condition is false and if I log in you will see that the account doesn’t exist comes back again because the condition was false and instead of comparing the user account to the password it basically uh compared the user account to the condition so if I give it a single quote or 1= 1 – space uh and login you can see that this is a correct condition and thus we are able to log in now before we even go uh to that extent if I just forget the condition over here and I just give it a single code the operator and I send this operator to the database and I click on login you will see that it generates an error which is right on top and it tells us the line the uh file where the error happened and you can see it happened in the MySQL handler.php PHP file right and then it gave us the message you have an error in your SQL syntax check the manual that corresponds to your MySQL server version for the right syntax to use now why would a hacker want to do this in the first place because there are different types of databases so there is a MySQL MSQL or Microsoft SQL Oracle SQL IBM DB2 all of these are variations of the SQL database uh they use the SQL language however every database has its own command right they they have their own syntax they have their own uh specific commands that are utilized for the database so in this scenario the hacker wants to identify what database is being currently utilized so they can craft those particular queries so now with this injection with just me sending the quote and the error getting generated I now come to know that we are using a MySQL server and the version of that server is 5.1.73 and uh the rest of the information about uh where the handlers are located and so on so forth right this gives the information to the hacker of how they want to proceed next what kind of queries they want to create what kind of syntax they want to utilize so error based attack is where you generate these kind of errors uh and you get this information the union based is where you craft your queries within the URL or you can try to combine multiple statements within the input fields and try to generate a response from that then we come to boolean based SQL injection uh sends a SQL query to the database which forces the application to return a different result depending on whether the query returns a true or a false result so basically if the input is false the input both the inputs are false the output would be false uh there’s one input that is false the other input that is true input B the output would be true and so on so forth right so depending on the result from the inputs the attacker will come to know which input is true with this he can then access the database of the website so you’re trying to figure out by sending out multiple inputs uh and then analyzing the output to see what exactly uh which command exactly worked what was the resultant output of that command thus from this kind of an information the hacker can infer their next step forward then you have timebased SQL injections uh now there are times when a database administrator or an application administrator has done some security configuration and thus have disabled verbose error messages now what is a verbose error message the error message that we saw right here is a verbose error message that means that the message gives out details the message gives out details about what the database is the version and whatnot so if they have sanitized these errors and you no longer can generate these errors and thus you cannot figure out what database is then what do you do right for example if I just take you to simply learn and take you to a URL that is supposedly not accessible you can see that it gives a generic error oops like it looks like you have crash landed on Mars it doesn’t give you a verbose error that we saw here so this gives us a detail error of what went wrong where it gives us the database the version of the database and uh where the query went wrong and etc etc etc whereas on this side where there’s some there’s a lot of security that goes in here so you can see that it doesn’t generate a error you just get a generic page in front of you so in that case what does a hacker do so the hacker then injects a time based uh query in the URL which allows us to verify whether the command is being executed or not so uh we put in a time weight let’s say 10 seconds of time wait so if we the moment we inject the query if the query times for 10 seconds and then gets executed that means that the SQL injection is possible however if we inject the query and uh it just gets executed without the delay that means that the time uh injection attack would not be uh possible on that particular site out of bound is not a very common attack it depends on the features being enabled on the database management system that is being used by the web application so this can be a somewhat of a misconfiguration error uh by the database administrator where you have enabled functions and not sanitized them so you have not done in uh access controls properly you have not given account control so queries should never be executed at an administrative level they should always be uh executed at a user level with minimum privileges that are required for that query to be executed now if you’re allowing these kind of functions to be uh to be enabled at the DBMS and there is an administrative account that can have access to them at that point in time an out ofbound injection attack is possible so let’s look at how a website works right uh how SQL works on a website now the website is constructed of HTML hypertext markup language uh which would include JavaScripting for functionality cascading stylesheets for the mapping of the website right and then ReactJS and whatnot uh for further functionality now when we send a query to the website it is normally using the HTTP protocol or HTTPS protocol when the query reaches the application the application would then go ahead and generate the SQL query uh at the client side you’ll have uh all these scripting languages coming in uh on the front end uh that we can utilize to craft queries and then send them across at the server side you’ll have uh databases like Oracle MySQL MSQL and so on so forth that will then execute those queries right so just to give you an example if I use a tool called Postman what we generally do uh when we craft a query is we send out a uh get request to the website and then we receive a response from the site uh with the HTML code and everything so this is a tool that is utilized by software testers to test the responses that you’re going to get from various websites so on the left hand side you can see I’ve used it on quite a bit uh here we have a example for gmail.com so let’s continue with that so this is a get request being sent to gmail the moment I send it it’s going to create an HTTP request and send it across the response that I get is this this is the HTML code for gmail.com right these are the cookies uh these are the headers uh that include information so you can see this is a text HTML character set utilized is UTF8 and the configuration uh that has been done with the application right so this is where uh everything comes in this is the cookie that has been sent with that particular uh request that I had sent out now if you analyze this query right so when we went onto this application and I typed in that single quote and we generated this error right uh you can see that the application converted this into a SQL query so the query was select username from accounts where the username in quotes single quotes and we use the quote right the single quote right there so uh that’s where we use that operator and that’s where the exception error occurred so these are the kind of queries that are structured by the application and then taken on to the database for execution when we type in uh it is a HTTP get request with the username and password within that query uh that is sent to the application the application converts it into a SQL query sends it to the database and the database responds with the appropriate response so how do we prevent SQL injection in the first place use prepared statements and parameterized queries uh these statements make sure that the parameters passed into SQL statements are treated in a safe manner so for example we saw that the single quote was an operator this shouldn’t be allowed to be utilized in the first place right so here what we are doing here is a secure way of running a SQL query in the JDBC using a parameterized statement define which user we want to find so there’s a string the email comes in connection to the database we are going to figure out how the connection is going to be passed how it is going to be created construct the SQL statement we want to run specifying the parameter right so we define how is it going to be uh created what is going to be created what can be passed to the database and what should not be passed to the database so that is one way of uh utilizing prepared statements and parameterized queries then we have object relational mapping most development uh teams prefer to use objection object relational mapping frameworks to make the translation of SQL results set into code objects more seamless so this is an example of object relational mapping uh where we map certain objects and allow that to be executed and then escaping inputs in a simple way to protect against most SQL injection attacks many languages have standard functions to achieve this right so you need to be very careful while using escape characters in your codebase when a SQL statement is constructed not all injection attacks rely on abuse of code characters so you need to know what characters are being utilized uh in the configuration that you have created in the structure that you have created in the code that you have created uh which characters are being recognized as operators you need to sanitize those operators and you need to uh basically ensure that these operators cannot be accepted as user input if they are they’re weeded out by the application and they never reach the database other methods of preventing SQL injection are uh password hashing so that passwords cannot be bypassed the passwords cannot be recovered passwords cannot be cracked uh third party authentication you use oath or uh some other service for a single sign on mechanism does uh you rely on a third party to maintain the security of authentication and uh what kind of parameters are passed for example uh using LinkedIn login or Facebook login right uh for the layman you normally go on to Facebook and you allow if you’re using a game right if you start playing a game you’re allowed to log into the game using your Facebook credentials or your Google credentials now that is not just for ease of use but the game user the developer has outsourced the authentication mechanisms to third parties such as Facebook or Google because they understand that that authentication mechanism is as safe as can be facebook and Google are wealthy organizations uh hire a lot of security experts and the development for their authentication mechanisms is topnotch small organization cannot spend that kind of money on security itself right so you use a third party authentication mechanism to ensure that these kind of attacks may not happen then web application firewalls uh having a web application firewall and configuring it properly uh for SQL injection attacks is one of the sureot method of uh mitigating or minimizing the uh threat in the first place so at this point in time you have realized that the application has some vulnerabilities for SQL injection and instead of recoding or restructuring the application uh you want to take the easier way out or the cheaper way out so what you do is you uh you install a web application firewall and you configure the web application firewall to identify malicious queries and stop them uh at the firewall level itself so they never reach the application and thus the vulnerabilities on the application don’t get executed buy better software and keep on updating the software so it’s not necessary that once you have a software you install it it’s going to be safe for life new vulnerabilities are discovered every day every hour and it may so happen what is secure today may be completely insecure tomorrow or the day after right so you need to keep on upgrading the software if there are no upgrades available and the vulnerability still exist you might want to migrate to a better software and thus uh ensure that you don’t get hacked right always update and use patches organizations keep on sending out updates and patches as and when they are released you need to install them to uh enhance your security postures and then continuously monitor SQL statements and databases use protocol monitors uh use different softwares use the firewalls to keep on monitoring what kind of queries you’re uh getting and based on those queries you want to ensure the inputs and the queries that are creating are not detrimental to the health of the software that you have jane is relaxing at home when she receives an email from a bank that asks her to update her credit card PIN in the next 24 hours as a security measure judging the severity of the message Jane follows the link provided in the email on delivering her current credit card PIN and the supposedly updated one the website became unresponsive which prompted her to try sometime later however after a couple of hours she noticed a significant purchase from a random website on that same credit card which she never authorized frantically contacting the bank Jane realized the original email was a counterfeit or a fake message with a malicious link that entailed credit card fraud this is a classic example of a fishing attack fishing attacks are a type of social engineering where a fraudulent message is sent to a target on the premise of arriving from a trusted source its basic purpose is to trick the victim into revealing sensitive information like passwords and payment information it’s based on the word fishing which works on the concept of baits if a supposed victim catches the bait the attack can go ahead which in our case makes Jane the fish and the fishing emails the bait if Jane never opened the malicious link or was cautious about the email authenticity an attack of this nature would have been relatively ineffective but how does the hacker gain access to these credentials a fishing attack starts with a fraudulent message which can be transmitted via email or chat applications even using SMS conversations to impersonate legitimate sources is known as smishing which is a specific category of fishing attacks irrespective of the manner of transmission the message targets the victim in a way that coaxes them to open a malicious link and provide critical information on the requisite website more often than not the websites are designed to look as authentic as possible once the victims submit information using the link be it a password or credit card details the data is sent to the hacker who designed the email and the fake website giving him complete control over the account whose password was just provided often carried out in campaigns where an identical fishing mail is sent to thousands of users the rate of success is relatively low but never zero between 2013 and 2015 corporate giants like Facebook and Google were tricked off of $100 million due to an extensive fishing campaign where a known common associate was impersonated by the hackers apart from credit access some of these campaigns target the victim device and install malware when clicked on the malicious links which can later function as a botnet or a target for ransomware attacks there is no single formula for there are multiple categories of fishing attacks the issue with Jane where the hacker stole her bank credentials falls under the umbrella of deceptive fishing a general email is sent out to thousands of users in this category hoping some of them fall prey to this scam spear fishing on the other hand is a bit customized version the targets are researched before being sent an email for example if you never had a Netflix subscription sending you an email that seems like the Netflix team sends it becomes pointless this is a potential drawback of deceptive fishing techniques on the other hand a simple screenshot of a Spotify playlist being shared on social media indicates a probable point of entry the hacker can send counterfeit messages to the target user while implying the source of such messages being Spotify tricking them into sharing private information since the hacker already knows the target uses Spotify the chances of victims taking the bait increase substantially for more important targets like CEOs and people with a fortune on their back the research done is tenfold which can be called a case of whaling the hackers prepare and wait for the right moment to launch their fishing attack often to steal industry secrets for rival companies or sell them off at a higher price apart from just emails farming focuses on fake websites that resemble their original counterparts as much as possible a prevalent method is to use domain names like Facebook with a single O or YouTube with no E these are mistakes that people make when typing the full URL in the browser leading them straight to a counterfeit web page which can fool them into submitting private data a few more complex methods exist to drive people onto fake websites like ARP spoofing and DNS cash poisoning but they are rarely carried out due to time and resource constraints now that we know how fishing attacks work let’s look at ways to prevent ourselves from becoming victims while the implications of a fishing attack can be extreme protecting yourself against these is relatively straightforward jane could have saved herself from credit card fraud had she checked the link in the email for authenticity and that a redirected to a secure website that runs on the HTTPS protocol even suspicious messages shouldn’t be entertained one must also refrain from entering private information on random websites or pop-up windows irrespective of how legitimate they seem it is also recommended to use secure anti-ishing browser extensions like cloudfish to sniff out malicious emails from legitimate ones the best way to prevent fishing is browsing the internet with care and being on alert for malicious attempts at all times start by learning about cross-ite scripting from a layman’s perspective cross-ite scripting also known as XSS is a type of code injection attack that occurs on the client side the attacker intends to run harmful scripts in the victim’s web browser by embedding malicious code in a genuine web page or online application the real attack takes place when the victim hits the malicious code infected web page or online

    application the web page or application serves as a vehicle for the malicious script to be sent to the user’s browser forums message boards and online pages that enable comments are vulnerable vehicles that are frequently utilized for cross-cripting assaults a web page or web application is vulnerable to XSS if the output it creates contains unsanitized user input the victim’s browser must then parse this user input in VBScript ActiveX Flash and even CSS cross-side scripting attacks are conceivable they are nevertheless most ubiquitous in JavaScript owing to the fact that JavaScript is most important to most browser experiences nowadays the main purpose of this attack is to steal the other user’s identity be it via cookies session tokens and other information in most of the cases this attack is being used to steal the other person’s cookies as we know cookies help us to login automatically therefore with the stolen cookies we can login with other identities and this is one of the reasons why this attack is considered as one of the riskiest attacks it can be performed with different client side programming languages as well cross-side scripting is often compared with similar client side attacks as client side languages are mostly being used during this however an XSS attack is considered riskier because of its ability to damage even less vulnerable technologies most often this attack is performed with JavaScript and HTML javascript is a programming language that runs on web pages inside your browser the client side code adds functionality and interactivity to the web page and is used extensively on all major applications and CMS platforms unlike serverside languages such as PHP JavaScript code runs inside your browser and cannot impact the website for other visitors it is sandboxed to your own navigator and can only perform actions within your own browser window while JavaScript is client side and does not run on the server it can be used to interact with the server by performing background requests attackers can then use these background requests to add unwanted spam content to a web page without refreshing it they can then gather analytics about the client’s browser or perform actions asynchronously the manner of attack can range in a variety of ways it can be a single link which the user must click on to initiate a JavaScript piece of code it can be used to show any piece of images that can be later used as a front end for malicious code being installed as malware with the majority of internet users unaware of how metadata works or the ways in which web requests are called the chances of victims clicking on a redirecting links is far too high cross-ite scripting can occur on the malicious script executed at the client site using a fake page or even a form that is displayed to the user on websites with displayed advertisements malicious emails can also be sent to the victim these attacks occur when the malicious user finds the vulnerable parts of the website and sends it as appropriate malicious input now that we understand the basics of cross-ite scripting let us learn more about how this kind of attack works in the first place we have the website or the web browser which is used to show content to the victim or which is the user in our case whenever the user wants to grab some content from the website the website asks the data from the server the server provides this information to the website and the web browser which ultimately reaches the victim how the hacker comes into play here it passes on certain arguments to the web browser which is can be then forwarded back to the server or to the user at hand the entire cross-ite scripting attack vector means sending and injecting malicious code or script this attack can be performed in different ways depending on the type of attack the malicious script may be reflected on the victim’s browser or stored in the database and executed every time when the user calls the appropriate function the main reason for this attack is inappropriate users input validation where the malicious input can get into the output a malicious user can enter a script which will be injected onto the website’s code then the browser is not able to know if the executed code is malicious or not therefore this malicious script is being executed on the victim’s browser or any faked form if that is being displayed for the users there are many ways to trigger an XSS attack for example the execution could be triggered automatically when the page loads or when a user hovers over specific elements of the page like hyperlinks potential consequences of cross-sight scripting attacks include capturing keystrokes of a user redirecting a user to malicious websites running web browser based exploits obtaining cookie information of a user who is logged into a website and many more in some cases cross-ite scripting attack leads to complete compromise of the victim’s account attackers can trick users into entering credentials on a fake form which can then provide all information to the attacker with the basic working of a cross-ite scripting attack out of the way let us go over the different ways hackers can leverage vulnerable web applications to gather information and eventually breach those systems the prime purpose of performing XSS attack is to steal the other person’s identity as mentioned it may be cookies session tokens etc xss may also be used to display faked pages or forms for the victim however this can be performed in several ways we have a reflected attack this attack occurs when a malicious script is not being saved on the web server but is reflected in the website results reflected XSS code is not being saved permanently in this case the malicious code is being reflected in any website result the attack code can be included in the faked URL or in the HTTP parameters it can affect the victim in different ways by displaying faked malicious page or by sending a malicious email in a reflected cross-ite scripting example the input of a search form is reflected on the page to show what the search key was an attacker may craft a URL that contains malicious code and then spread the same URL via email or social media a user who clicks on this link opens the valid web application which then runs the malicious code in the browser this script is not stored in the web application and malicious code is shown only to one user the user that opens the link executes the script and the attack is not necessarily visible on the server side or to the app owner itself the next variant is a stored cross-ite scripting attacks this occurs when a malicious script is being saved on the web server permanently this can be considered a riskier attack since it has leverage for more damage in this type of attack the malicious code or script is being saved on the server for example in the database or the website it is executed every time the users call the appropriate functionality this way stored XSS attack can affect many users also as the script is being stored on the web server it will affect the website for a longer time in order to perform stored XSS attack the malicious scripts should be sent through the vulnerable input form for example can be a command field or review field this way the appropriate script will be saved in the database and evaluated on the page load or appropriate function calling in a stored XSS example the script might have been submitted via an input field to the web server which did not perform a sufficient validation and stores the script permanently in the database the consequence of this might be that the script is now being delivered to all users visiting the web application and if for example able to gain access to the user session cookies in this attack the script is permanently stored in the web app the users visiting the app after the information retrieve the script the malicious code then exploits the flaws in the web application and the script and the attack is visible on the server side or to the app owner as well the third variant is DOM based cross-ite scripting attacks this type of attack occurs when the DOM environment is being changed but the client side code does not change when the DOM environment is being modified in the victim’s browser the client side code executes differently in order to get a better understanding of how XSS DOM attack is being performed let us analyze the following example if there is a website called textin.com we know default is a parameter therefore in order to perform XSS DOM attack we should send a script as parameters a DOM based XSS attack may be successfully executed even when the server does not embed any malicious code into the web page by using a flaw in the JavaScript executed in the browser for example if the client side JavaScript modifies the DOM tree of the web page it can be based on an input field or the get parameter without validating the input this allows the malicious code to be executed the malicious code that exploits flaws in the browser on the user side and the script and the attack is not necessarily visible on the server side or to the app owner by now it is clear that cross-ite scripting attacks are difficult to detect and even tougher to fight against there are however plenty of ways one can safeguard against such attacks let’s go through some of these preventive measures like mentioned earlier XSS attacks are sometimes difficult to detect however this can be changed if you get some external help a way to prevent excss attacks is using automated testing tools like crash test security suit or aunetic security suit still manual testing is highly timeconuming and costly and therefore not possible to be done for every iteration of your web application consequently your code shouldn’t be untested before any release using automated security you can scan your web application for cross-ite scripting and other critical vulnerabilities before every release this way you can ensure that your web application slide version is still secured whenever you alter or add a feature input fields are the most common point of entry for XSS attack script therefore you should always screen and validate any information input into data fields this is particularly important if the data will be included as HTML output this can be used to protect against reflected excss attacks validation should occur on both the client side and server side as an added precaution this helps validating the data before it’s being sent to the servers and can also protect against persistent XSS scripts this can be accomplished using JavaScript xss attacks only appear if any user input is being displayed on the web page therefore try to avoid displaying any untrusted user input if possible if you need to display user data restrict the places where the user input might appear any input displayed inside a JavaScript tag or a URL shown on the site is much more likely to be exploited than the input that appears inside a division or a span element inside the HTML body protecting against excss vulnerabilities typically requires properly escaping userprovided data that is placed on the page rather than trying to determine if the data is user provided and could be compromised we should always play it safe and escape data whether it is user provided or not unfortunately because there are many different rules for escaping you still must choose the proper type of escaping before settling on a final code encoding should be applied directly before user controllable data is written to a page because the context you’re writing into determines what kind of encoding you need to use for example values inside a JavaScript string require a different type of escaping to those in an HTML context sometimes you’ll need to apply multiple layers of encoding in the correct order for example to safely embed user input inside an event handler you need to deal with both JavaScript context and the HTML context so you need to first uni code escape the input and then HTML encoded content security policy or CSP is a computer security standard introduced to prevent cross-ite scripting clickjing and other code injection attacks resulting from the execution of malicious content in the trusted webpage context it is a candidate recommendations of the W3C working group on web application security it’s widely supported by modern web browsers and provides a standard method for website owners to declare approved origins of content that browsers should be allowed to load on their website http is an additional flag included in a set cookie HTTP response header using the HTTP only flag when generating a cookie helps mitigate the risk of clientside script accessing the protected cookie that is if the browser supports it if the HTTP only flag is included in the HTTP response header the cookie cannot be accessed through a client side script again this is if the browser supports this flag as a result even if a cross-side scripting flaw exists and a user accidentally accesses a link that exploits this flaw the browser will not reveal the cookie to a third party if a browser does not support HTTP only and a website attempts to set an HTTP cookie the HTTP only flag will be ignored browser browser thus creating a traditional script accessible cookie as a result the cookie becomes vulnerable to theft of modification by any malicious script next on our docket is a live demonstration where we solve a set of cross-ite scripting problems starting from the basic level to the topmost level six we’re going to start at level one in this web application it demonstrates a common cause of cross-side scripting where user input is directly included in the page without proper escaping if we interact with a vulnerable application window here and find a way to make it execute JavaScript of our choosing we can take actions inside the vulnerable window or directly edit its URL bar this task needs only basic knowledge let’s see why the most primitive injections work here right away let’s do a simple query and inspect the resulting HTML page i’m going to use this phrase with a single quote as a special character we can now inspect the HTML page we can see here in this line the special character single quote appears in the result over here the provided query text is placed directly in a B tag as in a body element we need to perform a reflected XSS into the web application because they are non-persistent XSS attacks and the payload should be included in the URL to perform successful exploitation we can use any payload but we’re going to use the simple one to perform an alert in this web application it’s simple and can be shown easily just going to write the script over here and we’re going to press search as you can see we have successfully launched our first cross-sight scripting attack we can see an alert box pop up with the necessary message and a similar process can be used to steal browser cookies and passwords albeit with different commands now we have the option to move to level two in this web application it shows that how easily XSS bugs can be introduced in complex chat applications chat app conversations are stored in a database and retrieved when a user wants to see the conversation therefore if a malicious user injects some JavaScript code all visitors will be infected this kind of cross-ite scripting attack is more powerful and it is more riskier than reflected cross-ite scripting attacks and that’s why is known as stored XSS i posted my query with a special character of a single quote and this is what I get whatever I typed in simply appeared on the page right after I click on share status let’s see the source you can see here the text I posted seems directly put inside a block code tag so even a simple script tag we used in level one should work here but it will not let us examine the code to understand why we’re going to toggle the code of A here and check the index.html file important part is line 32 the generated HTML fragment which is the HTML variable in the code is added to the mail HTML using the inner HTML method so when the browser parsing this HTML fragment it will not execute any script tag defined within that HTML fragment html parser will not execute a script tag when it parses HTMLs via this method this is why the script tag like we used in level one is not going to work here our solution is to use events events will execute the defined JavaScript we’re going to use an image over here and when we press on share status in the above injection we are loading an image that doesn’t exist which causes to trigger an on error event in on error event the it will execute our alert method with that we are able to beat level two and we can now move up to the next level in our challenge as you can see clicking on any tab causes the tab number to be displayed in the URL fragment this hints that the value after the hashtag controls the behavior of the page that is it is an input variable to confirm let’s analyze the code as you can see in line 43 inside the event handling the value provided after the hash in the URL is directly passed onto the true tab method no input validation is being performed the value passed to the choose tab method is directly injected into the img tag in line 17 this is an unsafe assignment and it is the vulnerable part of the code now all we have to do now is to craft a payload that would adjust the img tag to execute our JavaScript remember the script tag from level one would not work here since the variable HTML is used to add the DOM dynamically hence the events are aes here once again I will choose to use the existing img tag and change the source to something that doesn’t exist hence forcing it to fall in to execute an on error even which I will pass the URL once we visit that URL we can see that our Java pop-up has opened up here with the same message of XSS level 3 has been completed with this we can now move on to level four which is going to present a different kind of attack in this web application there is a timer on the page that means whatever numbers we put in the box a countdown starts and then when it finishes the application alerts that the countdown is finished and you can see the timer is a pop-up appearing over here and this resets the timer again now it is obvious that the value entered in the text box is transferred to the server over the timer parameter in the URL let us examine the code to see how the timer parameter is being handled we’re going to visit timer.html over here and we’re going to check over here in line 21 the start timer method is being called in the onload event however the timer parameter is being directly passed to the start timer method we need to perform a pop-up alert in the web application which escapes the content of the function start timer without baking the JavaScript code the parameter value is directly added to the start timer method without any filtering what we can try to do here is to inject an alert function to be executed inside the onload event along with the start timer method we’re going to remove this argument and put our script over here now when we press on create timer and we have a pop-up with the excss level four completed we can now move on to level five in this web application the application excss is different because this challenge description says cross-ite scripting isn’t just about correctly escaping data sometimes attackers can do bad things even without injecting new elements into the DOM it’s kind of open redirect cuz the attack payload is executed as a result of modifying the DOM environment in the victim’s browser this environment is used by the original client side script so that the client side code runs in an unexpected manner the vulnerability can be easily detected if the next link in the signup page is inspected the href attribute value of next link is confirm which is exactly the value of the next URL query parameter as you can see over here this means using the next query parameter can be used to inject a JavaScript code to the href attribute of the next link the following is the best way to do it as soon as the user clicks on the link the script will be triggered we’re going to press anything random and now that we click next we can see the XSS level five that we had provided in the URL as a parameter to the next variable since the value of next provided appears in a pop-up we can consider the attacker success and move on to the final level six in this web application it shows some of the external JavaScript is retrieved if you analyze the URL you can see that the script is loaded already the vulnerability lies within how the code handles the value after the hashtag if you check on line 45 the value right after the hashtag is taken as the gadget name and then in line 48 the value is directly passed on to the include gadget method and in the include gadget method that we can see over here you can see in line 18 a script tag is created and the URL gadget name parameter value is directly used as the source attribute of the script tag in line 28 this means we can completely control the source attribute of the script tag that is being created that is with this vulnerability we can inject our own JavaScript file into the code we can inject a URL of our own hosted JavaScript into the web application’s URL after the hashtag and the URL should not be using HTTPS but anything like that to bypass the regular expression for security checking going to remove the pre-tored URL and we’re going to load our own JavaScript file finally we have reached the end of our challenge completed six different varieties of crosscripting attacks and use different solutions for all of the six questions with work from home being the norm in today’s era people spend considerable amount of time on the internet often without specific measures to ensure a secure session apart from individuals organizations worldwide that host data and conduct business over the internet are always at the risk of a DDoS attack these DDoS attacks are getting more extreme with hackers getting easy access to the graph three of the six strongest DD dos attacks were launched in 2021 with the most extreme attack occurring just last year in 2020 lately cyber criminals have been actively seeking out new services and protocols for amplifying these DDoS attacks active involvement with hacked machines and botnets allow further penetration into the consumer space allowing much more elaborate attack campaigns apart from general users multinational corporations have also had their fair share of problems github a platform for software developers was the target of a DOS attack in 2018 widely suspected to be conducted by Chinese authorities this attack went on for about 20 minutes after which the systems were brought into a stable condition it was the strongest DOS attack to date at the time and made a lot of companies reconsider the security practices to combat such attacks even after years of experimentation TDOS attacks are still at large and can affect anyone in the consumer and corporate space hey everyone this is Babub from SimplyLearn and welcome to this video on what is a DOS attack let’s learn more about what is a DOS attack a distributed denial of service attack or DOS is when an attacker or attackers attempt to make it impossible for a service to be delivered this can be achieved by thwarting access to virtually anything servers devices services networks applications and even specific transactions within applications in a DOSS attack it’s one system that is sending the malicious data or requests a DOS attack comes from multiple systems generally these attacks work by drowning a system with requests for data this could be sending a web server so many requests to serve a page that it crashes under the demand or it could be a database being hit with a high volume of queries the result is available internet bandwidth CPU and RAM capacity become overwhelmed the impact could range from a minor annoyance from disrupted services to experiencing entire websites applications or even entire businesses taking offline more often than not these attacks are launched using machines in a botnet a botnet is a network of devices that can be triggered to send requests from a remote source often known as the command and control center the bots in the network attack a particular target thereby hiding the original perpetrator of the DOS campaign but how do these devices come under a botnet and what are the requests being made to the web servers let’s learn more about these and how do attack work a DOS attack is a two-phase process in the first phase a hacker creates a botnet of devices simply put a vast network of computers are hacked via malware ransomware or just simple social engineering these devices become a part of the botnet which can be triggered any time to start bombarding a system or a server on the instruction of the hacker that created the botnet the devices in these networks are called bots or zombies in the second phase a particular target is selected for the attack when the hacker finds the right time to attack all the zombies in the botnet network send these requests to the target thereby taking up all the servers available bandwidth these can be simple ping requests or complex attacks like SYN flooding and UDP flooding the aim is to overwhelm them with more traffic than the server or the network can accommodate the goal is to render the website or service inoperable there is a lot of wiggle room when it comes to the type of DOS attack a hacker can go with depending on the targets vulnerability we can choose one of the three broad categories of DOS attacks volume- based attacks use massive amounts of bogus traffic to overwhelm a resource it can be a website or a server they include ICMP UDAP and spoofed packet flood attacks the size of volume based attack is measured in bits per second these attacks focus on clogging all the available bandwidth for the server thereby cutting the supply short several requests are sent to the server all of which warrant a reply thereby not allowing the target to cater to the general legitimate users next we have the protocol level attacks these attacks are meant to consume essential resources of the target server they exhaust the load balances and firewalls which are meant to protect the system against the DOS attacks these protocol attacks include SY and floods and Smurf DDoS among others and the size is measured in packets per second for example in an SSL handshake server replies to the hello message sent by the hacker which will be the client in this case but since the IP is spoofed and leads nowhere the server gets stuck in an endless loop of sending the acknowledgement without any end in sight finally we have the application level attacks application layer attacks are conducted by flooding applications with maliciously crafted requests the size of application layer attacks is measured in requests per second these are relatively sophisticated attacks that target the application and operating system level vulnerabilities they prevent the specific applications from delivering necessary information to users and hog the network bandwidth up to the point of a system crash examples of such an attack are HTTP flooding and BGP hijacking a single device can request data from a server using HTTP post or get without any issues however when the requisite botnet is instructed to bombard the server with thousands of requests the database bandwidth gets jammed and it eventually becomes unresponsive and unusable but what about the reasons for such an attack there are multiple lines of thought as to why a hacker decides to launch a DOS attack on unsuspecting targets let’s take a look at a few of them the first option is to gain a competitive advantage many DOS attacks are conducted by hacking communities against rival groups some organizations hire such communities to stagger their rivals resources at a network level to gain an advantage in the playing field since being a victim of a DOS attack indicates a lack of security the reputation of such a company takes a significant hit allowing the rivals to cover up some ground secondly some hackers launch these DOS attacks to hold multinational corporations at ransom the resources are jammed and the only way to clear the way is if the target company agrees to pay a designated amount of money to the hackers even a few minutes of inactivity is detrimental to a company’s reputation in the global market and it can cause a spiral effect both in terms of market value and product security index most of the time a compromise is reached and the resources are freed after a while dos attacks have also found use in the political segment certain activists tend to use DOS attacks to voice their opinion spreading the word online is much faster than any local rally or forum primarily political these attacks also focus on online communities ethical dilemmas or even protests against corporations let’s take a look at a few ways that companies and individuals can protect themselves against DOS attacks the company can employ load balances and firewalls to help protect the data from such attacks load balances reroute the traffic from one server to another in a DOS attack this reduces the single point of failure and adds resiliency to the server data a firewall blocks unwanted traffic into a system and manages the number of requests made at a definite rate it checks for multiple attacks from a single IP and occasional slowdowns to detect a DOS attack in action early detection of a DOS attack goes a long way in recovering the data lost in such an event once you’ve detected the attack you will have to find a way to respond for example you will have to work on dropping the malicious DOS traffic before it reaches your server so that it doesn’t throttle and exhaust your bandwidth here’s where you will filter the traffic so that only legitimate traffic reaches the server by intelligent routing you can break the remaining traffic into manageable chunks that can be handled by your cluster resources the most important stage in DOS mitigation is where you will look for patterns of DDoS attacks and use those to analyze and strengthen your mitigation techniques for example blocking an IP that’s repeatedly found to be offending is a first step cloud providers like Amazon Web Services and Microsoft Azure who offer high levels of cyber security including firewalls and threat monitoring software can help protect your assets and network from DDoS criminals the cloud also has greater bandwidth than most private networks so it is likely to fail if under the pressure of increased TOS attacks additionally reputable cloud providers offer network redundancy duplicating copies of your data systems and equipment so that if your service becomes corrupted or unavailable due to a DOS attack you can switch to a secure access on backed up versions without missing a beat one can also increase the amount of bandwidth available to a host server being targeted since DOS attacks fundamentally operate on the principle of overwhelming systems with heavy traffic simply provisioning extra bandwidth to handle unexpected traffic spikes can provide a measure of protection this solution can prove expensive as a lot of that bandwidth is going to go unused most of the time a content delivery network or a CDN distributes your content and boosts performance by minimizing the distance between your resources and end users it stores the cached version of your content in multiple locations and this eventually mitigates DOS attacks by avoiding a single point of failure when the attacker is trying to focus on a single target popular CDNs include Accom My CDN Cloudflare AWS CloudFront etc let’s start with a demo regarding the effects of DOS attacks on a system for a demo we have a single device that will attack a target making it a DOS attack of sorts once a botnet is ready multiple devices can do the same and eventually emulate a DOS attack to do so we will use the virtualization software called VMware with an instance of Parrot Security operating system running for a target machine we will be running another VMware instance of a standard Linux distribution known as Linux light in a target device we can use Wireshark to determine when the attack begins and see the effects of the attack accordingly this is Linux light which is our target machine and this is parrot security which is used by the hacker when trying to launch a DOS attack this is just one of the dros that can be used to launch the attack we must first find the IP address of our target so to find the IP address we open the terminal we use the command if config and here we can find the IP address now remember we’re launching this attack in VMware now the both the instances of parrot security and Linux light are being run on my local network so the address that you can see here is 192.168.72.129 which is a private address this IP cannot be accessed from outside the network basically anyone who is not connected to my Wi-Fi when launching attacks with public servers or public addresses it will have a public IP address that does not belong to the 1921 168 subnet once we have the IP address we can use a tool called Hping 3 hping 3 is an open-source packet generator and analyzer for the TCP IP protocol to check what are the effects of an attack we will be using Wireshark wireshark is a network traffic analyzer we can see whatever traffic that is passing through the Linux light distro is being displayed over here with the IP address the source IP and the destination IP as to where the request is being transferred to once we have the DOSS attack launched you can see the results coming over here from the source IP which will be par security now to launch the HP3 command we need to give pseudo access to the console which is the root access now we have the root access for the console the hping 3 command will have a few arguments to go with it which are as you can see on the screen minus s and a flood a hyphen v hyphen p8 and the IP address of the target which is 192.16872.129 in this command we have a few arguments that such as the minus s which specifies SYN packets like in an SSL handshake we have the SYN request that the client sends to the server to initiate a connection the hyphen flood aims to ignore the replies that the server will send back to the client in response to the SYN packets here the parrot security OS is the client and Linux slide being the server minus V stands for verbosity as in where we will see some output when the requests are being sent the hyphen P80 stands for port 80 which we can replace the port number if we want to attack a different port and finally we have the IP address of our target as of right now if we check wireshark it is relatively clear and there is no indication of a DOS attack incoming now once we launch the attack over here we can see the uh requests coming in from this IP which is 192.168 72.128 till now even the network is responsive and so is Linux light the requests keep on coming and we can see the HTTP flooding has started in flood mode after a few seconds of this attack continuing the server will start shutting down now remember Linux light is a distro that can focus on and that serves as a backend now remember Linux light is a distro and such Linux distros are served as backend to many servers across the world for example a few seconds have passed from the attack now the system has become completely irresponsive this has happened due to the huge number of requests that came from pirate security you can see whatever I press nothing is responded even the wireshark has stopped capturing new requests because the CPU usage right now is completely 100% and at this point of time anyone who is trying to request some information from this Linux distro or where this Linux distro is being used as a backend for a server or a database cannot access anything else the system has completely stopped responding and any request any legitimate request from legitimate users will be dropped once we stop the attack over here it takes a bit of time to settle down now remember it’s still out of control but eventually the traffic dies down and the system regains its strength it is relatively easy to gauge right now the effect of a DOSS attack now remember this Linux light is just a VM instance actual website servers and web databases they have much more bandwidth and are very secure and it is tough to break into that is why we cannot use a single machine to break into them that is where a DOS attack comes into play what we did right now is a DOS attack as in a single system is being used to penetrate a target server using a single request now when a DOS attack multiple systems such as multiple pirate security instances or multiple zombies or bots in a botnet network can attack a target server to completely shut down the machine and drop any legitimate requests thereby rendering the service and the target completely unusable and inoperable as a final note we would like to remind that this is for educational purposes only and we do not endorse any attacks on any domains only test this on servers and networks that you have permission to test on cyber security has become one of the most rigid industries in the last decade while simultaneously being the most challenged with every aspect of corporate culture going online and embracing cloud computing there is a plethora of critical data circulating through the internet all worth billions of dollars to the right person increasing benefits require more complex attacks and one of these attacks is a brute force attack a brute force or known as brute force cracking is the cyber attack equivalent of trying every key on your key ring and eventually finding the right one brute force attacks are simple and reliable there is no prior knowledge needed about the victim to start an attack most of the systems falling prey to brute force attacks are actually well secured attackers let a computer do the work that is trying different combinations of usernames and passwords until they find a one that works due to this repeated trial and error format the strength of password matters a great deal although with enough time and resources brute force will break a system since they run multiple combinations until they find the right passcode hey everyone this is Beub from Simply Learn and welcome to this video on what is a brute force attack let’s begin with learning about brute force attacks in detail a brute force attack also known as an exhaustive search is a cryptographic hack that relies on guessing possible combinations of targeted password until the current password is discovered it can be used to break into online accounts encrypted documents or even network peripheral devices the longer the password the more combinations that will need to be tested a brute force attack can be time-conuming and difficult to perform if methods such as data offiscation are used and at times downright impossible however if the password is weak it could merely take seconds with hardly any effort dictionary attacks are an alternative to brute force attacks where the attacker already has a list of usernames and passwords that need to be tested against the target it doesn’t need to create any other combinations on its own dictionary attacks are much more reliable than brute force in a real world context but the usefulness depends entirely on the strength of passwords being used by the general population there is a three-step process when it comes to brute forcing a system let’s learn about each of them in detail in step one we have to settle on a tool that we are going to use for brute forcing there are some popular names on the market like Hashcat Hydra and John the Ripper while each of them has its own strength and weaknesses each of them perform well with the right configuration all of these tools come pre-installed with certain Linux distributions that cater to penetration testers and cyber security analysts like Kali Linux and Parrot Security after deciding what tool to use we can start generating combinations of alpha numeric variables whose only limitation is the number of characters for example while using Hydra a single six-digit password will create 900,000 passwords with only digits involved add alphabets and symbols to that sample space and that numbers grows exponentially the popular tools allow customizing this process let’s say the hacker is aware of the password being a specific 8digit word containing only letters and symbols this will substantially increase the chances of being able to guess the right password since we remove the time taken to generate the longer ones we omit the need for including digits in such combinations these small tweaks go a long way in organizing an efficient brute force attack since running all the combinations with no filters will dramatically reduce the odds of finding the right credentials in time in the final step we run these combinations against the file or service that is being broken we can try and break into a specific encrypted document a social media account or even devices at home that connect to the internet let’s say there is a Wi-Fi router the generated passwords are then fed into the connection one after the other it is a long and arduous process but the work is left to the computer other than someone manually clicking and checking each of these passcodes any password that doesn’t unlock the router is discarded and the brute force tool simply moves on to the next one this keeps going on until we find the right combination which unlocks the router sometimes reaching the success stage takes days and weeks which makes it cumbersome for people with low computing power at their disposal however the ability to crack any system in the world purely due to bad password habits is very appealing and the general public tends to stick with simple and easy to use passwords now that we have a fair idea about how brute force works let’s see if we can answer this question we learned about how complex passwords are tougher to crack by brute force among the ones listed on the screens which one do you believe will take the longest to be broken when using brute force tools leave your answers in the comment section and we will get back to you with the correct option next week let’s move on to the harmful effects of getting a system compromised due to brute force attacks a hacked laptop or mobile can have social media accounts logged in giving the hackers free access to the victim’s connections it has been reported on multiple occasions where compromised Facebook accounts are sending malicious links and attachments to people on their friends list one of the significant reasons for hacking malware infusion is best done when spread from multiple devices similar to distributing spam this reduces the chance of circling back the source to a single device which belongs to the hacker once brute forced a system can spread malware via email attachments sharing links file upload via FTP etc personal information such as credit card data usage habits private images and videos are all stored in our systems be it in plain format or root folders a compromised laptop means easy access to these information that can be further used to impersonate the victim regarding bank verification among other things once a system is hacked it can also be used as a mail server that distributes spam across lists of victims since the hacked machines all have different IP addresses and MAC addresses it becomes challenging to trace the spam back to the original hacker with so many harmful implications arising from a brute force attack it’s imperative that the general public must be protected against such let’s learn about some of the ways we can prevent ourselves from becoming a victim of brute force attacks using passwords consisting of alphabets letters and numbers have a much higher chance of withstanding brute force attacks thanks to the sheer number of combinations they can produce the longer the password the less likely it is that a hacker will devote the time and resources to brute force them having alpha numeric passwords also allows the user to keep different passwords for different websites this is to ensure that if a single account or password is compromised due to a breach or a hack the rest of the accounts are isolated from the incident two-factor authentication involves receiving a one-time password on a trusted device before a new login is allowed this OTP can be obtained either via email SMS or specific 2FA applications like AI and ages email and SMS-based OTPs are considered relatively less secure nowadays due to the ease with which SIM cards can be duplicated and mailboxes can be hacked applications that are specifically made for 2FA coursees are much more reliable and secure captures are used to stop bots from running through web pages precisely to prevent brute forcing through their website since brute force tools are automated forcing the hacker to solve capture for every iteration of a password manually is very challenging the capture system can filter out these automated bots that keep refreshing the page with different credentials thereby reducing the chances of brute force considerably a definite rule that locks the account being hacked for 30 minutes after a specified number of attempts is a good way to prevent brute force attempts many websites lock account for 30 minutes after three failed password attempts to secure the account against any such attack on an additional note some websites also send an email instructing the user that there have been three insecure attempts to log into the website let’s look at a demonstration of how brute force attacks work in a real world situation the world has gone wireless with Wi-Fi taking the reigns in every household it’s natural that the security will always be up for debate to further test the security index and understand brute force attacks we will attempt to break into the password of a Wi-Fi router for that to happen we first need to capture a handshake file which is a connection file from the Wi-Fi router to a connecting device like a mobile or a laptop the operating system used for this process is paral a Linux distribution that is catered to penetration testers all the tools being used in this demo can easily be found pre-installed in this operating system if getting your learning started is half the battle what if you could do that for free visit Skill Up by SimplyLearn click on the link in the description to know more to start our demo we’re going to use a tool called AirDon which is made to hack into wireless network specifically at this point it’s going to check for all the necessary scripts that are installed in the system to crack into a Wi-Fi and to capture the handshake file we’re going to need an external network card the significance of the external network card is a managed mode and a monitor mode for now the WLX1 named card is my external network adapter which I’m going to select to be able to capture data over the air we’re going to need to put it in monitor mode as you can see above it’s written it is in manage mode right now so we’re going to select option two which is to put the interface in monitor mode and it name is now WLAN zero monitor the monitor mode is necessary to capture data over the air that is the necessary reason why we need an external card since a lot of inbuilt cards that come with the laptops and the systems they cannot have a monitor mode installed once we select the mode we can go into the fifth which is the handshake tools menu in the first step we have to explore for targets and it is written that monitor mode is necessary to select a target so let’s explore for targets and press enter we have to let this run for about 60 seconds to get a fair idea about the networks that are currently working in this locality for example this ESS ID is supposed to be the Wi-Fi name that we see when connecting to a network j24 recover me these are all the names that we see on our mobile when trying to search for the Wi-Fi this BSS ID is supposed to be an identifier somewhat like a MAC address that identifies this network from other devices the channels features on one or two or there are some many channels that the networks can focus on this here is supposed to be a client that is connected to one such network for example the station that you can see 5626 this is supposed to be the MAC address of the device that is connected to a router this BSS ID is supposed to be which Wi-Fi it is connected to for example 5895D8 is this one which is the JO24 router so we already know which router has a device connected to it and we can use our attack to capture this handshake now that we it has already run for 1 minute now that we press Ctrl C we will be asked to select a target see it has already selected the number five which is the JO24 router as the one with clients so it is easy to run an attack on and it is easy to capture a handshake for select network 5 and we run a capture handshake it says we have a valid WPA WPA2 network target selected and that the script can continue now to capture the handshake we have a couple of attacks a do or a do air replay attack what this attack does is kick the clients out of the network in return when they try to reconnect to the Wi-Fi as they are configured that way that when a client is disconnected it tries to reconnect it immediately it tries to capture a handshake file which in turn contains the security key which is necessary to initiate the handshake for our demo let’s go with the second option that is the do a air replay attack select a timeout value let’s say we give it 60 seconds and we start the script we can see it capturing data from the JO24 network and here we go we have the WPA handshake file once the handshake file is captured can actually close this and here we go congratulations in order to capturing a handshake it has verified that a PMK ID from the target network has successfully been captured this is the file that is already stored it’s a cap file for the path we can let’s say we can keep it in a desktop okay we give the path and the handshape file is generated we can already see a target over here same Jio24 router with the BSS ID now if we return to its main menu we already have the handshake file captured with us now our job is to brute force into that handshake capture file the capture file is often encrypted with the security key of the Wi-Fi network if we know how to decrypt it we will automatically get the security key so let’s go to the offline WPAWP to decrypt menu since we’ll be cracking personal networks we can go with option one now to run the brute force tool we have two options either we can go with the air crack or we can go with the hashcat let’s go with air plus crunch which is a brute force attack against a handshake file we can go with option two it can already detect the capture file that we have generated so we select yes the DSS ID is the one which denotes the GO24 router so we’re going to select yes as well the minimum length of the key for example it has already checked that the minimum length of a Wi-Fi security key which is a WPA to PSK key will always be more than 8 digits and below 64 digits so we have to select something in between this range so if we already know let’s say that the password is at least 10 digits we can go with the minimum length as 10 and as a rough guess let’s say we put the maximum length as 20 the character set that we’re going to use for checking the password will affect the time taken to brute force for example if we already know that or we have seen a user use a password while connecting to the router as something that has only numbers and symbols then we can choose accordingly let’s say if you go with only uppercase characters and numeric characters go with option seven and it’s going to start decryting so how aircraft is working right here you can see this passphrase over here the first five or six digits are a it starts working its way from the end from the last character it keeps trying every single combination you can see the last the fourth character from the right side the D it’ll eventually turn to E because it keeps checking up every single character from the end this will keep going on until all the single characters are tested and every single combination is tried out since the handshake file is encrypted using the security key that is the WPA2 key of the router whichever passphrase is able to decrypt the handshake key completely will be the key of the Wi-Fi router this is the way we can brute force into Wi-Fi routers anywhere in the world cyber attacks are frequently making headlines in today’s digital environment at any time everyone who uses a computer could become a victim of a cyber attack there are various s of cyber attacks ranging from fishing to password attacks in this video we’ll look into one such attack that is known as botnet but before we begin if you love watching tech videos subscribe to our channel and hit the bell icon never to miss an update to begin with let’s take a look at some of the famous bot attacks the first one is mai botnet which is a malicious program designed to attack vulnerable IoT devices and infect them to form a network of bots that on command perform basic and medium level denial of service attacks then we have the zeus bot specifically designed for attacking the system for bank related information and data now let’s see what exactly a botnet is botnet refers to a network of hijacked interconnected devices that are installed with malicious codes known as malware each of these infected devices are known as bots and the hijack criminal known as bot hoarder remotely controls them the bots are used to automate large scale attacks including data theft server failure malware propagation and denial of service attacks now that we know what exactly a botnet is let’s dive deeper into learning how a botnet works during the preparation of a botnet network the first step involves preparing the botnet army after that the connection between the botnet army and the control server is established and the end the launching of the attack is done by the boter let’s understand through a illustration firstly we have a boter that initiates the attack according to the control server commands the devices that are infected with the malware programs and begins to attack the infected system let’s see some details regarding the preparation of the botnet army the first step is known as the prepping the botnet army the first step is creating a botnet is to infect as many as connected devices as possible this ensures that there are enough bots to carry out the attack this way it creates bots either by exploiting the security gaps in the software or websites or using fishing attacks they are often deployed through Trojan horses for the next step we have establishing the connection once it hacks a device as per previous step it infects it with a specific malware that connects the device back to the control bot server a bot herder uses command programming to drive the bot’s actions and the last step is known as launching the attack once infected a bot allows access to admin level operation like gathering and stealing of data reading and rewriting the system data monitoring user activities performing denial of service attacks including other cyber crimes now let’s take a look at the botnet architecture the first type is known as client server model the client server model is a traditional model that operates with the help of a command and control center server and communication protocols like IRC when the boter issues a command to the server it is then relayed to the clients to perform malicious actions then we have peer-to-peer model here controlling the infected bots involves a peer-to-peer network that relies on a decentralized approach that is the ports are topological interconnected and acts as both C and C servers that is the server and the client today hackers adopt this approach to avoid detection and single point failure in the end we will see some points on some counter measure against botnet attacks the first step is to have updated drivers and system updates after that we should avoid clicking random pop-ups or links that we often see on the internet and lastly having certified antivirus anti-spyware softares and firewall installed into a system will protect against malware attack the internet is an endless source of information and data still in some cases we come across some occurrences like cyber attacks hacking force entry which may affect a time on the web hi everyone and welcome to the simply learn channel today we will discuss a topic that secretly records our input data that is known as key loggers but before we begin if you like watching tech videos subscribe to our channel and hit the bell icon to never miss an update to understand the key logging problem better let’s take a look at an example this is June she works in a business firm where she manages the company’s data regularly this is Jacob from the information department who’s here to inform her about some of the security protocols during the briefing she informed him about some of the problems her system was facing with which included slow reaction speed and unusual internet activity as Jacob heard about the problems with the system he thinks of the possibility what could be the reason behind these problems her system was facing with the conclusion that he came across was the key logging issue with unknown to the problem her system was facing with she asked him about some of the details regarding it for today’s topic we learn what exactly key loggers are and how they affect our system what are the harmful effects that key logging can bring into the system to begin with we learn what exactly the key logging program is as the name suggests key logger is a malicious program or a tool that is designed to record keystrokes that are typed during data input and record them into a lock file then the same program secretly sends these log files to its origin where they can be used for malicious acts by the hacker now that we know what the key logging program is let’s take a look how they enter into the system searching for a suitable driver for a system can often lead to the installation of the key logging program into the system if we often visit suspicious sites and uncertified software are installed into our system then if we use unknown links or visiting unknown websites which come through unknown addresses can also be a reason behind the key logging issue entering into the system and lastly there are often cases where different pop-ups that we often see on social sites or different media sites can lead to the installation of key logging program into a system now that we know how the problem gets into the system let’s take a look how to identify whether the system is infected by the key logging issue the key locking issue can be identified if there are often cases when a keyboard lags behind the system the data that we enter sometimes is stuck in between when we type through the input then there are cases when the system freeze occurs unknowingly to what exactly could be the reason behind them and also there are delayed reaction time for different applications that run on the system and lastly there are different cases when we often see suspicious internet activity on the system that we don’t know about this could lead to the identification of a problem into the system now we’ll take a look at different types of key loggers that are present on the net which can harm a system differently the first problem that key loggers arouse is API based the most common key logging case which uses APIs to keep a log of the type data and share it to its origin for malicious purposes each time we press a key the key logger intercepts the signal and logs it then we have form grabbing based key loggers as the name suggests they are a based key loggers that store the form data that is if we often use web forms or different kinds of forms to enter different data they can be recorded into the system by the program and send it to its origin then we have kernelbased key loggers these key loggers are installed deeply into the operating system where they can hide from different antivirus if not checked properly and they record the data that we type on the keyboard and send it to its origin and lastly we have hardware key loggers these key loggers are present directly into the hardware that is they are embedded into system where they record the data that we type on the keyboard now let’s take a look how hackers differentiate different type of recorded data and exploit them when hackers receive information about the target they might use it to blackmail the target which may affect the personal life of the target and also blackmail them for different money related issues then in case of company data that is recorded by the key logging program can also affect the economic value of the company in the market which may lead to the downfall of the company also in some cases the key logging program can also log data about military secrets which may include nuclear codes or security protocols which are necessary to maintain the security of a country now let’s take a look whether mobile devices get infected with the key logging issue or not in the case of hand devices infection of key loggers are low in comparison to the computer systems as they use onscreen keyboard or virtual keyboard but in some cases we often see different kinds of malicious programs getting installed into the hand device if we often visit different uncertified websites or illegal websites or torrent sites and also the device that is infected with the key logging issue or different kind of malicious program can often lead to the exploitation of data that includes photos emails or important files by the hacker or the cyber criminal that installed the particular malicious program into the system now to prevent our system from getting infected by the key locking program let’s take a look at different points the first point includes using of different antivirus softares or

    tools which can prevent the entering of malicious program into the system then keeping system security protocols regularly updated is also a good habit and lastly using virtual keyboard to input our sensitive data which may include bank details login details or different passwords related to different websites now that we have some understanding about the topic of key loggers let’s take a look at the demo to further increase the knowledge about the topic for the first step we have to download some of the important libraries that are required into the system which is this library now we’ll run it the system says the library is already installed into the system now let’s take a look what exactly modules are required from the particular library from this library we’ll import the keyboard module which will help us to record the data that we type on the keyboard now from the same we’ll also import key module and the listener module and also the logging module which will help us to record the data into a log file for the next part we’ll write a piece of code that will allow us to save the data that is recorded by the program into a text file that will be named as key log text file along with the date and time stamp let’s take a look now we’ll provide it with the file name that will be given as key log dot txt file and also so the part where the format of the data is recorded put the brackets over here to contain the file name now we’ll write the format in which the data will be recorded into the log file which will be given as the format would be the message and the time stamp which would be given as along the time stamp given as percentage and ending it with the bracket now for the next step we’ll design two of the functions that will be used into the program that will be termed as wild press function and while release function let’s take a look while press function would be a function that will come into play when the keyboard key has been pressed is pressed and This would go for the format that we designed in the above line and logging the pressed key info a string file to be recorded into the LO file now now we’ll design a function that is while release that will come into play when the escape key has been pressed that is the program will terminate itself and the program will stop from running and in the end we require for the functioning of the program to loop these functions that is while press and while deletes to continue its cycle that will be going for while press and on release will contain while release function as listener and now this part would join the different threads and store them into the LO file now that we have completed the code for the program let’s run it we have to wait for a moment so the program runs it now to verify the program let’s open notepad and on the notepad we’ll write hello world which will be the basic whether the program is working or not let’s take a look and we’ll go for the main page on Jupyter notebook and refresh the page go to the bottom over here we see the key log text that is the text file that we created let’s open it and over here we have the data that is created as we started with note then this is the hello world part that we created just now which shows that the program we created is working properly now that we have reached the end of the module let’s take a look at the summary firstly we learned what exactly key loggers are then we understood what different modes are present how the system get infected with a key logging problem then we learned how to detect the problem into our system then we learned what different types of key loggers are present on the net we also understood how hackers use the recorded data from the program and we also learned whether mobile devices get infected with the key logging problem or not and lastly we understood what different points can be taken to prevent the entering of the key logging problem into the system and before we begin if you are someone who is interested in building a career in cyber security or to become an ethical hacker by graduating from the best universities or a professional who elicits to switch career with cyber security or ethical hacker by learning from the experts then try using a short to simply learn postgraduate program in cyber security with modules from MIT Schwarzman College of Computing the course link is mentioned in the description box below that will navigate you to the course page where you can find a complete overview of the program being offered before we learn about the Pegasus platform let us understand what spyware is and its working spyware is a category of malware that can gather information regarding a user or a device straight from the host machine it is mostly spread by malicious links via email or chat applications when a link with the malware is received clicking on this link will activate the spyware which allows the hacker to spy on all our user information with some spyware systems even clicking on the link isn’t necessary to trigger the malicious payload this can ultimately cause security complications and further loss of privacy one such spyware system that is making the rounds in the tech industry today is Pegasus the Pegasus is a spyware system developed by an Israeli company known as the NSO group it runs on mainly mobile devices spanning across the major operating systems like the Apple’s iOS on iPhone and the standard Android versions this is not a newly developed platform since Pegasus has existed since as early as 2016 a highly intricate spyway program that can track user location read text messages scan through mobile files access device camera and microphone to record voice and video pegasus has all the tools necessary to enforce surveillance for any client that wishes to buy its services initially the NSO group had designed the software to be used against terrorist factions of the world with more and more encrypted communication channels coming to the forefront Pegasus was designed to maintain control over the data transmission that can be a threat to national security unfortunately the people who bought the software had complete control over who how and up to what level they can put surveillance limits on eventually the primary clients became sovereign nations spying on public information that is supposed to stay private became really easy with this service multiple devices can be affected with the same spyware system to create a network information this network keeps feeding data to the host to understand how a network can be created let’s know how a mobile device can be affected by Pegasus we all communicate with friends and family over instant messaging applications and email in some instances if you check your inbox on a regular basis you must have noticed that we receive some spam emails that the mail providers like Gmail and Yahoo can just filter into the spam folder some of these messages bypass this filter and make their way into a person’s inbox they look like generic emails which are supposed to be safe the Pegasus spyware targets such occurrences bypassing malicious messages and links which install the necessary spy software on the user’s mobile device be it Android or an iPhone this isn’t unique to the email ecosystem since it’s equally likely to be targeted by SMS text WhatsApp Instagram or even the most secure messaging apps like Signal and Threma once the malicious links are clicked a spyware package is downloaded and installed on the device after the spyware is successfully installed the perpetrator who sent the payload to the victim can monitor everything the user does pegasus can collect private emails passwords images videos and every other piece of information that passes through the device network all this data is transmitted back to the central server where the primary spying organization can monitor the activities at a granular level this is not even surface level since complex spyware software like Pegasus can access the root files on our mobiles these root files hold information that is crucial to the working of the Android and iOS operating systems leaking such private information is a massive blow to the security and the privacy of an individual the information that may seem trivial like the name of your Wi-Fi connection or the last time you ordered an item from Amazon are indeed all valuable information this exploitation is primarily possible due to the zeroday vulnerabilities known as bugs in the software development process the zeroday bugs are the ones that have just been discovered by some independent security company or a researcher once they are found reporting these vulnerabilities to the developer of the platform which would be either Google for Android or Apple for iOS is the right thing to do however many such critical bugs make their way onto the dark web where hackers can use them to create exploits these exploits are then sent to innocent users with a link or a message like we had discussed before Pegasus was able to affect the latest devices with the all the security patches installed but some bugs are not reported to the developers or just cannot be fixed without breaking some core functionality these become the gateway for spyware to enter into the system you can never be 100% safe but you sure can give it all in protecting yourself the one thing where Pegasus stands out is it zeroclick action feature usually in spam emails the malicious code is activated when the user clicks the malware link a user doesn’t need to click the link in the new version of the Pegasus and a few other spyware programs once the message arrives in the inbox of WhatsApp Gmail or any other chat applications the spyware gets activated and everything can be recorded and sent back to the central server the primary issue with being affected by spyware as a victim is detection unlike crypto miners and Trojans spying services usually do not demand many system resources which makes them tough to detect after they have been activated since many devices slow down after a couple of years any kind of performance set due to such spyware is often attributed to poor software longevity by the users they do not check meticulously for any other causes that is causing the slowdown when left unchecked these devices can capture voice and video from the mobile sensors while keeping the owner in the dark let’s take a moment to check if you are well aware of the causes of such attacks how do users fall prey to such spyware programs a by installing untested software B by clicking on the third party links from email and messages C by not keeping their apps and phones updated or D all of the above let us know your answers in the comment section below and we will reveal the correct answer next week but what about the unaffected devices the vulnerable ones while we cannot be certain of our security there are a few things we can do to boost our device be it against Pegasus or the next big spyware on the market let’s say we are safe now and we have the time to take the necessary steps to prevent a spyware attack what are the things we can go for a primary goal must always be to keep our apps and the operating system updated with the latest security patches the vulnerabilities that the exploits target are often discovered by developers from Google and Apple which send the security patches quickly this can be done for individual apps as well so keeping them updated is of utmost importance while the most secure devices have fallen prey to Pegasus as well a security patch from developers may help in minimizing the damage at a later stage or maybe negate the entire spyware platform altogether another big factor is the spread of malware is the trend of sideloading Android applications using APK files downloading such apps from a third party website have no security checks involved and are mostly responsible for adear and spyware invasions on user devices avoiding the sideloading of apps would be a major step in protecting yourself we often receive spam emails or texts from people we may not know on social medias they are accompanied with links that allow malware to creep into our device we should try to follow the trusted websites and not click on any links that redirect us to unknown domains spyware is a controversial segment in governance while the ramifications are pretty extreme in theory it severely impacts user privacy against authoritarian regimes sufficient resources and a contingent plan can alter the false veil of democracy altogether even if our daily life is rather simplistic we must understand that privacy is not about what we have to hide instead it portrays the things we have to protect it stands for everything we have to share with the outside world both rhetorically and literally hey everyone today we look at the hack which took the world by storm and affected multiple governments and corporations the Solar Winds attack the global statistics indicate that upward of 18,000 customers have been affected potentially needing billions to recover the losses incurred before we have a look at this hack make sure to subscribe to our channel and hit the notification bell to never miss an update from Simpler the date is December 8th 2020 fire a global leader in companies specializing in cyber security released a blog post that caught the attention of the entire IT community a software known as Orion which was developed by Solar Winds Incorporated had become a victim of a remote access Trojan or a rat the breach was estimated to be running since the spring of 2020 and went virtually unnoticed for months the reveal sent the developers of the Orion software into a frenzy as they quickly released a couple of hot fixes for their platform in order to mitigate this threat and prevent further damage but how did this come into existence we first need to understand the platform which was responsible for this breach solowins a software company based in Texas United States had developed a management platform known as Orion itering to corporations and governments worldwide orion was responsible for the monitoring and management of IT administration this included managing the client servers virtualization components and even the organization’s network infrastructure that bought the platform solowins claims they have more than 300,000 clients including US government agencies and several Fortune 500 companies this entire chain can be classified as a supply chain attack in this variant of cyber crime the hackers target relatively weaker links in an organization’s chain of control and delivery these are prefilibly services rendered by a third party since there is no direct jurisdiction over it in this case the Orion platform was the primary target the culprit however was software updates the update server for Solowins Orion had a malicious version attached with malware or a Trojan to be precise this was made possible since the code repository that handled the software updates was breached once the update server repository was compromised the source code of the applications became open to modification and malicious code found its way onto the software the remote access Trojan was attached to a potential update nicknamed the Sunburst update this update gave hackers back door access to any client that uses the correct version on its release many clients believed the update to be legitimate since it came from the right source and they had no reason to believe otherwise american government agencies were supposedly hit the hardest as the list of victims included the US departments of homeland security Treasury and Health several private companies like Cisco Nvidia and Intel were compromised according to a list published by the cyber security firm Trusk most of the companies had issues quick updates to fix this vulnerabilities introduced by the software while the actual perpetrators have never been found it is believed that this was an act of crossber corporate espionage conducted by state sponsored hackers either from Russia or China before we move forward let’s take a recap of the things we learned what category of malware was responsible for the Solar Winds hack was it one a virus a remote access Trojan a spyware or a worm let us know your answers in the comment section right away and we will reveal the correct answer in a week coming to possible reparations the Biden government has launched a full investigation on the effects and the repercussions of this breach there are a couple of things that we as consumers must always tend to when working our way through the worldwide web using a password manager is highly recommended which can generate secure alpha numeric passwords you must also use different passwords for different accounts thereby reducing the chances of a single point of failure should one of those accounts get breached usage of two-factor authentication applications is also encouraged since it acts as a safety net if hackers directly get a hold of our credentials clicking on unknown links transmitted via emails is also a strict no as is installing applications from unverified sources the Solar Winds hack is estimated to cost the parent company nearly $18 million as reparations making it one if not the biggest hacks in cyerspace history as recently as of July 2021 the hackers accessed some US attorneys Microsoft 365 email accounts as part of the attack criminal organizations like the FBI and CIA are determined to figure out the culprits responsible for this debacle however the intricacy and the full extent of the breach makes it a way more complicated job than it looks on paper the day is 26th February 2022 the world is hit with breaking news that Russian state TV channels have been hacked by Anonymous a activist collective and movement who have made a name taking part in multiple cyber wars in the past decade this was in response to the Russian aggression on Ukrainian territory in the hopes of annexation anonymous hacked the Russian state TV networks to combat propaganda in Russia and highlight the damage to life meed out by the Kremlin in Ukraine they also hacked 120,000 Russian troops personal information and the Russian central bank stealing 35,000 files this served as a clear indicator of how cyber war can change the momentum in battle something which people had never seen so closely so what is cyber war a digital assault or series of strikes or hacks against a country is sometimes referred to as a cyber war it has the ability to cause havoc on government and civilian infrastructure as well as disrupt essential systems causing state harm and even death in this day and age the internet plays a bigger role than just watching videos and learning content it’s where you have your personal data and carry financial transactions so rather than resorting to physical violence cyber wars become the new means to cause havoc considering the vulnerability of the data passing through the internet in most circumstances cyber warfare involves the nation state attacking another in certain cases the assaults are carried out by terrorist organizations or non-state actors pursuing a hostile nation’s aim in June 2021 Chinese hackers targeted organizations like Verizon to secure remote access to their networks stuckset was a computer worm designed to attack Iran’s nuclear facilities but evolved and expanded to many other industrial and energy producing sites in 2010 since the definition of cyber war is so vague applying rules and sanctions based on digital assault is even tougher making the field of cyber warfare a lawless land not bound by any rules or policies there are multiple ways in which these attacks can be carried out a major category of cyber attack is espionage espionage entails monitoring other countries to steal critical secrets this might include compromising vulnerable computer systems with botn nets or spear fishing attempts before extracting sensitive data in cyber warfare the next weapon in cyber war is sabotage government agencies must identify sensitive data and its dangers if it is exploited insider threats such as disgruntled or irresponsible personnel or government staff with ties to the attacking country can be used by hostile countries or terrorists to steal or destroy information by overwhelming a website with bogus requests and forcing it to handle them denial of service attacks prohibit real users from accessing it attacking parties may use this form of assault to disrupt key operations and systems and prevent citizens military and security officials and research organizations from accessing sensitive websites but what benefits does cyber war offer in contrast to traditional physical warfare the most important advantage is the ability to conduct attacks from anywhere globally without having to travel thousands of miles as long as the attacker and target are connected to the internet organizing and launching cyber wars is relatively less tedious than physical warfare people living in or battling for a country are subjected to propaganda attacks in an attempt to manipulate their emotions and thoughts digital infrastructure is highly crucial today’s modern world starting from communication channels to secure storage servers crippling a country’s footprint and control on the internet is very damaging but what are some of the ways we as citizens protect ourselves in the case of a cyber war in the unfortunate event that your country is involved in warfare be sure to fact check every piece of information and follow only trusted sources in that frame of time even conversations online should be limited to a need to know basis considering propaganda campaigns have the power to influence the tide of war drastically it is highly crucial to follow basic security guidelines to secure our devices like regularly updating our operating systems occasionally running full system antivirus scans etc if your country or organization is being attacked having devices segregated in a network goes a long way in bolstering security try to avoid sharing a lot of personal data online in this era of Instagram and Facebook divulging private information can be detrimental to keeping a secure firewall for your data the more information an attacker has access to the higher his chances of being able to devise a plan to infiltrate defenses and if you’re someone who is interested in building a career in cyber security that is by graduating from the best universities or a professional who elicits to switch careers with cyber security by learning from the experts then try giving a shot to simply learn post-graduate programming cyber security with modules from the MIT Schwarzman College of Engineering and the course link is mentioned in the description box that will navigate you to the course page where you can find a complete overview of the program being offered during data transmission there are various external factors which can affect the transmission of data over a network channel to prevent such cases from happening we use internet protocol security which we’ll be discussing in this session on IPSec explain hi guys and welcome to yet another interesting video by simply learn but before we begin if you love watching tech videos subscribe to our channel and hit the bell icon to miss an update from us now without further ado let’s take a look at the agenda for this session to begin with we will look into what is IPSec continuing with why do we use IPSec in a network followed by components of IPSec modes of IP security as for the last topic we will look into working steps involved in IP security let’s begin with the first setting that is what is IPSec ipsec internet protocol security is defined as a set of framework and protocol to ensure data transmission over a network this protocol was initially defined of two main protocols for data security over a network channel which were authentication header which is responsible for data integrity and anti-replay services and the second protocol is encapsulating security payload in short ESP which includes data encryption and data authentication now let’s move on to the next setting that is why do we use IPSec in a network ipsec is used to secure sensitive data and information such as company data clinical data bank data and various sensitive information regarding an institution which are used during data transmission over a network channel the use of VPNs that are virtual private networks and apply IPSec protocols to encrypt the data for end to-end transmission let’s continue with why do we use IPSec services ipsec is also used to encrypt data for application layer in the OSI model and provide security for sharing data over network routers and data authentication let’s take a look at the working of IPSC services to begin with we have two different system system one and system two which will establish a network channel and then the encryption of data will takes place when one host will share the data to the second host during this IP sec services will secure the data that is to be transferred over the network channel by applying router encryption and authentication now let’s move on to the next topic that is components of IPSec the IPSec services comprises of multiple protocols that ensure the data transmission over the network channel the first one is encapsulating security payload protocol in short ESP this protocol of IP security provides data encryption and authentication services and it also authenticates and encrypt the data packet in the transmission channel moving on we have authentication header in short ah similar to ESP the authentication header also provides all the security services but it does not encrypt the data it also protects the IP packet and adds additional headers to the packet header the modified IP datagramgram looks this way where the IP components are included at the second position the seventh position and the sixth position along with the authentication of data services over the network channel moving on we have internet key exchange IKE this protocol provides protection for content data and also changes the attribute of the original data to be shared by implementing SHA and MD5 algorithms they also check the message for authentication and then only is forwarded to the receiver side for example this is the original data packet we are used to with IP header part TCP UDP and data whereas this is the modified IPSC data packet where TSP header is added between IP header and the TCP protocol now let’s move on to the next heading that is modes of IPSec there are basically two types of IPSec modes available for data transmission over the network channel where the first one is tunnel mode this mode of transmission is used to secure gateway to gateway data it is applied when the final destination of the data is to be connected to a sender site through a connection gateway over the internet for example we have two host host A and host B through the host A we are sending a message to host B which will pass through a gateway at host A point and it passes through a gateway to host B this is a basic format for gateway to gateway data transmission and the given IP datagramgram format is used for tunnel mode now let’s move on to the second mode of IPSec that is transport mode this mode of IPSec is used to protect protocols like TCP or UDP and is used to ensure end to end communication unlike tunnel mode the transport mode data at authentication header and encapsulating security payload for security purpose in the IP header this is the modified IP datagramgram for transport mode the point to be noted is the IPSec header is always added between IP header and TCP header now let’s move on to the last setting for this session on IPSec that is the working steps involved in IP security in general there are five steps involved in the working of IPSec to ensure data transmission over a network channel the first step is host recognition in the first step the host system will check if the packet is to be transmitted or not by automatically triggering the security policy for the data which is implemented by the sender side for proper encryption then the second step is known as IKE phase one in this step the two host devices the sender and the receiver side will authenticate each other to establish a secure network channel it is comprised of two modes the main mode this provides much better security with a proper time limit and the second mode known as aggressive mode as the name suggests it establishes the IPSC protocol much faster in comparison to main mode let’s move on to the third step which is IKE phase 2 after the second step the host decide the type of cryptography algorithm to apply over the session in the network channel and the secret key for the algorithm to be used to encrypt the data for transmission then we have IPSec transmission this step involves the actual transfer of data over the network channel using various protocols used in IPSec security which are implemented under the tunnel condition and the last step is IPSec termination after the completion of data exchange or session timeout the IPSec tunnel is terminated and the security key established is discarded by both the host system network security is a set of technologies that protects the usability and integrity of a company’s infrastructure by preventing the entry or proliferation within a network it architecture comprises of tools that protect the network itself and the applications that run over it effective network security strategies employ multiple lines of defense that are scalable and automated each defensive layer here enforces a set of security policies which are determined by the administrator beforehand this aims at securing the confidentiality and accessibility of the data and the network the every company or organization that handles a large amount of data has a degree of solutions against many cyber threats the most basic example of network security is password protection it has the network the user chooses recently network security has become the central topic of cyber security with many organizations involving applications from people with skills in this area it is crucial for both personal and professional networks most houses with highspeed internet have one or more wireless routers which can be vulnerable to attacks if they’re not adequately secured data loss theft and sabotage risk may be decreased with the usage of a strong network security system the workstations are protected from hazardous spyware thanks to network security additionally it guarantees the security of the data which is being shared over a network by dividing information into various sections encrypting these portions and transferring them over separate pathways network security infrastructure offers multiple levels of protection to thwart man-in-the-middle attacks preventing situations like eavesdropping among other harmful attacks it is becoming increasingly difficult in today’s hyperconnected environment as more corporate applications migrate to both public and private clouds additionally modern applications are also frequently virtualized and dispersed across several locations some outside the physical control of the IT team network traffic and infrastructure must be protected in these cases since assaults on businesses are increasing every single day we now understood the basics of network security but we need to understand how network security works in the next section in slightly more detail network security revolves around two processes authentication and authorization the first process which is authentication is similar to access path which ensure that only those who have the right to enter a building in other words authentication checks and verifies that it is indeed the user belonging to the network which is trying to access or enter it thereby preventing unauthorized intrusions next comes authorization this process decides the level of access provided to the recently authenticated user for example network admin needs access to the entire network whereas those working within it probably need access to only certain areas within the network based on the network users role the process of determining the level of access or permission level is known as authorization today’s network architecture is complex and faces a threat environment that is always changing and attackers that are always trying to find and exploit vulnerabilities these vulnerabilities can exist in many areas including devices data applications users and locations for this reason many network security management tools and applications are in use today that address individual threats when just a few minutes of downtimes can cause widespread disruption and massive damage to an organization’s bottom line and reputation it is essential that these protection measures are in place beforehand now that you know a little about network security and its working let’s cover the different types of network security the fundamental tenant of network security is the layering of protection for massive networks and stored data that ensure the acceptance of rules and regulations as a whole there are three types the first of which is physical security the next being technical and the third being administrative let’s look into physical security first this is the most basic level that includes protecting data and network to unauthorized personnel from acquiring control over the confidentiality of the network this include external peripherals and routers that might be used for cable connections the same can be achieved by using devices like biometric systems physical security is critical especially for small businesses that do not have many resources to devote to security personnel and the tools as opposed to large firms when it comes to technical network security it focuses mostly on safeguarding data either kept in the network or engaged in network transitions this kind fulfills two functions one is defense against unauthorized users the other is a defense against malleent actions the last category is administrative this level of network security protects user behavior like how the permission has been granted and how the authorization process takes place this also ensures the level of sophistication the network might need to protect it through all the attacks this level also suggests necessary amendments that have to be done to the infrastructure i think that’s all the basics that we need to cover on network security in which our next topic we’re going to go through two mediums of network security which are the transport layer and the application layer so transport layer is a way to secure information as it is carried over the internet with users browsing websites emails instant messaging etc tls aims to provide a private and secure connection between a web browser and a website server it does this with the cryptographic handshake between two systems using public key cryptography the two parties through the connection and exchange a secret token and once each machine validates this token it is used for all communications the connection employs lighter symmetric cryptography to save bandwidth and processing power since the application layer is the closest layer to the end user it provides hackers with the largest threat surface poor app layer security can lead to performance and stability issues data theft and in some cases the network being taken down examples of application layer attacks include distributed denial of service attacks or DDoS attacks HTTP floods HQ injections cross-sight scripting etc most organizations have an arsenal of application layer security protections to combat these and more such as web application firewalls secure web gateway services etc now that we have the theory behind network security has been covered in detail let us go through some of the tools that can be used to enforce these network security policies the first tool to be covered in this section is a firewall a firewall is a type of network security device that keeps track of incoming and outgoing network traffic and it decides which traffic to allow or deny in accordance to a set of security rules for more than 25 years firewalls have served as network security’s first line of defense they provide a barrier between trustworthy internal protected and regulated networks from shady external networks like the internet at some points the next tool which can be used to bolster network security is a virtual private network or VPN for short it’s an encrypted connection between a device and a network via the internet the encrypted connection aids the secure transmission of sensitive data it makes it impossible for unauthorized parties to eaves drop on the traffic and enables remote work for the user the usage of VPN technology is common in both corporate and personal networks next we cover the importance of intrusion prevention systems in network security or IPS frameworks an intrusion prevention system is a network security tool that continually scans a network for harmful activity and responds to it when it does occur by reporting blocking or discarding it it can be either hardware or software it’s more sophisticated than an intrusion detection system or an IDS framework which can just warn an administrator and merely identify harmful activities while in the case of an IPS it actually takes against that activity the next tool in this section and the final one are going to be behavioral analytics behavioral analytics focus more on the statistics that are being carried over and stored through months and years of usage once some kind of similar pattern is noted but the IT administrator can detect some kind of attack the similar attacks can be stopped and the security can be further enhanced now that we have covered all that we need to know about network security the necessary tools it required types etc let’s go through the benefits of network security as a for the first which is protection against external threats the objective for cyber assaults can be as varied as the defenders themselves although they’re typically initiated for financial gain whether they are industrial spies activists or cyber criminals these bad actors all have one thing in common which is how quick clever and covert the attacks are getting a strong cyber security posture that considers routine software updates may assist firms in identifying and responding to the abuse techniques tools and the common entry points the next benefit is protection against internal threats the human aspect continues to be the cyber security systems weakest link insider risk can originate from current or former workers third party vendors or even trusted partners and they can be unintentional careless or downright evil aside from that the rapid expansion of remote work and the personal devices used for business purposes while even IoT devices in remote locations can make it easier for these kind of threats to go undetected until it’s too late however by proactively monitoring networks and managing access these dangers may be identified and dealt with before they become expensive disasters the third benefit is increased productivity it is nearly impossible for employees to function when networks and personal devices are slowed to a crawl by viruses and other cyber attacks during the operation of website and for the company to run you may significantly minimize violations and the amount of downtime required to fix the breach by implementing various cyber security measures such as enhanced firewalls virus scanning and automatic backups employee identification of possible email fishing schemes suspicious links and other malicious criminal activities can also be aided by education and training another benefit is brand trust and reputation customer retention is one of the most crucial elements in business development customers today place a premium on maintaining brand loyalty through a strong cyber security stance since this is the fastest way to get other businesses back get referrals and sell more tickets overall additionally it helps manufacturers get on the vendor list with bigger companies as a part of the supply chain which is only as strong as its weakest link this opens possibilities for potential future endeavors and development with the rise in censorship and general fear over privacy loss consumer security is at an all-time high risk technology has made our life so much easier while putting up a decent target on our personal information it is necessary to understand how to simultaneously safeguard our data and be up to date with the latest technological developments maintaining this balance has become easier with cryptography taking its place in today’s digital world so hey everyone this is Bever from SimplyLearn and welcome to this video on cryptography but before we begin if you love watching tech videos subscribe to our channel and hit the bell icon to never miss an update from Simply Learn so here’s a story to help you understand cryptography meet an wanted to look for a decent discount on the latest iPhone she started searching on the internet and found a rather shady website that offered a 50% discount on the first purchase once Anne submitted her payment details a huge chunk of money was withdrawn from her bank account just moments after devastated and quickly realized she had failed to notice that the website was an HTTP web page instead of an HTTPS one the payment information submitted was not encrypted and it was visible to anyone keeping an eye including the website owner and hackers had she used a reputed website which has encrypted transactions and employs cryptography a iPhone enthusiast could have avoided this particular incident this is why it’s never recommended to visit unknown websites or share any personal information on them now that we understand why cryptography is so important let’s take a look at the topics to be covered today we take a look into what cryptography is and how it works we learn where cryptography is being used in our daily lives and how we are benefiting from it then we will understand the different types of cryptography and their respective uses moving on we will look at the usage of cryptography in ancient history and a live demonstration of cryptography and encryption in action let’s now understand what cryptography is cryptography is the science of encrypting or decrypting information to prevent unauthorized access we transform our data and personal information so that only the correct recipient can understand the message as an essential aspect of modern data security using cryptography allows the secure storage and transmission of data between willing parties encryption is the primary route for employing cryptography by adding certain algorithms to jumble up the data decryption is the process of reversing the work done by encrypting information so that the data becomes readable again both of these methods form the basis of cryptography for example when simply learn is jumbled up or changed in any format not many people can guess the original word by looking at the encrypted text the only ones who can are the people who know how to decrypt the coded word thereby reversing the process of encryption any data pre- encryption is called plain text or clear text to encrypt the message we use certain algorithms that serve a single purpose of scrambling the data to make them unreadable without the necessary tools these algorithms are called ciphers they are a set of detailed steps to be carried out one after the other to make sure the data becomes as unreadable as possible until it reaches the receiver we take the plain text pass it to the cipher algorithm and get the encrypted data this encrypted text is called the cipher text and this is the message that is transferred between the two parties the key that is being used to scramble the data is known as the encryption key these steps that is the cipher and the encryption key are made known to the receiver who can then reverse the encryption on receiving the message unless any third party manages to find out both the algorithm and the secret key that is being used they cannot decrypt the messages since both of them are necessary to unlock the hidden content wonder what else we would lose if not for cryptography any website where you have an account can read your passwords important emails can be intercepted and their contents can be read without encryption during the transit more than 65 billion messages are sent on WhatsApp every day all of which are secured thanks to end-to-end encryption there is a huge market opening up for cryptocurrency which is possible due to blockchain technology that uses encryption algorithms and hashing functions to ensure that the data is secure if this is of particular interest to you you can watch our video on blockchain the link of which will be in the description of course there is no single solution to a problem as diverse as explained there are three variants of how cryptography works and is in practice they are symmetric encryption asymmetric encryption and hashing let’s find out how much we have understood until now do you remember the difference between a cipher and cipher text leave your answers in the comments and before we proceed if you find this video interesting make sure to give it a thumbs up before moving ahead let’s look at symmetric encryption first symmetric encryption uses a single key for both the encryption and decryption of data it is comparatively less secure than asymmetric encryption but much faster it is a compromise that has to be embraced in order to deliver data as fast as possible without leaving information completely vulnerable this type of encryption is used when data rests on servers and identifies personnel for payment applications and services the potential drawback with symmetric encryption is that both the sender and receiver need to have the same secret key and it should be kept hidden at all times caesar cipher and machine are both symmetric encryption examples that we will look into further for example if Alice wants to send a message to Bob she can apply a substitution cipher or a shift cipher to encrypt the message but Bob must be aware of the same key itself so he can decrypt it when he finds it necessary to read the entire message symmetric encryption uses one of the two types of ciphers stream ciphers and block ciphers block ciphers break the plain text into blocks of fixed size and use the key to convert it into cipher text stream ciphers convert the plain text into cipher text one bit at a time instead of resorting to breaking them up into bigger chunks in today’s world the most widely used symmetric encryption algorithm is AES 256 that stands for advanced encryption standard which has a key size of 256 bit with 128 bit and 196 bit key sizes also being available other primitive algorithms like the data encryption standard that is the dees the triple data encryption standard 3DES and blowfish have all fallen out of favor due to the rise of AES aes chops ups the data into blocks and performs 10 plus rounds of obscuring and substituting the message to make it unreadable asymmetric encryption on the other hand has a double whammy at its disposal there are two different keys at play here a public key and a private key the public key is used to encrypt information pre-transit and a private key is used to decrypt the information postrit if Alice wants to communicate with Bob using asymmetric encryption she encrypts the message using Bob’s public key after receiving the message Bob uses his own private key to decrypt the data this way nobody can intercept the message in between transmissions and there is no need for any secure key exchange for this to work since the encryption is done with a public key and the decryption is done with a private key that no one except Bob has access to both the keys are necessary to read the full message there is also a reverse scenario where we can use a private key for encryption and the public key for decryption a server can sign non-confidential information using its private key and anyone who has its public key can decrypt the message this mechanism also proves that the sender is authenticated and there is no problem with the origin of the information rsa encryption is the most widely used asymmetric encryption standard it is named after its founders Revest Shamir and Edelman and it uses block ciphers that separate the data into blocks and obscure the information widely considered the most secure form of encryption albeit relatively slower than AES it is widely used in web browsing secure identification VPNs emails and chat applications with so much hanging on the keys secrecy there must be a way to transmit the keys without others reading our private data many systems use a combination of symmetric encryption and asymmetric encryption to bolster security and match speed at the same time since asymmetric encryption takes longer to decrypt large amounts of data the full information is encrypted using a single key that is symmetric encryption that single key is then transmitted to the receiver using asymmetric encryption so you don’t have to compromise either way another route is using the defy helman key exchange which relies on a one-way function and is much tougher to break into the third variant of cryptography is termed as hashing hashing is a process of scrambling a piece of data beyond recognition it gives an output of fixed size which is known as the hash value of the original data or just hash in general the calculations that do the job of messing up the data collection form the hash function they are generally not reversible without resilient brute force mechanisms and are very helpful when storing data on website servers that need not be stored in plain text for example many websites store your account passwords in a hashed format so that not even the administrator can read your credentials when a user tries to login they can compare the entered password’s hash value with the hash value that is already stored on the servers for authentication since the function will always return the same value for the same input cryptography has been in practice for centuries julius Caesar used a substitution shift to move alphabets a certain number of spaces beyond their place in the alphabet table a spy can’t decipher the original message at first glance for example if he wanted to pass confidential information to his armies and decides to use a substitution shift of plus two A becomes C B becomes D and so on the word attack when passed through a substitution shift of plus three becomes dwwdefn this cipher has been appropriately named the Caesar cipher which is one of the most widely used algorithms the enigma is probably the most famous cryptographic cipher device used in ancient history it was used by the Nazi German armies in the world wars they were used to protect confidential political military and administrative information and it consisted of three or more rotors that scrambled the original message depending on the machine state at that time the decryption is similar but it needs both machines to stay in the same state before passing the cipher text so that we receive the same plain text message let’s take a look at how our data is protected while we browse the internet thanks to cryptography here we have a web-based tool that will help us understand the process of RSA encryption we see the entire workflow from selecting the key size to be used until the decryption of the cipher text in order to get the plain text back as we already know RSA encryption algorithm falls under the umbrella of asymmetric key cryptography that basically implies that we have two keys at play here a public key and a private key typically the public key is used by the sender to encrypt the message and the private key is used by the receiver to decrypt the message there are some occasions when this allocation is reversed and we will have a look at them as well in RSA we have the choice of key size we can select any key from a 512 bit to 124 bit all the way up to a 496 bit key the longer the key length the more complex the encryption process becomes and thereby strengthening the cipher text although with added security more complex functions take longer to perform the same operations on similar size of data we have to keep a balance between both speed and strength because the strongest encryption algorithms are of no use if they cannot be practically deployed on systems around the world let’s take a 124-bit key over here now we need to generate the keys this generation is done by functions that operate on passphrases the tool we are using right now generates the pseudo random keys to be used in this explanation once we generate the keys you can see the public key is rather smaller than the private key which is almost always the case these two keys are mathematically linked with each other they cannot be substituted with any other key and in order to encrypt the original message or decrypt the cipher text this pair must be kept together the public key is then sent to the sender and the receiver keeps the private key with himself in this scenario let’s try and encrypt a word simply learn we have to select if the key being used for encryption is either private or public since that affects the process of scrambling the information since we are using the public key over here let’s select the same and copy it and paste over here the cipher we are using right now is plain RSA there are some modified ciphers with their own pros and cons that can also be used provided we use it on a regular basis and depending on the use case as well once we click on encrypt we can see the cipher text being generated over here the pseudo random generating functions are created in such a way that a single character change in the plain text will trigger a completely different cipher text this is a security feature to strengthen the process from brute force methods now that we are done with the encryption process let’s take a look at the decryption part the receiver gets this cipher text from the sender with no other key or supplement he or she must already possess the private key generated from the same pair no other private key can be used to decrypt the message since they are mathematically linked we paste the private key here and select the same the cipher must always so be the same used during the encryption process once we click decrypt you can see the original plain text we had decided to encrypt this sums up the entire process of RSA encryption and decryption now some people use it the other way around we also have the option of using the private key to encrypt information and the public key to decrypt it this is done mostly to validate the origin of the message since the keys only work in pairs if a different private key is used to encrypt the message the public key cannot decrypt it conversely if the public key is able to decrypt the message it must have been encrypted with the right private key and hence the rightful owner here we just have to take the private key and use that to encrypt the plain text and select the same in this checkbox as well you can see we have generated a completely new cipher text this cipher text will be sent to the receiver and this time we will use the public key for decryption let’s select the correct checkbox and decrypt and we still get the same output now let’s take a look at practical example of encryption in the real world we all use the internet on a daily basis and many are aware of the implications of using unsafe websites let’s take a look at Wikipedia here pretty standard HTTPS website where the edge stands for secured let’s take a look at how it secures that data wireshark is the world’s foremost and most widely used network protocol analyzer it lets you see what’s happening on your network at a microscopic level and we are going to use the software to see the traffic that is leaving our machine and to understand how vulnerable it is since there are many applications running in this machine let’s apply a filter that will only show us the results related to Wikipedia [Music] let’s search for something that we can navigate the website with okay once we get into it a little you can see some of the requests being populated over here let’s take a look at the specific request these are the data packets that basically transport the data from our machine to the internet and vice versa as you can see there’s a bunch of gibberish data here that doesn’t really reveal anything that we searched or watched similarly other secured websites function the same way and it is very difficult if at all possible to snoop on user data this way to put this in perspective let’s take a look at another website which is a HTTP web page this has no encryption enabled from the server end which makes it vulnerable to attacks there is a login form here which needs legitimate user credentials in order to grant access let’s enter a random pair of credentials these obviously won’t work but we can see the manner of data transfer unsurprisingly we weren’t able to get into the platform instead we can see the data packets let’s apply a similar filter that will help us understand what request this website is sending these are the requests being sent by the HTTP login form to the internet if we check here you see whatever username and password that we are entering we can easily see it with the wireshark now we used a dummy pair of credentials if we select the right data packet we can find a correct credentials if any website had asked for a payment information or a legitimate credentials it would have been really easy to get a hold of these to reiterate what we have already learned you must always avoid HTTP websites and just unknown or not trustworthy websites in general because the problem we saw here is just the tip of the iceberg even though cryptography has managed to lessen the risk of cyber attacks it is still prevalent and we should always be alert to keep ourselves safe online there are two types of encryption in cryptography symmetric key cryptography and asymmetric key cryptography both of these categories have their pros and cons and differ only by the implementation today we are going to focus exclusively on symmetric key cryptography let us have a look at its applications in order to understand its importance better this variant of cryptography is primarily used in banking applications where personally identifiable information needs to be encrypted with so many aspects of banking moving onto the internet having a reliable safety net is crucial symmetric cryptography helps in detecting bank fraud and boost the security index of these payment gateways in general they are also helpful in protecting data that is not in transit and rest on servers and data centers these centers house a massive amount of data that needs to be encrypted with a fast and efficient algorithm so that when the data needs to be recalled by the respective service there is the assurance of minor to no delay while browsing the internet we need symmetric encryption to browse secure HTTPS websites so that we get an all-around protection it plays a significant role in verifying website server authenticity exchanging the necessary encryption keys required and generating a session using those keys to ensure maximum security this helps us in preventing the rather insecure HTTP website format so let us understand how symmetric key cryptography works first before moving on to the specific algorithms symmetric key cryptography relies on a single key for the encryption and decryption of information both the sender and receiver of the message need to have a pre-shared secret key that they will use to convert the plain text into cipher text and vice versa as you can see in the image the key used for encryption is the same key needed for decryptting the message at the other end the secret key shouldn’t be sent along with the cipher text to the receiver because that would defeat the entire purpose of using cryptography key exchange can be done beforehand using other algorithms like the defy helman key exchange protocol for example for example if Paul wants to send a simple message to Jane they need to have a single encryption key that both of them must get secret to prevent snooping on by malicious actors it can be generated by either one of them but must belong to both of them before the messages start flowing suppose the message I am ready is converted into cipher text using a specific substitution cipher by Paul in that case Jane must also be aware of the substitution shift to decrypt the cipher text once it reaches her irrespective of the scenario where someone manages to grab the cipher text mid-transit to try and read the message not having the secret key renders everyone helpless looking to snoop in the symmetric key algorithms like the data encryption standard have been in use since the 1970s while the popular ones like the EES have become the industry standard today with the entire architecture of symmetric cryptography depending on the single key being used you can understand why it’s of paramount importance to keep it secret on all occasions the side effect of having a single key for the encryption and decryption is it becomes a single point of failure anyone who gets their hand on it can read all the encrypted messages and do so mainly without the knowledge of the sender and the receiver so it is the priority to keep the encryption and decryption key private at all times should it fall into the wrong hands the third party can send messages to either the sender or the receiver using the same key to encrypt the message upon receiving the message and decrypting it with the key it is impossible to guess its origin if the sender somehow

    transmits the secret key along with the cipher text anyone can intercept the package and access the information consequently this encryption category is termed private key cryptography since a big part of the data’s integrity is riding on the promise that the users can keep the key secret this terminology contrasts with asymmetric key cryptography which is called public key cryptography because it has two different keys at play one of which is public provided we manage to keep the keys secret we still have to choose what kind of ciphers we want to use to encrypt this information in symmetric key cryptography there are broadly two categories of ciphers that we can employ let us have a look stream ciphers are the algorithms that encrypt basic information one bit at a time it can change depending on the algorithm being used but usually it relies on a single bit or bite to do the encryption this is a relatively quicker alternative considering the algorithm doesn’t have to deal with blocks of data at a single time every piece of data that goes into the encryption can and needs to be converted into binary format in stream ciphers each binary digit is encrypted one after the other the most popular ones are the RC4 salsa and Panama the binary data is passed through an encryption key which is a randomly generated bitstream upon passing it through we receive the cipher text that can be transferred to the receiver without fear of man-in-the-middle attacks the binary data can be passed through an algorithmic function it can have either XR operations as it is most of the time or any other mathematical calculations that have the singular purpose of scrambling the data the encryption key is generated using the random bitstream generator and it acts as a supplement in the algorithmic function the output is in binary form which is then converted into the decimal or hexodimal format to give our final cipher text on the other hand block ciphers dissect the raw information into chunks of data of fixed size the size of these blocks depend on the exact cipher being used a 128 bit block cipher will break the plain text into blocks of 128 bit each and encrypt those blocks instead of a single digit once these blocks are encrypted individually they are chained together to form a final cipher text block ciphers are much slower but they are more tamperproof and are used in some of the most widely used algorithms employed today just like stream ciphers the original cipher text is converted into binary format before beginning the process once the conversion is complete the blocks are passed through the encryption algorithm along with the encryption key this would provide us with the encrypted blocks of binary data once these blocks are combined we get a final binary string this string is then converted into hexodimal format to get our cipher text today the most popular symmetric key algorithms like AES DEES and 3DES are all block cipher methodology subsets with so many factors coming into play there are quite a few things symmetrically cryptography excels at while falling short in some other symmetric key cryptography is much faster variant when compared to asymmetric cryptography there is only one key in play unlike asymmetric encryption and this drastically improves calculation speed in the encryption and decryption similarly the performance of symmetric encryption is much more efficient under similar computational limitations fewer calculations help in better memory management for the whole system bulk amounts of data that need to be encrypted are very well suited for symmetric algorithms since they are much quicker handling large amounts of data is simple and easy to use in servers and data farms this helps in better latency during data recall and fewer mixed packets thanks to its simple single key structure symmetric key cryptography algorithms are much easier to set up a communication channel with and offer a much more straightforward maintenance duties once the secret key is transmitted to both the sender and receiver without any prior mishandling the rest of the system aligns easily and everyday communications becomes easy and secure if the algorithm is applied as per the documentation symmetric algorithms are very robust and can encrypt vast amounts of data with very less overhead dees algorithm stands for data encryption standard it is a symmetric key cipher that is used to encrypt and decrypt information in a blockby-block manner each block is encrypted individually and they’re later chained together to form our final cipher text which is then sent to a receiver ds takes the original unaltered piece of data called the plain text in a 64-bit block and it is converted into an encrypted text that is called the cipher text it uses 48 bit keys during the encryption process and follows a specific structure called the fisal cipher structure during the entire process it is a symmetric key algorithm which means DS can reuse the keys used in the encryption format to decrypt the cipher text back to the original plain text once the 64-bit blocks are encrypted they can be combined together before being transmitted let’s take a look at the origin and the reason DES was founded dees is based on a fisal block cipher called Lucifer developed in 1971 by IBM cryptography researcher Host Fistol dees uses 16 rounds of this fisal structure using a different key for each round it also utilizes a random function with two inputs and provides a single output variable ds becames the organization’s approved encryption standard in November 1976 and was later reaffirmed as a standard in 1983 1988 and finally in 1999 but eventually DES was cracked and it was no longer considered a secure solution for all official roots of communication consequently tripleds was developed tripleds is a symmetric key block cipher that uses a double DS cipher encrypt with the first key delete encryption with the second key and encrypt again with a third key there is also a variation of the two keys where the first and second key are duplicate of each other but triple DS was ultimately deemed too slow for the growing need for fast communication channels and people eventually fell back to using DS for encrypting messages in order to search for a better alternative a publicwide competition was organized and helped cryptographers develop their own algorithm as a proposal for the next global standard this is where the reindal algorithm came into play and was later credited to be the next advanced encryption standard for a long time dees was the standard for data encryption for data security its rule ended in 2002 when finally the advanced encryption standard replaced dees as an acceptable standard following a public competition for a place to understand the structure of a fistol cipher you can use the following image as a reference the block being encrypted is divided into two parts one of which is being passed onto the function while the other part is exorded with the function’s output the function also uses the encryption key that differs for each individual round this keeps going on until the last step until where the right hand side and the left hand side are being swapped here we receive our final cipher text for the decryption process the entire procedure is reversed starting from the order of the keys to the block sorting if the entire process is repeated in a reverse order we will eventually get back our plain text and this simplicity helps the speed overall this was later detrimental to the efficiency of the algorithm hence the security was compromised a fistl block cipher is a structure used to derive many symmetry block ciphers such as dees which as we have discussed in our previous comment pistl cipher proposed a structure that implement substitution and permutation alternately so that we can obtain cipher text from the plain text and vice versa this helps in reducing the redundancy of the program and increases the complexity to combat brute force attacks the fistl cipher is actually based on the shannon structure that was proposed in 1945 the fistl cipher is the structure suggested by horse fistl which was considered to be a backbone while developing many symmetric block ciphers the shannon structure highlights the implementation of alternate confusion and diffusion and like we already discussed the festal cipher structure can be completely reversed depending on the data however we must consider the fact that to decrypt the information by reversing the fal structure we will need the exact polomial functions and the key orders to understand how the blocks are being calculated we take a plain text which is of 64bit and that is later divided into two equal halves of 32-bit each in this the right half is immediately transferred to the next round to become the new left half of the second row the right hand is again passed off to a function which uses an encryption key that is unique to each round in the file cipher whatever the function gives off as an output it is passed on as an exor input with the left half of the initial plain text the next output will become the right half of the second round for the plain text this entire process constitutes of a single round in the fistl cipher taking into account what happens in a polomial function we take one half of the block and pass it through an expansion box the work of the expansion box is to increase the size of the half from 32-bit to 48 bit text this is done to make the text compatible to a 48 bit keys we have generated beforehand once we pass it through the exo function we get a 48 bit text as an output now remember a half should be of 32bit so this 48 bit output is then later passed on to a substitution box this substitution box reduces its size from 48 bit to 32bit output which is then later exorted with the first half of the plain text a block cipher is considered the safest if the size of the block is large but large block sizes can also slow down encryption speed and the decryption speed generally the size is 64bit sometimes modern block ciphers like AES have a 128 bit block size as well the security of the block cyber increases with increasing key size but larger key sizes may also reduce the speeds of the process earlier 64-bit keys were considered sufficient modern ciphers need to use 128 bit keys due to the increasing complexity of today’s computational standards the increasing number of rounds also increase the security of the block cipher similarly they are inversely proportional to the speed of encryption a highly complex round function enhances the security of the block cipher albeit we must maintain a balance between the speed and security the symmetric block cipher is implemented in a software application to achieve better execution speed there is no use of an algorithm it it cannot be implemented in a real life framework that can help organizations to encrypt or decrypt the data in a timely manner now that we understand the basics of fistl ciphers we can take a look at how dees manages to run through 16 rounds of the structure and provide the cipher text at the end now that we understand the basics of fest ciphers we can take a look at how DES manages to run through 16 rounds of this structure and provide a cipher text in simple terms DS takes a 64-bit plain text and converts it into a 64-bit cipher text and since we’re talking about asymmetric algorithms the same key is being used when it is decrypting the data as well we first take a 64-bit clip plane text and we pass it through an initial permutation function the initial permutation function has the job of dividing the block into two different parts so that we can perform fist cipher structures on it there are multiple rounds being procured in the DS algorithm namely 16 rounds of fis cipher structure each of these rounds will need keys initially we take a 56- bit cipher key but it is a single key we pass it on to a round key generators which generates 16 different keys for each single round that the fisal cipher is being run these keys are passed on to the rounds as 48 bits the size of these 48 bits keys is the reason we use the substitution and permutation bongs in the polomial functions of the special ciphers when passing through all these rounds we reach round 16 where the final key is passed on from the round key generator and we get a final permutation in the final permutation the rhymes are swapped and we get our final cipher text this is the entire process of dees with 16 rounds of ciphers encompassed in it to decrypt our cipher text back to the plain text we just have to reverse the process we did in the DES algorithm and reverse the key order along with the functions this kind of simplicity is what gave dees the bonus when it comes to speed but eventually it was detrimental to the overall efficiency of the program when it comes to security factors dees have five different modes of operation to choose from this one of those is electronic code book each 64-bit block is encrypted and decrypted independently in the electronic code book format we also have cipher blockchaining or the CBC method here each 64-bit block depends on the previous one and all of them use an initialization vector we have a cipher feedback block mechanism where the preceding cipher text becomes the input for the encryption algorithm it produces a pseudo random output which in turn is exort with the plain text there is an output feedback method as well which is the same as cipher feedback except that the encryption algorithm input is the output from the preceding DES a counter method has a different way of approach where each plain text block is exord with an encrypted counter the counter is then incremented for each subsequent block there are a few other alternatives to these modes of operation but the five mentioned above are the most widely used in the industry and recommended by cryptographers worldwide let’s take a look at the future of DES the dominance of DEES ended in 2002 when the advanced encryption standard replaced the DES encryption algorithm as the accepted standard it was done following a public competition to find a replacement nist officially withdrew the global acceptance standard in May 2005 although tripleds has approved for some sensitive government information through 2030 nist also had to change the DS algorithm because its key length was too short given the increased processing power of the new computers encryption power is related to the size of the key and DS found itself a victim of ongoing technological advances in computing we have received a point where 56-bit was no longer a challenge to the computers of tracking note that because DES is no longer the NIST federal standard does not mean that it is no longer in use triple DS is still used today and is still considered a legacy encryption algorithm to get a better understanding of how these keys and cipher text look like we can use an online tool for our benefit as we already know to encrypt any kind of data a key is mandatory this key can be generated using mathematical functions or computerized key generation program such as this website offers it can be based on any piece of text let’s say the word is simply [Music] learn in our example once the key is settled we provide the plain text or the clear text that needs to be encrypted using the aforementioned key suppose our sentence for this example is this is my first message we have satisfied two prerequisites the message and the key another variable that goes into play is the mode of operation we have already learned about five different modes of operation while we can see some other options here as well let us go with the CBC variant which basically means the cipher blockchaining method one of CBC’s key characteristics is that it uses a chaining process it causes the decryption of a block of cipher text to depend all on the preceding cipher text blocks as a result the entire validity of all the blocks is contained in the previous adjacent blocks as well a single bit error in a cipher text block affects the decryption of all the subsequent blocks rearrangement of the order of these for example can cause the decryption process to get corrupted regarding the manner of displaying binary information we have two options here we can either go with B 64 or the hexodimal format let’s go with the base 64 right now as you can see the cipher text is readily available b 64 is a little more efficient than heads so we will be getting a smaller cipher text when it comes to B 64 albeit the size of both the formats will be the same the hex has a longer cipher text since B 64 takes four characters for every three bytes while hex will take two characters for each bite hence B 64 turns out to be more efficient now to decrypt the cipher text we go by the same format choose B 64 we copy the cipher text onto a decryption tool and we have to make sure that the key we are using is exactly the same we choose similar mode of operation and we choose the correct encoding format as well which is B 64 in this case as you can see the decryption is complete and we get a plain text back even if you keep everything the same but we just change the encoding format it will not be able to decrypt anything unfortunately DS has become rather easy to crack even without the help of a key the advanced encryption standard is still on top when it comes to symmetric encryption security and will likely stay there for a while eventually with so much computing power growth the need for a stronger algorithm was necessary to safeguard our personal data as solid as dees was the computers of today could easily break the encryption with repeated attempts thereby rendering the data security helpless to counter this dilemma a new standard was introduced which was termed as the advanced encryption standard or the AES algorithm let’s learn what is advanced encryption standard the AES algorithm also known as the reindial algorithm is a symmetric block cipher with a block size of 128 bits it is converted into cipher text using keys of 128 192 or 256 bits it is implemented in software and hardware throughout the world to encrypt sensitive data the National Institute of Standards and Technology also known as NIST started development on AES in 1997 when it was announced the need for an alternative to the data encryption standard the new internet needed a replacement for dees because of its small key size with increasing computing power it was considered unsafe against entire key search attacks the tripleds was designed to overcome this problem however it was deemed to be too slow to be deployed in machines worldwide strong cases were present by the Mars RC6 Serpent and the Twofish algorithms but it was the ringal encryption algorithm also known as AES which was eventually chosen as the standard symmetric key encryption algorithm to be used its selection was formalized with the release of federal information processing standards publication 197 in the November of 2001 it was approved by the US Secretary of Commerce now that we understand the origin of AES let us have a look at the features that make AES encryption algorithm unique the AES algorithm uses a substitution permutation or SP network it consists of multiple rounds to produce a cipher text it has a series of linked operations including replacing inputs with specific outputs that is substitutions and others that involve bit shuffling which is permutations at the beginning of the encryption process we only start out with a single key which can be either a 128 bit key a 192 bit key or a 256- bit key eventually this one key is expanded to be used in multiple rounds throughout the encryption and the decryption cycle interestingly AES performs all its calculations on bite data instead of bit data as seen in the case of the DES algorithm therefore AES treats 128 bits of a clear text block as 16 bytes the number of rounds during the encryption process depends on the key size that is being used the 128 bit key size fixes 10 rounds the 192 bit key size fixes 12 rounds and the 256 bit key holds 14 rounds a round key is required for each of these rounds but since only one key is input into the algorithm the single key needs to be expanded to get the key for each round including the round zero with so many mathematical calculations going on in the background there are bound to be a lot of steps throughout the procedure let’s have a look at the steps followed in AES before we move ahead we need to understand how data is being stored during the process of AES encryption everything in the process is stored in a 4 into 4 matrix format this matrix is also known as a state array and we’ll be using these state arrays to transmit data from one step to another and from one round to the next round each round takes state array as input and gives a straight array as output to be transferred into the next round it is a 16 byt matrix with each cell representing one bite with each four bytes representing a word so every state array will have a total of four words representing it as we previously discussed we take a single key and expand it to the number of rounds that we need the key to be used in let’s say the number of rounds are n that the key has to be expanded to be used with n +1 rounds because the first round is the key zero round let’s say n is the number of rounds the key is expanded to n + one rounds it is also a state array having four words in its vicinity every key is used for a single round and the first key is used as a round key before any round begins in the very beginning the plain text is captured and passed through an exor function with the round key as a supplement this key can be considered the first key from the n +1 expanded set moving on the state array resulting from the above step is passed on to a bite substitution process beyond that there is a provision to shift rows in the state arrays later on the state array is mixed with a constant matrix to shuffle its column in the mix column segment after which we add the round key for that particular round the last four steps mentioned are part of every single round that the encryption algorithm goes through the state arrays are then passed from one round to the next as an input in the last round however we skip the mix columns portion with the rest of the process remaining unchanged but what are these byte substitution and row shifting processes let’s find out regarding each step in more detail in the first step the plain text is stored in a state array and is exorbed with the k0 which is the first key in the expanded key set this step is performed only once on a block while being repeated at the end of each round as per iteration demands the state array is exor with the key to get a new state array which is then passed over as input to the sub bytes process in the second stage we have byte substitution we leverage an xbox called as a substitution box to randomly switch data among each element every single bite is converted into a hexodimal value having two parts the first part denotes the row value and the second part denotes the column value the entire state array is passed through the SB box to create a brand new state array which is then passed off as an input to the row shifting process the 16 input bytes are replaced by looking at a fixed table given in the design we finally get a matrix with four rows and four columns when it comes to row shifting each bit in the four rows of the matrix is shifted to the left an entry that is a fall-off is reinserted to the right of the line the change is done as follows the first line is not moved in any way the second line is shifted to a single position to the left the third line is shifted two positions to the left and the fourth line is shifted three positions to the left the result is a new matrix that contains the same 16 bytes but has been moved in relation to each other to boost the complexity of the program in mixed columns each column of four bytes is now replaced using a special mathematical function the function takes four bytes of a column as input and outputs four completely new bytes we will get a new matrix with the same size of 16 bytes and it should be noted that this phase has not been done in the last round of the iteration when it comes to adding a round key the 16 bytes of the matrix are treated as 128 bits and the 128 bits of the round key are exort if it is the last round the output is the cipher text if you still have a few rounds remaining the resulting 128 bits are interpreted as 16 bytes and we start another similar round let’s take an example to understand how all these processes work if our plain text is the string 2192 we first convert it into a hexadimal format as follows we use an encryption key which is that’s my kung fu and it is converted into a hexadimal format as well as per the guidelines we use a single key which is then later expanded into n +1 number of keys in which case it’s supposed to be 11 keys for 10 different rounds in round zero we add the round key the plain test is exor with the k0 and we get a state array that is passed off as an input to the substitution byes process when it comes to the substitution bytes process we leverage an sbox to substitute the elements of each bite with a completely new bite this way the state array that we receive is passed off as an input to the row shifting process of the next step when it comes to row shifting each element is shifted a few places to the left with the first row being shifted by zero places second row by one place third row by two places and the last by three the state array that we received from the row shifting is passed off as an input to mix columns in mix columns we multiply the straight array with a constant matrix after which I receive a new state array to be passed on onto the next step we add the new state array as an exor with the round key of the particular iteration whatever state array we receive here it becomes an output for this particular round now since this is the first round of the entire encryption process the state array that we receive is passed off as an input to the new round we repeat this process for 10 more rounds and we finally receive a cipher text once the final state array can be denoted in the hexodimal format this becomes our final cipher text that we can use for transferring information from the sender and receiver let’s take a look at the applications of AES in this world aes finds most use in the area of wireless security in order to establish a secure mode of authentication between routers and clients highly secure mechanisms like WPA and WPA2 PSK are extensively used in securing Wi-Fi endpoints with the help of renal’s algorithm it also helps in SSL TLS encryption that is instrumental in encrypting our internet browser sessions aes works in tandem with other asymmetric encryption algorithms to make sure the web browser and web server are properly configured and use encrypted channels for communication aes is also prevalent in general file encryption of various formats ranging from documents to the media files having a large key allows people to encrypt media and decrypt data with maximum security possible aes is also used for processor security in hardware appliances to prevent machine hijacking among other things as a direct successor to the dees algorithm there are some aspects that AES provides an immediate advantage in let us take a look when it comes to key length the biggest flaw in DES algorithm was its small length was easily vulnerable by today’s standards aes has managed to nab up 128 192 and 256 bit key lengths to bolster the security further the block size is also larger in AES owing to more complexity of the algorithm the number of rounds in dees is fixed irrespective of the plain text being used in AES the number of round depends on the key length that is being used for the particular iteration thereby providing more randomness and complexity in the algorithm the DES algorithm is considered to be simpler than AES even though AES beats DES when it comes to relative speed of encryption and decryption this makes advanced encryption standard much more streamlined to be deployed in frameworks and systems worldwide when it compares to the data encryption standard hello in our last video on cryptography we took a look at symmetric key cryptography we used a single private key for both the encryption and decryption of data and it works very well in theory let’s take a look at a more realistic scenario now let’s meet Joe joe is a journalist who needs to communicate with Ryan via long-distance messaging due to the critical nature of the information people are waiting for any message to leave Joe’s house so that they can intercept it now Joe can easily use symmetrically cryptography to send the encrypted data so that even if someone intercepts the message they cannot understand what it says but here’s the tricky part how will Joe send the required decryption key to Ryan the sender of the message as well as the receiver need to have the same decryption key so that they can exchange messages otherwise Ryan cannot decrypt the information even when he receives the cipher text if someone intercepts the key while transmitting it there is no use in employing cryptography since the third party can now decode all the information easily key sharing is a risk that will always exist when symmetric key cryptography is being used thankfully asymmetric key encryption has managed to fix this problem this is Baba from Simply Learn and welcome to this video on asymmetric key cryptography let’s take a look at what we are going to learn today we begin by explaining what asymmetric key cryptography is and how it works we take a look at its application and uses we understand why it’s called public key cryptography and then learn a little bit about RS encryption and then we learn about the advantages of asymmetric key cryptography over symmetric key cryptography let’s understand what asymmetric key cryptography is asymmetric encryption uses a double layer of protection there are two different keys at play here a private key and a public key a public key is used to encrypt the information pre-transit and a private key is used to decrypt the data post transit these pair of keys must belong to the receiver of the message the public keys can be shared via messaging blog posts or key servers and there are no restrictions as you can see in the image the two keys are working in the system the sender first encrypts the message using the receivers’s private key after which we receive the cipher text the cipher text is then transmitted to the receiver without any other key on getting the cipher text the receiver uses his private key to decrypt it and get the plain text back there has been no requirement of any key exchange throughout this process therefore solving the most glaring flaw faced in symmetric key cryptography the public key known to everyone cannot be used to decrypt the message and the private key which can decrypt the message need not be shared with anyone the sender and receiver can exchange personal data using the same set of keys as often as possible to understand this better take the analogy of your mailbox anyone who wants to send you a letter has access to the box and can easily share information with you in a way you can say the mailbox is publicly available to all but only you have access to the key that can open the mailbox and read the letters in it this is how the private key comes to play no one can intercept the message and read its contents since it’s encrypted once the receiver gets its contents he can use his private key to decrypt the information both the public key and the private key are generated so they are interlin and you cannot substitute other private keys to decrypt the data in another example if Alice wants to send a message to Bob let’s say it reads “Call me today.” She must use Bob’s public key while encrypting the message upon receiving the cipher message Bob can proceed to use his private key in order to decrypt the message and hence complete security is attained during transmission without any need for sharing the key since this type of encryption is highly secure it has many uses in areas that require high confidentiality it is used to manage digital signature so there is valid proof of a document’s authenticity with so many aspects of business transitioning to the digital sphere critical documents need to be verified before being considered authentic and acted upon thanks to asymmetric cryptography senders can now sign documents with their private keys anyone who needs to verify the authenticity of such signatures can use the sender’s public key to decrypt the signature since the public and the private keys are linked to each other mathematically it’s impossible to repeat this verification with a with duplicate keys document encryption has been made very simple by today’s standards but the background implementation follows a similar approach in blockchain architecture asymmetric key cryptography is used to authorize transactions and maintain the system thanks to its two key structures changes are reflected across the blockchain’s peer-to-peer network only if it is approved from both ends along with asymmetric key cryptography tamperproof architecture its non-repudiation characteristic also helps in keeping the network stable we can also use asymmetric key cryptography combined with symmetric key cryptography to monitor SSL or TLS encrypted browsing sessions to make sure nobody can steal up personal information when accessing banking websites or the internet in general it plays a significant role in verifying website server authenticity exchanging the necessary encryption keys required and generating a session using those keys to ensure maximum security instead of the rather insecure HTTP website format security parameters differ on a session by session basis so the verification process is consistent and utterly essential to modern data security another great use of the asymmetric key cryptography structure is transmitting keys for symmetric key cryptography with the most significant difficulty in symmetric encryption being key exchange asymmetric keys can help clear the shortcoming the original message is first encrypted using a symmetry key the key used for encrypting the data is then converted into the cipher text using the receivers’s public key now we have two cipher text to transmit to the receiver on receiving both of them the receiver uses his private key to decrypt the symmetry key he can then use it to decrypt the original information on getting the key used to encrypt the data while this may seem more complicated than just asymmetric cryptography alone symmetric encryption algorithms are much more optimized for vast amounts of data on some occasions encrypting the key using asymmetric algorithms will definitely be more memory efficient and secure you might remember us discussing why symmetric encryption was called private key cryptography let us understand why asymmetric falls under the public key cryptography we have two keys at our disposal the encryption key is available to everyone the decryption key is supposed to be private unlike symmetric ecryptography there is no need to share anything privately to have an encrypted messaging system to put that into perspective we share our email address with anyone looking to communicate with us it is supposed to be public by design so that our email login credentials are private and they help in preventing any data mishandling since there is nothing hidden from the world if they want to send us any encrypted information this category is called the public key cryptography there are quite a few algorithms being used today that follow the architecture of asymmetric cryptography none more famous than the RSA encryption rsa encryption is the most widely used encryption or public key encryption standard using asymmetric approach named after its founders Revest Shamir and Adelman it uses block ciphers to obscure the information if you are unfamiliar with how block ciphers work they are encryption algorithms that divide the original data into blocks of equal size the block size depends on the exact cipher being used once they are broken down these blocks are encrypted individually and later chained together to form the final cipher text widely considered to be the most secure form of encryption albeit relatively slower than symmetric encryption algorithms it is widely used in web browsing secure identification VPNs emails and other chat applications with so many variables in play there must be some advantages that give asymmetrically cryptography an edge over the traditional symmetric encryption methodologies let’s go through some of them there is no need for any reliable key sharing channel in asymmetric encryption it was an added risk in private key cryptography that has been completely eliminated in public key architecture the key which is made public cannot decrypt any confidential information and the only key that can decrypt doesn’t need to be shared publicly under any circumstance we have much more extensive key lengths in RSA encryption and other asymmetric algorithms like48 bit key and 496 bit keys larger keys are much harder to break into via brute force and are much more secure asymmetric key cryptography can use as a proof of authenticity since only the rightful owner of the keys can generate the messages to be decrypted by the private key the situation can also be reversed encryption is done using a private key and decryption is done by the public key which would not function if the correct private key is not used to generate the message hence proving the authenticity of the owner it also has a tamper protection feature where the message cannot be intercepted and changed without invalidating the private key used to encrypt the data consequently the public key cannot decrypt the message and it is easy to realize the information is not 100% legitimate when and where the case requires now that we have a proper revision let’s understand what digital signatures are before moving on to the algorithm the objective of digital signatures is to authenticate and verify documents and data this is necessary to avoid tampering and digital modification or forgery of any kind during the transmission of official documents they work on the public key cryptography architecture with one exception typically an asymmetric key system encrypts using a public key and decrypts with a private key for digital signatures however the reverse is true the signature is encrypted using a private key and is decrypted with the public key because the keys are inked together decoding it with the public key verifies that the proper private key was used to sign the document thereby verifying the signatures provenence let’s go through each step to understand the procedure thoroughly in step one we have M which is the original plain text message and it is passed onto a hash function denoted by H# to create a digest next it bundles the message together with the hash digest and encrypts it using the sender’s private key it sends the encrypted bundle to the receiver who can decrypt it using the sender’s public key once the message is decrypted it is passed through the same hash function each hash to generate a similar digest it compares the newly generated hash with the bundled hash value received along with the message if they match it verifies data integrity in many instances they provide a layer of validation and security messages through non-secure channel properly implemented a digital signature gives the receiver reason to believe that the message was sent by the claimed sender digital signatures are equivalent to traditional handwritten signatures in many respects but properly implemented digital signatures are more difficult to forge than the handwritten type digital signature schemes in the sense used here are cryptographically based and must be implemented properly to be effective they can also provide non-repudiation meaning that the signer cannot successfully claim that they did not sign a message while also claiming their private key remains secret further some non-repudiation schemes offer a timestamp for the digital signature so that even if the private key is exposed the signature is valid to implement the concept of digital signature in real world we have two primary algorithms to follow the RSA algorithm and the DSA algorithm but the latter is a topic of learning today so let’s go ahead and see what the digital signature algorithm is supposed to do digital signature algorithm is a FIPS standard which is a federal information processing standard for digital signatures it was proposed in 1991 and globally standardized in 1994 by the National Institute of Standards and Technology also known as the NIST it functions on the framework of modular exponentiation and discrete logarithmic problems which are difficult to compute as a force brute system unlike DSA most signature types are generated by signing message digest with the private key of the originator this creates a digital thumbrint of the data since just the message digest is signed the signature is generally much smaller compared to the data that was signed as a result digital signatures impose less load on processors at the time of signing execution and they use small volumes of bandwidth dsa on the other hand does not encrypt message digest using private key or decrypt message digest using public key instead it uses mathematical functions to create a digital signature consisting of two 160-bit numbers which are originated from the message digests and the private key dsas make use of the public key for authenticating the signature but the authorization process is much more complicated when compared with RSA dsa also provides three benefits which is the message authentication integrity verification and non-repudiation in the image we can see the entire process of DSF validation a plain text message is passed onto a hash function where the digest is generated which is passed onto a signing function signing function also has other parameters like a global variable G a random variable K and the private key of the sender the outputs are then bundled onto a single pack with the plain text and sent to the receiver the two outputs we receive from the signing functions are the two 160 bit numbers denoted by S and R on the receiver end we pass the plain text through the same hash function to regenerate the message digest it is passed on to verification function which has other requirements such as the public key of the sender global variable G and SNR received from the sender the value generated by the function is then compared to R if they match then the verification process is complete and data integrity is verified this was an overview of the way the DSA algorithm works we already know it depends on logarithmic functions to calculate the outputs so let us see how we can do the same in our next section we have three phases here the first of which is key generation to generate the keys we need some prerequisites we select a Q which becomes a prime divisor we select a prime number P such that P minus1 mod Q equal to zero we also select a random integer G which must satisfy the two formulas being mentioned on the screen right now once these values are selected we can go ahead with generating the keys the private key can be denoted by X and it is any random integer that falls between the bracket of zero and the value of Q the public key can be calculated as Y = G ^ X mod P where Y stands for the public key the private key can then be packaged as a bundle which comprises of values of P Q G and X similarly the public key can also be packaged as a bundle having the values of P Q G and Y once we’re done with key generation we can start verifying the signature and this generation repeat once the keys are generated we can start generating the signature the message is passed through a hash function to generate the digest H first we can choose any random integer K which falls under the bracket of 0 and Q to calculate the first 160 bit number of a signing function of R we use the formula G ^ K mod P into mod Q q similarly to calculate the value of the second output that is S we use the following formula that is shown on the screen the signature can then be packaged as a bundle having R and S this bundle along with a plain text message is then passed on to the receiver now with the third phase we have to verify the signature we first calculate the message digest received in the bundle by passing it through the same hash function we calculate the value of W U1 and U2 using the formulas shown on the screen we have to calculate a verification component which is then to be compared with the value of R being sent by the sender this verification component can be calculated using the following formula once calculated this can be compared with the value of R if the values match then the signature verification is successful and our entire process is complete starting from key generation to the signature generation all the way up to the verification of the signature with so many steps to follow we are bound to have a few advantages to boot this and we would be right to think so dsa is highly robust in the security and stability aspect when compared to alternative signature verification algorithms we have a few other ciphers that aim to achieve the simplicity and the flexibility of DSA but it has been a tough ask for all the other suits the key generation is much faster when compared to the RSA algorithm and such while the actual encryption and decryption process may falter a little in comparison a quicker start in the beginning is well known to optimize a lot of frameworks dsa requires less storage space to work its entire cycle in contrast its direct correspondent that is RSA algorithm needs a certain amount of computational and storage space to function efficiently this is not the case with DSA which has been optimized to work with weaker hardware and lesser resources the DSA is patented but NIST has made this patent available worldwide royalty-free a draft version of the speculation FIPS 1865 indicates that DSA will no longer be approved for digital signature generation but it may be used to verify signatures generated prior to the implementation date of that standard the RSA algorithm is a public key signature algorithm developed by Ron Rest Adi Shamir and Leonard Edelman the paper was first published in 1977 and the algorithm uses logarithmic functions to keep the working complex enough to withstand brute force and streamlined enough to be fast post deployment rsa can also encrypt and decrypt general information to securely exchange data along with handling digital signature verification let us understand how it achieved this we take our plain text message M we pass it through a hash function to generate the digest h which is then encrypted using the sender’s private key this is appended to the original plain text message and sent over to the receiver once the receiver receives the bundle we can pass the plain text message to the same hash function to generate a digest and the cipher text can be decrypted using the public key of the sender the remaining hashes are compared if the values match then the data integrity is verified and the sender is authenticated apart from digital signatures the main case of RSA is encryption and decryption of private information before being transmitted across communication challenge this is where the data encryption comes into play when using RSA for encryption and decryption of general data it reverses the key set usage unlike signature verification it receives the receivers’s public key to encrypt the data and uses the receivers’s private key in decrypting the data thus there is no need to exchange any keys in this scenario there are two broad components when it comes to RSA cryptography one of them is key generation key generation employs a step of generating the private and the public keys that are going to be used for encrypting and decrypting the data the second part is the encryption and decryption functions these are the ciphers and steps that need to be run when scrambling the data or recovering the data from the cipher text you will now understand each of these steps in our next subtopic keeping the previous two concepts in mind let us go ahead and see how the entire process works starting from creating the key pair to encrypting and decrypting the information you need to generate the public and private keys before running the functions to generate cipher text and plain text they use certain variables and parameters all of which are explained we first use two large prime numbers which can be denoted by p and q we can compute the value of n as n= to p into q and compute the value of zed as p minus1 into qus 1 a number E is chosen at random satisfying the following conditions and a number D is also selected at random following the formula E D mod Z equal to 1 and it can be calculated with the formula given below the public key is then packaged as a bundle with N and E and the private key is packaged as a bundle using N and B this sums up the key generation process for the encryption and decryption function we use the formula C and M the cipher text can be calculated as C = M ^ E mod N and the plain text can be calculated from the cipher text as C power D mod N when it comes to a data encryption example let’s take P and Q as 7 and 13 the value of N can be calculated as 91 if we select the value of E to be five it satisfy all the criteria that we needed to the value of D can be calculated using the following function which gives it as 29 the public key can then be packaged as 91A 5 and the private key can then be packaged as 91A 29 the plain text if it is 10 which is denoted by M cipher text can be calculated to the formula C= to M ^ E mod N which gives us 82 if somebody receives this cipher text they can calculate the plain text using the formula C to ^ D mod N which gives us the value of 10 as selected as our plain text we can now look at the factors that make the RSA algorithm stand out versus its competitors in the advantageous topics of this lesson rsa encryption depends on using the receivers’s public key so that you don’t have to share any secret key to receive the messages from others this was the most glaring flaw faced by symmetric algorithms which were eventually fixed by asymmetric cryptography structure since the key pairs are related to each other a receiver cannot intercept the message since they didn’t have the correct private keys to decrypt the information if a public key can decrypt the information the sender cannot refuse signing it with his private key without admitting the private key is not in fact private anymore the encryption process is faster than that of the DSA algorithm even if the key generation is slower in RSA many systems across the world tend to reuse the same keys so that they can spend less time in key generation and more time on actual cipher text management data will be tamperproof in transit since meddling with the data will alter the usage of the keys the private key won’t be able to decrypt the information hence alerting the receiver of any kind of manipulation in between the receiver must be aware of any third party who possesses the private key since they can alter the data mid-transit the cases of which are rather low imagine creating an account on a new website you provide your email address and set a password that you are confident and you would not forget what about the website owner how securely are they going to store your password for website administrators they have three alternatives they can either store the passwords in a plain text format they can encrypt the passwords using an encryption and decryption key or they can store the passwords in a hash value let’s have a look at each of these when a password is stored in plain text format it is considered to be the most unsafe option since anyone in the company can read your passwords a single hack and a data server breach will expose all the accounts credentials without needing any extra effort to counter this owners can encrypt the passwords and keep them in the servers as a second alternative but that would mean they also have to store the decryption key somewhere on their servers in the event of a data breach or the server hack both the decryption key and encrypted passwords would be leaked thus making it a single point of failure what if there was an option to store the passwords after scrambling them completely but with no way to decrypt them this is where hashing comes to play since only the hashed values are stored in the server no encryption is needed with no plain text passwords to protect your credentials are safe from the website administrators considering all the pros hashed passwords are the industry standard when it comes to storing credentials nowadays before getting too deep into the topic let’s get a brief overview of how hashing works hashing is the process of scrambling a piece of information or data beyond recognition we can achieve this by using hash functions which are essentially algorithms that perform mathematical operations on the main plain text the value generated after passing the plain text information through the hash function is called the hash value digest or in general just the hash of the original data while this may sound similar to encryption the major difference is hashes are made to be irreversible no decryption key can convert a digest back to its original value however a few hashing algorithms have been broken due to the increase in computational complexity of today’s new generation computers and processors there are new algorithms that stand the test of time and are still in use among multiple areas for password storage identity verification etc like we discussed earlier websites use hashing to store the user’s passwords so how do they make use of these hash passwords when a user signs up to create a new account the password is then run through the hash function and the resulting hash value is stored on the servers so the next time a user comes to login to the account the password he enters is passed through the same hash function and compared to the hash stored on the main server if the newly calculated hash is the same as the one stored on the website server the password must have been correct because according to hash functions terminology same inputs will always provide the same outputs if the hashes do not match then the password entered during login is not the same as the password entered during the signup hence the login will be denied this way no plain text passwords get stored preventing both the owner from snooping on user data and protecting users privacy in the unfortunate event of a data breach or a hack apart from password storage hashing can also be used to perform integrity checks when a file is uploaded on the internet the files hash value is generated and it is uploaded along with the original information when a new user downloads the file he can calculate the digest of the downloaded file using the same hash function when the hash values are compared if they match then file integrity has been maintained and there has been no data corruption since so much important information is being passed onto the hash function we need to understand how they work a hash function is a set of mathematical calculations operated on two blocks of data the main input is broken down into two blocks of similar size the block size is dependent on the algorithm that is being used hash functions are designed to be one way they shouldn’t be reversible at least by design some algorithms like the previously mentioned MD5 have been compromised but most secure algorithms are being used today like the SHA family of algorithms the digest size is also dependent on the respective algorithm being used md5 has a digest of 128 bits while SH 256 has a digest of 256 bits this digest must always be the same for the same input irrespective of how many times the calculations are carried out this is a very crucial feature since comparing the hash value is the only way to check if the data is untouched as the functions are not reversible there are certain requirements of a hash function that need to be met before they are accepted while some of them are easy to guess others are placed in order to preserve security in the long run the hash function must be quick enough to encrypt large amounts of data at a relatively fast pace but it also shouldn’t be very fast running the algorithm on all cylinders makes the functions easy to brute force and a security liability there must be a balance to allow the hash function to handle large amounts of data and not make it ridiculously easy to brute force by running through all the possible combinations the hash function must be dependent on each bit of the input the input can be text audio video or any other file extension if a single character is being changed it doesn’t matter how small that character may be the entire digest must have a distinctly different hash value this is essential to create unique digests for every password that is being stored but what if two different users are using the same password since the hash function is the same for all users both the digests will be the same this is called a hash collision you may think this must be a rare occasion where two users have exactly the same password but that is not the case we have techniques like salting that can be used to reduce these hash collisions as we will discuss later in this video you would be shocked to see the most used passwords of 2020 all of these passwords are laughably insecure and since many people use the same passwords repeatedly on different websites hash collisions risk are more common than one would expect let’s say the hash functions find two users having the same password how can they store both the hashes without messing up the original data this is where salting and peppering come to play salting is the process of adding a random keyword to the end of the input before it is passed on to the hash function this random keyword is unique for each user on the system and it is called the salt value or just the salt so even if two passwords are exactly the same the salt value will differ and so will their digest there is a small problem with this process though since the salt is unique for each user they need to be stored in the database along with the passwords and sometimes even in plain text to speed up the process of continuous verification if the server is hacked then the hashes will need to be brute forced which takes a lot of time but if they receive the salts as well the entire process becomes very fast this is something that peppering aims to solve peppering is the process of adding a random string of data to the input before passing them through the hash function but this time the random string is not unique for each user it is supposed to be common for all users in the database and the extra bit added is called the pepper in this case the pepper isn’t stored on the servers it is mostly hardcoded onto the website source code since it’s going to be the same for all credentials this way even if the servers get hacked they will not have the right pepper needed to crack into all the passwords many websites use a combination of salting and peppering to solve the problem of hash collision and bolster security since brute force takes such a long time many hackers avoid taking the effort the returns are mostly not worth it and the possible combinations of using both salting and peppering is humongous with cyber crime getting more and more complex by the day corporations are in the need of trained personnel in the field of cyber security ethical hacking and penetration testing had always been necessary for organizations and the general public to protect the system against malicious attackers however with the exponential growth in cyber attacks the necessity of being trained in ethical hacking is at an all-time high many such professionals tend to use Linux distributions for their penetration testing activities there are specific operating systems which are catered to ethical hackers these operating systems come pre-installed with the necessary tools and scripts required for ethical hacking probably the most famous operating system in this bracket is Kala Linux for today’s video we will learn about this distribution made by and for hackers we take you through the intricacies of its hardware and software specifications let’s take a look at the agenda for today we start by learning about Kali Linux and a basic explanation of its purpose we take a look at the history of Kali Linux from the story of its origin to its current day exploits next we learn a few distinct features of Kal Linux that make it an attractive choice for penetration testers worldwide moving on we take a look at the multiple ways we can install Kal Linux to start our journey in the world of penetration testing in the next few sections we compare it to an industry rival operating system by the name of Parrot Security operating system we take a look at the OS on a grassroots level next we learn about the standout features of Kali Linux and Parrot Security with their unique offerings we make a direct comparison between Kali and Parrot Security OS as far as their hardware specifications and allound usability is concerned we make a conclusion as to which operating system caters to which category of user in the next topic we take a detailed look at how we can install Kali Linux on a Windows 10 system using the VMware virtualization software moving on we go through some of the reasons why people should choose Kali Linux as their primary operating system when it comes to ethical hacking and penetration testing in the next

    section we cover the five different phases of penetration testing where each stage is a crucial segment in the entire cycle of a ethical hacking campaign we also take a look at the most popular tools installed in Kal Linux that are used regularly by ethical hackers as a part of their professional work coming to a few live demonstrations we start by learning some Linux terminal basic commands set up proxy chains to maintain a privacy on the internet run a few end mapap scans to find information about our victims use Wireshark to detect insecure browser traffic traveling through HTTP web pages learn about Metasloit and its components and finally use Metasloit to hack into a Windows 10 machine and grant ourselves root access or the admin access which basically gives us the key to the entire machine it’s no secret that the majority of our internet usage is at the risk of being hacked be it via unsafe messaging applications or misconfigured operating systems to counteract this void of digital security penetration testing has become the norm when it comes to vulnerability assessment kali Linux is an operating system that has become a well-known weapon in this fight against hackers a Linux distribution that is made specifically for penetration testers kali Linux has layers of features that we will be covering in today’s lesson let’s take a look at the topics to be covered in this video we start by learning about Kali Linux and a basic explanation of its purpose we take a look at the history of Kali Linux from the story of its origin to its current day exploits next we learn a few distinct features of Kali that make it an attractive choice for penetration testers worldwide finally we take a look at the multiple ways we can install Kali Linux to start our journey in the world of penetration testing let’s start by learning about Kali Linux in general Kali Linux which is formerly known as Backtrack Linux is an open-source Linux distribution aimed at advanced penetration testing and security auditing it contains several hundred tools that are targeted towards various information security tasks such as penetration testing security research computer forensics and reverse engineering kal Linux is a multiple platform solution accessible and freely available to information security professionals and hobbyists among all the Linux distributions Kali Linux takes its roots from the Debian operating system debian has been a highly dependable and stable distribution for many years providing a similarly strong foundation to the Kali desktop while the operating system is capable of practically modifying every single part of our installation the networking components of Kali become disabled by default this is done to prevent any external factors from affecting the installation procedure which may pose a risk in critical environments apart from boosting security it allows a deeper element of control to the most enthusiastic of users we did not get Kali Linux since the first day how did it come into existence let’s take a look at some of its history kal Linux is based on years of knowledge and experience in building penetration testing and operating systems during all these project lifelines there have been only a few different developers as the team has always been small the first project was called WPEX which stands for White Hat NPIX as can be inferred from the name it was based on the NPIX operating system as its underlying OS opix had releases ranging from version 2.0 to 2.7 this made way for the next project which was known as WAX or the long hand being White Hat Slack the name change was because the base OS was changed from NOPIX to Slack wax started at version 3 as a Nord it carrying on from WPIX there was a similar OS being produced at the same time auditor security collection often being shorted to just auditor which was once again using NOPIX its efforts were combined with wax to produce backtrack backtrack was based on slackware from version 1 to version 3 but switched to Ubuntu later on with version 4 to version 5 using the experience gained from all of this Kali Linux came after Backtrackk in 2013 kali started off using Debian stable as the engine under the hood before moving to Debian testing when Kali Linux became a rolling operating system now that we understand the history and the purpose of Kali Linux let us learn a little more about its distinct features the latest version of Kali comes with more than 600 penetration tools pre-installed after reviewing every tool that was included in Backtrack developers have eliminated a great number of tools that either simply did not work or which duplicated other tools that provided the same or similar functionality the Kali Linux team is made up of a small group of individuals who are the only ones trusted to commit packages and interact with the repositories all of which is done using multiple secure protocols restricting access of critical code bases to external asset greatly reduces the risk of source contamination which can cause Kali Linux users worldwide a great deal of damage as a direct victim of cyber crime although penetration tools tend to be written in English the developers have ensured that Kali includes true multilingual support allowing more users to operate in their native language and locate the tools they need for the job the more comfortable a user feels with the intricacies of the operating system the easier it is to maintain a stronghold over the configuration and the device in general since ARMbased singleboard systems like the Raspberry Pi are becoming more and more prevalent and inexpensive the development team knew that Kali’s ARM support would need to be as robust as they could manage with fully working installations kali Linux is available on a wide range of ARM devices and has ARM repositories integrated with the mainline distributions so the tools for ARM are updated in conjunction with the rest of the distribution all this information is necessary for users to determine if Kal Linux is the correct choice for them if it is what are the ways that they can go forward with this installation and start their penetration testing journey the first way to use Kali Linux is by launching the distribution in the live USB mode this can be achieved by downloading the installer image file or the ISO file from the Kali Linux website and flashing it to a USB drive with a capacity of at least 8 GB some people don’t need to save the data permanently and a live USB is the perfect solution for such cases after the ISO image is flashed the thumb drive can be used to boot a fully working installation of the operating system with the caveat that any changes made to the OS in this mode are not written permanently some cases allow persistent usage in live USBs but those require further configuration than normal situations but what if the user wants to store data permanently in the installed OS the best and the most reliable way to ensure this is the full-fledged hard disk installation this will ensure the complete usage of the systems hardware capabilities and will take into account the updates and the configurations being made to the OS this method is supposed to override any pre-existing operating system installed on the computer be it Windows or any other variant of Linux the next alternative route for installing Kal Linux would be to use virtualization software such as VMware or Virtual Box the software will be installed as a separate application on an already existing OS and Kali Linux can be run as an operating system in the same computer as a window the hardware requirements will be completely customizable starting with the allotted RAM to the virtual hard capacity the usage of both a host and guest operating system like Kal Linux allows users a safe environment to learn while not putting their systems at risk if you want to learn more about how one can go forward with this method we have a dedicated video where Kali Linux is being installed on VMware while running on a Windows 10 operating system you can find the link in the description box to get started with your very own virtual machine the final way to install Kali Linux is by using a dual boot system to put it in simple words the Kali Linux OS will not be overwriting any pre-installed operating system on a machine but will be installed alongside it when a computer boots up the user will get a choice to boot into either of these operating systems many people prefer to keep both the Windows and Kali Linux installed so the distribution of work and recreational activities is also allotted effectively it gives users a safety valve should their custom Linux installation run into any bugs that cannot be fixed from within the operating system professionals in security testing penetration testing and ethical hacking utilize Linux as their preferred operating system provides several configurable distributions that Miu may configure based on your end use kali Linux and Parrot OS are two popular penetration testing distributions while these operating systems each have unique offerings the overall choice can differ between personnel thanks to their various tools and hardware specifications today we will look at both these distributions and settle on the perfect choice for each type of user let’s go through the agenda for this video we will learn about Kali Linux and pilot security OS from scratch while understanding their primary selling points as a Linux distribution catered towards penetration testers next we know about some features of these operating systems that stand out of their package finally we directly compare Kal Linux and Par security OS thereby making a clear-cut conclusion on which OS is perfect on a per requirement basis so let’s start by learning about Kal Linux from a ground level kal Linux which is formerly known as Backtrack Linux is an open-source Linux distribution aimed at advanced penetration testing and security auditing it contains several hundred tools targeted towards various information security tasks such as penetration testing security research computer forensics and reverse engineering kali Linux is a multiplatform solution accessible and freely available to information security professionals and hobbyists among all the Linux distributions Kal Linux takes its roots from the Debian operating system debian has been a highly dependable and a stable distribution for many years providing a similarly strong foundation to the Kali Linux desktop while the operating system can practically modify every single part of our installation the networking components of Kali Linux come disabled by default this is done to prevent any external factors from affecting the installation procedure which may pose a risk in critical environments apart from boosting security it allows a more profound element of security control to the most enthusiastic of users now let’s take a look at Parrot security operating system parrot Security OS is a Debian based Linux distribution with an emphasis on security privacy and development it is built on the Demian’s testing branch and uses a custom hardened Linux kernel parrot security contains several hundred tools targeted towards tasks such as penetration testing computer forensics reverse engineering and security research it is seen as a generally lightweight distribution that can work under rigorous hardware and software specifications it features a distinct forensics mode that does not mount any of the systems hard disks or partitions and has no influence on the host system making it much more stealthy than its regular occurrence this mode is used on the host system to execute forensic procedures a rolling release is a paradigm in which software upgrades are rolled out constantly rather than in batches of versions in software development this ensures that the software is constantly up to date a rolling release distribution such as pirate security OS follows the same concept it provides the most recent Linux kernel and software versions as soon as they become available with a basic introduction to the operating systems out of the way let us take a look at the unique features of both Kali Linux and Parrot Security OS the latest version of Kali Linux comes with more than 600 penetration tools pre-installed after reviewing every tool included in Backtrack developers have eliminated a significant number of tools that either simply did not work or duplicated other tools that provided the same and similar functionality the Kali Linux team comprises a small group of individuals who are the only ones trusted to commit packages and interact with the repositories all of which is done using multiple secure protocols restricting access of critical code bases to external assets dramatically reduces the risk of source contamination which can cause Kali Linux users worldwide a great deal of damage as a direct victim of cyber crime although penetration tools tend to be written in English the developers have ensured that Kali includes proper multilingual support allowing more users to operate in the native language and locate the tools they need for the job the more comfortable a user feels with the intricacies of the operating system the easier it is to maintain a stronghold over the configuration and the device in general since ARMbased single board systems like the Raspberry Pi are becoming more prevalent and inexpensive the development team knew that Kali’s ARM support would need to be as robust as they could manage with fully working installations kali Linux is available on a wide range of ARM devices and has ARM repositories integrated with the mainline distribution so the tools for ARM are updated in conjunction with the rest of the distribution let’s take a look at some of the features of Parrot Security operating system now along with a giant catalog of scripts Parrot Security OS has its own hardened Linux kernel modified explicitly to provide as much security and resistance to hackers as possible in the first line of defense the configurations in the operating system act as the second gateway taking care of malicious requests and dropping them off this is particularly beneficial since should there be a scenario where the latex Linux kernel is causing some particular issue the Parrot OS development team will most likely iron it out first before passing it on as an update if the custom hard kernel wasn’t recent enough PAR security developers managed to install more hacking tools and scripts to ensure a smooth transition for the Kali Linux users all the tools you find in Kali are present in parent to us and a few extra ones for good measure and this has been achieved while keeping roughly the same operating system size between both of them however it’s not all productivity points for parrot OS they provide a choice between two different desktop environments mate which comes pre-installed by default and KDE for those unfamiliar with Linux terminology you can think of desktop environments as the main UI for a distribution being highly modular in nature one can use parrot security OS while adding another desktop environment that they find appealing while Kal Linux has only a single option parrot security has provided two optimized builds with mate desktop and KD desktop one of the primary advantages of Parrot OS over Kali Linux is that it’s relatively lightweight this implies that it takes significantly less disk space and computing power to function correctly with as little as 320 MB of RAM required in reality Parrot OS is designed to operate successfully off a USB stick but Kali Linux does not work well from a USB Thrive and is generally installed in a virtual machine pirate OS is more of a niche distribution if you’re searching for something lighter than Kal Linux features are great but what about performance real world metrics let us compare both these operating systems directly with respect to their hardware specifications and usability in the end we can decide on what distribution is fit for each type of user for our first point of comparison let’s take a look at the RAM required for optimum performance of the operating system which is highly essential when trying to crack hashes or something of similar nature ram usage is a very important facet while Kali Linux demands at least 1 GB of RAM Paris security can operate optimally with a minimum of 320 MB of RAM for correctly displaying graphical elements kali Linux requires GPU based acceleration while this is not the case with parro security OS which doesn’t require any graphical acceleration needed from the user side once these operating systems are installed on VMware using the live boot ISOs they take up a minimum amount of hard disk storage both of these operating systems have a recommended disk storage of minimum of 20 GB in Kali Linux and a minimum of 15 GB in par security so they can install all the tools necessary in the ISO file when it comes to the category and the selection of tools Kal Linux has always been the first in securing every single tool available for hackers in the penetration testing industry parrot security on the other hand has managed to take it up a notch while specializing in wireless pen testing Parrot security makes it a point that all the tools that Kali Linux provides has been included in the ISO while simultaneously adding some extra tools that many users will have to install from third party sources in Kali Linux being a decade old penetration testing distribution Kali Linux has formed up a very big community with strong support signature parcurity on the other hand is still growing and it is garnering much more interest among veteran penetration testers and ethical hackers a primary drawback of Kal Linux is the extensive hardware requirement to perform optimally it requires higher memory than pyro security it also needs graphical acceleration while demanding more virtual hard disk storage parrot security on the other hand was initially designed to run off a USB drive directly thereby requiring very minimal requirements from a hardware perspective like just 320 MB of RAM and no graphical acceleration needed this means PAR security is much more feasible for people who are not able to devote massive resources to either their virtual machine or on their laptop hard disk directly with the comparison done between both of these operating systems let’s take a look at the type of users both of these are catered to one can go with Kala Linux if they want the extensive community support offered by its users if they want to go with a trusted development team that have been working on this distribution since many years if they have a powerful system which can run Kal Linux optimally without having to bottleneck performance and if they are comfortable with a semi-professional environment which may or may not be very useful for new beginners one can decide to go with parrot security if they want to go with a very lightweight and lean distribution that can run pretty much on all systems it also has a lot of tools pre-installed and some of them are not even present on Kal Linux it is much more suitable for underpowered rigs where users do not have a lot of hardware resources to provide to the operating system and thereby it is much more feasible for people with underpowered laptops or no graphical acceleration compared to Kal Linux Parc’s desktop environment is also relatively easier to use for new beginners for people who are just getting into ethical hacking Parent Security does a relatively better job of introducing them to the operating system and to the various tools without having to dump them into the entire intricacies the installation of Kali Linux there are multiple ways to install Kali Linux we can either install it on a normal hard drive in a virtual machine software such as VMware or Virtual Box or we can do that in hard bare metal machines now for the convenience of explanation we’re going to install Kali Linux today on a virtual machine software known as VMware vmware is able to run multiple operating systems on a single host machine which in our case is a Windows 10 system to get started with Kali Linux installation we have to go to the website to download an image file we go to get Kali and as you can see there are multiple platforms on which this operating system can be inverted as per our requirement we’re going to go with the virtual machine section as you can see it is already recommended by the developers this is the download button which will download a 64-bit ISO file we can download 32-bit but that is more necessary for hard metal machines or if you’re going to use it for older devices which do not support 64-bit operating systems yet after clicking on the download button we can see we have a vinro archive which will have the ISO files for now we have downloaded the ISO file and it is already present with me so we can start working on the VMware side of things once the ISO file is downloaded we open up VMware Workstation go to file and we create a new virtual machine in these two options it is highly recommended to go with the typical setup rather than the custom one the custom is much more advanced and requires much more information from the user which is beneficial for developers and people who are wellversed with virtualization software but for 90% of the cases typical setup will be enough here we can select the third option which will be I will install the operating system later in some operating systems we can use the ISO file here directly and VMware will install it for us but right now in the case of Kal Linux the third option is always the safest kal Linux is a Linux distribution so we can select Linux over here and the version as you can see here have multiple versions such as the multiple kernels every distribution has a a parent distribution for example Kal Linux has Debian and there are other distributions which are based or forked from some parent distribution kal Linux is based off of Debian so we can go with the highest version of Debian which is the Debian 10.x 64bit go next we can write any such name we can write Kal Linux so that it’ll be easier to recognize the virtual machine among this list of virtual machine instances the location can be any location you decide to put by default it should be the documents folder but anywhere you put it will hold up all the information regard the operating system all the files you download all the configurations you store everything will be stored in this particular location that you provide when we go next we are asked about the disk capacity this disk capacity will be all the storage that will be provided to your virtual machine of Kal Linux think of your Windows device if you have a 1 TB of hard drive you have the entirety of the hard disk to store data on how much data you give here you can only store up to that amount of data not to mention some amount of capacity will be taken up by the operating system itself to store its programs and applications for now we can give around let’s say 15 GB of information or if it recommended size for DBN is 20 we can just go ahead with 20 it depends all on the user case if you are going to use it extensively you can even go as high as 50 or 60 GB if you have plans to download many more applications and perform multiple different tests another option we get over here is storing virtual discs as a single file or storing them into multiple files as we already know this virtual machine run entirely on VMware sometimes when transferring these virtual machine instances let’s say from a personal computer to a work computer we’re going to need to copy up the entire folder that we had mentioned before over here instead all virtual machines have a portability feature now this portability feature is possible for all scenarios except it is much easier if the split the virtual disck into multiple files now even if this makes what porting virtual machines easier from either system to system or software to software let’s say if you want to switch from VMware to Virtual Box or vice versa the performance takes a small hit it’s not huge but it’s recommended to go with storing the virtual disc as a single file if you have no purposes of ever moving the virtual machine even if you do it’s not a complete stop that it cannot be ported it’s just easier when using multiple files but in order to get the best performance out of the virtual machine we can store it as a single file over here this is a summary of all the changes that we made and all the configurations that have been settled until now now at this point of time we have not provided the ISO file yet which is the installation file for the Kali Linux that we downloaded from this website as of right now we have only configured the settings of the virtual machine so we can press on finish and we have Kal Linux in the list now to make the changes further we press on edit virtual machine settings the memory is supposed to give the RAM of the virtual machine the devices with RAM of 8 GB or below that giving high amount of RAM will cause performance issues and the host system if the memory has some amount of free storage left let’s say on idle storage my Windows machine takes about 2GB so I have 6GB of memory to provide although if you provide all of the 6GB it will be much more difficult for the host system to run everything properly so for this instance we can keep it as 2GB of memory for the virtual machine instance similarly we can use the number of processors and we can customize it according to our liking let’s say if we want to use one processor but we want to use two different cores we can select them as well hard disk is preset up as the SCSI hard disk and it does not need to be changed for the installation of this operating system at all cdi DVD this is where the installation file comes you can think of the ISO file that we downloaded as a pen drive or a USB thumb drive which is necessary to install an operating system to provide this we’re going to select use ISO image file we’re going to click on browse going to go to downloads and select the IMO file over here select open and you can see it is already loaded up next in the network adapter it is recommended to use NAT this helps the virtual machine to draw the internet from the host machine settings if your host machine is connected to the internet then the virtual machine is connected as well there are some other options such as host only or custom segments or LAN segments but those are not necessary for installation rest of them are pretty standard which do not need any extra configuration and can be left as it is press okay and now we can power on this virtual machine in this screen we can choose how we want to proceed with the installation we have a start installer option over here so we’re going to press enter on that we’re going to wait for the things to load from the ISO file um the first step in the installation is choosing the language of the operating system for this we can go with English as standard this is a location this will be used for setting up the time and some of the internal settings which depend entirely on the location of the user so for this we’re going to go with India configuring the keyboard it’s always recommended to go with the American English first many people make a mistake of going with the Indian keyboard if it is possible and it provides a lot of issues later on so it’s always prefer to go with the American English and if later we see some necessity of another keyboard dialect that is ne required we can install it later but for now we should always stick with American English as a basic at this point it’s going to load the installation components from the ISO file it is a big file of 3.6GB so it has a lot of components that need to be put into the virtual machine which can also be used to detect hardware once the hardware and the network configuration is done by the ISO file we want to write a host name for the system this host name can be anything which is used to recognize this device on a local network or a LAN cable let’s say if we use the name Kali domain name you we can skip it for now it’s not necessary as such for the installation this is the full name for the user let’s say we can provide the name as simply learn as a full name next we’re going to set up a username this username is going to be necessary to identify the user from its root accounts and the subsequent below accounts for now we can give it as something as simply 1 2 3 now we have to choose a password for the user now remember since this is the first user that is being added onto this newly installed operating system it needs to be a password for the administrator we can use whichever password we like over here and use the same password below and press on continue at this point it’s going to detect on the components on which the operating system can be installed like here there are multiple options like the use entire disk use entire disk and setup LVM use entire disc and setup encrypted LVM for newcomers it is recommended to just use the first one since LVM encryption is something that you can learn afterwards when you’re much more hands-on with the Linux operating system for now we’re going to use the use entire disg guided installation and press on continue when we set up the virtual machine on VMware we had set up a disk capacity there we gave a propose 20 GB that is the hard disk which is being discovered here even though it is a virtual disk on VMware it acts as a normal hard disk on which an operating system can be installed so we select this one and press on continue here there is a multiple partition system all the operating systems that are installed have different components one is used for the keeping of the applications one for the files other for the RAM management and other things for newcomers it is always recommended to keep it in one partition and we’re going to select that and press on continue this is just an overview of the partition it’s going to make as you can see it has a primary partition of 20.4GB and a logical partition of 1 GB used for swap memory now these kind of naming can be confusing for people who are not well versed with Linux operating systems or in general virtualization but for now you can go ahead and press on continue as this will be fine we can press on finish partitioning and write changes to disk and continue it’s just a confirmation page as you can see that SCSI3 is our virtual hard disk of 20 GB disk capacity write the changes to the disk we press yes and click on continue at this point the installation has started now this installation will take a while depending on the num amount of RAM provided the processors provided and how quickly the performance of the system is being hampered by the host machine on quicker systems this will be rather quick while on the smaller ones this will take a while since this is going to take some time to install as it is being run on a virtual machine with only 2 GB of RAM we’re going to speed up this part of the video so we don’t have to waste any more time just watching the progress bar now that our core installation is completed it’s asking us to configure a package manager the work of a package manager on Linux operating system is similar to the Google Play Store on Android mobile devices and on the App Store for the Apple devices it’s an interface to install external applications which are not installed by default let’s say for Google Chrome or any other browser which can be used to browse the internet at this point of time it’s ask us to select a network mirror we’re going to select as yes and move forward with this next it’s going to ask us for a HTTP proxy which we can leave it as blank and press it as continue forward at this point of time it’s looking for updates to the Kali Linux installation this will fetch the new builds from the Kali server so the installation is always updated to the latest version now that the package manager is configured we have the grub bootloader the grub is used for selecting the operating system while booting up its core functionality is to allow the operating system to be loaded correctly without any faults so at this point of time if it asks install the grub boot loader to your primary dive we can select it as yes and press continue remember the installation was conducted on dev SDA so we’re going to select installation of the grub loader on the same hard disk that we have configured we press this one and press continue so now the grub boot loader is being installed the grub is highly essential because it it shows the motherboard where to start the operating system from even if the operating system is installed correctly and all the files are in correct order the absence of a bootloadader will not be able to launch the OS properly as you can see the installation is finally complete so now we can press on continue and it’s going to finalize the changes now you can see Kal Linux being booted up straight away it doesn’t check for the ISO file anymore since the operating system is now installed onto the virtual hard disk storage that we had configured before here we’re going to enter our username and password that we had set up before and we have the Kalinux system booted up and this is your homepage we can see the installed applications over here which are being used for penetration testing by multiple security analysts worldwide all of these come pre-installed with Kal Linux and others can be installed using the AP package manager that we had configured we can see a full name over here and with this our installation of the Kali Linux is complete it’s no secret that the vast bulk of our internet usage is vulnerable to hacking whether it’s through hazardous messaging apps or faulty operating systems penetration testing has become the norm for vulnerability assessment in order to fill this vacuum in digital security kali Linux is a well-known operating system in this fight against hackers kal Linux a distribution designed specifically for penetration testers has layers of features that we will go over in today’s lesson and take a look at some of the tools and features that the operating system has to offer let’s take a look at the videos topics and features that the operating system has to offer let’s take a look at the videos topics we start by learning the requirements of an operating system like Kali Linux we learn more about the core features of the OS and its intricacies moving on we take a look at the five distinct stages of penetration testing that dictate the flow of vulnerability assessment in general next we learn about some important tools that can be found on Kali Linux which are geared specifically for ethical hacking purposes and finally we have an extensive demonstration where we work on some basic terminal commands proxy tools and a couple of highly regarded software from the crux of the operating system let’s start by learning why one should learn Kali Linux in the first place in today’s world an organization’s most valuable asset is its information or data this is true for all kinds of businesses be it public or private on a daily basis they all deal with enormous amounts of sensitive information as a consequence terrorist groups hacking teams and cyber thieves often attack them to ensure the safety and protection businesses use a variety of security measures and regularly update their index organizations must be proactive in this age of digitalization by regularly assessing and updating their security everyday hackers discover new methods to breach firewalls ethical hackers or white hat hackers provide a fresh perspective on security they conduct penetration tests to validate security measures generally they will penetrate your networks and give you relevant information about your security posture once an organization has this knowledge it may upgrade its security procedures accordingly the latest version of Kallay Linux comes with more than 600 penetration tools pre-installed after reviewing every tool that was included in Backtrack developers have eliminated a great number of tools that either simply did not work or which duplicated other tools that provided the same or similar functionality occasionally when conducting penetration testing or hacking we must automate our activities since there may be hundreds of conditions and payloads to test and manually examining everything is timeconuming to improve our productivity we utilize tools that come prepackaged with Kali Linux these tools not only save us time but also accurately capture and process the data the Kylie Linux team is made up of a small group of individuals who are the only ones trusted to commit packages and interact with the repositories all of which is done using multiple secure protocols restricting access of critical code bases to external assets greatly reduces the risk of source contamination although penetration tools tend to be written in English the developers have ensured that Kali includes true multilingual support allowing more users to operate in the native language and locate the tools they need to do for the job since ARM based single board systems like the Raspberry Pi are becoming more and more prevalent and inexpensive the development team knew that Kali’s ARM support would need to be as robust as they could manage with fully working installations kali Linux is available on a wide range of ARM devices and as ARM repositories integrated with the mainline distribution so tools for ARM are updated in conjunction with the rest of the distribution tools now that we understand the necessity for an operating system like Kali Linux let us take a look at some of its core features and offerings to the ethical hacking world kali Linux formerly known as Backtrack Linux is an open-source Linux distribution which is aimed at advanced penetration testing and security auditing it contains several hundred tools targeted towards various information security tasks such as penetration testing security research computer forensics and reverse engineering kali Linux is a multiplatform solution accessible and freely available to information security professionals and hobbyists among all the Linux distributions Kali Linux takes its roots from the Debian operating system debian has been a highly dependable and stable distribution for many years providing a similarly strong foundation to the Kali Linux desktop while the operating system is capable of practically modifying every single part of our installation the networking components of Kali Linux come disabled by default this is done to prevent any external factors from affecting the installation procedure which may pose a risk in critical environments apart from boosting security it allows a deeper element of security and control to the most enthusiastic of users let us now take a look at the five stages or phases of penetration testing this is the first stage of the penetration test which is known as the reconnaissance phase in this stage the security researcher collects information about the target it can be done actively which means you are collecting information without contacting the target or even both it helps security firms gather information about the target system network components active machines open ports and access points operating system details etc this activity can be performed by using information available in the public domain and using different tools the next phase is more tool oriented rather than performed manually and it is the scanning phase the penetration tester runs one or more scanner tools to gather more information about the target the penetration tester runs one or more scanner tools to gather information about the target by using various scanners such as war dialers port scanners network mappers and vulnerability scanners the tester collects as many vulnerabilities which help to turn an attack in a more sophisticated way the next stage is known as the gaining access phase in this phase the penetration tester tries to establish a connection with the target and exploit the vulnerabilities found in the previous stage exploitation may be buffer overflow attacks denial of service or DOS attacks session hijacking and many more basically penetration tester extracts information and sensitive data from servers by gaining access using different tools in the maintaining access phase the penetration tester tries to create a backdoor for himself it helps him to identify hidden vulnerabilities in the system and can later act as a gateway to retrieve control of the system in the final phase of covering tracks the penetration tester tries to remove all logs and footprints which help the administrator identify his presence this helps the tester to think like a hacker and perform corrective actions to mitigate those activities now that we understand the basics of penetration testing and how ethical hackers go about their way let us take a look at some notable tools which can be used on Kali Linux at the top of the chain lies NAPAP lmap is a free and open-source utility port scanner which can be used for network discovery and security auditing many systems and network administrators also find it useful for tasks such as network inventory managing service upgrade schedules and monitoring host or service uptime it is most beneficial in the early stages of ethical hacking that a hacker must figure the possible entry point to a system before running the necessary exploits thus allowing the hacker to leverage any insecure openings and breach the device it’s a part of the scanning phase of the penetration testing nap uses raw IP packets in novel ways to determine what hosts are available on the network what services these hosts are offering what operating systems they are running and their versions what type of packet filters and firewalls are in use and dozens of other characteristics it was designed to rapidly scan large networks but works fine against single hosts as well since every application that connects to a network needs to do so via a port the wrong port or server configuration can open a can of worms which lead to a thorough breach of the system and ultimately a fully hacked device next on the list we have metas-loit the metas-ploit framework is a very powerful tool that can be used by cyber criminals as well as ethical hackers to probe systemic vulnerabilities on networks and servers as a part of the third stage of penetration testing it’s an open-source framework which can be easily customized and used with most operating systems with Metasloit the ethical hacking team can use a readymade or custom code and introduce it into a network to probe for weak spots as another flavor of threat hunting once these flaws are identified and documented the information can be used to address systemic weaknesses and prioritize solutions once a particular vulnerability is identified and the exploit is fed into the system there are a host of options for the hacker depending on the vulnerability hackers can even run root commands from the terminal allowing complete control over the activities of the compromised system as well as all personal data stored on the device a big advantage of metas-loit is the ability to run full-fledged scans on a target system thereby giving a detailed picture of the security index of said system this also provides the necessary exploits that can be used to bypass the firewalls and the anti virus software having a single solution to gather almost all the necessary points of attack is very useful for ethical hackers and penetration testers as denoted by the high rank in this list at number three we have Wireshark wireshark is the world’s foremost and widely used networking protocol analyzer it lets you see what happening on your network at a microscopic level and is a de facto standard across many commercial and nonprofit enterprises government agencies and educational institutions wireshark is a popular open-source tool to capture network packets and converts them to human readable binary format it provides every single detail of the organization’s network infrastructure it consists of devices designed to help measure the ins and outs of the network the information collected through Wireshark can be used for various purposes such as realtime or offline network analysis identification of the traffic coming onto your network its frequency and its latency between specific hops this helps network administrators generate statistics based on realtime data wireshark is also a cross-platform tool that can be installed on Windows Linux and Mac systems to enable hackers on all ecosystems to monitor network traffic irrespective of the operating system the development team is determined to maintain this level of freedom for their users in the foreseeable future the next tool on our list is Air Garden which is a part of the third phase of penetration testing this is a multi-use bash script for Linux systems to hack and audit wireless networks like our everyday Wi-Fi router and its counterparts along with being able to launch denial of service attacks on compromised networks this multi-purpose Wi-Fi hacking tool has very rich features which support multiple methods for Wi-Fi hacking including multifps hacking modes all-in-one WP attack handshake file capturing evil twin attacks pixie dust and so much more it usually needs an external network adapter that supports monitor mode which is necessary to be able to capture wireless traffic traversing the air channels thanks to its open-source nature Air Garden can be used with multiple community plugins and add-ons thereby increasing its effectiveness against a wide variety of routers both in the 2.4 GHz band and 5 GHz band the next tool is John the Ripper john the Ripper is an open-source password security auditing and password recovery tool available for many operating systems john the Ripper Jumbo supports hundred of hash and cipher types including for user passwords of operating systems web apps groupware database servers network traffic captures encrypted private keys file systems and document files some of the key features of the tool include offering multiple modes to speed up password cracking automatically detecting the hashing algorithm used by the passwords and the ease of running and configuring the tool making it a password cracking script of choice for noviceses and professionals alike it can use dictionary attacks along with regular brute forcing to speed up the process of cracking the correct password without wasting additional resources the word list being used in this dictionary attacks can be used from the users end allowing for a completely customizable process now that we have covered the basics of Kali Linux let us take a look at the agenda for our demo today we start out with a few terminal commands that are a basic part of a Linux operating system configure our own proxy chains to maintain anonymity while running penetration testing attacks on our victims next we run a few end mapap scans on a local Windows 10 machine to find out the type of information that can be gathered in such a scenario moving on we use Wireshark to monitor internet traffic and understand the importance of encryption and security when browsing the worldwide web next we learn about metas-ploit and its various applications in the line of vulnerability assessment of a device and finally we use metas-ploit to take root access of a fully updated Windows 10 computer system let’s begin with some terminal basics on Kali Linux when most people hear the term Linux they envision a complex operating system used only by programmers however the experience is not as frightening as it appears linux is an umbrella term for a collection of free and opensource Unix operating systems there are many variants like Ubuntu Fedora Debian these are distributions which is will be a more precise term when using a Linux operating system you will most likely utilize a shell which is a command line interface that provides access to the operating system services the majority of Linux distributions ship with a graphical user interface also known as GUI as their primary shell this is done to facilitate user interaction in the first place having said that a command line interface is suggested due to its increased power and effectiveness by entering the commands into the CLI tasks that require a multi-step GUI procedure may be completed in a matter of seconds we can start the terminal by clicking on the prompt icon here on top once the terminal is opened we can put up our commands the first command that we are going to look into is pwd pwd stands for present working directory as of right now what you’re seeing is the terminal window by default if I write pwd and press enter this shows the directory in which the terminal is being run on as of right now it’s in the nf folder of my desktop which is specifically this folder if I open up this folder you can see it is currently empty as in it has no contents if I use another command known as mkdir which is supposed to stand for make directory and I write nf2 shortage for new folder 2 if I open up the nf you can see the new folder is created this is how the pwd command works another important command to change directories it’s called the cd command let’s say right now if I am in NF I want to create a new file in NF2 folder or something else in the NF2 folder i have to shift to cd NF2 now if I write pwd it’ll show the present working directory of home simply learn desktop NF and inside that I am in NF2 right now it is done to navigate to the Linux files and dis directories it requires either the full path or just the name of the directory if we have to move a completely different folder on a completely different file then we can use the entire path like this for now CD works another few commands is we can write cd dot dot and it’ll come back one folder now the pwd will be just NF and not NF2 let’s say we are in this folder and we want to go a different file let’s say if you just go for cd home simpler that’s it right now these are the folders in our current present working directory we have the desktop the documents downloads etc from here we can again go to the desktop using the same cd command cross check the changing of directories and check the files again and yes there we go nf How do we know this what are the command that we are used to show the files and folders that folder is known as the ls command ls can be used to view the contents of a directory by default this command will display the contents of your current working directory if we add some other parameters we can find the contents of other directories as well there are some hidden files as well in Linux which cannot be showed just with ls for example if you just go to cd etc which is a configuration folder for Linux if you write ls now these are the files that can be seen if you want to see the hidden files we’ll have to add one more parameter here like ls minus a and as you can see the number of files have increased this time around there are other things as well that we can see with Linux ls minus al will show the hidden files along with some of the parameters and some of the permissions that has been provided for each file as you can see many of these files have root access some of them can write some of them can read it differs file to file and the ls minus al command is used to check each of these files permission and change them accordingly if needed the next command that we can look for is the cat command or concatenate it is one of the most frequently used commands and it is used to list the contents of a file on the output for example let’s say if I have a file at the desktop in this NF2 folder I will create a document create an empty file E file i’ll open up the document and I’ll write it as hello Kali i will save this up now to change the directories from etc to NF2 we have already discussed how to use the cd command using just the folder name now if you want to go through the entire directory we can write cd home as you can see it is already prompting us to complete the name of the directory at this point we just have to press tab and it completes it for ourself next we already know we have to enter the desktop nf and nf2 and this brings us to the current working directory here if we press ls we can find a file over here now as discussed for the concatenate it is used to show the contents of a file so right now if we press cat a t which stands for concatenate e file as you can see we have written hello kali in the text file and we can see the output right now we can also use it to create new files for example if we write cat any file name such as e file 2 here we can write anything hello kali again once we press ctrl c here we can check e file 2 and we have hello kali again printed over here we can see the same using the concatenate command as well if I press ls you can see we have two files here and I can go with cat e file 2 and I have hello kali again this is how the concatenate command works apart from this it can be used to copy there is a different command like called cp which is used to copy the files from one place to another mind you this is not moving this is only going to copy the command for example currently our PWD which is the present working directory is in the NF2 folder as you can see over here let’s copy the E file to the NF folder we can write CP E file 2 and give the path of the NF folder which will be home simply learn texttop NNF now if I press ls I’ll find both the files in NF2 since I copied to go back to the NF folder again we can again use the same command of no uh we can again use the home simply learn desktop and just NF no NF2 this time just NF as you can see this will change back our present working directory now when we press ls we will find the e file to file and the nf2 folder and we can confirm this using the gui as well this is the nf folder and you can see the nf2 folder and the e file 2 document if I write cat e file 2 cat e file 2 we can see the contents of the file now this can be done using moving as well for example if I go to cd NF2 which is the inside folder it has both the document files like E file and E file 2 let’s say I want to move the E file completely from NF2 to NF1 instead of writing cp the command I’m going to use is mv mv e file and again give the path of the folder into which I have to copy which will be again home simply learn desktop and nf as you can see the contents of the NF2 have appeared here and E file has been moved from NF2 to NF this is the NF2 and we don’t find E file here anymore if we press CD dot dot and we go back to NF LS right now and we can find both the files E file that we moved and E file 2 that we copied from the NF2 folder so this is how copying and moving will work using the terminal now this is just a simple oneline statement that might take a couple of clicks when using GUI this is why the command line interface is considered to be much more streamlined for Linux operating systems another very important command for Linux operating system is the pseudo command pseudo is short for super user do the command enables you to perform tasks that require administrative or root permissions we can think of it as how we run programs as administrator on Windows systems it is not advisable to use this command for daily use because it might be easy for an error to occur and the permissions of root are very intricate so new beginners are advised to use the pseudo command only when absolutely necessary for example pseudo su with this command I am giving this terminal a root permission this SU stands for this user at this point it’s going to ask for my admin password once I enter my password and I now have root access note how the password that I entered did not show up here this is a security measure to prevent people from snooping on your root password which is the endgame of all this operating system as you also can see the symbol changed if the dollar symbol is showing it’s source as a standard user when you switch to root you can easily see a hash symbol this opens up a separate shell inside this terminal command for example we can exit out of the root user to the standard user using the command exit and once again we have the dollar sign and the root has vanished over here there are some commands that will only work with administrative access for example when updating the Kali Linux system we have to use a update as you can see it says problem unlinking the file because permission denied now let’s try this using pseudo sudo apd update as you can see it is updating the package repositories which work as the software installed on the system this can be done using either writing the pseudo command every time we want to perform a root access or we can just write pseudo su once and write a update alone the fetching is complete over here for the second example let’s say I just write pseudo su and this time it’s not going to ask me the password because at this current terminal process I’ve already provided the root password once and it is in memory right now now when we used to update the system we had to write pseudo a update that was because we were running it as a standard user now we are running it as a root user so all we have to write is a update and it’s going to continue its work there you go another command that can be useful is the ping command it’s pretty self-explanatory it’s going to be checking the internet connectivity it can be used to check internet connectivity or you can see if the there is a local server on your system which needs to be pinged then you can check that for example if we have to write ping and we can use either IP address or domain let’s say if you want to check that if we can access google.com using this Kali Linux installation or not we can write ping google.com and you can see it shows the bytes being sent and received and how much time it took to take up the request this can be done for local systems as well for example this installation of Kali Linux is being run on a virtual machine once this machine is running I still have my host machine running over here the IP address of which is 192.168.29 179 if I try to ping this from here as you can see the time to complete the request is drastically low compared to a website on the internet considering this is on the local network this is how the ping command is worked and it can show you what kind of packages are transmitted how many are received if there was any kind of packet loss between the connection window and other details a very important command when working with the terminal for a long duration is a history command pretty self-explanatory there are so many commands that are being run sometimes people forget what was the change they did or what was the directory name they put a history command helps to recover some of the commands that you have written it doesn’t go all the way back but it takes up many commands that were inputed in the last few processes this is how the history command works these are some of the most commonly used terminal commands if you want to learn more about this terminal and every other feature of this please let us know in the comment section and we’ll try to make an in-depth tutorial especially if you got repeat if you want to learn more about the terminal please let us know in the comment section and we will try to make an in-depth tutorial specifically for terminal commands on Linux moving on we learn how to configure proxy chains on our system proxying refers to the technique of bouncing your internet traffic through multiple machines to hide the identity of the original machine it is a good tool that hackers use to accomplish this goal is proxy chains essentially you can use proxy chains to run any program through a proxy server this will allow you to access internet from behind a restrictive firewall which hides your IP address proxy chains even allows you to use multiple proxies at once by chaining them together one of the most important reasons that proxy chains is used in a security context is that it’s easy to evade detection attackers often use proxies to hide their true identities while executing an attack and when multiple proxies are chained together it becomes harder and harder for a forensic professional to trace the traffic back to the original machine when these proxies are located across countries investigators would have to obtain warranties in the local jurisdictions where every proxy is located to to see how proxy chain works let’s open Firefox first and check our current IP address write Firefox and there we go as we can see Firefox is now open let’s check our current IP address right now if you go to an address called my ip.com and you can see it easily detects our country is in India and this is a public IP address now if we move to the terminal again here we can now write proxy chains minus h what this minus h does is it finds a help it uh it it stands for the help file this is for help file what we found out using this is proxy chains has a config file here etc proxy chains 4 cf this is the config file found using this config file we can customize how our proxy chain should work if we want to open that we have to use it in a text editor on Windows we have Notepad and other things like that Microsoft Word to edit documents on Linux we have a tool called nano to access the nano we use the command nano and give the path of the file that we want to check as of right now the proxy chains config file is located over here so we’re going to follow the path there chains 4 cf and here we go we see the config file there are three basic types of proxy chaining here we have a strict chain where all the proxy in the list will be used and they will be chained in order we have a random chain where each connection made through proxy chains will be done by a random combo of proxies in the proxy list and you have dynamic chain it’s the same as strict chain but dead proxies are excluded from the chain and here we can set up whichever type we want to enable or disable a particular type we use the hash symbol here as you can see right now all the lines have a hashtag symbol at the front except this one a dynamic chain this is the current one being used let’s say if I want to use a strict chain method so

    I can add a hash value here and remove the hash here at one point of time any one of these three four types should be enabled let’s go for the dynam um dynamic chain we can disable this strict chain by putting the hashtag in front and removing the dynamic chain as you can see below we have few commands to how to handle the nano text editor this symbol is known as the control button on your keyboard now if we want to write out which is synonymous to saving the file supposed to go with control O so if I press Ctrl O on my keyboard it says file name to write and we have to press enter here since we want to overwrite the proxy chains 4.f file we don’t want to create a new file over here so just press enter and we get a permission denied this permission denied we’re getting is because we have opened this using a standard user etc is a system folder to be able to use make some changes we have to use it using a pseudo command to exit this nano we have to use the controlx command we use controll x we’re going to clear and this time we’re going to use the pseudo command pseudo nano etc proxy chains 4 cf and we have the same file open up again now this time if you want to make a change let’s say we’re going to add a strict chain instead of a dynamic chain we remove the hashtag from strict we’re going to use control O for the save file option we’re going to press enter and it says wrote 160 lines again if you want to reverse this change we put the hashtag over here enable dynamic chain we press Ctrl O press enter and it says root 160 lines now we can exit straight away using the control X format right now we have not provided any file or a proxy chain we can have proxy IP addresses from the internet but we have to make sure that they are safe and they don’t snoop on our data when there is no proxy chains being provided personally it going it’s going to use the to network but for that we have to start to is a service in Linux to know more about the store we can write sudo systemct ctl which is used to know the status of services on the Linux operating system and status of to uh system ctl sorry uh as instead of stl It should be systemctl status to as you can see it is a to service anonymizing overlay network for TCP connections and it’s currently inactive now to start this up we have to write sudo systemct ctl start dot now if we repeat the same sudo systemctl status store as you can see it’s active now you can see the green logo over here okay to integrate the Firefox and the browser we can use the proxy chains command directly over here we can write proxy chains we can use Firefox to launch our web browser and let’s say if we want to visit google.com we press enter and the Firefox window is launched and it should open up google.com next and there we go if we go to my ip.com once again as you can see we have a different IP address and the country is unknown as well so this is how we can use proxy chains to anonymize uh internet usage when using Kali Linux next on our agenda is the ability to scan networks using N MAPAP at its core N MAPAP is a network scanning tool that uses IP packets to identify all the devices connected to a network can learn more about N map using the help file as you can see these are some of the parameters that can be used when scanning ports of a system you can see the version and the URL of the of the service over here the primary uses of N mapap can be broken into three core processes first the program gives you detailed information on every IP active on your network and then each IP can then be scanned secondly it can also be used to providing a lot of live hosts and open ports as well as identifying the OS of every connected device thirdly NAPAP has also become a valuable tool for users looking to protect personal and business websites using N MAPAP to scan your own web server particularly if you’re hosting your website from home is essentially simulating the process that a hacker would use to attack your site attacking your own site in this way is a powerful way of identifying security vulnerabilities as we already discussed the host Windows 10 machine on the system has an IP address of 192.168 29.179 if you want to test the OS scan of the system we’re going to first get the root permission over here we use the pseudo command and now we are a root user we’re going to launch the command N map minus O which is supposed to be an OS detection scan the IP address we can use of the host system 192.168.29.1 29.179 in a legitimate penetration testing scenario we can use the IP address of the vulnerable digit device over here we are going to let it scan for a while and it’s going to give us some guesses on what can the OS be as you can see the scan is done and it has shown some of the ports that are open you can see the MSRPC port open the HTTPS 443 port open which is used to connect to the internet and it has some aggressive OS guesses as well for example it thinks there’s a 90 94% chance that it’s going to be a Microsoft Windows XP Service Pack 3 that’s partly because a lot of the Windows XP update packages are still prevalent on Windows now that the OS detection is confirmed there are multiple more details that we can gather from N map let’s go with the N map minus a command which is supposed to capture as much data as possible there is also a speed setting you can call it a speed setting or a control setting of the minus T minus T ranges from T0 to T1 to T2 all the way up to T5 this basically determines how aggressively the victim is being scanned if you scan slowly it’ll take more time to provide the results but it will also give a less chance for the intrusion detection system on the vulnerable machine firewall to detect that someone is trying to penetrate the network for now if you want to go with somewhat of a high speed we can go with the T4 and provide the same IP address of the local machine I am trying to attack it’s going to take a little bit of time since it’s trying to capture a lot of information as you can see the results are now here it it launched a scan and took a few top ports that are most likely vulnerable from a Windows XP perspective and it showed a few ports over here it has not shown 991 filtered ports which could not be attacked anyway since they were closed for outside access it shows a few fingerprint settings like the connection policies and the port details it shows an HTTP options some other intricate details that can be used when you attacking its servers it shows a VMware version that it’s running and some few other ports over here apart from that we also have the aggressive OS guesses over here just like we did with the minus O and you can see this time it is showing Windows 7 as 98% no exact OS matches since uh if there was any exact OS matches we could have seen a 100% chances over here this is a trace route a trace route will be the time and the path a connection request takes from the source to the destination for example this request went from 19 to 16872.2 to a destination address since this is a local machine it took only a single step on multiple occasions if you’re trying to access a remote system it’s going to be a number of trace suits when it jumps from firewall to firewall and router to router this is how we can use end mapap to find information about a system and find some vulnerable ports we can access moving on we have a tutorial on how to use Wireshark to sniff network traffic to start using Wireshark we’re going to have to open the application first now during installation of Wireshark there is an option to enable if nonroot users can be able to capture traffic or not in my installation I have disabled that so I will be launching Wireshark when using the root user itself also to capture data we need an external Wi-Fi adapter you can see it over here in the VM tab removable devices link 802.1 and WLAN this is a external Wi-Fi adapter which is inserted into my USB system can see it over here if I write IW config this is the one wlan zero this is absolutely necessary because we need to have a monitor mode required we won’t need it for sniffing data on wireshark right now but it’s going to be necessary later on in this tutorial as well as we will see for now we can just start up wireshark by writing its name on the command line and it should start the program here we go here it’s going to check which of the adapters we want to use for example right now the ETH0 which supposed to stand for Ethernet zero port you can see data is being transmitted up and down we’re going to select ETH0 and we have started capturing data you can see the data request from the source the destination and the time and the which protocol it is following everything we can see and we can see the IPv4 flags here as well as you can see over here to capture internet traffic we can try running Firefox if we just write wikipedia.com And you can see the number of requests increasing okay this is spelling mistake wikipedia here you can see the application data of all these requests going up and they’re connected to a destination server of 103 102 166.224 now if you even if you check the transmission control protocol flags over here and so many more things we cannot find anything beneficial as you can see the information over here is gibberish which is supposed to be since it’s supposed to be encrypted now this is possible due to this being an HTTPS website hence you can see the lock symbol over here and connection is supposed to be secure now what about HTTP ports we have seen a many people recommend to not visit HTTP ports repeat we have seen many people recommend to not visit HTTP websites and even if you have to visit to not provide any critical information for example let’s go to a random HTTP page over here as you can see this is saying connection is not secure and this is an HTTP HTTP page and not HTTPS now let’s check for some of the information that is passing through this this is a login form let’s say I have a legitimate account over here if I write my account name and my password is supposed to be password 1 2 3 4 i press login and uh the password does not match because I do not have an account over here but let’s say I did and I was logged in as expected we can go to wireshark we can use filters over here now all the requests that I’m sending it’s a TCP request so I can write a filter containing TCP contains whatever string if it is being passed let’s say for the end username I write my account name so I can just write my account name over here and press enter to find a request over here now as you can see there are many flags over here if I go to the HTT HTML form URL encoded and open up some of its flags as you can see I can see my account name and simply learn password over here this is the same details that I input on the website let’s say I did have a legitimate account on this website i would have logged in with no problems but anyone who would be using Wireshark to sniff on the data can easily get my credentials from here this is why it’s recommended to not provide any information on HTTP pages the security is not up to the mark and always look for the lock symbol when visiting any website or making any internet transactions or providing any information this is how we can use Wireshark to detect transmission and sniff packet data that is being transferred through the network adapter next we have to learn about what is Metasploit the Metasloit project is a computer security project that provides information about security vulnerabilities and aids in penetration testing and IDS development we can open up the terminal here we’re going to allow root access and to open up Metasloit the keyword is MSF console it’s going to take a little bit of time to start it up now the Metasloit console has been loaded from here we can decide what type of attack we want to launch and what kind of exploits we can launch against vulnerable targets for example like we already discussed I’m running this virtual machine on a Windows 10 host machine so if I open the command prompt for my Windows 10 over here if I need to check the IP address once I go with IP config here you can see the IP address of this local machine moving on if we have to attack that machine let’s say we want to see what kind of exploits are going to work over there now we already know that Windows has some common vulnerabilities one of those vulnerabilities is the HDA server vulnerability hda is supposed to be a HTML application but when passed the right payload it can be used to open a back door into a system to start off with the metasloit and accessing such applications we’re going to use the command use exploit and the name of the reverse HDA server is this Windows MIS for miscellaneous HDA server as you can see it already found this one all right now there are some options that we need to set for this exploit to go through for example you can see some of the options over here there’s a payload the payload is supposed to be the malicious file that we are going to send on the HTML application which allows us to give the back door for example right now the payload which is the malicious file is a Windows meter reverse TCP completely understandable now let’s set the LHOST lhost and Rhost and SRV host should be the one where we are going to launch the attack from for example if we launched another tab of this console and we just press config the IP address is 192.168 72130 so we’re going to set the LHOST as 192.168.72.130 and we’re going to do the same thing with SRV host we’re going to set a port where we need to capture the backdoor access next the payload has already been set this payload will launch a backd dooror and give us interpreter access to the system metup printer is can be considered as an upgrade of a normal command prompt shell we will look into it once we get the access in the first place now that we have set the commands we can press on exploit and press enter now you can see we have a URL over here we’re going to copy this URL once the URL is copied we take it into the browser and paste it this will ask us to download this file now as per browser security settings this file should be blocked by default we can decide to keep it and with the correct formulation of this malicious package even the website browser antivirus softwares will not be able to detect good payloads we’re going to save this file and we’re going to open it publisher could not be verified if we press run and we go back to our meta beta access over here you can see it has already captured a URL of an HD server and it is writing delivering payload just have to wait for a few seconds till the payload is delivered it has sent this much amount of data meter session one is opened and we should get the access soon there we go now to understand where is the session set we can write sessions minus I as you can see it has a meta over here we’re going to write sessions minus I the session ID is one so we’re going to write one and we have the metap access now to get a fair idea of the system we’re going to write sus info and it’s going to the computer name the OS architecture all these things we can write the help command to see what are the things that we can get out of the system we can take screenshots we can control the webcam and start a video chat we can take a lot of things over here there are other commands as well where we can change the file directory like the cat command cd command there are so many things that work in the normal cmd which we can run on the meter as well now if you want to access the command prompt of the system directly we can go with this we have to write shell and there we go we are in the downloads folder right now to see if this is the same computer or not we’re going to write IP config as you can see it is our M victim machine with 192 168 or 29.171 we can just press exit and we’re back with the meter access this is how we can use Meta and Metasloit to gain access to a Windows 10 machine next let’s take a look at how we can get root access from a Windows 10 system we just learned how we can get a meter access from a system we can background this meter per session by writing background and pressing enter we can still we can still see the session session minus I it’s still present over here now these kind of access are not administrative access these are the kind of back doors that can be created for standard users but to get a complete access of a system including the program files the Windows documents we need to have root access or administrative access to do that we’re going to use another exploit reminder that the Metapita session of the standard access is already present and we’re not messing with it right now we’re going to set up another session albeit with the same machine that exploit name is use exploit Windows local bypass USC event viewer and there we go now if we check the options that we can put in the system we have to choose an exploit target we need to put a session as well let’s say we going to use the session one this is the session that has the meter access with the standard user it doesn’t have the system user we’re going to write set session one and we’re going to run exploit run a few commands and it opened a second meter session as you can see it is the session two if I write CIS info you can still see I’m not the um system user right now i’m still just a normal user how can we check that if you go to shell I’ll still see user shabb downloads all these things if I press exit go back to the meter there is a command on meter get system it attempts to elevate your privilege to that of the local system which basically means you get promoted into root access so if we write get system and due to pipe impersonation we now have the system root access as you can see now it has become x64 and we are the admin users now if I go to shell I can easily go back Windows and I can easily access these things this kind of control over the Windows folders and the program files folders these kind of things are not possible if you are not an admin access or the command prompt has not been run with admin permissions this is how we can use privilege escalation to get into an admin access system we used the second exploit which was the bypass US event viewer exploit and essentially used it with the first session as you can read here Windows escalation US protection bypass it was first disclosed on 2016 but it still works on some systems this is how we can get a root access on a Windows 10 installation hope you learned something new today today we are going to talk about some really interesting and powerful hacking gadgets you should know about in 2024 but remember this is just for learning we don’t want anyone getting into trouble so moving on the best way to keep your computers and devices safe is to know about the risk so some risk are easy to cater using strong passwords and don’t download from bad websites and don’t hand your unlocked device to strangers but they are also hidden dangers that can cause big problems some tools look innocent but can be very dangerous here are seven gadgets that look normal but are actually powerful hacking tools these tools are made for security experts to test system but they can be misused so let’s kick things off with a device that’s small but incredibly powerful that is Raspberry Pi so Raspberry Pi is a compact and affordable computer that has revolutionized the tech world originally designed for educational purposes it has become a favorite among hobist makers and even professionals despite its small size it boasts impressive capabilities including multiple USB ports HDMI output and support for various operating systems like Linux and Windows 10 IoT core the Raspberry Pi can be used for a wide range of projects from simple programming and gaming to complex IoT systems and home automation the Raspberry Pi can also be dangerous hacking tool with the right software it can be used to perform a variety of hacking task for example it can run Kali Linux a popular operating system for penetration testing this allows it to be used for network scanning password cracking and even setting up rogue access points to intercept data its small size makes it easy to hide and its affordability means it’s accessible to many in the wrong hands this innocent looking device can become a powerful tool for malicious activities now that we have seen the potential of the Raspberry Pi which by the way is one of the personal favorites for tinkering let’s move on to another seemingly simple but powerful device the Wi-Fi adapter so Wi-Fi adapter might seem like a simple device used to connect to wireless networks but it can be a potent hacking tool in the wrong hands these adapters when paired with the right software can intercept and monitor wireless communications making them invaluable for network analysis and penetration testing for example they can be used with tools like air crackg to crack Wi-Fi passwords hackers can use Wi-Fi adapters to perform attacks such as packet sniffing and man-in-the-middle attacks these activities can lead to unauthorized access to networks data theft and severe security breaches it’s like having a digital spy in your pocket while essential for legitimate security testing it’s crucial to be aware of the potential misuse and to secure your own wireless networks against such threats speaking of Wi-Fi you won’t believe how sneaky this next device is let’s take a look at a device that takes wireless hacking to a whole new level the Wi-Fi Pineapple the Wi-Fi Pineapple looks like a standard router but it is a sophisticated device used for hacking wireless networks it allows attackers to create rogue Wi-Fi access points tricking users into connecting and revealing their login credentials imagine connecting to what looks like a free public Wi-Fi only to have your data intercepted this device is capable of advanced man-in-the-middle attacks monitoring and recording data from all connected devices additionally the Wi-Fi Pineapple can capture Wi-Fi handshakes which can then be used to crack network passwords its powerful feature makes it a favorite among penetration testers for assessing network security but in the wrong hands it can be used for malicious activities highlighting the importance of robust wireless security so from Wi-Fi to Bluetooth which is everyone these days right let’s now explore a powerful tool for Bluetooth hacking the Ubertooth 1 the Ubertooth one is an open-source Bluetooth testing tool that appears to be a simple USB dongle despite its unassuming appearance it can monitor and analyze Bluetooth communications making it a valuable asset for those testing the security of Bluetooth devices think of it as a spy for Bluetooth traffic the Ubertooth 1 can capture Bluetooth packets perform Bluetooth attacks and even explore vulnerabilities in Bluetooth networks its ability to dissect Bluetooth traffic makes it a powerful tool for both legitimate security research and potential misuse understanding its capabilities helps highlight the importance of securing Bluetooth enabled devices against unauthorized access and attacks continuing with radio frequency tools which honestly sounds like something out of a spy movie so let’s discuss the hack RF1 and its versatile capabilities so the hack RF1 is a versatile softwaredefined radio SDR platform that can transmit and receive radio signals from 1 MHz to 6 GHz it looks like a standard electronic device but can be used for a wide range of hacking activities imagine being able to capture and manipulate signals across a broad spectrum with the Hack RF1 users can capture and analyze various radio signals jam frequencies and even spoof signals to manipulate communication systems this tool is particularly useful for exploring and testing the security of wireless communication systems while it serves an essential role in legitimate research and development the hack RF1 also demonstrates the need for robust security measures to protect against radio frequency based attacks so now let’s look at a tool that takes advantage of a computer’s trust in USB devices and trust me this one’s sneaky the USB rubber ducky so the USB rubber ducky is a device that looks like a regular flash drive but acts like a keyboard typing commands into any computer it’s plugged into hackers use it to execute pre-programmed scripts that can steal data install malware or take control of the target device it’s like a tiny digital ninja this tool exploits the trust computers have in USB devices making it a potent weapon for cyber attacks it’s a reminder to be cautious about plugging in unknown USB devices as they could be rubber duckies in disguise ready to unleash harmful commands and compromise your system security so finally we have got a real undercover gadget here let’s uncover the secret capabilities of the land turtle the land turtle looks like a typical USB ethernet adapter but it’s a covered hacking tool used to monitor and infiltrate networks don’t let its innocent appearance fool you it provides hackers with several capabilities such as network scanning DNS spoofing and data capture the land turtle can be discreetly plugged into a network allowing access to gather sensitive information and gain unauthorized access its ability to operate undetected makes it particularly dangerous emphasizing the need for vigilance and robust network security measures to prevent unauthorized devices from connecting to your systems so there you have it guys we have explored some of the most powerful and dangerous hacking gadgets out there these tools can do a lot of damage if they fall into the wrong hands that’s why it’s so important to stay informed and vigilant about cyber security hey everyone today we will explore the world of cyber security with hacker GPD specialized version of chat GPD designed for ethical hacking and cyber security in a digital landscape where cyber attacks occur every 39 seconds causing billions in damages annually hacker GPT provides the essential tools and knowledge to defend against these threats so hacker GBD offers guidance on a wide range of topics including security practices ethical hacking techniques and scripting for system security cyber crime damages are expected to reach $6 trillion annually making it a major challenge for organizations and if we talk about some of the breaches so in 2020 over 36 billion records were exposed due to data breaches and the infamous Equifax breach of 2017 where 147 million people’s information was compromised highlights the importance of regular security assessments and vulnerability management these are the areas where hacker GBD excels and hacker GBD strictly adheres to ethical guidelines refusing to assist with any unethical or illegal queries so our commitment is to provide guidance that adheres to legal and professional standards helping you become a responsible cyber security professional so guys let’s get started with hacker GVD that equip you with the knowledge and skills to defend against cyber threats ethically and effectively craving a career upgrade subscribe like and comment below dive into the link in the description to fasttrack your ambitions whether you’re making a switch or aiming higher SimplyLearn has your back and just a quick info for you guys if you are an aspiring cyber security professional looking for online training and certification from prestigious universities and in collaboration with leading experts to enhance your credibility then search no more simply learns postgraduate program in cyber security from MIT University in collaboration with EC council should be your right choice for more details you can use the link in the description box and pin comment so let’s get started so guys this is chat GPT and this is the paid version of chat GPT for what I was telling you is this is the explore GP section so here you can find all the GPS that are created by chat GPT OpenAI or the individuals or you can find the companies who have created GPS so you can find these are the recently used and this is the most used hacker GPT you can find other GPs also that is hacker GPT and you could see that and they have been used by 5,000 plus users and this have been used by 10,000 plus users so you can just search for ethical hacker GBT here and it has been rated 4.5 stars 10,000 plus conversations and these are the conversation status if you need any assistance and the capabilities you can see here and the ratings given by users and more by the creator who has created this so we’ll start with this we’ll start the chat here and I want to tell you guys that chat jeopardy doesn’t answer non-ethical questions so if you try to extract that information from chat GP that won’t be possible but we can do a bit like we can cross a bit line with ethical hacker GPT but that should be used for ethical purposes only so I will show you guys how you can utilize this GPT and one more thing guys if you want to create your own GPT you can also create that also you can go to explore GBD section and here’s the create option click on create and here you can start creating your GBD if you click on configure you can write the name of your GBD description instructions and the conversation starters as you just saw with the hacker GBD ethical hacker GBD and the capabilities what you want to be enabled you can do that and here in the create section you could write the prompts here and it will take that information and use it for more purposes and here you could attach more files that could help create your GPD okay guys so here you could see the configuration and the preview of your GPT and you can finalize that so moving back we’ll get back to ethical hacker GBT and start with our conversation with him so starting with the first thing we can do is we can ask him like how can I perform a basic security assessment on a web application so if I tell you guys performing a basic security assessment on a web application is crucial for identifying vulnerabilities and ensuring the application is secure and this process involves using various tools and techniques to test the application for common security issues so you could ask him that how can I perform a basic security assessment on a web application and just wait for a few seconds and you could have the response from ethical hacker GV so you could see that performing a basic security assessment on a web application involves several key steps and these are the key steps number one is preparation and information gathering and how you can do that these are the steps identify the scope gather information then is the second step that is reconnaissance and you can use the tools burp suit nikto and others similarly you could see all the steps here so I won’t be guiding or I won’t be reading what responses are generated by ethical hacker GBT i have used that and he provides very accurate like I would say around 95 to 96% accurate results here I want to show you guys how you can utilize it so I will show you prompts and what things you can ask him so this was all about repeat so this was about the general security thing now we’ll move to ethical hacking and we can ask him how we can perform a SQL injection attack ethically on a test environment so these are the prompts that you can write that would be how do I perform a SQL injection attack and that to ethically if you write this that would be good on a test environment and if I tell you guys so SQL injection is one of the most common web application vulnerabilities and understanding how to perform a SQL injection attack ethically on a test environment can help you identify and mitigate this risk in your own applications and you could see he has responded and he has provided you the steps that you can set up a control test environment first thing then preparation and you could use these tools then you have the manual SQL injection testing so these are the methods that you could use that is or or 1 equal to 1 for the database and automated SQL injection testing So this is the command for that and you could verify vulnerability documentation reporting so you could see that this GP is capable of answering the basic questions as we have discussed the basics question till now now we’ll move to scripting and automation so here you could see how he respond to this so we’ll ask him can you provide a Python script to scan open ports on a network so let’s see what he provides provide a Python script and that to to scan ports on a network so scanning open ports on network is a fundamental step in identifying potential vulnerabilities and a Python script that can automate this process making it easier to regularly check for open ports and secure them so this is the Python script you can use any ID and run on that and you could see that he’s explaining the code also yeah you can ask him like can you explain the code line by line and this hacker GBT will do that for you and how to run the script that also he has provided you and similarly we can also ask him that how we can write a bash script to monitor and log unauthorized login attempts and if you want I can also run this prompt how do I write a bash script and that to to monitor and log unauthorized access unauthorized login attempts so we can monitor and log unauthorized login attempts and that would be essential for maintaining the security of your system so as you can see he has written a bash script and that can help you automate this process and this will provide realtime alerts and logs for further analysis and you could see that he’s providing the explanation and how you can run the script and he’s writing the note also like you can write more prompts if you have any doubts in any of the script or any of the responses that hacker GPT has responded and he will definitely provide you with good responses so now moving on now we’ll ask this ethical hacker GPD about some specific security tools and we could ask him about Burp suit and so let’s write a prompt can you explain how to configure and use Burp suit or we can write for web application testing so if I sum you up so Burp suit is a powerful tool for web application security testing and understanding how to configure and use it effectively can help you identify and address a wide range of security vulnerabilities in your applications so you could see he has provided the initial steps that would be downloading and installing Burpsuit configuring your browser to use Burpsuit as a proxy and then intercept and inspect traffic and then you can use it for testing purpose logging and reporting and tips for effective testing so this is the response for the security tools and if we talk about incident response we can ask him to write a script to collect system logs for forensic analysis so collecting system logs is a critical part of incident response and forensic analysis and this script can automate processes that can ensure that you have all the necessary data to investigate security incidents effectively so if I write here we can ask this hacker GPD and I’m sure he will provide the response for that and write the script so can you provide a script to collect system logs for forensic analysis so as I told you this is the critical part of incident response and we have covered about the tools that is BBS suit we have asked him about the automation process general cyber security question ethical hacking that would be SQL injection attack and the Python script to scan open ports on a network so he can write scripts also automation task and he could response with the general cyber security questions also and if you see here for the incident response he has writed the script to collect system logs for forensic analysis so I won’t be explaining this code as we’re just looking for the prompts that we can give to ethical hacker GBT if you want you could just ask him also that explain this code line by line and here he has mentioned also the explanation that is directories and files to collect and after that he’s collecting the logs and that will be copied in the directory that is he has mentioned it a variable that is output directory archiving logs cleanup and how to run the script so this was about the incident response now we move to some advanced topics and in advanced topics what we can ask him is key how to perform a man-in-the-middle attack in a controlled environment and remember these that you have to mention some of the keywords that would be in a controlled environment and for that thing only he will response or provide the response to you so I will start here that how do I perform a man in the middle attack in a controlled environment so if you understand man in the middle attack that works in a controlled environment this can help you develop better defenses against such attacks and it’s important to learn and practice these techniques ethically so you can see here that he’s providing the prerequisites and the step-by-step guide how you can conduct a man-in-the-middle attack so first is set up the control environment then install necessary tools enable IP forwarding perform ARP spoofing and then capture and analyze traffic clean up and restore the network and conclusion so you could just follow up with more prompts that I want more information about setting up the control environment just write this prompt and this ethical hacker GPT will provide more responses to you so he will provide you how you can set up the control environment so now moving on we will ask some more prompts and that could be about the reverse engineering so we could ask him that can you explain the processes of reverse engineering a malware sample or we can also ask about honeyport to detect malicious activity that could be how can I implement a honey port to detect malicious activity or what are the techniques for securing a docker container so we’ll ask him one prompt here so let’s see what he responds to that so how can I implement a honey report to detect malicious activity so you could see that he has started responding to that and if I tell you the sum so a honey port is a security mechanism set to detect deflect or in mechanism to some manner and it counteract attempts at unauthorized use of information systems implementing a honey port can help you monitor and understand attack patterns and this is the step-by-step guide to implement a honeyport you can choose the type of honey port prepare your environment install and configure the honeyport software and these are all the commands how you can configure it then you can monitor and analyze the honey port and regular maintenance and updates and this is the simple port using honey you could install that and run these commands so with that guys and in the last we will also cover cyber security policies and compliance so he could also answer to those prompts also that you can ask him that what should be included in a company’s cyber security policy and you could mention which type of company you are running so I will ask him that so you could ask him that what should be included in a uh attempt cyber security policy so let’s see so you could see here that creating comprehensive security policy for an act company involves adding various aspects and that would be introduction first is the purpose for cyber security policy scope roles and responsibilities data protection and privacy network security application security user security awareness and training incident response and management compliance and legal requirements physical security device and endpoint security so similarly you could ask him that draft me the company’s cyber security policy and start with the introduction so he will provide you all the introduction points and then you can ask him that draft roles and responsibilities he will draft that also so you could like break it into parts and ask the ethical hacker GPT and he will respond to you as it has some limitations of some words and some of the responses so you could ask him in the breaking parts and he will respond to you do you know friends that Wireshark is a powerful network protocol analyzer that helps you capture and analyze network traffic in real time it allows you to deep dive into data packets traveling through your network giving you insights into network performance security and troubleshooting in this tutorial we’ll guide you through the basics of using Bioshark from setting up your capture environment to interpreting the data by the end of this tutorial you’ll have a solid understanding of how to navigate Yshark interface set of filters and analyze the network traffic for different use cases so guys let’s get started so guys let us start first by understanding what is Wireshark so guys Vireshark is a comprehensive open-source network protocol analyzer that basically allows user to capture and analyze the data traveling over the network in real time it is widely used by network administrators security professionals and also developers for various purposes for example guys like network troubleshooting where you have to identify and resolve network issues by examining the traffic patterns and diagnosing the connectivity problems the next one is network analysis which we’ll also be doing in our hands-on where you have to understand and optimize network performance by analyzing data flows and interaction between network systems the third one is security auditing you will also have to detect and investigate unusual or potentially malicious network activities such as unauthorized access or data breaches and finally you have a protocol development where you can debug and develop network protocols by capturing and analyzing protocol messages and behaviors the key features of Wireshark are the first one is packet capture wireshark captures packets of data transmitted over the network each packet contains a wealth of information including source and destination addresses and also you get protocol types and payload data so as you can see all over here I’ve already downloaded via shark and I’ll guide you also how to download it but as you can see these are the lines that shows that the Wi-Fi packet you know graph is showing that this is how the packets are transmitting so this is basically the realtime analysis what you can get through in wireshark next one is you get a detailed inspection guys wireshark also decodes and displays data at various protocol layers example you can get Ethernet IP TCP HTTP which allows for detailed examinations of network communications you can also perform filtering and searching then you’ll also get a chance to do data visualization which includes features for visualizing network graphics such as flow graphs as you can see all over here and also statistics which can helps in understanding network behavior and performance wireshark is available for multi-operating systems like for Windows Mac OS Linux and many more now there are certain scenarios where network security engineers use it suppose for network performance monitoring where you track and analyze the performance of network applications and services you also get an incident response you investigate and respond to network security incidents by analyzing capture traffic and you also do the protocol analysis where you examine and troubleshoot network protocols and ensure proper implementation now let us start with the wireshark so first let us download the wireshark and before we download it I expect that you would have got some brief idea regarding what is wireshark now what you have to do guys you have to go at this link wireshark oorgg.d download.html so since I’m using windows so I have clicked on windows x64 installer just right click on this so as you can see it will start downloading so guys since I’ve already downloaded it I may not have to do it again and the steps are very simple just you have to click yes yes and it’s going to download all the required dependencies and your installer will be ready and after clicking all the okays you are going to get something like this so this is your entry of the wireshark network analyzer now so as you can see all over here you can capture the network packets from these interfaces so you can see local area connection 10 adapter lookup traffic capture Bluetooth is there then you have the Ethernets okay so let us choose the Wi-Fi as a network interface okay and just click on this so as you can see all over here so many of the packets have started running up okay and this is a shark icon so basically it is uh doing the real time packet capturing where you have all these things so now let us try to understand what is there in wireshark so you can see you have file basically for managing files you have open save export okay so these kind of options are there you can also export the TLS session keys okay you can export the objects and uh you can do print quit then here in the edit so edit you can modify the preferences settings and profiles if you talk about view you can adjust the layout all over here or wireshark if you talk about go you can navigate through the packets all over here then here is a capture you can start or stop all over here you can restart it then next is analyze so as you can see all over here you have display filters display filter macros display filter expressions and many more okay similarly you have statistics okay which helps in viewing network statistics and data summaries here you have telephoneony for using these kind of protocols okay then you have wireless okay then you have tools all over here firewall ACL rules MAC address okay and there you have the help icon so this is a very basic outview of this application now let us do some basic exercises first so let us try to capture a traffic first okay so since I’ve already selected uh our network interface as Wi-Fi and let us restart it so you can just go on capture and just start the restart okay so this has started now go to your browser and just type say http okay and say bin og is a file so guys this is a basic website that we have requested on our browser and let us go to our wireshark and stop this for a moment so as you can see all over here this icon shows applying a display filter now go all over here and type the filter say http okay and you can say our filtering would be done so as you can see here you have the source you have the destination here you have the time here you have the number here you have the length of the packets okay and this is the info okay so now let us do the general analysis of the wireshark output so as you can see all over here the first one is HTTP request and responses so as you can see this is our source okay we are sending a request to the destination address with [Music] 44.219.81.240 the protocol is HTTP and the length of the packet is 480 and it is basically a get request okay so get HTTP/1.1 now there’s a reply from this destination all over here and to the destination at our source the protocol is still HTTP now the length of the packet is increased is 887 and what we are getting guys all over here that the status is 200 and it says okay now as you can see what we are getting basically an HTML file all over here okay now similarly we are again requesting and we are getting a JSON file all over here now getting a specific JSON HTTP 1.1 and similarly reply is coming so as you can see it’s a two and fro motion where we are requesting to a destination which is the browser with the protocol HTTP and similarly we are getting a reply from our destination so guys this is our device and this is the given uh resource we are trying to access on our browser so basically now we can see these are the content types which is text HTML for the HTML structure okay and also you can see all over here this is a JSON type okay and uh these are the type of the content we are trying to access it okay and this is the uh request what we have uh done to our uh destination which is the browser okay with the bin og and it is returning a text html file i hope so guys you would have got a brief idea like how you can do the general analysis of the wireshark output now let us try to do one more example which will make our concepts more clear now guys I will show you one more use case of this that you can diagnose the network issues with ping and trace command okay so with the help of wireshark this can also be done guys so what you need next is you can open a terminal okay and just right click all over here and now in this what we are going to do guys we are going to generate an ICMP traffic so with the help of ping command okay so now what we do we type ping say google.com and you can see all over here the request and reply have started and now what we will do guys we will use the tracer command for tracing our packet flow so so you can see something we have got all over here we will discuss about this bit later now let us open our wireshark okay and what we’ll do guys we will type ICMP okay and just click all over here okay so guys go to the filter and type ICMP okay and just click all over here and but before that you have to stop this and now let us try so you can see all over here that here the destination is showing unreachable but here we are getting the reply okay now let us try to examine this protocol okay so what all over here let us try to understand first what we did in the terminal okay so guys when we are typing the command ping google.com this command is basically testing the reachability of google.com by sending the internet control message protocol or ICMP echore request packets and waiting for the replies which is echo response now guys let us break down the ping results so first three replies we are going to see that each reply shows the IP address of 142.250.1 2550.1 93.110 which is one of the Google servers and you can see the roundtrip time latency for the packets for the first time it is showing around 76 milliseconds for second round trip time it is showing around 88 then third is 99 and fourth one is 30 mconds now you can see uh there is something called time to live also and in this case the time to live for each packet is around 55 millconds Okay so basically this field indicates how many hops or routers the packet can pass through before being discarded okay now you can also see the request timeout so the fourth packet is a request timeout meaning no reply was received within this set time and you can also see the ping statistics so you can say here sent four packets received four packets and there is no loss okay so this is one thing and also approximate round trip in milliseconds you can see minimum is 30 milliseconds and maximum is 99 millconds average is calculated 73 milliseconds so this is statistics what we got now you can see all over here we have the trace command okay so here no arguments are provided first so let us try to understand the d means do not resolve IP address to host names okay where h means maximum number of hops of routers to search and w means timeout in milliseconds for each reply so suppose if I see tracer google.com so guys this will show all the hops that the packet has to travel through reach the Google server which will help to diagnose where the delays or issues might occur on the path now you can see all over here there are lot of options are given so similarly you can read this now let us try to do the wireshark analysis so you can see all over here with our source 10.101.5.118 and we are sending the request to the Google server and this is internet control message protocol so you can see all over here this is eco this is a ping request with ID 0x001 and we can see the sequence is also given the time to live and we are replying in 7641 millconds so this packet is basically what we are doing guys we are 7630 is our packet number and this is what we are sending as a request then 7641 is a reply from the Google server with the given ID okay the sequence number of this and the time to live and it is also giving the request one now what you can do guys you can also apply one filter all over here we can okay now with the help of this you can just see there are a lot of options as a filtering okay so you can read the documentation for this and whenever it is turning red guys it is showing something as error okay and now uh let us do this and let us type our IP address say 101 1 okay 1 dot 5.118 okay so this is also one of the way you can apply the filter okay so it’s going to filter out the IP address okay say let’s do this so it is going to filter out our IP address which is basically the same which is sending because we have not given any other ping requests so guys here what we can see so this is kind of of the analysis what we are doing basically okay so guys this was a wireshark analysis for diagnosing the network issues with the help of ping and trace commands and you can do lot more other things with the help of wireshark basically these tools are used by network administrators hackers and also network engineers to understand the network performance diagnose the network issues okay so this was a short exercise which I have shown you about the basics of wireshark i hope so you would have enjoyed our today’s video imagine being able to assess a security of a systems like a pro hacker but ethically of course in this tutorial we are going to walk you down through how to perform penetration testing using Kali Linux which is one of the most powerful tools in the cyber security world whether you are a beginner or a tech enthusiast you’re going to learn the basics of pentesting with essential tools in Kali Linux and how to identify vulnerabilities in your network by the end of this video you’re going to have a strong foundation on how to start your ethical hacking journey so first let us try to understand what exactly is penetration testing penetration testing or pen testing is a simulated cyber attack which is conducted by ethical hackers to evaluate the security of a system application or even a network the goal here is to uncover vulnerabilities weak points that attackers could exploit and provide actionable recommendations to secure the systems unlike regular vulnerability assessments penetration testing goes a step bit further by actively exploiting the vulnerabilities to understand their impact now you would be wondering why do we do penetration testing so penetration testing serves several critical purposes first of all like identifying the weaknesses so you could just write over here okay now let us discuss about this point so even the most secure systems have vulnerabilities and these can stem from outdated software misconfiguration or even a human error now penetration testing uncovers these weaknesses before they are exploited suppose I’ll give you an example uh you have a web application that uses an outdated version of a PHP a penetration test could reveal that this version has known vulnerability allowing remote code execution okay so for this purpose you could use penetration testing the second point is testing incident response a penetration test doesn’t just highlight vulnerabilities but it also assesses how your systems and team respond to simulated attacks this helps their organizations identify gaps in their incident response plans suppose during a test a ethical hacker deploys ransomware the security team speeds and efficiency in detecting the containing the attack determine their readiness for the real incident so for the incident response testing you could use penetration testing now the third point could be meeting the compliance standards industries like healthcare finance and e-commerce must comply with stringent data protection regulations so penetration testing helps meet standards such as PCIDSS GDPR or HIPPA okay so I’ll just mention all over here fine now the fourth reason which I could think of could be protecting the reputation a breach can damage customers trust and tarnish your brand image penetration testing is a proactive way to safeguard your reputation for example a major retail chain suffers a data breach exposing millions of customer records post incident analysis reveals that a simple penetration test could have identified the vulnerability and prevented the breach now let us discuss about types of penetration testing so penetration tests can be categorized based on their scope and the level of information shared with the tester on the basis of that I have mentioned three of the penetration testing types the first one is blackbox testing so here the tester has no prior knowledge of the system this simulates an attack by an external hacker so that is called a blackbox testing now if I discuss about white box testing here the tester has full access to the system including source code architecture details etc so this simulates an insider attack or a highly informed hacker the third one that we have all over here is gray box testing so here the tester has partial knowledge such as user credential or limited architecture details based on this he simulates the attack so you could do these kind of penetration testing on a system to check its vulnerability now let’s do a hands-on exercise on penetration testing with Kali Linux now if you have not installed Kali Linux so just go to the official documentation or official website of Kali Linux so here you could see you’ll get a tab called get Kali okay just uh you could go for virtual machine way of installation uh you could go through installing the image okay so there are various ways you could do it but if you’re using Windows operating system so what you could do just go directly to your Microsoft Edge okay so here it is going to have Kali Linux just type on okay so you could see this app is there and you could install this directly so you could see I have installed it directly so let us open the terminal okay and the process of installation is very very simple now on Kali Linux you have to install some additional tools to perform penetration testing so now let us try to set up the tools okay so you can see all over here I have opened my Kal Linux terminal now the tools that we are going to install all over here will be N mapap ho dig nectto WP scan open bus and metasloit let me give you a brief idea about these tools so N map also stands for network mapper so the purpose of this tool is going to be scanning the network to identify open ports services and operating system you could also scan the target for open ports and also the running services next tool will be who is now who is is going to provide you domain registration details and ownership information like for example who is and you could give a name like certain uh example.com could be a you know demo website so which will help you to gather domain level information about the target now the third tool is dig so Dick performs the DNS enumeration to receive the DNS records like for example A MX NS okay so all of these are DNS records basically so this tool is very much important if you are you know uh you know we will be needing some DNS record to do the penetration testing so basically it is used to explore the DNS structure of the targeted domain now the fourth tool is going to be Nikto so Nikto is going to scan web servers for vulnerabilities such as outdated software default configuration and potential misconfigurations now it is also going to check for vulnerabilities on the web server also the fifth tool is WP scan now if I talk about this so this basically scans the WordPress websites for vulnerabilities in themes plugins and core files okay now it enumerates the users and checks for plug-in vulnerabilities so WP scan requires an API token which can be obtained from this website so type wpu lndb.com so you could uh get it all from here okay so this is certain additional requirement now let us talk about the next tool that we have is openvas now if I talk about openvas or greenbone vulnerability manager so this provides a comprehensive vulnerability management system okay so basically it performs scans to detect vulnerabilities across the target finally we have the metas-ploit if I talk about metas-ploit then it is basically used to exploit development and execution for identified vulnerabilities now before updating it you have to type certain thing like this sudoapp update okay so after you have done this then you could just type sudo apt install n mapap now since I’ve already installed n mapap okay so I don’t need to do it but you could do it with this command so now let us check the version of n mapap for that purpose you could type n mapap and type version so you could see I have 7.94 version okay and this is official documentation of n mapap if you want more information about this tool you could refer this documentation the next tool is who is same thing we have to do pseudoapp update okay now next thing would be suda app install who is okay so we have installed who is also next tool will be dig so just install dig like this so you could install dig something like this so app install DNS utils okay so we have installed dig also and to check the version type dig vi so you would get the version as 9.2 okay finally let us install nectto so same command for here type necto since I’ve already installed necto so I don’t need to do it now let us check the version of it necto so you could see I have version of nikto all over here now fifth tool will be WP scan so same thing so you could see it has installed WP scan also now after installing register at uh you know WP scan and copied the generated you know API token so guys as you can see all over here on your WP scan/profile you’re going to get an API token now guys let’s move ahead so guys you can check the version of WP scan after you know typing wpcan/ version and you could see I have version 3.8.27 installed now let us install openvos so for installing openvos type sudo app install and then type openvas so you can see all over here that our installation is in progress and it is installing this tool so guys you can see all over here we have installed this tool so so guys next step is installing metasloit so type sudo app install metasloit framework now since I’ve already installed this so I need not need to do it but you can type this command and you could download it okay so there is one error in this okay now it’s fine now let us check the

    version of it so type MSF console and next would be version so you can see I have 6.4.34 version now we have installed all these tools and check the version also now let us proceed for penetration testing okay guys so we’ll be using this uh demo website to do the pent penetration testing so you could get the link all over here so it is a juicehop.herokuapp.com okay I will mention it in the link so you could access this website to learn how to do penetration testing but one word of advice before you are doing uh penetration testing for any other application uh just get a written permission of it without uh their permission you cannot do the penetration testing of any official website so because the idea is uh hacking ethically okay so unethical practices is not permissible now let us open our Kal Linux okay so here we are going to open the end map and we are going to run a scan on this website the same website which we have opened which is httpjushop.hoku.com heroku.com so just copy the link okay so type nm mapap ss a and give the name of the given website and so you could see now it has started scanning so basically this is going to reveal the open ports services and possibly underlying technology of the web application so guys it might take some time just wait for a few moments so guys you could see all over here that N map has given the complete scan okay so you could see the stats all over here so port 80 and it is using a TCP protocol okay and state is open it is uh so port 80 is basically open all over here and the service is HTTP okay and the version is cowboy so we have got this brief idea regarding this that uh for open port on HTTP it is 80 now let us identify the web server use all over here so you could see all over here the server is Heroku router and uh so we have got all the information of this website we have got the open port so the overall idea was to look for the open vote okay now let us do the vulnerability assessment of this so for doing the vulnerability assessment we’ll be using necto so type nicto /h and the name copy the link now in this we are going to look for misconfiguration or outdated server version or exposed directory and files so you could see we have got uh the target host name the target port okay and uh you could see the SSL info is also given all over here okay and uh so you could see all over here it is telling that the site uses TLS and the strict transport security header is not defined all over here so in similar way still uh is looking for the vulnerability okay let us uh give it some time so guys you could see all over here that Nikto has given a lot of vulnerability assessment so let us try to look at first okay now you could see it has also told that server is using wild card certificate okay if you want a brief idea about it just click on this link then uh you could also see all over here that uh it is giving all the information what could be you know vulnerable so now it is giving some backup certificate file found so if you move down a little bit so you could also see that Xc content type header is also not set so here it is telling that it could allow a user agent to render the content of the site in different fashion so this can be a mime type attack can be done on this website so guys you can see all over here that it is also given robots.txt so this is actually a plain text file which is located in the root directory of the website for example juice entry.com/roots.txt the primary purpose is to instruct web crawlers such as search engine bots or like who are interacting with the website it can release sensitive information making it significant for both web security and SEO perspective so guys you could see all over here we could manually check for robots.txt file so give the link of the given website for which you’re doing the pen testing and give / robots.txt now you could see in the output it’s given user agent star disallow FTP now what is user agent so this is a directive which applies to all the web crawlers and the bots so asterisk is a wild card meaning it is intended for every bot that visits this website example it could be a Google bot or bingeb etc now what is it is disallowing so disallowing it is this directory is telling that bots not to crawl on the index of the FTP directory of the website okay so bots should keep uh you know they should skip this FTP and avoid listing its content in the search engine however this does not restrict manual access by the users or attackers like who can directly visit the / FTP URL in their browser or they could use a tool like curl so what is the significance of these configuration like for example with the web crawlers search engines and bots will respect this directive and avoid the crawling of the /tp directory it is helping optimize the crawling by excluding unnecessary sensitive path for the security perspective the presence of /fttp in rewards.txt can be a security risk because it is revealing the existence of potentially sensitive directory attackers may manually navigate to the /tp to check for files or vulnerabilities third if we talk about with the respect of penetration testing the FTP entry can serve as a clue for ethical hackers or penetration testers to investigate okay so you can check the / FTP directory for sensitive files like backups configurations or credentials okay now if you want to look for the hidden files so you could use tools like DB okay so you could go for the directory you know enumeration for the same just type db give the link and /tp so you might be able to access some hidden directories under / FTP so I hope so you would have got a brief idea regarding / FTP and do check for these files in a given uh website it’s very very important process of penetration testing now let us finally proceed for the SQL injection so guys SQL injection is a technique which is used to manipulate a website database by injecting malicious SQL code into the input field so the steps involve are as follows so first of all go to the login page so you could see account all over here go click on login now here enter the following user credentials like you could give for username as say 1 okay or you could give any password or you could leave it blank okay now you could see all over here that we have injected a payload 1 equals to 1 or something like this okay so it you can see all over here that I’m not able to login okay so you could see this is been secured now let us give certain other email and let us say provide a password or we could leave it blank so it’s still asking for your password type anything okay uh just login you can see it is telling invalid email or password okay means like we have not registered yet all over here that’s why it’s saying invalid email so let let me explain you what I’m trying to do all over here so suppose the payload which I’m trying to inject suppose as I have written all over here say 1= to 1 okay now this is actually breaking the SQL query logic for example If you are typing select star from users where username equals to this or 1 equals to 1 minus minus and password could be anything okay so this or condition always evaluates true so let me show you so guys you could see here that I’m writing a SQL query something like this okay select star from users where username equals can be anything or it could be 1 equals to minus one and password could be anything so this is kind of a SQL injection where we are trying to put anything malacious inside the you know given code so this or condition 1 equals to 1 always evaluates to true so it is bypassing the authentication so the minus minus sign is used to comment out the rest of the SQL query ignoring the password checks okay now if you successfully log in without valid credentials then you could say the application is vulnerable to SQL injection but you can see all over here that this condition is not happening okay and if you even try to leave out the password it is not showing anything for login so this is actually not vulnerable to SQL injection now let us try to do cross-ite scripting so guys cross-sight scripting or XSS is an attack that injects malicious script into the website which are then executed in the browser of unsuspecting users so the steps to test XSS first you have to identify the input fields okay search bar it could be or a feedback form like on this website and you could enter a payload certain thing like this so first of all let us try to go all over here in the search bar click on inspect okay now we have to find out where the script is written okay so type Ctrl+ F okay so Okay now the script uh Okay now what you would do all over here let us now perform the excss attack so as we have navigated to our web application so we have targeted this input field okay now we are trying to inject okay script alert XSS okay so what you have to do you have to click on right click on this and go to the developers tool okay and then you will uh get screen like this where you have to add script alert accesses now if the alert box pops up okay if it does then it shows that it is vulnerable to the XSS attack so guys as you can see all over here I have inserted this script alert XSS /cript so I’m trying to inject the XSS now if you see a pop-up button like coming all over here then it indicates that this input field is vulnerable to XSS attack so just right click on this and let us see so guys as you can see all over here that I have inserted this script alert accesss now when you right click on this and any pop-up is coming up then it means that this website is vulnerable to excss attack so in this way you can perform exploitation now if you cannot manually insert the tag okay what you can do guys you can modify the existing DOM okay so first of all locate the input field in the developers tool then right click on it and on that input element okay and manually replace the given values press enter to save the changes and check if the script executes so let us right click on this so you can see nothing is happening so it’s all fine now that’s one way you could do it or alternatively what you could do you could go on the console and type the same thing like document.query selector input matt input zero so this is the given form field and the value and inject the excss attack all over here and then if it is applicable trigger the search button programmatically so what you could do you could uh trigger in the next step document.query selector form.submit now if the green if the pop-up appears all over here then we are successfully injecting the XSS attack now if you can’t inject the script okay so this also scenario comes up so first of all inspect the sanitization logic review how the application processes your input some apps escape dangerous characters like these curly braces okay these braces and script so test alternative input fields try other input fields forms or query parameters where your script might work so guys this was a small introduction on pen testing with using various tools present in the Kali Linux cyber security is not just a job it’s a war zone where organizations fight daily to protect their most valuable assets data and systems the stakes have never been higher and the demand for skilled professionals is rapidly growing a trusted survey predicts that millions of cyber security job openings in India alone by next year but here’s the harsh reality most candidates lack the skills and the industry demands this is where certifications comes in you have probably heard people ask why do certifications why not just get a degree wait let me tell you the truth college programs often fail to keep up with the fast changing demands of cyber security industry certifications on the other hand are laser focused on the skills you actually need they are faster more affordable and targeted so whether you’re a fresher or a professional looking to climb up the ladder certifications are your best bet let’s explore the top five certifications that can give you an edge to help you land that dream cyber security job now you might be thinking I’m not from an IT background can certifications really help me or maybe you have graduated with a computer science degree and are wondering why bother with certifications let me explain why certifications are so powerful first if you are from a nonIT background certifications can open doors you never thought possible they provide you with hands-on practical skills that employers value far more than theoretical knowledge for example even if you have never written a single line of code certifications like comt plus security or certified ethical hacker can teach you the foundational skills needed to land your first job in cyber security on the other hand if you’re already a computer science graduate certifications allow you to specialize cyber security is a vast field and employers look for specialists in areas like penetration testing risk management or compliance a certification like CISSP can turn your general degree into a targeted resume that screams expertise here’s why certifications are such a game changer at first it will help you to boost your resume by adding instant credibility showing you have invested in gaining expertise they also align with industry trends ensuring your skills match with current standards they also demonstrate your commitment to your career and give you a competitive edge making you stand out to hiring managers in a crowded job market so now let us explore the top five certifications that you can take your cyber security career to the next level so let’s get started so now let’s begin with our very first certification at the top of the list which is certified information system security professional CISSB widely regarded as the gold standard in cyber security certification it’s offered by IANS it is one of the most respected organizations in this field this certification is very essential for professionals who want to lead cyber security efforts at an enterprise level well CISSP is an comprehensive certification that covers eight key cyber security domains such as risk management security operations and software development security it’s highly designed for experienced professionals and proves you have the expertise to design implement and also manage a rubber cyber security program organizations worldwide trust CISSP certified professionals to handle sensitive security needs talking about the eligibility to qualify you need to at least have five years of professional experience in at least two of the A domains a bachelor’s degree in computer science or any one of the experiences preferred even without full experience you can take the exam and earn the title associate while you complete the required work experience let’s talk about the exam details and cost well the CISSP exam is about six hours long with 250 questions and the cost of the exam is rupees 61,49 Indian rupees and for us it’s around $749 this is one of the fee to register and sit for the certification exam cissp opens doors to senior roles such as chief information security officer who can earn around 76 lakhs year in India and $150,000 plus per year in the US also senior security consultant who can earn around 13 lakhs per year in India and $120,000 per year in the United States well CISSP is more than just a credential it’s a symbol of expertise leadership and trust in the cyber security world for anyone serious about advancing in this field this is the certification you should aim for also if you’re looking for specialized training to a CISSP examination consider simply learn CISSP certification training this is globally acclaimed program and is aligned with the latest IC exam pattern offering comprehensive coverage of all the A domains with live online classes hands-on lab and also expert guidance with features like simulation tools test papers and included CISSP exam voucher simplearn ensures you are exam ready plus their 100% money back exam pass guarantee also adds extra confidence as you work towards elevating your cyber security credit next on our list is CISA which is certified information system auditor a highly respected certification from ISCA focusing on auditing compliance and risk management it’s perfect for professionals responsible for evaluating and improving an organization security framework cisa is recognized worldwide especially in highly regulated industries like finance healthcare and government it demonstrates expertise in identifying vulnerabilities ensuring compliance and improving security controls let’s talk about the eligibility for this certification well to qualify you need to have at least 5 years of work experience in IT audit control or security you also need to have a bachelor’s degree that can wave up to 2 years of this requirement let’s talk about the exam details and cost with this certification well the exam is 4 hours long with 150 questions testing your knowledge of auditing and compliance exam fee is around $47,141 Indian rupees and $575 for a CA members and if you’re not a member of ISACA then you have to pay $62,000 in Indian rupees and $760 for USA let’s talk about the career opportunities and salaries well CISA certified professionals can secure roles like IT audit manager who can earn around 20 lakhs per year in India and $130,000 per year in the United States compliance program manager also can earn around 24 lakhs per year in India and $140,000 per year in the United States with organization increasingly prioritizing governance and compliance CISA has become a critical certification for professionals in these areas it’s must have for those who want to specialize in auditing and risk management also if you want to boost your career in IT auditing and compliance you can consider simply learn CIS certification training as an accredited training partner of ISACA Simple Learn offers comprehensive preparation including live classes by industry experts access to the official ISACA learning kit and simulation test to help you master the 2024 CIS exam alone this training provides you upto-ate curriculum and practical insights to help you excel your career with an exam pass guarantee and flexible learning options simply learn also ensures that you’re fully prepared to achieve CISA certification and advance your professional journey let’s talk about the third certification on the list which is certified information security manager CISM coming at number three this is another certification from IACCA aimed at managers and leaders in cyber security it’s ideal for professionals who want to transition into leadership roles cism focuses on the strategic and managerial aspects of cyber security such as governance incident management and program development it’s valued by organization seeking security leaders who can make informed highle decision let’s talk about the eligibility to qualify you need to have five years of experience in information security management a degree of another relevant certification that can wave up to 2 years of this requirement let’s talk about the exam details and the cost well the exam is 4 hours long with 150 question assessing your strategic thinking and the cost is 47,000 rupees and $575,000 in United States for ISCA members and 62,000 rupees in per Indian currency and for non-members it is around $760,000 cism certified professionals often step into leadership roles such as director of information security who can earn around 37 lakh per year in India and 160,000 per year dollars in the United States data governance manager can earn around 30 lakhs per year in India and $140,000 per year in the United States for those aiming to lead cyber security teams and make strategic decisions CISM provides the credibility and expertise needed to succeed also if you want to elevate your career and leadership role Simple Learn CISM certification training can be your ideal choice as an ICA elite training partner Simplearn provides an learning kit including the IC value review manual QA and exam voucher along with live classes conducted by increders so you can refer to this uh certification by simply learn let’s move on to the fourth number on the list which we have comp eia security plus the perfect entry-level certification for building core cyber security skills it’s a vendor neutral which means it’s recognized across industries and applies to various technologies security plus covers essential topics like network security threat management and compliance it’s designed to give beginners a strong foundation in cyber security and prepare them for real world challenges let’s talk about the eligibility well there are no strict prerequisites but coma recommends having basic IT experience or earning the network plus certification first let’s talk about the exam details and cost the 90-minute exam includes both multiplechoice questions and also performancebased questions the registration fee for the exam is $30,000 rupees and in USD it is around $370 with security plus you can pursue roles like security engineer who can earn around 8.2 lakhs per year in India and $95,000 per year in the United States cloud engineers can earn up to rupees six lakh per year in India and $85,000 per year in the United States security plus is an affordable impactful way to start your cyber security journey making it an excellent choice for beginners also if you’re looking to begin your cyber security career with confidence consider simply learn TI security plus certification training this will also provide you comprehensive coverage of all the exam objectives and focuses on real world applications to prepare you for the industry challenges additionally flexible learning options and 247 assistance makes it an excellent choice for learners worldwide finally we have C which is certified ethical hacker on the list the perfect certification for those who dream of thinking to become a hacker to protect systems offered by EC council this credential focuses on skills needed to become penetration testing and ethical hacking c is a hands-on certification that teaches you to identify vulnerabilities and detect attacks and secure systems it’s a great choice for professionals drawn to ethical hacking and proactive cyber security moving on to the eligibility part to qualify you need to have two years of experience in information security or at least completion of the EC council’s official training program the exam details and the cost is the exam is around 4 hours long with 145 multiple choice questions and the exam fee is 98,000 and $1,199 USD in USD ca certified professionals often work as penetration tester who can earn around average of five lakh per year in India and $85,000 per year in the United States cyber security engineers can earn $7.3 lakh per year in India and $100,000 in the United States c is perfect for professionals who want to specialize in offensive security and ethical hacking it’s an exciting certification that paves the way for dynamic high impact tools also if you are ready to step into the world of ethical hacking then Simply Learn CE V13 certification training is the perfect choice accredited by the AC Council this course includes the official E course where AIdriven tools and exam voucher with hands-on labs live sessions and cutting edge tools simple learn equips you to excel in penetration testing and many more that’s our wonderful course if you have any doubts or question ask them in the comment section below our team of experts will reply you as soon as possible thank you and keep learning with Simply Learn staying ahead in your career requires continuous learning and upskilling whether you’re a student aiming to learn today’s top skills or a working professional looking to advance your career we’ve got you covered explore our impressive catalog of certification programs in cuttingedge domains including data science cloud computing cyber security AI machine learning or digital marketing designed in collaboration with leading universities and top corporations and delivered by industry experts choose any of our programs and set yourself on the path to career success click the link in the description to know more hi there if you like this video subscribe to the SimplyLearn YouTube channel and click here to watch similar videos to nerd up and get certified click here

    By Amjad Izhar
    Contact: amjad.izhar@gmail.com
    https://amjadizhar.blog

  • Modern JavaScript: Objects, Prototypes, Classes, and Modules

    Modern JavaScript: Objects, Prototypes, Classes, and Modules

    The provided texts offer a comprehensive exploration of object-oriented programming (OOP) in JavaScript, starting with fundamental concepts like objects, object literals, factory functions, and constructor functions, contrasting them with procedural programming. The material progresses to cover prototypal inheritance, explaining the prototype chain, constructor properties, and the significance of shared methods for memory efficiency and code reuse. Advanced topics such as property descriptors, abstraction, and the use of Getters and Setters are discussed to illustrate how to manage object behavior and encapsulate data. The explanation extends to modern JavaScript features including ES6 classes as syntactic sugar over prototypes, hoisting behavior, and the creation of static methods and private members. Furthermore, the texts introduce modules (CommonJS and ES6) for organizing and reusing code, along with the role of npm for package management and third-party libraries. Finally, the sources touch upon asynchronous JavaScript, covering callbacks, Promises, and async/await for handling non-blocking operations.

    Node.js and JavaScript Fundamentals Study Guide

    Quiz

    1. Explain the primary purpose of both Node.js and Visual Studio Code as introduced in the source material. Why are both recommended for the course?
    2. Describe the process of creating a new JavaScript file and running it using Node.js within the Visual Studio Code environment. Include the specific commands or shortcuts mentioned.
    3. What are the key components of the Visual Studio Code interface, as highlighted in the text? Briefly explain the function of the activity bar and the status bar.
    4. Explain the difference between primitive and object data types in JavaScript, focusing on how they are passed (by value vs. by reference) and the implications of this difference.
    5. Define what it means for objects in JavaScript to be dynamic. Provide an example of how you can dynamically add, modify, and delete properties from an existing object.
    6. What is a JavaScript closure? Explain how closures enable the creation of private variables and methods within constructor functions.
    7. Describe the purpose and basic syntax of Getters and Setters in JavaScript. How do they contribute to encapsulation within object-oriented programming?
    8. Explain the concept of the prototype chain in JavaScript. How does it enable objects to inherit properties and methods from other objects?
    9. What is the significance of the this keyword in JavaScript, and how does its behavior differ when a method is detached from its object context? How does strict mode affect this?
    10. Briefly explain the concept of abstraction in object-oriented programming and describe at least two ways to achieve private properties or methods in JavaScript classes as discussed in the source material.

    Quiz Answer Key

    1. Node.js is a runtime environment that allows JavaScript code to be executed outside of a web browser, primarily used for backend development. Visual Studio Code (VS Code) is an Integrated Development Environment (IDE) used for writing and debugging code. Both are recommended for the course to provide an environment for writing and executing JavaScript code for backend applications.
    2. To create a new JavaScript file in VS Code, open the project folder and click the new file icon or use the keyboard shortcut (Ctrl+N or Cmd+N). Name the file with a .js extension (e.g., code.js). To run it with Node.js, open the integrated terminal in VS Code (Ctrl+` or Cmd+`) and use the command node filename.js (e.g., node code.js).
    3. Key components of VS Code include the activity bar (on the left with icons for Explorer, Search, Source Control, Run and Debug, and Extensions) and the status bar (at the bottom showing errors/warnings, line number, and language). The activity bar allows navigation between project files, search, version control, debugging, and extensions. The status bar provides contextual information about the current file and project.
    4. Primitive data types (number, string, boolean, etc.) are passed by value, meaning a copy of the value is assigned to a new variable, and changes to one do not affect the other. Object data types (including objects, arrays, and functions) are passed by reference, meaning both variables point to the same object in memory, so changes to one are reflected in the other.
    5. Objects in JavaScript are dynamic because you can add, modify, and delete their properties and methods after they have been created. For example, if you have const person = { name: ‘Alice’ };, you can add a property with person.age = 30;, modify it with person.name = ‘Bob’;, and delete it with delete person.age;.
    6. A JavaScript closure is an inner function that has access to variables in its outer (enclosing) function’s scope, even after the outer function has finished executing. Closures enable the creation of private variables by defining variables within the outer function’s scope, which are then only accessible by the inner function’s methods, effectively hiding them from the outside.
    7. Getters are methods that allow you to retrieve the value of an object’s property, while Setters allow you to modify the value of a property. They are defined within an object literal or class using the get and set keywords followed by the property name and a function. They contribute to encapsulation by providing controlled access to an object’s internal properties, allowing for validation or other logic during property access or modification.
    8. The prototype chain in JavaScript is a mechanism of inheritance where objects can inherit properties and methods from other objects. Every object (except the root object) has an internal link to another object called its prototype. When you try to access a property of an object, JavaScript first looks at the object itself. If the property is not found, it then looks at the object’s prototype, and so on, up the chain until the property is found or the end of the chain is reached.
    9. The this keyword in JavaScript refers to the object that is currently executing the code. Its behavior depends on how a function is called. When a method is detached from its object (e.g., assigned to a variable and called independently), this typically loses its binding to the original object and may refer to the global object (in non-strict mode in browsers) or be undefined (in strict mode). Strict mode enforces more consistent behavior and helps prevent unintended global variable modifications.
    10. Abstraction in OOP involves hiding complex implementation details and exposing only the essential information to the user. Two ways to achieve private properties or methods in JavaScript classes discussed are using ES6 Symbols (which create unique, less accessible identifiers, though not truly private) and using ES2022 private class fields and methods denoted by a hash (#) prefix, which provides truly private encapsulation not accessible from outside the class.

    Essay Format Questions

    1. Discuss the significance of modularity in JavaScript development, particularly within the Node.js environment. Explain how CommonJS and ES6 modules facilitate encapsulation and code organization, highlighting their key differences and use cases based on the source material.
    2. Analyze the concept of asynchronous programming in JavaScript. Compare and contrast the use of callbacks, promises, and async/await for managing asynchronous operations, discussing the benefits and drawbacks of each approach as presented in the provided excerpts.
    3. Explain the principles of object-oriented programming (OOP) as introduced in the source material. Discuss how JavaScript supports these principles through features like constructor functions, prototypes, classes, and encapsulation techniques such as closures and Getters/Setters.
    4. Describe the role and importance of package management in Node.js using npm. Discuss how package.json and semantic versioning contribute to dependency management, project stability, and collaboration among developers, referencing the concepts of global vs. local package installations.
    5. Discuss the concept of privacy and data encapsulation in JavaScript. Analyze the different techniques for achieving privacy, such as naming conventions, closures, Symbols, weak maps, and private class fields (#), evaluating their effectiveness and use cases based on the information provided in the source material.

    Glossary of Key Terms

    • Node.js: A runtime environment that allows JavaScript code to be executed outside of a web browser, primarily used for server-side development.
    • Visual Studio Code (VS Code): A free source code editor made by Microsoft for Windows, Linux, and macOS, used for writing and debugging code.
    • IDE (Integrated Development Environment): A software application that provides comprehensive facilities to computer programmers for software development.
    • JavaScript: A high-level, often just-in-time compiled, and multi-paradigm programming language that conforms to the ECMAScript specification.
    • Console: A window in which text-based output from and input to a computer program takes place. In web development and Node.js, often used for logging information.
    • File Explorer (Windows): A file manager application used by Windows operating systems for browsing and managing files and folders.
    • Finder (macOS): The default file manager and the graphical user interface shell used in all Macintosh operating systems.
    • Project: A collection of related files and folders that constitute a software development effort.
    • File Extension: A suffix at the end of a filename indicating the type of file. For JavaScript files, it is .js.
    • console.log(): A JavaScript function used to print output to the console.
    • Integrated Terminal: A terminal emulator directly within an IDE like VS Code, allowing developers to run command-line tools without switching applications.
    • Activity Bar (VS Code): The vertical bar on the left side of the VS Code window that allows switching between different views like Explorer, Search, etc.
    • Status Bar (VS Code): The horizontal bar at the bottom of the VS Code window that displays information about the current project and file.
    • Primitive Data Types: Basic data types in JavaScript that are passed by value, including number, string, boolean, big int, undefined, null, and symbol.
    • Object Data Type: A complex data type in JavaScript that can hold collections of key-value pairs. Includes objects, arrays, and functions, and is passed by reference.
    • Pass by Value: When a variable holding a primitive value is assigned to another variable, a copy of the value is created in a new memory location.
    • Pass by Reference: When a variable holding a reference to an object is assigned to another variable, both variables point to the same object in memory.
    • Dynamic Objects: Objects in JavaScript that can have their properties and methods added, modified, or deleted after creation.
    • Constructor Function: A function in JavaScript that is used with the new keyword to create and initialize objects.
    • Instantiation: The process of creating a new instance of an object from a class or constructor function.
    • Closure: An inner function in JavaScript that has access to the outer (enclosing) function’s variables—scope chain—even after the outer function has finished executing.
    • Encapsulation: The bundling of data (properties) and methods that operate on the data into a single unit (object), and restricting direct access to some of the object’s components.
    • Getter: A special method that is used to get the value of an object’s property.
    • Setter: A special method that is used to set the value of an object’s property.
    • Object Literal: A way to create objects in JavaScript using curly braces {} and defining properties as key-value pairs.
    • Prototype: An object that serves as a template for other objects. Objects inherit properties and methods from their prototype.
    • Prototype Chain: A sequence of objects linked together via their prototypes, used for inheritance and looking up properties and methods.
    • this Keyword: A keyword in JavaScript that refers to the object that is currently executing the code. Its value depends on how the function is called.
    • Strict Mode: A feature in JavaScript that enforces stricter parsing and error handling on your code, helping to avoid common pitfalls and unsafe practices.
    • Abstraction (OOP): Hiding complex implementation details and showing only essential information to the user.
    • ES6 (ECMAScript 2015): A major update to the JavaScript language standard that introduced new features like classes, modules, arrow functions, etc.
    • Symbol (ES6): A primitive data type whose instances are unique and immutable, often used to create private object properties.
    • Weak Map (ES6): A collection of key-value pairs in which keys must be objects, and unlike Maps, WeakMap keys are not strongly referenced, allowing them to be garbage collected if they are not referenced elsewhere.
    • Private Class Fields (ES2022): Class fields declared with a # prefix that are truly private and not accessible from outside the class.
    • Module: A self-contained unit of code that can be imported and used in other parts of a program. In Node.js, each file is treated as a separate module.
    • CommonJS: A module system for JavaScript, primarily used in Node.js, that uses require() to import modules and module.exports to export them.
    • ES6 Modules: A standardized module system for JavaScript that uses import to import modules and export to export them, supported in modern browsers and Node.js.
    • require(): A function in CommonJS used to import modules.
    • module.exports: An object in CommonJS used to define what a module exports.
    • import (ES6): A keyword in ES6 used to import modules.
    • export (ES6): A keyword in ES6 used to export modules.
    • package.json: A file at the root of a Node.js project that describes the project, its dependencies, scripts, and other metadata.
    • npm (Node Package Manager): The default package manager for Node.js. It is the world’s largest software registry, containing over a million packages.
    • Dependency: A library or package that a project relies on to function correctly.
    • npm install: A command used to download and install the dependencies listed in a project’s package.json file.
    • Semantic Versioning (SemVer): A versioning standard using a three-part number (MAJOR.MINOR.PATCH) to indicate the nature of changes in a software release.
    • Global Packages (npm): Packages installed in a system-wide directory, making them accessible from any project. Installed using the -g or –global flag.
    • Local Packages (npm): Packages installed within a specific project’s node_modules directory, only available to that project.
    • npm publish: A command used to upload a package to the npm registry.
    • Asynchronous Programming: A programming paradigm that allows multiple tasks to run concurrently without blocking the main execution thread.
    • Synchronous Programming: A programming paradigm where tasks are executed sequentially, and each task must complete before the next one can start.
    • Callback Function: A function passed as an argument to another function, to be executed at a later point, often after an asynchronous operation completes.
    • Callback Hell (Pyramid of Doom): A situation in asynchronous JavaScript code where multiple nested callbacks make the code difficult to read and maintain.
    • Promise: An object representing the eventual completion (either success or failure) of an asynchronous operation and its resulting value.
    • then(): A method of a Promise that is called when the promise is fulfilled (resolved).
    • catch(): A method of a Promise that is called when the promise is rejected.
    • async: A keyword used to define an asynchronous function, which implicitly returns a Promise.
    • await: A keyword used inside an async function to pause the execution of the function until a Promise is resolved or rejected.
    • try…catch: A statement used to handle exceptions (errors) in JavaScript code, including within async functions.

    Briefing Document: Asynchronous JavaScript and Module Management

    This document provides a detailed review of the main themes and important ideas presented in the provided source materials, focusing on asynchronous JavaScript, module management in Node.js, and object-oriented programming concepts.

    Part 1: Introduction to Node.js and Development Setup

    Main Themes: Setting up a development environment with Node.js and Visual Studio Code (VS Code), basic JavaScript syntax, and an introduction to Object-Oriented Programming (OOP).

    Key Ideas and Facts:

    • Node.js Installation: The document guides users through downloading and installing Node.js, recommending the default settings for most users.
    • “node.js once downloaded open the installer and follow the onscreen instructions the default settings are suitable for most users so you can proceed with them unless you have specific preferences”
    • VS Code Installation and Basic Usage: It provides instructions for downloading and installing VS Code, emphasizing that default settings are sufficient. Basic operations like creating a new project folder, adding files (.js extension is crucial), writing and saving code (Ctrl/Cmd + S), and executing JavaScript using the integrated terminal (node filename.js) are covered.
    • “the name of this file doesn’t matter but the file extension does”
    • “to save it I can do command s or on Windows it would be control s”
    • “I’ll type node and then the name of our file which is code. JS”
    • VS Code Interface Overview: The document introduces key components of the VS Code interface, including the activity bar (folder, search, source control, run and debug, extensions), status bar (errors/warnings, line number, language), command palette (Ctrl/Cmd + Shift + P), and basic customization options (color theme, text size).
    • “on the left hand side is the activity bar where we see a list of icons”
    • “on the bottom of the screen is the status bar here in Blue”
    • “you can access the command pallet by going to view and then command pallet now another way to do that is with the keyboard shortcut of command shift and P”
    • Recommended VS Code Extensions: Two extensions are recommended for the course: Live Server (for hot reloading in web development) and Quokka.js (for inline JavaScript output).
    • “for this course there are two vs code extensions that I suggest and that we will be using throughout this course so click on the icon for extensions and type in Live server then you can install this extension”
    • “another extension that we’ll be using for the early part of this course is quoka you type in quoka so select this one and then install it”
    • Introduction to OOP: The document introduces the fundamental concept of Object-Oriented Programming as a paradigm focused on organizing software design around “data or objects rather than focusing solely on functions and logic.” Objects are described as instances of classes, which serve as blueprints.
    • “objectoriented programming or o op is a programming Paradigm built around the concept of objects at its core oop organizes software design around data or objects rather than focusing solely on functions and logic objects are instances of classes which serve as blueprints for creating and managing data and”

    Part 2: JavaScript Fundamentals and Object-Oriented Concepts

    Main Themes: Data types, pass by value vs. pass by reference, dynamic nature of objects, loops, object literals, factory functions, constructor functions, the this keyword, prototypes, classes, static methods, abstraction, encapsulation, Getters and Setters, and property attributes.

    Key Ideas and Facts:

    • Data Types: JavaScript supports eight data types: seven primitive (number, string, boolean, bigint, undefined, null, symbol) and one complex (object, including arrays and functions).
    • “JavaScript supports eight different data types which include seven primitive types and one complex type”
    • Pass by Value vs. Pass by Reference: Primitive types are passed by value (copied), so changes to one variable do not affect others. Reference types (objects, arrays, functions) are passed by reference (point to the same memory location), so changes in one variable are reflected in others.
    • “primitive types these are passed by value so when you work with primitive values these are passed by copy”
    • “reference types like objects are handled differently so they are passed by reference meaning both variables point to the same object in memory”
    • Dynamic Objects: JavaScript objects are dynamic, allowing properties and methods to be added, modified, or deleted after creation. Using const with an object prevents reassignment of the variable but not modification of the object’s contents.
    • “objects in JavaScript are inherently Dynamic which means that you can add or modify their properties and Methods at any time after their creation”
    • “using the cons keyword with an object declaration ensures that the variable cannot be reassigned to a different value however the contents of the object it points to such as its properties and methods can still be altered or extended”
    • Loops: The for…of loop is introduced as ideal for iterating over array elements.
    • “for arrays we can use the four of loop so the four of loop is ideal for ating over array elements”
    • Object Literals, Factory Functions, and Constructor Functions: The document explains different ways to create objects in JavaScript, including simple object literals, factory functions (returning objects), and constructor functions (using new and the this keyword).
    • The this Keyword: The behavior of this depends on how a function is called. In constructor functions, this refers to the newly created object. Detaching a method from its object can cause this to lose its original context (referring to the global object or undefined in strict mode).
    • “the this keyword in JavaScript behaves differently based on how a function is called This Behavior can lead to unexpected results especially when functions are detached from the object context”
    • Prototypes: Every object in JavaScript has a prototype (except the root object), which it inherits properties and methods from. Constructor functions have a prototype property that defines the prototype for all instances created with that constructor, optimizing memory usage by sharing methods.
    • “in JavaScript every object has a prototype except for the root object which is at the top of the Prototype chain the Prototype acts as a template or parent from which the object inherits methods and properties”
    • “Constructor functions have their own prototype in JavaScript functions are objects so they have their own prototype property which is used to assign properties and methods to instances created by the Constructor function”
    • Classes (ES6): ES6 introduced class syntax, which provides a more structured way to create objects and handle inheritance, implicitly using strict mode.
    • “if we were to to use classes they implicitly use strict mode to avoid these issues instead of using a Constructor function I’ll specify it to be a class”
    • Static Methods: Static methods are associated with the class itself, not instances of the class, and are called directly on the class.
    • “static methods are defined directly on the class itself and are called on the class rather than on an instance of the class”
    • Abstraction: Abstraction involves hiding complex implementation details and exposing only necessary parts through a public interface (e.g., public methods interacting with private methods). Private methods can be simulated using naming conventions (underscore prefix), Symbols (pseudo-private), or truly private class fields (using # prefix in ES2022+).
    • “abstraction and programming involves hiding complex implementation details and exposing only the necessary parts of an object this is commonly achieved through private properties and methods”
    • Encapsulation: Encapsulation is the bundling of data (properties) and methods that operate on the data, restricting direct access to some of the object’s components. This is achieved through private properties and methods, controlled access via Getters and Setters, and module scope.
    • Getters and Setters: Getters (get) and setters (set) are special methods used to control how object properties are accessed and modified, allowing for validation and encapsulation. Object.defineProperty (and Object.defineProperties) can be used to define these.
    • “Getters and sets are special methods that provide you with a way to get and set the properties of an object this encapsulation technique allows you to control how important values are accessed and modified in your objects it’s often used to ensure that data encapsulation and validation rules are followed”
    • Property Attributes (Descriptors): Properties have attributes (configurable, enumerable, writable) that determine if they can be deleted, iterated over, or modified. Object.defineProperty can be used to configure these attributes.
    • “configurable enumerable and writable for properties in our own objects”
    • “what are the property descriptors or attributes in JavaScript that determine whether a property can be accessed modified or iterated over in JavaScript property descriptors or attributes that determine whether a property can be accessed modified or iterated over are innumerable writable and configurable”
    • Closures: Closures are inner functions that have access to variables in their outer (enclosing) function’s scope, even after the outer function has finished executing. They are used to achieve encapsulation and create private variables.
    • “a closure means that inner function has access to variables declared in its outer function”
    • “closures are inner functions that are able to access variables defined in its outer function so in other words closure functions can access variables from their outer scope even after the outer function has finished executing now you would utilize closures in order to achieve encapsulation and to hide private variables or private properties”
    • WeakMap for Private Properties: WeakMap can be used to store private data in objects. Keys in a WeakMap are objects, and if an object key is garbage collected, its entry in the WeakMap is also removed, preventing memory leaks.
    • “weak Map is another way to implement private properties and methods in JavaScript classes”
    • “using weakmap for storing private data ensures that these details are not accessible from outside the class this is much more secure than using properties prefixed with an underscore”

    Part 3: Module Management in Node.js

    Main Themes: Understanding and using the Node.js module system (CommonJS and ES6 modules) for organizing and reusing code, global objects, and package management with npm.

    Key Ideas and Facts:

    • Node.js as a Runtime Environment: Node.js allows JavaScript to run outside a web browser, primarily used for backend development (APIs, server-side applications). It uses an event-driven, non-blocking architecture.
    • “node.js is an open- Source cross-platform runtime environment that enables the execution of JavaScript outside of a web browser it’s primarily used for building servers set applications and networking tools”
    • Node.js Architecture and Features: Key features include its suitability for scalable, data-intensive, and real-time applications, quick startup and agility, real-world usage by major companies, the ability to use JavaScript for both frontend and backend, and a rich ecosystem (npm).
    • Runtime Environments: A runtime environment provides libraries and manages program execution. Web browsers have their own JavaScript engines (V8 in Chrome/Node.js, SpiderMonkey in Firefox, Chakra in Edge).
    • Node.js Module System (CommonJS): Each file in Node.js is treated as a separate module. require() is used to import modules, and module.exports (or exports) is used to export module contents.
    • “in node.js each file is treated as a separate module node.js provides a simple and efficient way to create modules and expose them to other parts of your application”
    • “node.js uses exports and module. exports to make functions and objects available to other files”
    • “we use the require function to include the module in another file”
    • Module Encapsulation (CommonJS): Modules in Node.js have their own scope, preventing global namespace pollution. Only explicitly exported items are accessible outside the module.
    • “one of the key benefits of using modules in nodejs is encapsulation by scope isolation each module has its own scope meaning its variables and functions are not accessible outside unless explicitly exported”
    • Exporting Defaults (CommonJS): module.exports = … is used to export a single default value (class, function, etc.).
    • “to export a class or function as the default export you use module. exports”
    • ES6 Modules: ES6 modules offer a more modern syntax for modularity in JavaScript (import and export).
    • “with es6 modules this provides a modern and cleaner syntax in order to achieve the same thing for JavaScript files that run in web browsers”
    • Global Objects in Node.js: Node.js provides built-in global objects (e.g., global, process, console, Buffer, timer functions) that are available in all modules. Custom global objects can be created by attaching properties to the global object.
    • “in nodejs Global objects are special objects that are available in all modules these objects provide essential functionality that could be access anywhere within a node.js application making them a fundamental part of the node.js runtime environment”
    • Loading Modules (require()): The require() function loads modules based on file paths. It’s best practice to use const when requiring modules to prevent accidental reassignment.
    • “nodejs uses the requir function to import modules which is a fundamental aspect of managing dependencies and modularity of your application”
    • “it’s a best practice to use the cons keyword as this prevents accidental reassignment of the module variable within your code”
    • Module Wrapping: Node.js wraps each module’s code in a function, providing scope isolation and access to module-specific variables (exports, require, module, __filename, __dirname).
    • “when node.js executes a module it does not run the code directly as written instead it wraps the module code inside a function this approach is not immediately apparent to the developer but it is fundamental to how nodejs operates”
    • OS Module: The built-in os module provides methods for retrieving system information (e.g., total memory, free memory).
    • “When developing applications that require system level data node.js provides a built-in module called OS which allows you to gather information about the underlying operating system”
    • FS (File System) Module: The built-in fs module allows interaction with the file system, providing synchronous (blocking) and asynchronous (non-blocking with callbacks or Promises) methods for file operations.
    • “node.js provides a powerful built-in module called FS for interacting with the file system this module is essential for reading from and writing to files on the server”
    • Package Management (npm): npm (Node Package Manager) is used to install, manage, and publish JavaScript packages. package.json file tracks project dependencies.
    • “npm which stands for node package manager which simplifies the addition of functionalities and accelerates the development process”
    • “npm is the default package manager for nodejs”
    • package.json: This file contains metadata about the project, including its name, version, dependencies, and scripts. npm init is used to create it.
    • “the package.json file is a central configuration file for your nodejs project it stores important metadata about your project such as its name version dependencies and scripts”
    • “you can initialize a new packagejson file by navigating to your project directory in the terminal and running the command mpm init”
    • Installing Packages (npm install): npm install <package-name> installs a package and adds it to node_modules and package.json (as a dependency). The –save-dev flag installs development dependencies.
    • “npm install <package-name> is the fundamental command used to install packages from the npm registry”
    • “to install a package as a development dependency which are tools needed for development and testing but not for running the application in production you can use the –save-dev flag”
    • node_modules: This directory stores all installed npm packages.
    • “npm installs these packages and their dependencies into a folder named nodeore modules in your project directory”
    • Version Control (Git and .gitignore): It’s crucial to exclude the node_modules directory from Git version control using a .gitignore file, as these dependencies can be restored using npm install.
    • “excluding known modules from Version Control is a best practice in nodejs development it keeps your project repository manageable speeds up operations like cloning and ensures that all developers are working with the same dependencies as defined in package.json”
    • Semantic Versioning (SemVer): Packages use semantic versioning (major.minor.patch) to indicate the type of changes in updates, helping developers understand the potential impact of updating dependencies. Carrots (^) and tildes (~) in package.json specify acceptable ranges for automatic updates.
    • “semantic versioning is a standard for versioning software which is widely adopted in the development Community including nodejs packages it helps developers understand the potential impact of updating a package”
    • Global npm Packages: Packages installed globally (npm install -g <package-name>) are typically command-line tools accessible system-wide. Minimize global installations to avoid version conflicts.
    • “Global packages are typically command line tools or utilities that you want to run from anywhere on your system not just within a specific project”
    • “to install a package globally you would use the – G or hyphen G or the– Global flag with the mpm install command”
    • Publishing npm Packages: The process involves setting up a package.json with a unique name, creating an npm account, writing the package code, and using npm publish to share it. Updates require incrementing the version in package.json.
    • “creating and Publishing your own mpm package can be a rewarding process allowing you to share your work with the wider no. JS community”
    • “to publish your package to mpm using the command mpm publish”

    Part 4: Asynchronous JavaScript

    Main Themes: Understanding synchronous vs. asynchronous code execution, and the evolution of patterns for handling asynchronous operations: callbacks, Promises, and async/await.

    Key Ideas and Facts:

    • Synchronous vs. Asynchronous Code: Synchronous code executes sequentially, blocking further execution. Asynchronous code allows other operations to continue while waiting for a task to complete.
    • “understanding the difference between synchronous and asynchronous code is fundamental in JavaScript synchronous code executes sequentially blocking further execution until the current task is completed in contrast a synchronous code allows other operations to continue while waiting for an asynchronous task to complete improving performance and responsiveness”
    • Callbacks: Functions passed as arguments to be executed upon completion of an asynchronous operation. Nested callbacks can lead to “callback hell” (deeply nested and hard-to-manage code). Named functions can improve readability of callback-based code.
    • “a call back is a function that is passed as an argument to another function to be executed once an asynchronous operation is complete”
    • “nested callbacks which can lead to callback how which is a situation where code becomes deeply nested and difficult to manage this pattern complicates both reading and maintaining the code”
    • Promises: Objects representing the eventual outcome (success or failure) of an asynchronous operation. They have three states: pending, fulfilled (resolved), and rejected. Promises provide a cleaner way to handle asynchronous logic using .then() for success and .catch() for errors, avoiding callback hell. Promise.resolve() and Promise.reject() create pre-resolved or pre-rejected promises. Promises support running asynchronous operations in parallel using Promise.all().
    • “JavaScript promises are a powerful tool for managing asynchronous operations A promise is an object that represents the eventual result of an asynchronous operation it can be in one of three states the first being pending so this is the initial State when the promise is still waiting for the asynchronous operation to complete the second state is fulfilled the operation completed successfully and the promise has a value and the third possible state is rejected so the operation failed and the promise hasn’t air”
    • “replacing callbacks with promises promises help avoid the complexity of nested callbacks by returning promises from functions you can chain asynchronous operations more straightforward using the them method for resolve promises and do catch for errors”
    • Async/Await: Syntactic sugar over Promises that makes asynchronous code look and behave more like synchronous code. async declares an asynchronous function (which implicitly returns a Promise), and await pauses the execution of an async function until a Promise resolves. Error handling with async/await is done using try…catch blocks.
    • “async 08 is syntactic suar sugar over promises making asynchronous code look synchronous”
    • “this keyword allows you to wait for a promise to resolve and get its result you could use it only inside functions marked with the async keyword”
    • “async this keyword is used to declare that a function is asynchronous it ensures that the function returns a promise”
    • “for air handling we use try and catch blocks to handle errors when using a sync and a we”

    This briefing document covers the foundational concepts and practices discussed in the provided sources, highlighting the setup of a development environment, core JavaScript principles, object-oriented programming, module management in Node.js, and effective strategies for handling asynchronous operations. Understanding these topics is crucial for modern JavaScript development, particularly in backend environments using Node.js.

    Frequently Asked Questions on Node.js and JavaScript Asynchronous Programming

    1. What are the fundamental differences between synchronous and asynchronous code execution in JavaScript, and why is understanding this distinction important for Node.js development?

    Synchronous code executes line by line, and each operation must complete before the next one begins, potentially blocking the program if an operation takes a long time. Asynchronous code, on the other hand, allows the program to continue executing other tasks while waiting for a long-running operation (like reading a file or a network request) to complete. Once the asynchronous operation finishes, a callback function or a promise’s resolution/rejection is handled. Understanding this distinction is crucial for Node.js development because Node.js is designed to handle many concurrent connections efficiently. Its non-blocking, event-driven architecture relies heavily on asynchronous operations to prevent the server from becoming unresponsive when dealing with I/O-bound tasks.

    2. How does Node.js utilize modules to organize and encapsulate code, and what are the advantages of this modular approach for building scalable and maintainable applications?

    Node.js treats each file as a separate module, helping to organize code into reusable units. Modules can export specific parts of their functionality (functions, objects, classes) using module.exports (in CommonJS) or export (in ES Modules), which can then be imported into other modules using require (in CommonJS) or import (in ES Modules). This modular approach offers several advantages:

    • Code Organization: It breaks down large applications into smaller, manageable pieces, making the codebase easier to navigate and understand.
    • Reusability: Modules can be reused across different parts of the application or even in other projects, reducing code duplication and development time.
    • Maintainability: Changes to one module are less likely to affect other parts of the application, provided the module’s interface remains stable, making it easier to update and refactor code.
    • Scalability: Well-organized, modular code is easier to scale as new features or functionalities can be added as separate modules without increasing the complexity of the entire system.
    • Namespace Management: Modules help avoid global namespace pollution by keeping variables and functions within their local scope unless explicitly exported.

    3. What is the Node Package Manager (npm), and why is it an essential tool for Node.js development? What are some key commands and concepts associated with npm?

    npm (Node Package Manager) is the default package manager for Node.js. It is an essential tool that allows developers to easily share, install, and manage dependencies (third-party libraries and tools) for their Node.js projects. Key commands and concepts include:

    • npm init: Initializes a new Node.js project and creates a package.json file.
    • package.json: A file that contains metadata about the project, including its name, version, dependencies, scripts, and more. It’s crucial for managing project dependencies.
    • npm install <package-name>: Installs a specified package and adds it to the node_modules directory and the dependencies or devDependencies section of package.json.
    • npm install -D <package-name> or npm install –save-dev <package-name>: Installs a package as a development dependency, typically used for testing or build tools.
    • npm install: Installs all the dependencies listed in the package.json file.
    • node_modules: The directory where npm installs project dependencies. It’s typically excluded from version control.
    • Semantic Versioning (semver): A standard (Major.Minor.Patch) used by npm to manage package versions and specify compatible update ranges using symbols like ^ (caret) and ~ (tilde) in package.json.
    • Global vs. Local Installations: Packages can be installed locally (within a project’s node_modules) or globally (for command-line tools accessible system-wide using npm install -g <package-name>).
    • npm publish: Used by developers to upload their own packages to the npm registry for others to use.

    4. How does Node.js handle asynchronous operations using callbacks, promises, and async/await? What are the benefits and drawbacks of each approach, and when might you choose one over the others?

    Node.js provides several ways to handle asynchronous operations:

    • Callbacks: Functions passed as arguments to be executed upon the completion of an asynchronous task.
    • Benefits: Widely supported and the original way of handling asynchronicity in JavaScript.
    • Drawbacks: Can lead to “callback hell” (deeply nested callbacks) making code hard to read and maintain. Error handling can become complex.
    • When to use: For simple asynchronous operations or when working with older APIs that don’t support promises.
    • Promises: Objects representing the eventual completion (resolve) or failure (reject) of an asynchronous operation. They provide a more structured way to handle asynchronicity using .then() for success and .catch() for errors.
    • Benefits: Improve code readability and maintainability by avoiding callback hell through chaining. Offer better error handling with a single .catch() at the end of a promise chain.
    • Drawbacks: Can still lead to verbose code with long chains. Error handling needs to be explicitly managed.
    • When to use: For managing sequences of asynchronous operations or when dealing with APIs that return promises.
    • Async/Await: Syntactic sugar built on top of promises that allows you to write asynchronous code that looks and behaves more like synchronous code using the async and await keywords.
    • Benefits: Significantly improves code readability and makes asynchronous logic easier to follow. Simplifies error handling using try…catch blocks.
    • Drawbacks: await can only be used inside async functions. Can sometimes hide the asynchronous nature of operations, potentially leading to misunderstandings about performance.
    • When to use: For most modern asynchronous JavaScript development where readability and maintainability are key, especially for complex sequences of asynchronous tasks.

    5. What is the significance of the this keyword in JavaScript, and how does its behavior differ in various contexts (e.g., global scope, function context, class methods, arrow functions)? How can issues related to this context be managed?

    The this keyword in JavaScript refers to the object that is currently executing the code. Its behavior varies depending on the context in which it is used:

    • Global Scope: In non-strict mode, this refers to the global object (e.g., window in browsers, global in Node.js). In strict mode, this is undefined.
    • Function Context (Regular Functions): The value of this depends on how the function is called. It can be the global object (in non-strict mode when called independently), undefined (in strict mode when called independently), the object calling the method (when called as a method of an object), or bound to a specific object using call(), apply(), or bind().
    • Class Methods: Inside methods of a class, this refers to the instance of the class that the method is called on.
    • Arrow Functions: Arrow functions do not have their own this context. They lexically capture the this value from their surrounding (enclosing) scope. This makes them useful for callbacks within methods or other functions where you want this to refer to the outer scope’s this.

    Issues related to this context can be managed by:

    • Using arrow functions to preserve the this from the outer scope.
    • Using bind(), call(), or apply() to explicitly set the this value.
    • Being mindful of strict mode’s impact on this in regular functions.
    • When detaching methods from objects, ensure the intended this context is preserved (e.g., using bind()).

    6. Explain the concepts of closures, encapsulation, and abstraction in JavaScript. How are these principles implemented and why are they important for writing robust and maintainable code, especially in the context of object-oriented programming with Node.js?

    • Closures: A closure is a feature in JavaScript where an inner function has access to the outer (enclosing) function’s variables—the scope chain—even after the outer function has finished executing. This happens because the inner function “closes over” its environment. Closures are often used to create private variables and maintain state.
    • Encapsulation: Encapsulation is the practice of bundling data (properties) and the methods that operate on that data within a single unit (an object or a module). It also involves hiding the internal state of an object and exposing only a public interface. This protects the data from unintended modification and simplifies how the object is used. In JavaScript, encapsulation can be achieved using closures (for data privacy), conventions (like prefixing private members with _), Symbols, WeakMaps, and private class fields (#). Modules also provide encapsulation by isolating the scope of variables and functions.
    • Abstraction: Abstraction involves hiding complex implementation details and showing only the essential information to the user. It allows developers to use objects or modules without needing to know how they work internally. In JavaScript, abstraction can be implemented through well-defined public interfaces of objects and modules, which internally use private properties and methods (achieved through closures, Symbols, WeakMaps, or private class fields) to handle the complexity.

    These principles are crucial for writing robust and maintainable code because they:

    • Improve Code Organization: They help structure code logically, making it easier to understand and manage.
    • Enhance Reusability: Encapsulated and abstracted components are more likely to be reusable in different parts of the application or in other projects.
    • Increase Maintainability: Changes to the internal implementation of an encapsulated component do not affect other parts of the system as long as the public interface remains the same.
    • Promote Data Integrity: Encapsulation helps protect data by controlling how it can be accessed and modified.
    • Reduce Complexity: Abstraction allows developers to work with higher-level concepts without being overwhelmed by the underlying details.

    In Node.js, which is often used to build complex backend systems, applying these OOP principles helps manage the complexity of the application and ensures that the codebase remains manageable as it grows.

    7. What are prototypes and how does prototype-based inheritance work in JavaScript? How do constructors relate to prototypes, and why is understanding the prototype chain important for optimizing memory usage and code reuse in Node.js applications?

    In JavaScript, every object has a prototype, which is another object that it inherits properties and methods from. This is the basis of prototype-based inheritance. When you try to access a property of an object, and that property is not found on the object itself, JavaScript looks up the prototype chain until it finds the property or reaches the end of the chain (which is null).

    Constructors are functions used to create objects. When you create an object using the new keyword with a constructor function, the newly created object’s internal prototype ([[Prototype]], accessible via __proto__ or Object.getPrototypeOf()) is set to the prototype property of the constructor function.

    Understanding the prototype chain is important for:

    • Memory Optimization: Methods and properties added to the prototype of a constructor are shared by all instances created by that constructor. This means that instead of each object having its own copy of these members, they all refer back to the same ones on the prototype, saving memory, especially when dealing with a large number of objects.
    • Code Reuse: Inheritance through prototypes allows you to reuse functionality defined on a prototype across multiple objects, promoting a more organized and efficient codebase. You can extend or modify the behavior of objects by manipulating their prototypes.
    • Understanding JavaScript’s Object Model: A solid grasp of prototypes is fundamental to understanding how objects in JavaScript work and how inheritance is achieved.

    In Node.js, where applications often involve creating many objects (e.g., handling numerous requests), leveraging prototype-based inheritance effectively can lead to significant performance improvements and more efficient resource utilization.

    8. What are ES Modules and CommonJS, and how do they differ in Node.js? What are the syntaxes for importing and exporting modules in each system, and when might you choose one over the other in a Node.js project?

    CommonJS was the original module system used in Node.js. It uses a dynamic approach to module loading.

    • Exporting: Uses module.exports to export values (can be a single value or an object containing multiple exports) and exports as a shorthand for module.exports.
    • Importing: Uses the require() function to import modules, typically assigning the result to a variable.

    ES Modules (ECMAScript Modules) are the standard module system introduced in ECMAScript 2015 (ES6). They offer a more static and standardized way to handle modules across JavaScript environments (browsers and Node.js).

    • Exporting: Uses the export keyword to export named bindings (e.g., export const myVariable = …) or a default export (e.g., export default myClass).
    • Importing: Uses the import keyword to import named bindings (e.g., import { myVariable } from ‘./module’) or the default export (e.g., import myClass from ‘./module’).

    Differences in Node.js:

    • Loading Mechanism: CommonJS is dynamic (modules are resolved at runtime), while ES Modules are more static (module dependencies can be analyzed at parse time, allowing for potential optimizations like tree-shaking).
    • Syntax: Different keywords (require/module.exports vs. import/export).
    • Scope: Both provide module-level scope, but ES Modules have stricter scoping rules.
    • “use strict”: ES Modules implicitly operate in strict mode.
    • Top-level await: Allowed in ES Modules but not in CommonJS (outside of async functions).

    When to Choose:

    • CommonJS: Historically used in most Node.js projects and is still the default in many older projects or when working with code that primarily uses this syntax.
    • ES Modules: Recommended for new Node.js projects as they are the modern JavaScript standard and offer benefits like static analysis and better support in modern JavaScript tooling. Node.js has increasingly improved its support for ES Modules, and it’s becoming more common to use them. You can configure Node.js to treat .js files as ES Modules by adding “type”: “module” to your package.json file, or by using the .mjs file extension.

    Many modern Node.js projects are transitioning to or already using ES Modules for a more standardized and potentially optimized module management system.

    JavaScript OOP Challenges and Considerations

    Object-Oriented Programming (OOP), while offering numerous benefits, also presents certain challenges, particularly in its implementation and design. Based on the sources, some of these challenges in the context of JavaScript include:

    • Challenges with Inheritance:
    • Inappropriate Relationships: A key challenge with inheritance is ensuring that the subclass truly represents a specialized version of the superclass, adhering to the “is a” relationship. Problems arise when a subclass inherits methods that do not logically apply to it, leading to an inappropriate relationship and potentially bloated or confusing interfaces. For example, if a base Employee class has a code method, it might not logically apply to a Manager subclass.
    • Inheritance Complexity: Deep inheritance hierarchies can become difficult to manage and understand. The more levels of inheritance, the harder it can be to track where properties and methods are coming from and how changes in one part of the hierarchy might affect others. The sources suggest limiting inheritance depth to maintain manageable code.
    • Constructor Property Issues: When implementing inheritance using Object.create to set the prototype, the constructor property of the subclass prototype mistakenly points to the superclass constructor. This can cause confusion when creating instances dynamically and requires manually resetting the constructor property to reflect the actual subclass constructor.
    • Modifying Built-in Prototypes: While JavaScript allows extending built-in prototypes, it is generally ill-advised due to the potential for conflicts with third-party libraries that might rely on the default behavior. Modifying built-in prototypes can also lead to inconsistent behavior and make code harder to maintain and predict, potentially breaking compatibility with future JavaScript versions.
    • Global Scope Pollution: In JavaScript environments, particularly browsers, defining variables and functions in the global scope (using var at the top level) can lead to namespace pollution. The global namespace can become cluttered, making it difficult to track definitions. Additionally, accidental overwriting of global variables by different parts of an application can cause hard-to-diagnose bugs. Modularity, using techniques like CommonJS or ES6 modules, is essential to mitigate these risks by encapsulating code and avoiding global scope interference.
    • Managing Private Data: Achieving true data encapsulation, a core OOP principle, has historically been a challenge in JavaScript. While naming conventions (using underscores) and ES6 Symbols offer some level of privacy, they don’t provide complete protection. ES2022 introduced private class fields (using the # prefix) as a more robust solution for ensuring data and method privacy within classes. WeakMap can also be used to store private data, offering the additional benefit of allowing objects to be garbage collected even with associated private data in the WeakMap.
    • Choosing Between Inheritance and Composition: Deciding when to use inheritance versus composition can be a challenge. Inheritance should ideally represent an “is a” relationship, but over-reliance can lead to complex hierarchies and the inheritance of inappropriate functionalities. Composition, representing a “has a” relationship, often provides a more flexible and robust alternative by building objects from components, reducing dependencies and promoting code reuse through techniques like mixins.

    These points highlight some of the significant challenges and considerations when working with OOP principles in JavaScript, emphasizing the importance of careful design, adherence to best practices, and understanding the specific features and limitations of the language.

    JavaScript Objects: Concepts and Mechanisms

    Let’s discuss JavaScript objects, drawing on the information from the sources and our previous conversation about OOP challenges.

    Fundamentals of JavaScript Objects

    At its core, a JavaScript object is a collection of key-value pairs. These pairs are also known as properties, where the key is typically a string (or Symbol) and the value can be any JavaScript data type, including primitive values, other objects, or functions. Functions within an object are referred to as methods.

    Creating Objects

    JavaScript offers several ways to create objects:

    • Object Literals: The most common way to create a simple object is using curly braces {} to define an object literal, where you directly specify the key-value pairs. For example:
    • let programmer = {
    • name: “Steven Garcia”,
    • preferredLanguage: “JavaScript”,
    • writeCode: function() {
    • console.log(this.name + ” writes ” + this.preferredLanguage + ” code”);
    • },
    • drinkCoffee() { // Syntactic sugar for defining methods
    • console.log(this.name + ” drinks coffee”);
    • }
    • };
    • Factory Functions: A factory function is a function that returns a new object each time it is called. This can help avoid code duplication when creating multiple similar objects.
    • Constructor Functions: Before ES6, JavaScript used constructor functions along with the new keyword to create objects, mimicking class-like behavior. Constructor functions use PascalCase for naming convention, and the this keyword is used to assign properties and methods to the new object.
    • ES6 Classes: Introduced in ES6, the class syntax provides a more structured and cleaner way to define constructor functions and manage prototypical inheritance. It is essentially syntactic sugar over JavaScript’s existing prototypal inheritance model. Classes use a constructor method to initialize object properties and define methods within the class body.

    Dynamic Nature of Objects

    JavaScript objects are inherently dynamic, meaning you can add, modify, and delete properties and methods at any time after an object’s creation. This can be done using either dot notation or square bracket notation. While using const to declare an object prevents reassignment of the variable to a different object, the contents of the object itself can still be altered.

    Iterating Over Object Properties

    JavaScript provides several ways to iterate over the properties of an object:

    • for…in loop: This loop iterates over all enumerable properties of an object, including inherited properties from its prototype chain.
    • Object.keys(obj): This method returns an array containing the names of all own enumerable properties of the object obj. It does not include inherited properties.
    • Object.values(obj): This method returns an array containing the values of all own enumerable properties of the object obj.
    • Object.entries(obj): This method returns an array of [key, value] pairs for all own enumerable properties of the object obj.

    Prototypes and Prototypal Inheritance

    Every JavaScript object has an internal prototype (accessible via Object.getPrototypeOf(obj) or the older __proto__ property), which is another object or null. When you try to access a property of an object, and that property is not found on the object itself, JavaScript looks for it in the object’s prototype, then in the prototype’s prototype, and so on, up the prototype chain. This mechanism is known as prototypal inheritance, where objects inherit properties and methods from their prototype objects.

    Constructor functions also have a prototype property, which is an object that becomes the prototype for all instances created with that constructor. Methods defined on a constructor’s prototype are shared among all instances, leading to more memory-efficient code compared to defining methods directly within the constructor function.

    The this Keyword

    The this keyword in JavaScript refers to the context in which a function is executed. In the context of object methods, this typically refers to the object that the method is called on. However, the value of this can change depending on how a function is called (e.g., direct function call, method call, using call, apply, or bind). In strict mode, the value of this in a standalone function is undefined, which helps prevent accidental modification of the global object. ES6 classes implicitly use strict mode.

    Encapsulation and Data Privacy

    Encapsulation, one of the four pillars of OOP, involves hiding the internal state and functionality of an object and exposing only what is necessary. JavaScript provides several mechanisms for achieving data privacy:

    • Abstraction: Hiding complex implementation details and showing only necessary information to the user. This is often achieved through well-defined public interfaces (methods) that interact with private parts of the object.
    • Naming Conventions (Underscore Prefix): Historically, using an underscore _ prefix for property names was a convention to indicate that a property was intended for internal use and should not be accessed directly from outside the object. However, this does not provide true privacy.
    • Symbols: ES6 introduced Symbols, which are unique and immutable primitive values that can be used as object property keys. Properties keyed by Symbols are not easily discoverable through standard reflection mechanisms, providing a form of “soft” privacy.
    • Weak Maps: WeakMap is a collection of key-value pairs where keys are objects, and values are arbitrary values. Unlike regular Maps, WeakMap allows for garbage collection of key objects even if they are still present as keys in the WeakMap (if there are no other strong references to them). This makes them suitable for storing private data associated with objects without preventing memory leaks.
    • ES2022 Private Class Fields: ES2022 introduced private class fields and methods using the hash # prefix. These private members are truly private and are only accessible from within the class where they are defined, providing strong data encapsulation.

    Inheritance and Extending Objects

    JavaScript primarily uses prototypal inheritance for sharing properties and methods between objects. ES6 classes provide a more familiar syntax for defining inheritance hierarchies using the extends keyword. A subclass (or derived class, child class) can extend a superclass (or base class, parent class), inheriting its properties and methods.

    • The super keyword is used in a subclass constructor to call the superclass constructor and in subclass methods to call superclass methods, allowing for extending or modifying inherited behavior.
    • Method overwriting allows a subclass to provide its own specific implementation of a method that is already defined in its superclass.

    Mixins

    Mixins offer a flexible alternative to traditional inheritance for composing objects with multiple behaviors. Instead of inheriting from a single base class, an object can “mix in” functionalities from multiple smaller, focused objects. This can be achieved using Object.assign to copy properties and methods from mixin objects to a target object. Mixins promote composition over inheritance, which can lead to more modular and maintainable code.

    Property Descriptors

    JavaScript objects have associated property descriptors that define the attributes of each property, controlling how they can be accessed, modified, and enumerated. These attributes include:

    • enumerable: Determines whether the property will appear during for…in loops and Object.keys().
    • writable: Determines whether the property’s value can be changed.
    • configurable: Determines whether the property descriptor can be changed and whether the property can be deleted.

    You can get and set these attributes using Object.getOwnPropertyDescriptor() and Object.defineProperty() respectively.

    Getters and Setters

    Getters and Setters are special methods that allow you to control the access and modification of object properties.

    • Getters (defined using the get keyword in object literals or class bodies, or Object.defineProperty) are called when you try to access a property, allowing you to execute code and return a computed value.
    • Setters (defined using the set keyword or Object.defineProperty) are called when you try to assign a value to a property, allowing you to perform actions like validation or logging before the value is actually set.

    Getters and Setters provide a way to encapsulate property access and modification, enhancing data integrity and providing a cleaner interface.

    Primitive vs. Reference Types

    It’s important to understand that objects are reference types in JavaScript. When you assign an object to a variable, you are actually assigning a reference to the object in memory. If you assign that variable to another variable, both variables will point to the same object in memory. Therefore, changes made through one variable will affect the other. This is in contrast to primitive types (e.g., numbers, strings, booleans), which are passed by value, meaning a copy of the value is created when assigned to a new variable.

    Memory Management

    As we discussed, using prototypes for shared methods is crucial for memory efficiency when dealing with numerous object instances. Instead of each instance having its own copy of a method, they all share the same method defined on the prototype. Additionally, using WeakMap for private data can aid in memory management by allowing the garbage collector to reclaim memory occupied by objects even if they have associated private data in the WeakMap (when there are no other strong references).

    By understanding these concepts, you can effectively work with JavaScript objects, leveraging their flexibility and power while also being mindful of best practices for code organization, maintainability, and performance, especially in the context of the OOP challenges we previously discussed.

    JavaScript Object Literals: Definition and Use

    Let’s delve deeper into JavaScript object literals, drawing upon the information in the provided sources and our previous discussion about JavaScript objects.

    An object literal is a fundamental way to create objects in JavaScript. It is defined using curly braces {} and consists of key-value pairs. These key-value pairs represent the properties of the object, where the key is typically a string (or Symbol) and the value can be any valid JavaScript data type, including primitive values, other objects, or functions (which become methods of the object).

    Creating Object Literals

    You create an object literal by simply using the curly brace notation and defining the key-value pairs within them. Here’s a basic example from source:

    let proProgrammer = {

    name: “Your Name”,

    preferredLanguage: “JavaScript”

    };

    In this example, proProgrammer is an object literal with two properties: name and preferredLanguage, each assigned a string value.

    Defining Properties and Methods

    Within an object literal, you can define both data properties and methods.

    • Properties are defined as key: value pairs.
    • Methods (functions associated with the object) can be defined in a couple of ways:
    • Using a traditional function expression:
    • let myObject = {
    • myMethod: function() {
    • // … function body
    • }
    • };
    • Using the more concise syntactic sugar introduced in ES6:
    • let myObject = {
    • myMethod() {
    • // … function body
    • }
    • };

    Source provides an example illustrating method definition:

    let programmer = {

    name: “Steven Garcia”,

    preferredLanguage: “JavaScript”,

    writeCode: function() {

    console.log(this.name + ” writes ” + this.preferredLanguage + ” code”);

    },

    drinkCoffee() { // Syntactic sugar

    console.log(this.name + ” drinks coffee”);

    }

    };

    Here, writeCode and drinkCoffee are methods of the programmer object literal. The this keyword within these methods refers to the programmer object itself, allowing access to its properties like name.

    Dynamic Nature

    As we discussed previously, and as implied by the ability to manipulate objects using dot or bracket notation, object literals, like all JavaScript objects, are dynamic. You can add new properties or methods, modify existing ones, or delete them after the object literal has been created. For example:

    let myObject = { key: “value” };

    myObject.newProperty = “another value”; // Adding a new property

    myObject.key = “updated value”; // Modifying an existing property

    delete myObject.key; // Deleting a property

    Use Cases and Benefits

    Object literals are incredibly useful for:

    • Organizing related data: They allow you to group together a set of variables (properties) and functions (methods) that logically belong together, as seen in the programmer example.
    • Representing real-world entities or complex data models: You can easily model objects with their attributes and behaviors using object literals.
    • Creating simple configuration objects: Passing options or settings to functions often involves using object literals.
    • Returning simple data structures from functions.

    Source highlights that by using object literals, you can create versatile and reusable code structures that represent real-world entities or complex data models effectively. They contribute to making your code cleaner and more intuitive to work with by encapsulating related properties and functions within a single organized entity.

    Limitations

    While object literals are convenient, they have limitations, especially when you need to create multiple objects with the same structure and methods. Source points out that if you need to create multiple programmer objects using the object literal syntax repeatedly, it can lead to duplicated code, making your application harder to maintain. This is particularly true for objects that include methods, as the behavior might be repeated across multiple instances.

    Comparison with Other Object Creation Methods

    To address the code duplication issue with object literals, JavaScript offers other ways to create objects, such as:

    • Factory Functions: As mentioned in source, factory functions are functions that return a new object each time they are called, allowing for the creation of multiple objects with the same methods but potentially different property values.
    • Constructor Functions (and ES6 Classes): These provide a blueprint for creating objects and are particularly useful for implementing inheritance and creating instances of a specific “type” of object, as discussed in sources.

    In summary, object literals are a foundational and highly used feature in JavaScript for creating single instances of objects with a clear and concise syntax. They are excellent for organizing data and representing entities but can become less maintainable when you need to create many similar objects, at which point factory functions or constructor functions/classes might be more appropriate.

    JavaScript Factory Functions: Object Creation Pattern

    Let’s delve into Factory Functions in JavaScript, drawing upon the information in the provided sources and our previous discussion about object literals.

    A factory function in JavaScript is essentially a function that returns a new object each time it is called. Source explains that the name of a factory function is typically in camel case notation and that it can accept parameter variables. These parameters allow you to customize the values of the object being returned.

    Creating Factory Functions

    According to source, you implement a factory function as a regular JavaScript function. Inside this function, you define and return a new object literal. Here’s the example provided in source for creating programmer objects:

    function createProgrammer(name, preferredLanguage) {

    return {

    name,

    preferredLanguage,

    writeCode: function() {

    console.log(this.name + ” writes ” + this.preferredLanguage + ” code”);

    },

    drinkCoffee: function() {

    console.log(this.name + ” drinks coffee”);

    }

    };

    }

    In this example, createProgrammer is a factory function that takes name and preferredLanguage as parameters and returns a new object literal with these properties and the writeCode and drinkCoffee methods. Source also demonstrates a more concise syntax for the returned object literal:

    function createProgrammer(name, preferredLanguage) {

    return {

    name,

    preferredLanguage,

    writeCode() {

    console.log(this.name + ” writes ” + this.preferredLanguage + ” code”);

    },

    drinkCoffee() {

    console.log(this.name + ” drinks coffee”);

    }

    };

    }

    Source also provides an example of a factory function for creating grocery list items:

    function createGroceryItem(name, quantity) {

    return {

    name,

    quantity,

    display() {

    console.log(this.quantity + ” times ” + this.name);

    }

    };

    }

    Benefits of Using Factory Functions

    Source explicitly states the benefit of factory functions is that they reduce code duplication and the need to copy and paste when you need to create multiple objects with similar structures and behaviors.

    Consider the limitation of object literals we discussed earlier. If you needed to create several programmer objects, using object literals would require you to duplicate the writeCode and drinkCoffee methods in each object, making the code inefficient and harder to maintain. Factory functions solve this problem because the methods are defined once within the factory function and are included in each new object it returns. This makes the codebase cleaner and more manageable.

    Source further elaborates that factory functions provide an efficient way to create new objects. The parameter variables allow for customizing the values of the returned object.

    Usage

    To use a factory function, you simply call it like any other function, passing in the necessary arguments. Source provides the following examples:

    For the programmer factory:

    const newProgrammer = createProgrammer(“Alice”, “JavaScript”);

    newProgrammer.writeCode(); // Output: Alice writes JavaScript code

    For the grocery list item factory:

    const newItem = createGroceryItem(“bananas”, 5);

    newItem.display(); // Output: 5 times bananas

    In summary, factory functions are a valuable pattern in JavaScript for creating multiple objects with shared behavior without duplicating code. They enhance maintainability and provide a cleaner way to instantiate objects compared to repeatedly using object literals, especially when those objects have methods. They offer a step towards more structured object creation in JavaScript.

    JavaScript Constructor Functions

    Let’s discuss Constructor functions in JavaScript, drawing upon the information in the provided sources and our conversation history about object literals and factory functions.

    In traditional JavaScript, before the introduction of the class syntax in ES6, constructor functions were the standard way to mimic class-like behavior and instantiate new objects. Source explicitly states that JavaScript used functions and the new keyword to achieve this, a technique known as Constructor functions. The ES6 class syntax, as source notes, is essentially syntactic sugar over this underlying prototypal inheritance mechanism.

    Defining Constructor Functions

    According to source, constructor functions are defined using the function keyword. By convention, their names are written in PascalCase, where the first letter of each word in the name is capitalized (e.g., Programmer, GroceryItem).

    Here’s an example from source of a constructor function for creating programmer objects:

    function Programmer(name, preferredLanguage) {

    this.name = name;

    this.preferredLanguage = preferredLanguage;

    this.writeCode = function() {

    console.log(this.name + ” writes ” + this.preferredLanguage + ” code”);

    };

    this.drinksCoffee = function() {

    console.log(this.name + ” drinks coffee”);

    };

    }

    And here’s a constructor function for a grocery item from source:

    function GroceryItem(name, quantity) {

    this.name = name;

    this.quantity = quantity;

    this.display = function() {

    console.log(this.quantity + ” times ” + this.name);

    };

    }

    The new Keyword

    The crucial aspect of constructor functions is how they are used to create objects. You instantiate a new object and call a constructor function using the new keyword.

    When you use new followed by a constructor function:

    1. A new object is created in memory.
    2. The this keyword inside the constructor function is bound to this newly created object.
    3. The code inside the constructor function is executed, allowing you to assign properties and methods to the this object.
    4. If the constructor function does not explicitly return an object, the newly created object is returned implicitly.

    Source provides an example of creating instances using the new keyword:

    const newProgrammer = new Programmer(“Alice”, “JavaScript”);

    newProgrammer.writeCode(); // Output: Alice writes JavaScript code

    const newItem = new GroceryItem(“bananas”, 5);

    newItem.display(); // Output: 5 times bananas

    The this Keyword

    As mentioned above, within a constructor function, the this keyword refers to the specific instance of the object being created. This allows you to assign properties (like this.name = name) and define methods (like this.writeCode = function() {…}) that will belong to each individual object created with the constructor.

    The constructor Property

    Every object in JavaScript has a special property called constructor. This property references the function that was used to create the object via the new keyword. Source illustrates this:

    console.log(newProgrammer.constructor); // Output: [Function: Programmer]

    This constructor property can be useful for checking the type of an object, especially in more complex codebases.

    Comparison with Object Literals and Factory Functions

    • Object Literals: As we discussed, object literals are excellent for creating single, specific objects. However, when you need to create multiple objects with the same structure and methods, they lead to code duplication. Constructor functions (and factory functions) address this by providing a reusable blueprint.
    • Factory Functions: Both constructor functions and factory functions serve to create multiple objects. However, they differ in their approach:
    • Constructor functions are called with the new keyword, and they implicitly return the newly created object. The this keyword is central to their operation.
    • Factory functions are regular functions that explicitly return a new object literal. They don’t require the new keyword, and the concept of this refers to the scope in which the function is called unless explicitly bound. Source mentions that factory functions ensure each object has its unique properties but can share the same methods. We will likely discuss how method sharing is typically implemented with constructor functions (using prototypes) later.

    In summary, constructor functions provide a way to create multiple objects with a defined structure and behavior. They rely on the new keyword to instantiate objects and bind the this keyword to the new instance. They were a fundamental pattern in JavaScript for creating objects that share properties and methods before the introduction of the more class-like syntax in ES6.

    JavaScript Essentials Course

    The Original Text

    learn JavaScript Essentials with this course that covers everything from objectoriented programming fundamentals to Advanced asynchronous Techniques Steph Garcia will teach you critical Concepts including objects prototypes es6 classes modules and the node ecosystem while building practical skills through Hands-On examples welcome to JavaScript Pro the comprehensive course designed to take you from intermediate to advanced level JavaScript JavaScript is everywhere from Dynamic websites to mobile apps mastering it is the key to unlocking opportunities as a developer this isn’t just another JavaScript course it’s a step-by-step guide into the features of the JavaScript language this course is for developers looking to level up their skills what truly sets this course apart is our teaching style I use the active recall technique popularized by Cal Newport the author of deep work and a computer science Professor this technique engages your brain in a way that helps you truly internalize concepts by actively practicing how to retrieve them from memory in every section you’ll encounter carefully crafted study questions designed not just to teach but also to challenge you we’ll go over a possible answer for every single question helping you fill in any gaps of your understanding plus there’s an accompanying ebook and PDF that includes all the questions and answers so you can review and reinforce your knowledge anytime this course is designed to actively engage all learning styles visual auditory reading and kinesthetic so that no matter how you learn best you’ll find an approach that works for you every lesson is structured to utilize multiple senses and areas of the brain to maximize retention and understanding we start with the fundamentals of advanced JavaScript covering objectoriented programming prototypes es6 classes and modules you’ll dive into practical tools like Babel webpack and node.js to build projects that mirr world world scenarios my goal is to teach you how to think like a professional developer by the end of this course you’ll have the skills confidence and mindset needed to tackle complex JavaScript problems Ace job interviews and have the fundamental programming skills needed to build apps so let’s go over what you’ll learn in the nine sections of JavaScript Pro intro to Advanced topics we start with the essentials an introduction to Advanced JavaScript Concepts and how this course is structured to maximize your learning you’ll set up a professional development environment and gain an overview of the key skills you’ll develop throughout the course this section lays the foundation for a smooth productive learning experience objects Master the core principles of objectoriented programming also referred to as o including the four pillars which are encapsulation inheritance abstraction and polymorphism you’ll learn how to create and manipulate objects using different approaches like object literals factories and Constructors by the end of the section you’ll understand how to manage properties use Getters and Setters and handle Concepts like abstraction and private properties which are all critical for building scalable and maintainable code prototypes discover how javascripts prototypical inheritance Works under the hood explore key Concepts like inheritance property descriptors and the difference between prototype and instance members you’ll also learn when and why to avoid extending built-in objects and how to iterate through prototype members effectively prototypical inheritance build on the previous section with a deep dive into creating and managing your own prototypical inheritance hierarchies you’ll learn how to reset Constructors call Super Constructors override methods and even Implement polymorphism by the end of the section you’ll know how and when to use inheritance in real road projects and how to enhance functionality with mixins es6 classes transition from traditional prototypes to Modern es6 classes this section covers class syntax inheritance and static methods you’ll also dive into advanced topics like using symbols and weak maps for private members hoisting and Method overwriting these are the tools that will make your JavaScript cleaner more maintainable and align with modern best practices es6 tooling Master the tools that power modern JavaScript development you’ll learn how to use modules both commonjs and es6 as well as how to optimize your workflow flow with Babble and webpack these tools will allow you to write cleaner more efficient code and ensure compatibility across different environments which is a must have for professional developers node module system get started with nodejs and understand how it enables JavaScript to run on servers you explore node.js architecture the module system and key built-in modules like path OS file system and events by the end of the section you’ll know the fundamentals of node.js required to create powerful scalable backend systems and understand how the module Raper function and event driven architecture work node package manager learn how to manage project dependencies like a pro this section covers everything from creating and managing package.json files to installing updating and Publishing packages you’ll also explore semantic versioning and best practices for working with global and local packages these skills are crucial for maintaining efficient collaborative development workflows asynchronous drop JavaScript in this section we will cover one of the most important aspects of JavaScript asynchronous programming learn the difference between synchronous and asynchronous code and how to manage async operations using callbacks promises and async await you’ll also explore patterns for handling callback how running promises in parallel and creating subtle promises this section will give you the confidence to write efficient non-blocking code for World Ro applications so how can this structure work for you each section is designed to build in the laughs creating a seamless Learning Journey that connects theoretical knowledge with practical applications whether you’re preparing for a job interview building your own mobile app or simply aiming to master JavaScript this course will help you with the tools confidence and expertise to achieve your goals level up your career with JavaScript Pro enroll today on Steven codecraft tocom and let’s take your skills to the next level in this video I’ll will guide you through the resources and material tutal that will help you get the most out of your learning experience on Steven codecraft docomo course so if I scroll down here and click Start Learning this will navigate to the course dashboard so here on the course dashboard you can see a button that says to start the video course and if we scroll down we can also see links for the course materials so let’s first click into the video course so we can see that interface so on the left we see the videos so here if I select this particular video I scroll down we can see the different sections now I’ll press play to start the video course so I’ll pause it for now and let’s look at the different options that we have so we have an option to show the subtitles we also have a settings icon where we can adjust the speed so if the video is going too fast you can always adjust it so let’s scroll ahead up here so for each video Lesson I have an active recall study section this helps mimic a technical phone screen interview and also helps you understand where you have gaps in your knowledge so play this so here I will ask a open-ended question Focus and how does it organize software designed after as it you’ll see this text that says to pause the video and answer so manually pause the video and try to answer it in your own words I’ll press play again and then I will provide a sample answer for this question the main focus of object so after you hear the answer don’t worry about memorizing it for btim it’s just to help you understand it in case you struggled with putting in your own words so after you watch the video click on the button that says complete and continue so after you do that you will see a check mark next to this video Lesson and then we’ll move on to the next video in the course so let’s go back to my courses now that you’re more familiar with the video section of the course let’s go back to the dashboard for JavaScript Pro now let’s discuss the course materials so scroll down and you see these different links so for the first link is the code for the course so this section contains the completed code for the course in a GitHub repository so this includes the finished projects and examples that will be building together these resources are designed to help you see the end goal and provide a reference for what your own code should look like as you progress you can use this code as a guide to troubleshoot and refine your own projects but remember the real learning happens when you write the code yourself there’s also another link for the starter files so these files are neatly organized into folders with clear name and conventions to match each video in the course so we’ll click into one of these folders in this case the object section and here you can see different files corresponding to each video Lesson so you can click on this green button you can either clone the project from your terminal or click on download zip and you can open that in s code there’s also an ebook in the course section and this is a 600 page comprehensive ebook and it covers all the topics that we’ll discuss in the video lessons so I strongly encourage you to read the relevant section of the ebook before watching the associated video I’ll scroll down here so you’re more familiar with what the ebook looks like so here we have the introduction and discussion of objectoriented programming So reading the material ahead of time primes your brain for what’s coming in the video making it easier to follow along and retain the information there’s one more ebook in the course materials which is the active recall study questions so this is to ensure that you solidify your knowledge and prepare for worldw applications and Technical phone screen interviews so this PDF contains all of the active recall study questions that we will go over in the videos and this is to test your understanding of key Concepts and build a solid foundation in JavaScript programming let’s scroll here so you’re more familiar it looks like so these are all the questions for section two so you go through each of these and try to answer in your own words and don’t worry about memorizing it for btim of the answer that I provide then you can scroll down so if you struggle with answering that I provide a sample answer so I highly recommend that you take the time to answer these questions even if you’re unsure about an answer the process of thinking about it and putting in your own words will strengthen your understanding and of course you can always refer back to the ebook or the video for clarification these course materials are here to support you every step of the way by engaging with them which includes the finish code the starter files the ebook and the study questions you’ll set yourself up for success and gain a deep lasting understanding of JavaScript to start programming JavaScript there are two essential tools you need to install node.js and visual studio code so what is no. JS this is a powerful runtime environment that lets you run JavaScript outside the confines of a web browser it’s what enables you to build and run JavaScript applications on your computer including server side project while you could just run JavaScript in your browser for this course you will be using node.js to execute our programs the second tool is Visual Studio code otherwise known as vs code developed by Microsoft this is an integrated development environment or IDE for short and this is where you’ll spend most of your time writing testing debugging and running your code it’s a versatile desktop application used by developers worldwide and we’ll be using it throughout this course both node.js and visual studio are free and easy to install installing node.js Begin by opening your browser and heading to nodejs.org once you’re on the side click the download node.js LTS stands for long-term support downloading this version is recommended for most users because it’s the most stable and well supported version of node.js once downloaded open the installer and follow the onscreen instructions the default settings are suitable for most users so you can proceed with them unless you have specific preferences installing Visual Studio code next we’ll install our IDE navig to code. visual studio.com in your web browser click the download button for your operating system vs code is available for Windows Mac and Linux after downloading run the installer like with nodejs the default installation options will work perfectly for our purposes so now once you have installed both nodejs and visual studio code click to open up vs code after you click it you will see the welcome page then open up finder or File Explorer for your windows and create a new folder now this will be the folder where we place our code so I’ll just name it project now the name of the folder doesn’t matter then I can click and drag it into V s code this will open up the project now to add a new file to our project I can click on this icon and I can name it code. JS so the name of this file doesn’t matter but the file extension does so now we can write our first line of code and I’ll say console.log then in single quotes I’ll say hello world and then I’ll end it with a semicolon notice as I’m typing this file has not been saved yet and so I see a circle indicating that I have unsaved changes so to save it I can do command s or on Windows it would be control s so now if I want to actually execute this file I can do file appearance and then panel to open up the integrated terminal in vs code now there’s also a shortcut I can do control and back tick so if you don’t use the back tick character often it’s located on the left hand side of your keyboard above the tab key so I can do control and back tick to toggle this open so I’ll be using node to execute this program so I’ll type node and then the name of our file which is code. JS so here we see this value hello world is log to the console so I’ll close this now vs code offers a lot of features and a lot of ways to customize it before this course we’ll just be covering the basics that you need to get started so on the left hand side is the activity bar where we see a list of icons the topmost icon is the folder icon and we can use it to toggle our project to see the folders and files within it next is the search icon and we can use this to search find and replace text so for example let’s say if I do hello enter we see that this text is found in our code. JS file so close that the next one is our source code icon and this is used to keep track of the changes in our project as well as collaborate with other developers using get ver control next is the run and debug icon you would use this when setting break points in your code and debugging it if there are errors next is the extensions icon this gives you access to the extensions Marketplace this enables you to install additional features to VSS code to improve your productivity and help you customize vs code to your needs now the icons on the bottom is for your account and to adjust your settings now on the bottom of the screen is the status bar here in Blue on the side you will see any errors or warnings in your code and on the right side I see the line number that I’m on for my current file and I also see the programming language being used so let’s say if I wanted to add another file to my project rather than always having to click on this icon I can use a keyboard shortcut of command and N or control and n on windows open up a new file and on the bottom right we see that this is identified as plain text so now if I want to save this file as a Javascript file I can do command s and I can name it as second program. JS and now in the bottom right we see that vs code can identify that this is a JavaScript file the next thing I want to cover is the command pallet you can access the command pallet by going to view and then command pallet now another way to do that is with the keyboard shortcut of command shift and P it will be control shift and P on Windows now the command pallet is very important as it is the control center for all commands in VSS code from here we can also adjust the color theme that we use so I click on color theme and as I scroll up and down we can see different color themes for my code editor you can also access additional themes we going to the very top clicking on browse additional color themes allowing you to search through different options for this course I’ll just stick to the standard Visual Studio One now to make the text larger you can do command and plus or control and plus on Windows and also command minus or control minus in order to make the text smaller so this is a quick overview of VSS code teaching you the basics that you need for this course so for this course there are two vs code extensions that I suggest and that we will be using throughout this course so click on the icon for extensions and type in Live server then you can install this extension and we’ll utilize it later in the course now this extension live server essentially makes it easy for us to have hot reloading so when we write our code we can actually see those changes reflected in a web browser then another extension that we’ll be using for the early part of this course is quoka you type in so select this one and then install it this allows us to see the output of our JavaScript without having to constantly run it in our terminal before we get started if you’re interested in supporting my courses and projects you can follow me on my new YouTube channel and Instagram at stepen codecraft you can also explore my courses at Steven codecraft tocom and if you’re looking to enhance your health and fitness routine check out my workout and meal planning app at fitfuel planner.com the app offers over 100 recipes workout plans meal plans and a grocery list feature it’s designed to make tracking your calories and macronutrients straightforward and stress free I appreciate your support and I’ll see you in the next section objectoriented programming or o op is a programming Paradigm built around the concept of objects at its core oop organizes software design around data or objects rather than focusing solely on functions and logic objects are instances of classes which serve as blueprints for creating and managing data and behavior a class can encapsulate both the data often referred to as attributes and the functions known as methods that operate on that data this combination makes it easier to group related functionality and data into a single modular structure one of the key benefits of oop is how it promotes modularity and code reusability by designing software in a way that mirrors Ro World objects and their interactions o op helps developers create systems that are easier to understand maintain and extend languages like JavaScript python Java and C are just a few examples of programming languages that support oop providing the tools to create and manipulate objects effectively oop is especially useful for managing the complexity of large software projects making it a preferred approach for many modern applications [Music] what does object orent programming focus on and how is it different from just using functions object orent programming also referred to as oop focuses on organizing code around objects which represent data and the actions that can be performed on that data this is different from just using functions where the focus is primarily on writing step-by-step instructions or logic to solve problems without grouping data and behavior together objectoriented programming or o op is a programming Paradigm that focuses on objects rather than functions this approach organizes software design by grouping related data and behavior into self-contained units called objects at the heart of oop are its four foundational principles I’ll explain each of these principles up front so you’re familiar with them as we begin throughout the course you’ll see examples that clarify these abstract ideas so these four principles include abstraction polymorphism inheritance and encapsulation first let’s discuss abstraction abstraction involves hiding the complex implementation details of an object and exposing only what’s necessary this simplifies how we work with objects allowing us to focus on their functionality without needing to understand all the intricate details behind the scenes polymorphism polymorphism means many forms and this allows objects to be treated as instances of their parent class rather than their specific class this enables methods to behave differently depending on the object that’s calling them making your code more flexible and adaptive inheritance in inheritance allows new objects or classes to take on properties and behaviors of existing ones this reduces code duplication and promotes reusability and makes it easier to maintain consistent design across your application encapsulation encapsulation combines data and the methods that manipulate it into a single self-contained unit referred to as an object by restricting direct access to this data encapsulation and ures better control security and reduces the risk of unintended interference these four principles abstraction polymorphism inheritance and encapsulation can be remembered using the acronym API transitioning from procedural programming before oop became widely adopted many programs were written using procedural programming this approach divides the program into functions that operate on variables while simple procedural programming can create significant challenges as projects grow such as code duplication and interdependencies so code duplication refers to repeatedly copying and pasting similar code across functions leading to redundancy interdependencies refers to changes in one function can inadvertently break others creating a web of interconnected issues often referred to as spaghetti code objectoriented programming addresses these issues by bundling related data and behavior into objects within an object variables are known as properties and functions are called Methods why o Matters by adopting oop principles you can write more modular maintainable and scalable code o simplifies interactions between different parts of your application reduces the risk of errors and Mak your code easier to extend and adapt to Future requirements whether you’re managing a small script or a complex system o provides the structure and Clarity needed for professional software development this lesson provided a highlevel overview of the four core principles of oop which can be remembered using the acronym API standing for abstraction polymorphism inheritance and encapsulation throughout this course we’ll explore more practical examples of of each of these foundational principles in [Music] detail what is the main focus of objectoriented programming and how does it organize software design the main focus of object or programming also referred to as oop is on objects which group related data and behavior into a single unit this helps organize software design by bundling properties and methods together making code easier to manage understand and reuse what is abstraction in oop and how does it simplify working with objects abstraction oop means hiding the complex details of how something works and only showing what is necessary it simplifies working with objects by letting you use their functionality without needing to understand all the behind the scenes implementation how does polymorphism make code more flexible and adaptable in oop polymorphism makes code more flexible and adaptable by allowing the same method or function to work in different ways depending on the object it is used with this reduces the need for repetitive code and makes it easier to handle different types of objects in a consistent way what is inheritance in oop and how does it help reduce code duplication inheritance in oop is a way for one class to use the properties and methods of another class this helps reduce code duplication by allowing you to reuse existing code in new classes instead of writing it again what does encapsulation do in oop and why is it important for control and security encapsulation and O bundles data and the methods that work on it into a single unit called an object and it restricts direct access to the data this is important for control and security because it ensures that data is only modified in controlled ways reducing errors and preventing unintended interference how does oop address the challenges of procedural programming such as code duplication and interdependencies oop addresses challenges like code duplication and interdependencies by organizing code into objects that combine data and behavior this reduces redundancy by reusing code through inheritance and makes programs easier to manage by keeping related functionality within self-contained objects reducing the risk of unintended interactions between parts of the program in JavaScript an object can be defined using curly braces which signify an object literal an object literal is a way to organize data using key value pairs so here’s you can declare an empty object so we can use the let keyword and I’ll name the object Pro programmer let’s assign this to an object literal I’ll give it a key of name and the value of my name I’ll add another key for preferred language and I’ll set that to JavaScript now I’ll Define a method which will utilize these two properties so name this write code and set that to an anonymous function so this will console.log use a template string this.name writes this. prefer language code and I’ll end it with a semicon now I’ll Define another method and I’ll use syntactic sugar for cleaner syntax so I’ll say drink coffee then open and closing parentheses then I will console log this. name drinks coffee so this shows different syntax that you can use to define methods within an object literal and I will end this with the semicolon now I can call programmer. write code control and back tick to bring up the terminal let’s navigate to where this file is so it is in objects and here I’ll do node and I name this file three object literals JS and here I see it logged these property Val vales so in this instance the programmer object literal has four members so it has two properties the name and the preferred language and has two methods write code and drink coffee so this structure allows us to encapsulate related properties and functions within a single organized entity making our code cleaner and more intuitive to work with by leveraging object literals you can create versatile and reusable code structures that represent rward entities or complex data models effectively what is an object literal and how would you create one an object literal is a data structure in JavaScript that allows you to Define key value pairs it essentially enables you to group together variables and functions in the context of an object it will be referred to as properties and methods and you would create one by using curly braces to help reinforce this concept your exercise is to create a simple JavaScript object literal representing a grocery list item this object should have the properties of quantity and name along with a method display that logs the quantity and the name to the console in this format so to demonstrate how you can implement this I can use the cons keyword and I’ll name it grocery item could assign that to an object literal with the key of name I’ll just set that to appps and the key of quantity I’ll set that to four and our method so that will be display console.log back ticks so I’ll say this. Quantity times this. name end it with the semicolon and we’ll close our object literal with a semicon then I can call grocery item. display I can just log this out and I see the expected [Music] output so suppose you need to add another programmer to your team using the object L syntax repeatedly can lead to duplicated code which makes your application harder to maintain this is especially true for objects that include methods indicating that the object has Behavior which may be repeated across multiple instances so let’s consider this object L that we created in the previous lesson if we need to create multiple programmer objects it will be inefficient and air prone to copy and duplicate all this so a more scalable solution is to use a factory function so a factory function is a function that returns a new object each time it is called ensuring that each object has its unique properties but shares the same methods so here’s you can Implement if I name it function and I want name it create programmer so now we’ll specify two parameter variables the first will be name and the second will be prefer language then we’ll return an object literal we do name prefer language we’ll do write code for the method and we can just copy this then the other method is drink coffee and once again we’ll just copy this console log statement and since it’s is a function we don’t have to end it with the semicolon so we can now create a new programmer simply by calling this function so I’ll scroll down so we can see it I’ll say const new programmer equal to create programmer pass in the name Alice and JavaScript as the preferred language so now when I call a new programmer recode let’s pull out the panel and I’ll scroll down I’ll list it out and so I’ll do node I’ll just copy the name of this file and I’ll output it and here we see Alice writes JavaScript code so using Factory functions in this way helps avoid code duplication and simplifies maintenance making your code base cleaner and more manageable [Music] what are Factory functions and why would you use [Music] them Factory functions provide an efficient way for us to create a new object so the name of the function will be in camel case notation and it can accept parameter variables these parameter variables can help customize the values of the object being returned the benefit is that it reduces code duplication and the need to copy and paste [Music] create a factory function which returns a new grocery list item the parameters should be name and quantity so this is the grocery list item which we created in the previous lesson so rather than having to duplicate this we create our Factory function so I say create grocery item and this accepts name and quantity as parameter variable this returns a new object literal it will be name quantity and for the method we can just copy this and paste it here we can end this with a semicolon and so now if we wanted to create a new item we can say h new item is equal to create grocery item we’ll say bananas end up with the S and we’ll just say five so I’ll scroll down we can call new item. display so let’s bring up the terminal and I’ll run it again and here we see the quantity of five [Music] bananas in traditional JavaScript there are no native classes as found in languages like Java or C instead JavaScript uses functions and the new keyword to mimic class life Behavior which is a technique known as Constructor functions this approach was the standard before es6 introduce class syntax as syntactic sugar to simplify object creation and inheritance we willover es6 and that syntax later in the course but for now here’s an example of a Constructor function for creating programmer objects so here I’ll just write a comment to say the lesson and we’ll start up quok so I bring up the command pallet with command shift and P or control shift and P and I will say quoka start on current file so you don’t see this just type in quok select that so now we can see it in our output without having to run node in the terminal so use the function keyword and we use Pascal case for naming our Constructor function and it accepts two parameters which is the name and the preferred language of the programmer language then I’ll use the this keyword which means this current object set it to the name then the preferred language now let’s Implement our methods so this. write code is set to the anonymous function console.log back TI for our template string and I’ll say this.name writes this. preferred language code we end this with the semicon and the anonymous function I’ll say this dot drinks coffee set that to Anonymous function console.log I’ll say this.name drinks coffee just to demonstrate the centx Now to create an instance of this object and to call this Constructor function we use the new keyword so I’ll say con new programmer equal to new programmer then we pass in our arguments I’ll pass an ALICE for the name and on JavaScript as the preferred language now I can call new programmer. write code save that and here we see the output Alice writes JavaScript [Music] code what is a Constructor function a Constructor function is used to instantiate a new object in JavaScript so for the name of convention you would name the function using Pascal case and for assigning the properties and for the methods you would use the this keyword which references this object or the current [Music] object so now for the exercise create a Constructor function for the grocery item so to implement that once again we use our function keyword and we use Pascal case so the first character of each word is capitalized this takes in two parameters the name and the quantity or this keyword with this object just assign this to the quantity now for our display method this. display set that to an anonymous function console.log back TI this. quantity times this.name end that with the semicolon so now we’ll create instance of the grocery item and we call this Constructor function with the new keyword so say const new item is equal to new grocery item for the name we’ll say bananas and the quantity of five so now let’s call this display method so that be new item. display save that and here we see the output which is five bananas every object in JavaScript includes a special property known as Constructor this property references the function that was used to create the object via the new keyword for instance we consider our Constructor function for a programmer object here we use the new keyword to call this function so if we wanted to find out which Constructor function created this object we can access that via its Constructor property so let’s console log that so I’ll say new programmer. Constructor now when we log that in the console so this file is named Constructor property. JS so this will output the programmer function confirming that new programmer is an instance of this programmer Constructor function so this property is particularly useful for confirming the type of object you’re working with especially when dealing with complex code bases that involve multiple Constructors and [Music] prototypes in JavaScript functions are treated as objects this means that like any object a function can have properties and methods and it can be assigned to variables or passed as arguments to other functions so let’s consider a simple function I just name it add and it takes in two numbers num one and num two and it simply Returns the sum of these values so you can assign this function to another variable effectively creating a reference to the original function so I ad do cons if I just name this n and assign that to add now n will reference this function as fun funs are objects in JavaScript so now can actually call that function console. log with this reference n so I can say N I can pass in two and two so I’ll expect the output of four so starting up CA I see that the output is four so as an object the function add has properties and methods for example the length property of a function returns a number of its expected arguments so I were to do console.log of add. length we get the value two as there are two parameter variables so to further illustrate how functions are objects consider creating a function using the function Constructor so I can name that with const programmer Funk equal to new function taking in the name and I’ll use back six so this.name assign to name and to find a method write code assign to an anonymous function console.log code in JavaScript so let’s instantiate an instance so I can say cons and I’ll just call this programmer is assigned to new programmer Funk and I’ll pass in my name as the argument so now let’s call this method right code programmer WR code and here we see our expected output so this lesson shows the unique nature of functions in JavaScript by understanding that functions are indeed objects you gain a deeper understanding into the flexibility and capabilities of JavaScript as a programming [Music] language so for your exercise create a function named calculate price so this function will accept two parameters a grocery item object and a price which is just a number so in that function simply return the price times the quantity of the grocery item so based on our previous lesson we created this Constructor function to create a grocery item and we instantiated a new item so we want to create the function calculate price which accepts a grocery item and a price and we simply return the price Times Grocery item quantity so we want to assign this function name to a variable to demonstrate that functions or objects in JavaScript so we do const perform calculation is assigned to calculate price so now we can invoke it with this reference so let’s do console.log perform calculation so for the first argument we’ll pass our grocery item and we’ll pass 25 cents so here we see the output in quoka is 125 JavaScript supports eight different data types which include seven primitive types and one complex type the Primitive types are are number string Boolean big int undefined null and symbol the eth data type is object which also encompasses arrays and functions understanding the distinction between these types is crucial due to how they are allocated and managed and memory so to demonstrate primitive types these are passed by value so when you work with primitive values these are passed by copy so this means if you assign a variable to another containing a primitive value the new variable gets a copy of that value so altering one will not affect the other because each variable holds its own unique value in a separate memory location so find sanche let a initialize that to the value of 10 and I initialize B and I assign that to a b will get a copy so they are not referencing the same data in memory so if I do a and I Reign that to 20 let’s start qua console log this conso loog the value of a and we’ll cons out the value of B here we see they are different values so now let’s consider reference types which are passed by reference so on the other hand reference types like objects are handled differently so they are passed by reference meaning both variables point to the same object in memory thus changes made in one variable are reflected in the other so say if I assign a and assign it to an object with the value of 20 then if I assign B to a they now reference the same object in memory so if I update a. value to be 100 this will be reflected in both of the references so let me just copy these console log statements and output them here we see they are referencing the same object so in JavaScript primitive values are copied by value meaning they do not affect one another when changed now objects which include arrays and functions are copied by reference meaning changes to One affect any other variable referencing the same object this fundamental understanding helps in managing how data is passed around round in your programs ensuring fewer surprises and more predictable code Behavior what are primitive values and what do they pass by primitive values refer to simple values such as string number booleans and they are passed by copy what are object values and what are they passed by object values refers to key value pairs this also includes arrays and they are passed by [Music] reference so objects in JavaScript are inherently Dynamic which means that you can add or modify their properties and Methods at any time after their creation using the cons keyword with an object declaration ensures that the variable cannot be reassigned to a different value however the contents of the object it points to such as its properties and methods can still be altered or extended so consider the following example find Stan a person object and I give it the key of name and the value of my name let’s end it with the semicolon Now by console log this console.log of person now let’s start up gu so bring our Command pallet start on current file here we see it just outputs our object now if we want to add properties we can do so using either dot notation or square bracket notation so if I use dot notation first I can say person. favorite food assign that to tacos and I’ll just copy this console log and we output it just to demonstrate that I have dynamically added this property and here we see this contains the two properties for the name and favorite food now let’s use the other syntax which is the square bracket syntax and I’ll call this favorite ice cream and let’s just assign that to chocolate now let’s paste our console log statement and here we see our object has been updated now we can also use the delete keyword which will delete a property so if I do delete person favorite ice cream and let’s paste this again and here we see our object has been updated dynamically again deleting the property of favorite ice cream now let’s add a method so I can say person. e let’s assign this to Anonymous function here I’ll say console.log with back ticks and I can say this. name eats this. favorite food and then with the semic so now let’s invoke this method that we’ve added dynamically so I’ll say person. save that and if I look here let me expand this we see Steven eats tacos is the output so this ability to modify objects is both powerful and flexible allowing us to adapt objects to changing requirements or conditions dynamically however it also means that you need to manage objects carefully to avoid unintended side effects from these changes explain in your own words how are objects Dynamic objects in JavaScript are dynamic because you can change and mutate the properties and methods of the object after it has been [Music] initialized so for your exercise create an object with the grocery item Constructor function then dynamically add the property of grocery a so here we have this grocery item Constructor function let’s instantiate an instance of it so we can do that with const new item call the new keyword grocery item we’ll name this bananas the quantity of five now we want to dynamically add a new property so I can say new item do grocery aisle and I’ll set this to the produce section now let’s just console log this console. log of a new item and here we see we have dynamically added the property of grocery [Music] aisle in JavaScript different Loops offer various ways to iterate over collections like arrays and objects for arrays we can use the four of loop so the four of loop is ideal for ating over array elements so if we do let numbers and I assign this to an array of 1 2 3 4 and 5 then if I just do four con element of numbers then console. log of element here we see the output is just each of these elements now for objects we can use the forend loop so the forend loop allows you to iterate over the keys of an object and this is useful for accessing values when you know the structure of the object so I can do con dog and instantiate this object with the name of Max the age of five and so the eye color of blue we’ll end this with the semicolon now we can use our 4 n Loop so four and I can say cons key in the dog object now I can do console.log of dog and access the key with square bracket notation and here I see this output the associated values for each of the keys so besides these two traditional Loops JavaScript provides methods to retrieve the keys values and key value pairs directly from objects which can be iterated over with the four of loop so let’s say if I want to get the keys I can do cons Keys equal to object. keys of the dog object so now I do const key of keys I can do console about log of key and here this will output all the keys of this object likewise I can do the same with the values so cons values equal to object. values of the doc object now for cons value of values console.log each of the values so now this outputs the associated values now we can also enumerate over the key value pairs with object. entries so I can do const entries of object. entries pass this object in now I can do four F entry of entries now here I can do console.log and I’ll use back ticks because I’m going to use interpolation the key which I can access at the first index so that be index is zero and the associated value which would be entry at the index of one so we can save this and said object is supposed to be dog as our object so here are the outputs the associated key value pairs for each of the properties in the dog object so these methods provide a powerful and flexible ways to handle objects in JavaScript they simplify the process of working with objects properties it makes your codee cleaner and more efficient how can you enumerate over the properties of an object there are different ways toate over the properties of an object one way is you can use the fourin loop to iterate over the keys of an object we can also use the built-in object class for example iterating over the keys with object. keys enumerating over the values with object. values and enumerating over the properties with object. [Music] entries so for your exercise write three for Loops enumerating over the object’s Keys the object’s values and the object’s key value entries so to complete that let’s enumerate over the object’s Keys we can do that with or I can say cons key of object. keys and for the argument I’ll pass in this object that we created then we can CL for log the key so here we get all the keys for object that we enumerate over now we can Loop over all the values so I can say cons value of object. values passing a new item and here we just console log the value so we get the associated values that we passed in as arguments when we first instantiated this object so now let’s enumerate over the key value entries so I can say for con entry of object. entries new item but now we can do console.log we’ll just log out entry so here we see each entry is an array where the value at the zeroth index is the key and the value at the first index is the associated value abstraction is a core Concept in objectoriented programming that involves hiding complex details while exposing only the necessary parts of a class or object to the user this makes the objects in our applications easier to interact with and reduces the impact of changes so let’s consider the programmer Constructor function that we’ve been using and I’ll illustrate the concept of abstraction so we use the function keyword and I use Pascal naming convention to name our Constructor function the parameters are name and preferred language so now we use the this keyword to assign our properties and we will assign our preferred language so now that we’ve assigned those properties let’s create a public method just create a comment just to illustrate that so we use the this keyword to create our public method and I’ll name it write code we assign this to an anonymous function now I’ll use a keyboard shortcut so I can just type out log and so here vs code says log to the console so I can press tab for autoc completion so now I’ll use back ticks because I want to use string interpolation so dollar sign and then curly braces this. name so I’m utilizing this property in our string wres this. prefer language code so this public method is accessible through do notation when we create an instance of this programmer so now to demonstrate a private method so the concept of abstraction refers to using private methods such that the public methods are only those that are absolutely necessary and we want to abstract away the details so I can use the cons keyword I can also use the let keyword so if you recall both the let keyword and the cons keyword are only available within the block that they are defined in right so you can only call it within the block that it’s implemented in so I assign this to an anonymous function so we’ll use our keyboard shortcut again with log and then down arrow and then tab and once again I’ll use back ticks and use interpolation so this.name drinks coffee so now let’s define another public method and now we will utilize this private method that we defined so I’ll use the this keyword and I’ll assign this to an anonymous function and here I will just call our private method so here we see with abstraction we are abstracting away the implementation details which is hidden from the user so to better illustrate this I can create an instance of this programmer so I can say cons programmer I’ll use the newy keyword which calls this Constructor function and we named it programmer so I’ll say name Steven and preferred language is Javascript so now if I do programmer dot here I can see what is accessible through do notation what its public interface is so here I see the name property I see the preferred language and I see the public methods of start day and write code so let’s call write code and I’ll just do shift option and down arrow to create a copy and I’ll try to call drink coffee so here I’m attempting to call this private method and let’s see what happens I’ll save it with command s now I’m going to bring up the terminal so I’m going to do command and J for that so here I’ve already navigated to the directory where this file is located and I name this file 11y abstraction. JS but your file could be named differently and here I’ll just run it in the terminal rather than using qua to better illustrate this so 11 abstraction. JS so here we run it if I scroll up when I called write code this outputs this. name writes preferred language code and so here we see the output is Steven writes JavaScript code so that worked as expected however here we see we try to call this private method and we get a type error that programmer. drink coffee is not a function so we know it’s not accessible and this is what will occur if we try to call a private method so it would throw an exception so now we want to instead use the public method right so only public methods are accessible through dot notation so I’ll clear this with command K and then up arrow and we’ll run it again so now I see I get the expected output when I ran right code however when I called start day this called the private method I defined where we have this. name drinks coffee and here we saw the output of undefined drinks coffee so this means that this.name is currently undefined within this context so if you remember in JavaScript functions are objects and they have their own this context so in this instance this example rather this is referring to the function that is defined in however we want that this keyword to instead reference its enclosing scope so the enclosing programmer such that we can access this. name so order to do that we can use the bind method so I can say bind and I’ll say this which references the current context that’s being implemented in so that Constructor function so now if I run it again let me clear this with command k up arrow and then run and here I see the expected result for this private method call inst start day which is Steven drinks coffee so that is the result of calling this method so to recap in this example we saw that let me close the terminal so you can actually see it right code is a public method that is accessible to any instances of this programmer Constructor function and on the other hand drink coffee is defined as a private method inside the Constructor function and here we use the cons keyword so this method is not accessible from outside this code block so outside the programmer function instead it is meant to be used internally by other methods within the programmer object like start day here which exposes a controlled interaction with drink coffee so this illustrates the concept of abst abration which is utilizing private methods and hiding away the implementation details so some key points on abstraction that I want to discuss two main points one is you just want to show what is necessary in the public interface so in our example here we see that start day that method abstracts away the details of what starting the day entails for a programmer so in this case drinking coffee now the consumer of this programmer Constructor function does not need to know the implementation details they just need to know that they can start the day and call that public method the second point of abstraction is hiding the complexity so methods like drink coffee do not need to be exposed outside of this object as they handle specific functionalities and implementation details that are not relevant to the programmer that is utilizing this Constructor function so this approach helps in maintaining a cleaner interface for the objects making them easier to use and reducing dependencies on the internal implementation details so we can always change those implementation details in the future and minimize the impact of those changes so this leads to better modularity and easier maintenance of our [Music] code so in this exercise we will build upon the grocery item Constructor function that we’ve been using in previous exercises and we will create a grocery list Constructor function so this will help us understand the concept of abstraction which involves hiding the implementation details and exposing only the necessary parts so here is the initial grocery item Constructor function so the grocery list Constructor function should internally maintain an array to store grocery items it should also provide methods to add items display all items and get the total quantity of items so to practice abstraction we will use private methods for operations that should not be exposed directly specifically you will Implement a private method for calculating the total quantity of items so here’s a starting point for the grocery list Constructor function use the function keyword we’ll name it grocery list this doesn’t accept any parameters for the Constructor function then internally we have items which will hold the grocery items I’ll just add a comment private array to store items your task is to complete the grocery list Constructor function by adding the following methods you’ll Implement add item which accepts two parameters for a name and quantity and this adds a new grocery item to the list there is display items which will display all items in the list there is get total quantity which will return the total quantity of all items and we have a private method calculate total quantity to calculate the total quantity of items so by the end of this exercise you will have a better understanding of how to implement abstraction in JavaScript using Constructor functions so now let’s Implement our grocery list Constructor function I’ll scroll down so we have more room so now first let’s Implement our private method to calculate the total quantity of items so you can use the cons keyword and on name this and we’ll name this calculate total quantity we assign this to Anonymous function now we will return this quantity and we utilize the reduce method that’s built in for the array data type so items. reduce so with this we can take all the items in our list and reduce it to one value so here we pass our callback function so the previous value which we can name that total and the current value so I’ll name that it we use our Arrow function syntax so the total plus the item do quantity right so here for our grocery list we have the properties of name and quantity now for the reduce method it also takes an optional second parameter set that to zero and this represents the initial starting value so now I’ve implemented that what a comment here just so we know that it is a private method so now we will Implement our other methods needed to operate on the grocery list array this. add item so an anonymous function picks in the name and a quantity so now let’s create that new object so cons item and then new grocery item says pass in these arguments to create the new object and then we will add it to our items array so now we Implement our display items method assign this to Anonymous function then we can do items and here we can call the buil-in for each method so it would be the item the current item that we are operating on and we simply want to call the display method so the display method we have implemented here and here this console logs the quantity and the name of the item so we can Implement all this on one line so now want to implement get total quantity set this to an anonymous function and we simply will call this private method that we have implemented here so now let’s utilize this grocery list Constructor function so I’ll say cons I’ll name it my list and we’ll use the new keyword then grocery list and this doesn’t accept any arguments so now that we’ve created a list let’s add items to it so my list. add item so I’ll say banana and a quantity of five then just to copy this I’ll do shift option and then down arrow just rename it to be apple and let say the quantity is three let me scroll down so you can see so now let’s call my list do display items so this will go through an output so let’s bring up the terminal so command and J or control and back tick so I’ll do up eror and then I’ll run it so here I see when I call display items this outputs the quantity and the item name for all the items in our list so now I’ll comment this out and I’ll close the terminal just so we can see better now I want to console log I’ll use back tick now I want to find the total quantity of items in our grocery list so total quantity we use interpolation here so my list do get total quantity so we’re calling that public method end it with the semicolon so once again we’ll open up the integrated terminal so command and J or control and J up arrow and we’ll run it again and here we see the total quantity is eight items in our grocery list so some key points on abstraction once again we want to show only what is necessary so only the methods of add item display items and get total quantity are exposed to the user the user does not need to know about how the total quantity is calculated so that is a private method and the second key point is hiding the complexity so if I scroll up again so the calculated total quantity method is private and its functionality is the internal implementation details that should not be exposed closures in JavaScript are a powerful way to achieve encapsulation which is one of the core principles of object ored programming so if you remember our acronym of the four pillars of object programming which is a pi so the A is for abstraction the P is for polymorphism the I is for inheritance and the E is for encapsulation so what is a closure a closure means that an inner function has access to variables declared in its outer function this allows you to hide the internal State and functional of an object exposing only what is necessary to the outside world so this is a technique that enables us to achieve encapsulation so using closures we can create private properties and private methods making JavaScript objects easier to work with so instead of overwhelming the user object with too many public properties and methods you only expose what is absolutely necessary for the object to function properly so let’s go over a simple example to better understand the concept of closures so I use the function keyword and and I’ll name this function example So within it I’ll create a constant named num and I will initialize it to the value of five so now I’m going to create a function within this function so remember in JavaScript functions are objects so I can name this log [Music] num and here I’ll type log and then I can log to the console so I get that auto completion that Visual Studio code provides for me now log out that identifier of num so now I will call or invoke log num so now let’s call example so here we see this inner function has access to the variables declared in its outer scope so it’s outer function which is this constant value so let me bring up the integrated terminal I’ll do that with command J you do this with control J so node and I name this file 12 hyphen private do tab so Auto completes for me so we output that so here when we invoked call this function example we get the expected output of five this is a simple example demonstrating the concept of closures where inner functions have access to variables declared in its outer scope so let’s go through a more complex example in the case when we we return the function so rather than simply defining this function or declaring it rather let’s instead return it so can do return and we’ll delete this so now this function returns a function and so when we call example we want to store the result I’ll name this inner function initialize to that and so now log num is now accessible through inner function right so this is referencing the function that is being returned so now let’s call that inner function in function and we invoke it let’s bring up the integrated terminal again up arrow and we’re running and once again we get the expected result so even though this function which we named example has finished executing inner function still has access to num because of the closure so even after this example or even after the outer function has finished executing the inner function is still able to access all the variables and identifiers declared in its parent scope at the time of Declaration right so you’ll get more practice with this and you’ll become more understandable let’s go over a more complex example and here we will create private properties and methods using closures within a Constructor function

    so once again we use the function keyword and I’ll just name this make functions so here if we use the let keyword I’ll name this private num I’ll initialize it to the value of zero so now we’ll create inner function function private increment so this increments the value plus plus so now we have these local values which are not accessible outside of this function and here we will return a JavaScript object and we will define an interface right so methods to use so we’ll have our log num method we’ll Define this with an arrow function so we’ll do log and then tab for that autoc completion this will console log the number now we’ll Define another method increment once again we’ll use an arrow function to Define it curly braces so this will call Private increment here we do log Tab and we’ll just say increment it so now let’s call make function I’ll say cons now we can destructure these values so use curly braces log num and increment make functions and so this is an example of destructuring so we know make functions returns an object and we’ve D structured these two methods so now it’s easier to work with now if we didn’t do destructuring we could name this for example increment object we could really name it anything and through increment object we can access the increment and lognum methods but I prefer the destructuring syntax so did command Z to get back to that so now let’s call log num this will output the value of zero which it was initialize with then we can call increment which will update the value and we will see the console log value of incremented and then we can call log num again so let’s bring up integrated terminal again here I will scroll down we’ll clear it with command K up arrow and we run it again so here we see the initial value of private num is zero we incremented the value and the updated value is one so this shows an example of closures as this make functions has finished executing but here this JavaScript object and the methods defined within it still have access to these identifiers or the the variable is declared in its parent scope and this helped us achieve encapsulation because we only expose log num and the increment method and we’re not exposing the in implementation details or the private num property so let’s clear this out we’ll go through another example so using closures in a Constructor function so we’ll go back and we’ll use our example for the programmer Constructor function the parameters are name and preferred language so I’ll just write some comments just so it’s easy for us to identify what we’re doing so we’ll specify a private property so we’re not going to use the this keyword so it’s not accessible through do notation so I’ll use the let keyword instead and we’ll assign this to the value of name now an example of a public property which will be accessible through notation so this do preferred language assign to that parameter of preferred language so now let’s define a public method we use the this keyword say write code assign this to an anonymous function let’s do log and then tab for the auto completion we use back ticks and we can say code in this preferred language now an example of our private method Again Play Let drink coffee assign to an anonymous function here we will log it again so log to console I’ll just say gulp dot dot dot now we’ll say a public method that uses a closure so this. start day assign this to Anonymous function and we just call drink coffee so we are hiding those implementation details of this so let’s actually instantiate a new programmer so we’ll say const programmer we use the new keyword and the name of our Constructor function we’s say Alis and the language is Javascript and this with the semic colum now programmer. write code and we’ll say programmer. start day right so this repetition is really good to help you get used to the syntax as well as get a better understanding of the terminology that we use in programming let’s scroll down open up the integrated terminal up arrow and run so here we see code and JavaScript and go so in these examples let’s close this and we’ll look over our implementation of this Constructor function so private name let’s actually use it so can use private name right so let’s run it again to make sure that we’re actually utilizing our private property so here we see Alis codes in JavaScript and just sculp so private name and drink coffee are private because they are defined with the let keyword and not exposed via the this keyword so considering public properties and methods preferred language and write code are public because they are defined with the dis keyword and can be accessed outside the function and through dot notation once we create an instance of this Constructor functions programmer so using closures so the start Bay method demonstrates a closure is a public method that can access the private drink coffee method because of the closure it can access uh variables and identifiers is declared in its outer scope so let’s consider closures versus scope so scope is the context in which variables and expressions are visible or can be referenced if a variable is not in the current scope it is unavailable for use now for closures these are functions that capture and reference external variables so when I say external variables this refers to variables which are not defined locally in the function but these variables are accessible because they exist in the outer environment the function defined in the closure remembers the environment in which it was created at the time of function declaration this is why drink coffee this method remains accessible only within functions defined in the same scope so only within the Constructor function so closures are a fundamental and Powerful aspect of JavaScript allowing for more secure and modular code by protecting and encapsulating behavior within objects so we’ covered a lot of new terminology in this lesson I’m not expecting you to remember and nor all of it immediately and we’re going to get more practice and more exposure to these Concepts throughout the course so it will make more sense the main takeaway that I want you to get from this lesson is that a closure means that inner function has access to variables declared in its outer function what are closures so closures are inner functions that are able to access variables defined in its outer function so in other words closure functions can access variables from their outer scope even after the outer function has finished executing now you would utilize closures in order to achieve encapsulation and to hide private variables or private properties so now for your exercise the objective is for you to understand and Implement closures to create private properties and methods within a Constructor function so your task is to create a bank account Constructor function that can manage a user’s account balance so the balance should be private and the Constructor should provide public methods to deposit money withdraw money and check the balance so now to go over the instructions step one you want to define the bank account Constructor function now it should have a private variable balance to store the account balance it should have a private method to validate the amount being deposited or withdrawn so this private method will validate and ensure that the value that you’re passing as an argument is of the number data type and that the amount stored in the balance is greater than the amount being withdrawn as well as the money that you’re depositing is a positive number so it should have public methods to deposit money withdraw money and check the balance so step two you want to implement the following public methods the first is deposit which accepts the parameter of the amount to deposit so this adds the specified amount to the balance if it is valid right you’re utilizing that private method to validate the argument the second method or second public method is withdraw which accepts the parameter of the amount and this subtracts the specified amount from the balance if it’s valid and there are sufficient funds now the third public method is get balance which simply Returns the current balance so pause the video and attempt to implement this Constructor function for the bank account so now you’ve attempted to implement that we’ll go ahead and write the code for that so we use the function keyword then name of it is bank account now for the parameter I’ll specify initial balance now I’ll use this as a private property so it’s not accessible through notation you can only access it through the public interface or the public methods this helps us achieve encapsulation so we’re setting that to the initial balance and I’ll add a variable just to better describe what I’m doing so private variable to store balance okay now I want to implement the private method to validate the amount so this amount could be what is being used to either deposit money or to withdraw money so cons I’ll say is valid amount the anonymous function parameter being amount so return and I’ll use the type of operator CU I want to ensure that the amount is of the number data type so and we will check that the amount is greater than zero because we can’t deposit a negative number and we don’t want to withdraw a negative number so we can utilize this helper method in our public methods that we’re going to implement so I’ll just say public method to deposit money so we use the this keyword to create a public method within our Constructor function we name a deposit and we assign this to an anonymous function with the amount being the parameter now we’re going to use utilize our private method so if is valid amount for the amount then I’ll do curly braces so in the case when the amount being deposited is a number data type and is a positive number then we want to perform that update so we’ll use our shorthand syntax to update the balance in the bank account and we will log it out so I’ll say log down arrow and then tab I’ll use back ticks so deposited now the colon now we’re using interpolation so I’ll do a dollar sign and the curly braces and the amount now because I’m doing US dollars I want to use the dollar sign in the actual output so I’m going to add another dollar sign before just so um the correct symbol shows up when we output it to the console so now else in the case when it’s not a valid amount so do log then tab and and then I’ll say invalid deposit amount so I’m informing the user on that so we’ implemented this I can end that with the semicon now want to implement the public method I’ll scroll up so you can actually see better so public method to withdraw money so now we’ll do this do withdraw we assign this to an anonymous function now once again um we’re utilizing our helper method so if is valid amount we ensuring that that is a number data type and a positive number and if the amount that we’re trying to withdraw is less than equal to the balance then we can actually perform that so we use shorthand syntax to update the balance so minus equals and we will log that to the user to inform that this has been successfully performed back ticks with Drew interpolation the amount and we want the dollar sign show up so we’ll add that there else we’ll log and then tab insufficient FS now in the case when it is not a valid amount so in the case when the amount that you passed as an argument is either not the number not of the number data type or is a negative value then we want to Output a message for that case so I’ll say invalid withdraw amount okay so we implemented that we have one more public method which is to get the current balance so once again we use this keyword get balance Anonymous function and then we will simply return the balance so we’re just returning this private property that we set here so now we’ve implemented this I’ll scroll up so we can actually utilize it so now let’s instantiate an instance of this and call this Constructor function so I use the con keyword I’ll name the identifier my account and we assign this to new bank account now for the initial value I’ll specify 100 as the initial balance so now I can do my account. deposit not deposit 50 now let’s do my account. withdraw and I’ll withdraw 30 and we going do console.log and I’ll say my account. getet balance so let’s call it so now let’s open up our integrated terminal I could do that with command and J or control andj now I’ll do up arrow and I’ll run this so here we see the correct console logging where we deposited $50 and then we withdrew $3 and because we started with the initial balance of 100 we get the expected output of 120 so let’s close this integrated terminal and scroll back to the code that we wrote for this exercise so an explanation of it we have private properties and private methods here our private property of the balance of the bank account and the private method which is the is valid amount helper method so the balance variable and the is valid amount function are private because they are not exposed via the this keyword right we’re using the let keyword and the cons keyword so these are accessible within the block that it is defined in so accessible within the Constructor function now we have public methods with deposit withdraw and get balance and they’re accessible and public methods because they utilize the this keyword they could be accessed outside of the function through dot notation now for using closures the public methods demonstrate closures in the sense that they can access the private balance variable and the is valid amount function because they are defined within the same scope right so closures are inner functions that can access identifiers or variables in its outer function so some key points on closures first is it helps us achieve encapsulation where we hide internal State and functionality exposing only what is necessary another key point is scope so this is the context in which variables and expressions are visible or can be referenced and to recap on closures these are functions that can access variables from their outer scope even after the outer function has finished executing so by completing an attempting exercise you have more experience with closures and have a better understanding of how to create private properties and method methods to encapsulate the internal State and functionality of objects Getters and sets are special methods that provide you with a way to get and set the properties of an object this encapsulation technique allows you to control how important values are accessed and modified in your objects it’s often used to ensure that data encapsulation and validation rules are followed here’s how you can incorporate Getters and Setters into the programmer Constructor function using object define properties so here we have this private property private name and we cannot access it through do notation so in order to access that value you can do object. define properties now if I hover my mouse over that the first parameter is the object where we want to add or modify properties so I’ll use the this keyword which means this current object or this programmer object and for the second parameter I will specify an object again this with a semicolon and here we’ll Define the name of the property so name it name and then def find an object and here we can use the special keyword for get and we’ll set it to an anonymous function and this will simply return the private name so now if I actually want to use this property I’ve instantiated programmer object and do log tab I can say programmer. name so rather than having to call doget I simply can access it through a property and that will call the get method let’s run this in the integrated terminal so command J or control J and I name this file 13 Getters and Setters so do tab the auto complete and then I’ll run it and here I get the name of the programmer which I have access through that get method that we defined right through that name property which we defined here now we can also set the value we use the keyword for set and we’ll set this to an anonymous function the parameter will be the new name that we wanted to set now with Setters we can Implement validation rules to ensure that the value that we are setting is appropriate so I can check and make sure that the new name is not falsy which means that the new name is not an empty string null so in the case when value that I was setting is falsy I can log to the console and I can say the name cannot be empty and then we will use the return keyword to stop the execution otherwise we will set the private name so here say new name now let’s utilize this Setter method now we would do this through the name property I scroll down here if I want to set the name I can say programmer. name and I’ll set it to my name Steven now here I’ll copy this and here we see the name is changed so open up the integrated terminal again up arrow and we run it so here we see I successfully changed the name to be Steven we’re able to accomplish this because of the setter method now let’s check and make sure that our validation rules apply so let’s say instead of assigning this to my name Steven let’s say if it was an empty string integrated terminal clear this out and run it again here we see this console log statement saying the name cannot be empty and then when we log the name again we see it continues to be Alice which means that our validation rules were applied Getters and Setters the name property has a getter and Setter defined and the getter simply Returns the current value of the private name this private property while the setter allows you to validate the new name before signing it to private name so this is an example of encapsulation utilizing gets of Setters also known as accessors and mutators and this structure ensures that the internal St of the object in this case the private name can only be changed in controlled ways increasing data integrity and interaction safety using Getters and Setters not only encapsulates the internal state but also allows for additional logic to be implemented when getting or setting a property such as validation or logging which enhances the functionality and robustness of your code in this section we covered the fundamentals of objectoriented programming beginning with a definition of oop and an exploration of its four core pillars we covered essential Concepts and techniques including object literals Factory functions and Constructor functions which are foundational in understanding how objects are created and utilized in JavaScript we also discuss the Constructor property which links an object back to its Constructor function and examine how functions themselves can be treated as objects in JavaScript this leads to a deeper understanding of javascript’s flexible approach to oop important distinctions between value and reference types were highlighted clarifying how JavaScript handles data storage and manipulation which is crucial for Effective memory management and performance further we explore Dynamic aspects of objects such as adding removing and enumerating properties providing practical skills for manipulating object properties in real time the concept of abstraction was introduced along with practical implementations of private properties and methods which enhance encapsulation and data hiding in JavaScript finally use of Getters and Setters were discussed illustrating how these can be employed to control access to an object’s properties ensuring data integrity and [Music] encapsulation this section focuses on inheritance a fundamental Concept in object ored programming that allows one object to inherit the properties and methods of another this mechanism is key for reusing code efficiently and effectively I’ll introduce some terms that are critical to understanding different aspects of inheritance so the terms to First consider are Base Class super class and parent class so these are all synonymous and they all mean the same thing and these terms refer to the class whose features are inherited by other classes so now consider the terms derive class subass and child class so these three terms are all synonymous as well and these are classes that inherit properties and methods from the base class this relationship is often referred to as an is a relationship indicating that the derived class is a specialized form of the base class so I don’t expect you to memorize these right away I wanted to expose you to these terms so you understand what they are and we’ll see practical examples throughout this course so we can also differentiate between two types of inheritance the first being classical inheritance so this is found in class-based languages where inheritance is defined through classes and these include program languages like C or Java now the second type of inheritance is prototypical inheritance this is specific to JavaScript and this type of inheritance does not involve classes instead JavaScript uses prototypes this refers to objects that other objects can inherit properties and methods from it’s important to note that in JavaScript the traditional concept of classes is implemented differently while es6 which stands for modern JavaScript introduce class syntax it is syntactic sugar over JavaScript existing prototypical inheritance model understanding this helps clarify how JavaScript handles inheritance and sets the stage for using these Concepts to structure and reuse code [Music] effectively what is inheritance and why is it important inheritance is a concept in programming where one object can inherit properties and methods from from another object in JavaScript this is done through prototypical inheritance also called prototypal inheritance it’s important because it allows for code reuse making programs more efficient and easier to manage inheritance is one of the four pillars of objectoriented programming along with encapsulation abstraction and polymorphism what type of inheritance model does JavaScript use prototypical inheritance or classical inheritance JavaScript uses the prototypical inheritance model this means objects can inherit properties and methods directly from other objects rather than from classes as in classical inheritance what do these three terms refer to Base Class super class and parent class in JavaScript the term is Base Class super class and parent class all refer to the same concept the class from which another class inherits properties and methods these terms are often used interchangeably to describe the original class that provides functionality to a derived or child class what do these three terms refer to derived class subass and child class in JavaScript the terms derive class subclass and CH class all refer to the same concept a class that inherits properties and methods from another class with that other class being the parent class these terms are often used interchangeably to describe the new class that extends the functionality of the original [Music] class in programming enhancing an object’s functionality is a common task ask I will initialize some objects I’ll say let user and assign this so it’s just an empty object literal then I’ll create admin and I’ll create a guest so now consider these three objects that we’ve created now if we were to add properties and methods to this user object literal and we also have the admin and guest objects it is beneficial to reuse what we have in the user object as they’re going to have the same properties and methods now the admin and guest objects are more specific versions of the user object now both the admin and guest are users of the website so we can utilize prototypal inheritance to accomplish this in JavaScript objects possess a special hidden property prototype that is either null or references another object this reference object is also called a prototype when you see the term prototype think of it as interchangeable with parent similar to a parent class from which properties and methods are inherited so I’ll add some properties and methods to this user object to demonstrate this if this user object were to have the property of name I’ll set that to my name then the property of surname so I’ll set it to my last name email which is stepen Stephen codec craft.com is active say true now I can find some Getters and Setters so I’ll use the set keyword and I’ll set it to be full name the parameter will be value so now we’ll perform destructuring so I’ll use square brackets and I’ll say this.name and this. surname assigned to Value dos split on whitespace so with the set keyword I’ll be able to use full name through notation and assign it to value so for example it would look like user. full name is assigned to let’s just say Bruce Wayne for example so here is how we would utilize the setter now we call the split method on the value that is passed in which is this string and we split it on whites space so now we are destructuring it because when we call split this stores these strings into an array so Bruce would be at the zeroth index and Wayne would be at the first index and so that is how we set it here and this is a clean syntactic sugar that we can use to do it all on one line so now we Define a getter so I’ll say get full name and then I can show us return I’ll use back ticks so I can use interpolation this. name space this do surname and I’ll end this with semicon so I need add a comma here and then a comma after this so now I’ll add two more methods for log in and log out so I can console.log I’ll use a short hand so log and then back tick this. full name right so I’m using the setter here logged in then another comma and then log out to log turn then tab back to this. full name log down so here we see we have implemented properties the Setters and getter and two methods now this same functionality is also required in the admin object and the guest object now we don’t want to duplicate our code and have to copy and paste it so there is a cleaner way that we can do this utilizing inheritance and specifically prototypical inheritance or prototypal inheritance so here rather than having to copy and paste it because admin is a user of the website it satisfies that condition we can use a special property known as Proto which stands for Prototype so it’s two underscores then Proto two more underscores that will be the key for this property and we set this to user so what we’re doing here is we’re saying that the parent of this object is the user object so it’s going to inherit these properties and methods so this enables us to inherit all this functionality without having to duplicate all the code so because admin is a more specific version it is a derived class it’s more specialized than the user object it’s more specific so I can say is admin is true so here we are inheriting all the functionality of that user object and we are also extending it so I can also add a custom method manage users which is just specific to the admin object so here I would do log and then tab back ticks so here we can utilize what we inherited from the user object so this. full name is managing users now we can also utilize prototypical or prototypal inheritance in the guest object so once again we use Proto and the user so we can say is guest it’s true and I’ll add a custom method here so say browse content log and I’ll say this. full name his browsing conare notice how we are not duplicating properties and methods in our objects if you attempt to use a property not Define an object JavaScript automatically retrieves it from the Prototype this concept is known as prototypal inheritance the Prototype property is internal and hidden but it can be set in various ways one of which is using the special Proto property that we were using here so if we didn’t set it in the definition of this object literal let’s say if I were to remove this for example then we can also set it through dot notation so I can do admin Proto sign it a user so that would work as well so I’m going to do command Z undo this so if the user object here has many useful properties and methods they become automatically available in their derived objects so admin and in guest and these properties that inherits is known as inherited properties so the Prototype chain can extend even further so let’s say if we had a even more specialized object let me Define that here I can say let super admin which is an even more specific object with enhanced Privileges and enhanced functionality I can say the Proto right so it’s parent object is admin so it’s referencing as a parent this admin object and this prototype is set to the user object so super admin will inherit all of the properties and methods defined here in the user object and it will inherit the properties and the method of the admin object so let’s add some more specialized functionality I can say is super admin is true and I’ll add a method I’ll say manage admins I’ll do log and then tab this. full name is managing admit full so there are some limitations to prototypical or prototypal inheritance the first being is that prototype references cannot form a circular chain otherwise JavaScript throws an error for example setting the user Proto object to be super admin would cause a circular reference now the second limitation is that the Proto value can only be an object or null other types are IGN Ed an object may not inherit from two other objects simultaneously the value of the this keyword in methods refers to the current object even if the method is inherited so here we’re using the this keyword it’s referring to this current object the admin it’s not referring to the user object so setting a property in an inherited object modifies only that object State and does not affect the base object state so to demonstrate that by scroll down here let’s say if I already do admin. full name and I set this to Bruce Wayne now say if I log this out I will log the admin. name and I will log out the user. full name I’ll bring up the integrated terminal I go back and I change into prototypes directory I’ll do node two I’ll do tab to autocomplete it if I run it here I see the admin’s name is Bruce Wayne and by setting it it did not change its parent it did not change its prototype right so it only affected the current object so when I log out user it logs out Steven Garcia which is the value that we set when we first created the object literal so now consider the four in Loop so we can use the for in Loop to iterate over both the object’s explicitly implemented properties and inherited properties of an object so here if I just comment this out I will say for let key in admin I can do log and here I would just log out the key once again when we bring up the integrated terminal I’ll clear this command K up arrow and run it so here we see is admin we scroll to the admin implementation here we see that property being defined we see manage users which is that specialized method we implemented and we see all of the properties and methods implemented by its parent by its prototype in the user object now one thing to differentiate here we comment this out if we were to do or utilize object. Keys object. values or object. entries this will return only the explicitly implemented properties for that object it will not output the inherited Properties or methods so far to do log and then I do object. keys of the admin let’s bring up the integrated terminal up Arrow run it so here we see is admin that property that we explicitly Define and that specialized method manage users so this will not output any of the inherited properties and methods of the Prototype so for this video we were using the Proto property which is a geter in Setter for the internal prototype property however in modern JavaScript we prefer to use object. getet prototype of and object. set prototype of so a summary of what we’ covered so far in JavaScript all objects have a hidden prototype property that is either another object or null if an object or method is not found in an object Java scpt looks for it in the Prototype write and delete operations directly affect the object itself and not the Prototype so by changing that in the derived class it will not impact the parent object so by changing that in the derived object it will not impact the parent object and the Forin Loop iterates both over explicitly defined properties and inherited properties of an object while other key value getting methods only operate on the object itself so let’s go over another example in JavaScript we know that inheritance is achieved using prototypes which are essentially objects that other objects can use as a template and we know that this process is called prototypal inheritance so for another example let’s create an object that encapsulates common behavior and properties that are shared amongst all programmers so I’ll use the cons keyword and I’ll name it programmer prototype so be object literal will Define a method so an anonymous function will log it back tick say writing code in this dot preferred language comma will to find another method drink coffee s Anonymous function and we will log drinking coffee now we end this object literal with a semicolon so now we can create a Constructor function in then we’ll use this base object as its prototype so as the parent object so we’ll use the function keyword and we’ll name it programmer the two parameters are the name and the preferred language so say let private name is assigned the name so this is a private property so I can say object. define properties the first argument will be this for the current object and we’ll pass an object as the second argument so we’ll specify the property to be Nam and it will have a getter and Setter so Define the get Anonymous function and this just Returns the private name comma then set the new name private name is assigned to the new name now we’ll also set the preferred language let’s just do that here this do preferred language is set to the preferred language now at the bottom we want to inherit the common Behavior you scroll up defined in the parent object so I can say object dot set prototype of so the first argument will be this for the current object and the second argument will be the object which will be the Prototype so this case is the programmer prototype so let’s instantiate this I’ll say cons and JS programmer equal to new programmer so the name will be Alice and the preferred language is Javascript so to better explain what we just implemented we Define a programmer Constructor function that has a private property named private name we Define Getters and Setters so we can access this private name do the property of name so this demonstrates encapsulation so we are hiding the inner details of this object and we also set the Prototype with the method set prototype of so this will allow all instances of programmer to utilize the methods built into its parent object so all instances when we call a programmer we have the right code method and the drink coffee method so now let’s verify that the inheritance is working correctly by calling the methods on this JS programmer object so we can do JS programmer. write code you can try JS programmer. drink coffee now we’ll log it out so be JS programmer logging out the name so here we are utilizing this getter to get the private name now we’ll use the setter and I’ll set this to my name Steven and we will log out the updated value so JS programmer. name so let’s scroll up and open up the integrated terminal with command J so up arrow and we run it so here we see the result of the write code method says writing code in JavaScript if I scroll up this functionality is in the Prototype here we see right code in preferred language now when we called the drink coffee method this outputed the expected string drinking coffee now if I scroll back down we outputed the name so we got Alice we updated the name and log that out and we saw the name of Steven so this example showcases how to effectively use prototypes to implement inheritance and Java Script allowing for shared behavior and properties while maintaining encapsulation of private data so so by leveraging prototypes the programmer object can be extended to create various types of programmers with minimal code [Music] duplication what is the Proto property in JavaScript the protor property is a reference to the Prototype of an object it allows objects to inherit properties and methods from another object this property is used to set for access the Prototype directly but it is considered outdated instead modern JavaScript uses object. get prototype of and object. set prototype of for these tasks in JavaScript multi-level inheritance allows objects to inherit properties and methods from multiple levels of prototypes so consider this simple example if I just declare an array and I assign this to an empty array so when my array is created it is not just an instance of an array but also part of a larger inheritance hierarchy so my array is an instance of array and array. prototype also referred to as array base provides methods and properties common to all arrays now object. prototype also referred to as object base is the prototype for array base it provides methods and properties that are inherited by all objects in JavaScript including arrays this setup forms a multi-level inheritance chain where my array inherits from array. prototype and array. prototype inherits from object. prototype this is how the inheritance looks in a structured form so the base is object. prototype also known as object base then array. prototype extends that also known as array base and then our instance of the my array so some key points objects created by a specific Constructor like array will share the same prototype in this case array. prototype this multi-level inheritance allows objects like my array to access properties and methods defined in object. Prototype giving JavaScript its Dynamic and flexible nature understanding this inheritance structure helps in recognizing how methods like two string or has owned property are available to your array even though they are not directly defined within the array Constructor or on the array instance itself this concept is fundamental to mastering javascripts prototype based inheritance and helps in designing more efficient and robust applications [Music] so moving forward in this course we’ll be using the live server extension in vs code in order to improve our productivity and reduce our need to run our code in the integrated terminal so click on the icon for the extensions Marketplace and search for live server Swiss extension allows us to have hot reloading where it will run our JavaScript code in a web browser and when we make a change in our JavaScript code it will automatically update and we can see those changes without having to constantly run it in the terminal so now that you have that installed I’ll close this back to our folders I’ll create a directory so you can click on this icon and I’ll name it underscore practice you can name it whichever you prefer now within it I’ll create a new file and I’ll name it index.html now I’ll be creating a course on HTML and CSS so no need to be an expert in those Technologies we just need this file in order to open up a web page with live server also create a file named index.js and here we will place our jscript code for our lessons so back to the HTML file we need to create the Border plate for an HTML document so visual studio code will generate this for us simply type in an exclamation point and here we see emit abbreviation so just do Tab and here vs code generate this for us so now we want to reference our Javascript file so within the body element or body tags type in script and then type text SL JavaScript now we will reference our index.js file here so we’ll do source. SL index.js as it’s in the same directory then we will have a closing tag and that’s it so now now we’ll open up our Command pallet so that’s command shift and P or control shift and P type in Live server open with live server so this will open our index.html in our web browser now because we don’t have any HTML written between the body it’s just a blank web page for now so let me close the sidebar with command B and I will resize this so now our JavaScript will be running in the JavaScript console we can see that in the dev tools also I suggest that you use Google Chrome unless you are more comfortable with Microsoft Edge or Firefox so now to open up the Google Dev tools the keyboard shortcut is command option and J you can also right click and then click on inspect so here in order to get this to open in a new window click on these three dots and here when it says doc side you want to click the left most icon so this will open the dev Tools in its own window now to see our JavaScript code you want to click on console so now we can click on this settings icon to hide that now in order to see and execute our javascri code Type in log right and then we’ll do Tab and then hello world then save it and now we see it reflected on the right side console so we no longer have to constantly run it in integrated terminal so here I’ll do command and plus so we can see the text more easily so in JavaScript we know that we can define an object like this by creating an object literal say the name and the value of Steven we can end this with a semicolon and we can log out this object with person and here we see output it on the right hand console now let’s iterate through this using a Forin Loop so I can do four let key in person then log and tab and just log out that key Val value so here we see the key of name was outputed now notice how only the properties defined directly in this person object are displayed similarly if we use object. keys so let’s log that out object. keys and then the person object we output that we see the value of name so this only shows the properties defined at the object’s own level so the properties that inherited from object. prototype also refer to to as object. base aren’t displayed because of specific attributes attached to those properties so these attributes can control whether properties are innumerable rable and configurable so in other words these attributes determine whether the property will be outputed when iterating over it such as with a for end Loop or if using object. keys object. values or object. entries so let’s see this in action I’ll clear this out and we’ll examine the prop descriptor for the two string method which this person object inherits from object base so I’ll clear this out as well and I will expand this so we can see it more easily so we’ll say let object base assigned to object. getet prototype of the person object so we’re getting the parent object of this person object now we will do property descriptor this is object. getet own property descriptor of the object base so that parent object and the two string method which is defined in its parent so now we’ll do log tab property descriptor and we will see those attributes that determine whether the two string method will be shown when we enumerate through person object so let’s save this and we’ll see the result in our console let’s expand this so we see the attributes of configurable inumerable what the value is and writable so the one we are concerned about is the innumerable and we see the value set to false so when the innumerable attribute is set to false this prevents the two string method from appearing in the output of a for in Loop and methods like object. keys so you can also Define or modify these attributes so configurable inumerable and writable for properties in our own objects so for instance if we wanted to make the name property here non- enumerable you could do this so we can do object. Define property now the name of the object and the name of the property and we can pass it an object we can Define these attributes so we can say writable is false now innumerable is false so now it won’t show up when we do a for in Loop and configurable is true so let’s comment this out for now we’ll expand this so after this change the name property will no longer appear in a 4N Loop or object. keys so let’s just demonstrate that let key in the person object then we can log all the keys that are innumerable let me resize this and we can clear this out by clicking this icon you can save it and here we see there are no innumerable keys so no innumerable properties in this person object because we Define this here for the name property so by default when properties are created directly on an object they are writable inumerable and configurable attributes are set to true this allows properties to be modified enumerated and reconfigured unless explicitly changed understanding these property attributes and their implications helps in managing how data and objects is accessed and manipulated providing greater control over object behavior in JavaScript [Music] applications what are the property descriptors or attributes in JavaScript that determine whether a property can be accessed modified or iterated over in JavaScript property descriptors or attributes that determine whether a property can be accessed modified or iterated over are innumerable writable and configurable so for inumerable if true the property will appear during four in loops and object. keys for writable if true the property’s value can be changed for configurable if true the property descript can be changed and the property can be [Music] deleted in JavaScript every object has a prototype except for the root object which is at the top of the Prototype chain the Prototype acts as a template or parent from which the object inherits methods and properties accessing an object’s prototype the recommended method to get the Prototype of an object is by using object. getet prototype of this function Returns the Prototype or the parent of the specified object Constructors and their prototypes in JavaScript Constructors are special functions used to create instances of objects since functions in JavaScript are objects themselves they too have properties one of which is the Prototype property this property is not the Prototype of the Constructor itself but rather the object that will be used as the Prototype for all instances created with that Constructor so for example if I create a Constructor function with the function keyword and if I name it circle now the code within the code block so that will be used for instantiating a new Circle object so now if I log this out we know that functions are objects in JavaScript so I can do Circle and it has a property of prototype so if we log that out here we see this empty object we can expand it this object is used as the parent for all objects created with new Circle close this out and I can comment this out creating objects and their prototype links when you create a new object its prototype or its parent is set to the Prototype of its Constructor function so this is Illustrated with say if I create an object literal and I assign this to curly braces so this is syntactic sugar for let object equal to new object so the Prototype of obj or object can be referred to using using the Proto property which is an accessor property that exposes the internal prototype linkage so we’ll just log that out log and then tab see the object and then two underscores before and after Proto so here we outputed that we can expand it so this would be the same as doing say if we do log object. prototype so we get the same output close this me expand it so now if we were to expand it we can expand the get and here we see the internal prototype is object so understanding how prototypes and Constructors work in JavaScript is crucial for effectively leveraging languages object oriented capabilities by grasping these Concepts developers can better manage and utilize object inheritance in their programs and reduce code [Music] duplication does every object have a prototype in other words does every object have a parent object every object has a prototype or a parent object except for the root object which is at the top of the Prototype chain so an object will inherit the properties of methods from its prototype or parent object do Constructor functions have their own prototype yes Constructor functions have their own prototype in JavaScript functions are objects so they have their own prototype property which is used to assign properties and methods to instances created by the Constructor function optimizing memory usage with prototypes in JavaScript in Practical applications especially those involving numerous object instances it’s important to manage memory efficiently if each object instance were to maintain its own copies of methods this would lead to significant memory overhead when dealing with thousands of objects how JavaScript handles method access to address this JavaScript utilizes prototype based inheritance when a method is called an object the JavaScript engine first checks if the method exists on the object itself if the method is not found the engine then looks up the Prototype chain of the object utilizing the Prototype property each Constructor function in JavaScript has a prototype property which is shared by all instances of the Constructor this shared prototype is crucial for memory efficiency so Dem for example this we just create a Constructor function name programmer the two parameters being named and preferred language then we use the this keyword to assign it and the preferred language so now methods added to the Prototype are shared across all instances so I will expand this just so we can see it more easily we can do programmer so that Constructor function. prototype write code so we can assign this to an anonymous function and here we do log and back tick so we can use interpolation this. name writes code in this. preferred language end this with a semiconon we could also override the two string method for all instances so we can do programmer. prototype do two string assign this to an anonymous function say programmer this.name comma language this. preferred language and that with a sumon so now let’s create an instance of this programmer so I can say const JS programmer new PR programmer I’ll say Alice and the language is Javascript now let’s just call JS programmer. write code now we save it and here in the console we see the expected output so the advantages of using prototypes let me expand this again so we can see the code the First Advantage is memory efficiency since methods defined on the Prototype are shared there is only one copy of each method in memory memory regardless of the number of instances this is especially beneficial in applications where many instances of a class are created as it saves a significant amount of memory so for example if we were going to create many programmer objects they would all share these same methods so right code and this implementation of the two string method so the second Advantage is flexibility javascript’s Dynamic nature allows you to add or modify methods on the Prototype at any time modifications to the Prototype are reflected across all instances immediately which can be particularly useful for updating functionality at runtime and the third Advantage is overriding methods so you can easily override inherited methods by defining new implementations on the prototype for example the two string method for programmer has been overwritten to provide more specific information about each programmer instance managing instance and prototype members so first consider instance members these are defined within the Constructor function and these are unique to each instance such as the name and preferred language in the programmer Constructor these properties are set per individual object and manage data that varies from one instance to another now consider prototype members these are defined on the constructor’s Prototype and these members are shared across all instances like the right code and two string Methods this setup is optimal for methods that perform generic actions applicable to all instances by strategically using prototypes to share methods among instances you can enhance your job JavaScript applications both in terms of performance and maintainability this approach ensures efficient memory usage while maintaining the flexibility to adapt the shared behavior of objects how does using prototype based inheritance in JavaScript help in managing memory efficiently when dealing with numerous object instances using prototype-based inheritance in JavaScript helps manage memory efficiently because methods defined on the Prototype are shared among all instances of an object instead of each instance having its own copy of the method there’s only one copy stored in memory this significantly reduces memory usage especially when creating thousands of instances as all instances refer to the same method on the Prototype what are the advantages of defining a method on a constructor’s prototype as opposed to defining them within the Constructor function itself defining a method on a constructor’s prototype in JavaScript has several advantages one being memory efficiency methods on the Prototype are shared by all instances so only one copy of each method exists in memory saving space when creating many instances a second Advantage is consistency changes to a prototype method are immediately reflected in all instances making it easy to update functionality across multiple objects the third Advantage is performance shared methods reduce the memory overhead and can lead to better performance as there is no need to duplicate methods for each instance understanding prototype Dynamics in JavaScript so in JavaScript changes to a constructor’s prototype affect all instances regardless of whether they’re created before or after the changes this Behavior highlights javascript’s use of object references for prototypes consider the programmer Constructor function so just create this takes the name and preferred language as parameters we’ll set these properties so now let’s instantiate it I’ll set cons I’ll just call this programmer new programmer with the name of stepen in the language of JavaScript so now let’s add a new method to the programmer prototype so we do programmer prototype write code sending this to an anonymous function console.log say this.name writes code in this. preferred language end that with the semic and let me expand this so we can see the full method so even though programmer this instance was created before the right code method was added to the Prototype this instance can still access the right code method so let’s do that do programmer. write code we can save that and here in the console we see the console log statement Steven writes code in JavaScript so enumerating object properties so using a Forin Loop you can enumerate over all properties of an object including those on the Prototype so here we can do for let key in programmer we do log while the keys and let’s comment this out for now can save that now here we have enumerated over the properties so we have the name the preferred language and the method right code So based on the JavaScript documentation properties defined directly on the object are referred to as own properties while those inherited from the Prototype are called prototype properties so checking for own properties you can use the has owned property method me to determine if a property is an own method of the object so we’ll see an example of that do log programmer do has own property we’ll say the name output that and here we see the output of true let me comment this out we’ll clear it just so it’s easier to see so that the name property is an own method meaning that it was defined within the Constructor function so let’s see another example I’ll do shift option and down arrow to copy that and I’ll specify right code so this is the name of the method or the member that was defined on the Prototype here when we save this we get the value of false indicating that this is a prototype property so this method has own property helps distinguish between properties that are part of the object itself and those inherited from the Prototype understanding the distinction between own and prototype properties is crucial for working effectively with object or features in JavaScript this this lesson demonstrates the dynamic nature of prototypes and their practical implications providing a deeper understanding of how JavaScript handles object properties and inheritance how does adding a new method to a constructor’s prototype affect existing instances of that Constructor in JavaScript adding a new method to a constructor’s prototype in JavaScript makes that method available to all existing instances of that Constructor as well as any new instances created afterward this is because instances reference the prototype for methods so they automatically have access to any new methods added to the Prototype even if they were created before the method was added what is the difference between owned properties and prototype properties in JavaScript and how can you check if a property is an owned property of an object in JavaScript only properties are those defined directly on an object while prototype properties are inherited from the object’s prototype to check if a property is an own property of an object you can use the has owned property method if this returns true the property is an owned property if it returns false the property is inherited from the Prototype or from its parent while JavaScript allows you to extend the functionality built-in prototypes such as adding a shuffle method to array. prototype it is generally advisable to avoid doing so so here’s an example of what it might look like do array. prototype and we extend it by adding a shuffle method assigning this to Anonymous function and here I just add a comment this would be implementation of the shuffle so then when we create a new array assign this to an empty array then I’ll be able to call array. Shuffle so here let open up the tools let’s just log something out I’ll just do log and I’ll say Shuffle I save that it reach the output of Shuffle so this approach may seem convenient because we can add our own custom methods to builtin data types in JavaScript however it carries significant risk so there is a potential for Conflict for example Library conflicts if you modify a built-in prototype you risk conflicts with thirdparty libraries that might rely on the default behaviors of these objects different implementations of the same method can lead to inconsistent Behavior cross parts of your application as a best practice do not modify objects that you do not own this helps with maintainability and compatibility modifying objects that are globally accessible like built-in prototypes can make your code harder to manage and predict it may also break compatibility with future versions of Javas script or interfere with enhancements in third party libraries so for an alternative approach instead of modifying built-in prototypes consider a safer alternative you can use a utility function so rather than doing this if com that out can do function Shuffle array this takes in an array as parameter variable and here you have the shuffle logic here and then you return the array so then to utilize that can simply do cons shuffled array then you simply invoke that function and pass in the array now you can also extend the Prototype safely so if absolutely necessary you want to ensure your ification does not overwrite existing methods and check if the method isn’t already defined so for example you can do if type of array. prototype. Shuffle so if the type of is not a function meaning that’s not defined then if I just copy this and paste it here and uncommon that to tabs so this is an example of how you can extend the Prototype safely by adherance of these guidelines you to ensure that your jav code remains robust maintainable and compatible with other libraries in future updates why is it generally advisable to avoid modifying built-in prototypes in JavaScript it is generally advisable to avoid modifying built-in prototypes in JavaScript because doing so can cause conflicts with third party libraries that rely on the default behaviors of these objects modifying prototypes can also make your code harder to maintain and predict it might break compatibility with future versions of JavaScript or interfere with enhancements in other libraries what are some safer alternatives to modifying built-in prototypes in JavaScript and how can they help maintain code compatibility and predictability some safer alternatives to modifying built-in prototypes in JavaScript include using utility functions where you create Standalone functions to add new functionality without affecting built-in prototypes this avoids potential conflicts and keeps your code isolated and maintainable you can also extend prototypes safely so if you must extend a prototype first check if the method already exists to avoid overriding existing functionality these approaches help maintain co- compatibility and predictability by preventing conflicts with existing or future code and ensuring your additions do not interfere with standard JavaScript Behavior or thirdparty [Music] libraries so to summarize inheritance and prototypes in JavaScript this section has provided a thorough exploration of several key Concepts in JavaScript related to optic R programming we began by understanding inheritance including prototypes and prototypical inheritance which are fundamentals to how JavaScript handles objects and classes we discuss multi-level inheritance where objects inherit properties and methods across multiple levels allowing for a more structured and hierarchical object model the use of property descriptors was covered to control and manage our properties behave including their enumerability and figurability and writability further we examine the distinction between Constructor prototypes and instance members emphasizing the difference

    and roles of each in JavaScript programming the process of iterating over both instance and prototype members was covered giving practical insight into how to access and manipulate object properties effectively lastly we address best practices regarding prototype manipulation specifically advising against extending built-in objects this practice while possible can lead to conflicts and compatibility issues especially when dealing with third party libraries overall this section aimed to equip you with a solid understanding of how inheritance and prot types contribute to efficient and effective JavaScript programming promoting better coding practices and a deeper understanding of the language’s [Music] capabilities what is the significance of prototypes and prototypical inheritance in javascripts handling of objects and classes prototypes and prototypical inheritance are crucial in JavaScript because they allow objects to inherit properties and methods from other objects this enables code reuse and efficient memory usage since methods can be shared across instances rather than duplicated prototypical inheritance also supports a flexible and dynamic object model allowing developers to extend and modify objects at runtime which is fundamental to javascript’s object orent programming capabilities how do property descriptors help manage the behavior of object properties in JavaScript and what attributes can they control property descriptors in JavaScript help manage the behavior object Properties by allowing you to control specific attributes of those properties the attributes they can control are innumerable this determines if the property shows up in the forn Loop and object. keys writable this determines if the property’s value can be changed and configurable this determines if the property descriptor can be changed and if the property can be deleted using property descriptors you can precisely Define how properties behave making your objects more secure and predictable why is it generally advised against extending built-in objects and JavaScript and what are the potential risk of doing so it is generally advised against extending built-in objects in JavaScript because it can cause conflicts with third party libraries that rely on the default behavior of these objects this can lead to inconsistent behavior and bugs additionally modifying built-in objects can make your code harder to maintain and predict and it may break compatibility with future versions of JavaScript or interfere with updates and other libraries a better practice is to use utility functions or safely extend prototypes by checking for existing [Music] methods when building software duplicating methods across different objects not only consumes more memory but also goes against the dry principle dry stands for don’t repeat yourself let’s consider how can use inheritance to share common functionality in a way that aligns with best practices imagine we have multiple types of programmer objects such as front-end programmer and backend programmer and they share some common behaviors instead of duplicating methods across both Constructors we can define a generic programmer object that contains shared methods so let’s define a base shape for our shared methods and we name it programmer now this will accept one parameter the should be name so we can set this property for the name and we can Define all of the shared methods that we want so we can do this. code assigning this to Anonymous function and here we log out this. name SCS coding then we can Define this. debug let’s extend this so we can see it more easily function and here we log out this. name is debugging and our last method this. meeting we log it out this. name is attending meetings so here let’s create two instances of this so we can say Alice we call a new programmer to call this Constructor function pass in the name and let’s duplicate so shift option and down arrow I’ll pass in Steven so now let’s do alice. code and steven. code here we save this and we see the expected console log statements so when you define methods directly within the programmer Constructor function each instance of programmer will have its own copy of these methods so here the instance of Alice will have its own methods for code debug and meeting as well as the instance for Steven this approach is less efficient in terms of memory usage because every instance has duplicate methods so remember functions are objects in JavaScript so let’s compare the code functions for these two programmer objects so here I comment this out and then I’ll log out alice. code so that reference and we’ll see if this is strictly equal to steven. code so we are comparing to see whether these functions reference the same object so we see the value of false so in this case Alice and Steven each have their own copies of the code debug and meetings method which is redundant and can consume more memory especially if you create many instances so here can clear this out and expand this so instead of defining these three methods in the Constructor function we can Define it in the Prototype so that these methods will be shared I can Define it here do programmer. prototype. code and then I can assign the function here and I’ll do the same with the other methods so programmer. prototype. debug we’ll copy this and paste it there now we have one more for the meetings programmer. prototype. meetings and then we will copy the implementation here now since we Define on the Prototype we can remove this so now when we compare these functions so alice. code and steven. code we saw the output of true because they are referencing the same function on the Prototype so these functions are shared amongst all instances so when you define methods on the programmer. Prototype all instances of programmer share the same method implementation so this is more memory efficient because the methods are not duplicated for each instance instead they are shared among all instances which is the essence of prototypical inheritance in JavaScript in this case Alice and Steven share the same code debug and meetings method which are defined on the Prototype this reduces memory usage and ensures that all instances benefit from many updates to these methods without needing to update each instance individually what are the benefits of defining methods on the prototype of a Constructor function in JavaScript and how does this approach align with the drive principle defining methods on the Prototype of a Constructor function in JavaScript provides two main benefits the first being memory efficiency methods defined on the Prototype are shared among all instances of the Constructor this reduces memory usage since each instance does not create its own copy of the method the second benefit is code reuse by using the Prototype you avoid duplicating code across multiple instances aligning with the drive principle this makes the code easier to maintain and update in summary prototypical inheritance allows for shared behavior and memory efficiency making your code more maintainable and performant so let’s summarize what we covered so far we implemented methods on the prototype for three reasons one is memory efficiency so defining methods on the Prototype ensures that all instances share the same method implementations reducing memory usage the second benefit is meth method sharing so prototype methods are shared among all instances making it easier to maintain and update the methods and the third is the benefit of inheritance prototypical inheritance leverages the shared Behavior allowing derived objects like front-end programmer and backend programmer to inherit and use these methods without duplication by defining methods on the Prototype you adhere to the principle of efficient memory usage in code reuse making your JavaScript code more maintainable and performant now let’s define more specific programmer roles you can expand this scrolling up we can create a front end programmer Constructor function so this also takes in a name and we’ll create our Constructor function for a backend programmer now we want to call the programmer Constructor function to initialize the name property so we want this version frontend programmer and back programmer to be derived objects that inherit from the programmer Constructor function so in order to call the programmer Constructor function we’ll do programmer. call now for the first argument we will pass the current context so we use the this keyword so this references this current object meaning the instance of the front-end programmer now for the second argument we will pass a name he because that is the expected parameter for the programmer Constructor function so here when we scroll up this Constructor function expects a name so we can also repeat this for the backend programmer so using programmer. call we are calling the programmer Constructor function and setting the context to the new instance of the front-end programmer or backend programmer this ensures that the name property is correctly initialized for each specific programmer type so for setting up the inheritance to enable the front-end programmer and backend programmer to inherit the methods from the programmer prototype we need to set the prototypes to be instances of the programmer Constructor function so to do that can do frontend programmer. prototype this is assigned to object.create programmer. prototype now we repeat this so shift option down arrow for the backend programmer I will also set the Constructor so frontend programmer. prototype. Constructor and set this to front end programmer and we’ll repeat that for the backend programmer so now front-end programmer and backend programmer instances can use the methods to find in program so was access to code debug and the meeting method so let’s actually see this here I will set this here we’ll clear it out let’s common out this console log statement and we’ll utilize these two instances we can do HST say Joe is new front end programmer the name of Joe so here we can say joe. code joe. debug and joe. meeting and we see the expected console log statements defined on the programmer prototype now let’s create an instance of the backend programmer so I can say const and I’ll say gen new backend programmer gen so we’ll call the same methods gen code move this up gen. debug and gen. meting and here we see the expected console log statements so this setup uses prototypical inheritance to share common methods among different types of programmers minimizing redundancy and enhancing maintainability by structuring objects in this way you effectively utilize javascript’s Dynamic nature and prototypical inheritance to create more efficient and organized code this approach ensures that all specific programmer types benefit from updates to the programmer prototype without needing to modify each Constructor separately adhering to efficient coding practices and the principles of object Orient [Music] design how does using programmer. call passing in for the first argument the this keyword and for the second argument passing in the name within the constructors of front-end programmer and backend programmer ensure proper initialization of the name property for these specific programmer types using programmer. call within the constructors of front-end programmer and backend programmer ensures proper initialization of the name property by calling the programmer Constructor with the current instance the this keyword so this way the name property is correctly set for each front-end programmer and backend programmer instance just like it would be for a programmer instance why do we use object . create and pass in for the argument programmer. prototype to set the prototypes of front-end programmer and backend programmer and what is the significance of resetting their Constructor properties we use object. create to set the prototypes of front-end programmer and backend programmer so they can inherit methods from programmer this allows instances of these objects to share the same methods making the code more efficient resetting their constructive properties ensuring the instances are correctly identified as front-end programmer or backend programmer maintaining proper type identification so recap and Core Concepts the term prototype in JavaScript essentially means the parent object in our Constructor functions we define properties and methods often we Define a general Constructor function like programmer which contains common properties and methods so in this case the name property and the code method however we may need to create more specialized objects such as frontend programmer which has specific capabilities instead of duplicating the properties and methods defin in programmer we use prototypical inheritance also called prototypal inheritance to reduce code duplication by doing this front end programmer so this will inherit the properties and methods from the programmer parent object when we call a method such as this code method JavaScript checks the front-end programmer object if it doesn’t find the method definition it looks up the inheritance chain to the programmer prototype and uses the method defined there this setup means we write less code which is easier to maintain and modify because the code is defined in one place and reuse as applications grow reducing code duplication through inheritance makes logical sense so addressing Constructor property issues in prototypical inheritance when implementing inheritance a common issue is the Constructor property this property is important for creating instances Dynam dynamically based on the Constructor function associated with the Prototype so let’s illustrate this with our programmer example here we have the parent object or the base object and we have the derived object the front-end programmer which is a more specialized version of the programmer Base by using programmer. call we inherit the name property but we also want to inherit its methods so to do this we would do frontend programmer. prototype assigned to object . create programmer. prototype right so add a commment here so this is setting up inheritance so we inherit methods so every object has a Constructor property which refers to the function called to initialize the object when we call new frontend programmer so here when we are creating instance a frontend programmer we wanted to call the front-end programmer Constructor this refers to this Constructor function however after setting the prototype to object.create and passing in programmer. Prototype as we did here to inherit the methods The Constructor property of frontend programmer. prototype points to the programmer Constructor function so it’s pointing to this Constructor function as opposed to this one so this can cause confusion so to demonstrate this can log it out say front end programmer. prototype Constructor and strictly equal to this Constructor function just to demonstrate that it is now referencing this Constructor function rather than the frontend programmer Constructor function that we wanted to so can resize this so we can see the output in our console and I’ll save it and here we see the value true so this shows that it’s referencing this Constructor function so to correct this we reset The Constructor property after changing the Prototype right so after we inherit the methods then we need to make sure that we’re referencing the correct Constructor function so to do this we would do front end programmer. prototype do Constructor and we assign this to the front-end programmer Constructor function so now here when we log this out if we save this again we see the value is false because the front-end programmer Constructor function is no longer referencing the programmer Constructor function so to recap whenever you change the Prototype of a function in JavaScript reset the Constructor property this ensures The Constructor property accurately reflects the actual Constructor function for instances preventing potential issues and object creation and inheritance this practice maintains consistency and predictability especially in complex inheritance hierarchies [Music] what is the primary benefit of using prototypical inheritance in JavaScript when creating specialized objects like front-end programmer from a general Constructor function like programmer the primary benefit of using prototypical inheritance in JavaScript is that it reduces code duplication by inheriting properties and methods from a general Constructor function like programmer specialized objects like front-end programmer can use those shared features without having to rewrite them this makes the code easier to maintain and update since the common code is defined in one place and reused across different objects why is it necessary to reset the Constructor property when setting up inheritance using object.create in JavaScript and what potential issues can arise if this step is omitted it is necessary to reset the Constructor property when setting up inheritance using object.create in JavaScript because object.create Chang es the Prototype which can mistakenly point to the wrong Constructor if you don’t reset it the Constructor property might refer to the parent object like programmer instead of the child object like front-end programmer this can cause confusion and bugs when creating new instances as JavaScript won’t know the correct function to use for initializing the objects how does JavaScript handle method lookups in the context of prototypical inheritance and what is the sequence of steps when a method like code is called on an instance of frontend programmer when a method like code is called on an instance of front-end programmer JavaScript follows these steps the first is checking the instance JavaScript first looks for the code method directly on the frontend programmer instance second check the Prototype if it doesn’t find the code method on the instance it looks up the Prototype chain to the frontend programmer. Prototype next it checks the parent prototype if the code method isn’t there it continues up the chain to programmer. prot type where it finds and uses the code method defined there this process ensures that the instance can use methods defined in its own class or any parent class following the inheritance chain so in objector programming in JavaScript Constructors play a crucial role in setting up new objects so Constructor functions essentially refer to the function that is called or invoked to instantiate an object with a given state so we will modify the programmer Constructor that we’ve been working on so we can do function we call it programmer and we’ll specify two parameters so the name and the specialization and we can set that here with the this keyword and this. specialization sign to specialization so now let’s create a derived Constructor function so this will be a more specific type of programmer which we will call a frontend programmer who will also have a preferred framework along with a name and specialization so we have function frontend programmer name specialization and preferred framework so to inherit the name and specialization properties from this parent object rather than having to duplicate that code we do programmer. call for the first argument we’ll pass in the this keyword so that refers to this current object and then we’ll pass in name and specialization because these are the two arguments needed because these are the two parameter variables defined in this programmer Constructor function so now that we’ve inherited those two properties we need to assign our preferred framework now that we implemented that let’s create an instance of front end programmer you can say cons say Steven new frontend programmer Steven for the name the specialization will be front end and the preferred framework speci for that to be react so react is actually a JavaScript library but in this context we will consider it a framework so let’s talk a bit about the new keyword when you use the new operator several things happen first is a new object creation so JavaScript creates a new object in memory second is setting the Prototype it sets the Prototype of this new object to the Prototype of the Constructor function from which it was called so it would be programmer. prototype if you were to do new programmer and it is frontend programmer. prototype for when you do new frontend programmer so third is executing the Constructor The Constructor function is called with the this keyword bound to the newly created object allowing properties and methods to be assigned to this and fourth is returning the object unless the Constructor explicitly returns a different object object the new object is returned by default so let’s discuss the this keyword so in the context of a Constructor function called with the new Operator by default the this keyword refers to the new object being created and second if the Constructor function is called without the new operator then it would refer to the global object so this would be the window object in browsers or the global object and no. JS which can lead to unexpected behaviors and errors Show an example of this here we log out the front end programmer name now do shift option down arrow to create those copies the specialization and the preferred framework let’s resize this so we can see our output in the console and clear this out and when we save it we get our expected output logging our properties so the key takeway using Constructor functions properly with the new operator ensures that the new objects are set up correctly with their intended prototypes and properties it is essential to use the new operator to avoid unintended side effects and ensure that the this keyword behaves as expected within the Constructor function this mechanism is fundamental for implementing inheritance and creating a hierarchy of objects in JavaScript explain the steps involve when the new operator is used with the Constructor function in JavaScript why is it important to use the new operator when calling a Constructor function when the new operator is used with a Constructor function in JavaScript the following steps occur first is a new object creation so a new JavaScript object is created in a memory second is set in the Prototype the new object’s prototype is such as the Constructor functions prototype third is executing the Constructor the Constructor function is called with the this keyword bound to the new object allowing properties methods to be assigned to it and the fourth step is R return the object the new object is returned automatically unless the Constructor explicitly returns a different object it’s important to use the new operator to ensure that the this keyword refers to the new object being created without the new operator then the this keyword will refer to the global object or be undefined if you were using strict mode leading to unexpected behaviors and errors so refactoring with the programmer function so suppose we have a base programmer class and specific subclasses like front-end programmer and backend programmer so here’s you can set up inheritance using a generalized extend function so we have our base programmer Constructor function and a method now let’s create our specific programmer types so that’s function frontend programmer with the name we call programmer. call This And name so let’s copy this and we’ll create our backend programmer so let’s define an extend function that automates the process of setting up prototypical inheritance between a parent and a child Constructor function so we can inherit the methods and properly assign The Constructor function so you can do function extend so for the first parameter variable I’ll specify that to be the child object or child class the second will be the parent so we want to inherit the methods of the parent so we do child. prototype is assigned to object.create parent. prototype so then we will assign The Constructor prototype. Constructor to the child so now using the extend function so with this extend function implemented you can easily set up inheritance for any any number of specific programmer types by simply calling it so we’ll just do extend front end programmer and programmer so I’ll do shift option and down arrow and I’ll pass in backend program so now let’s test the implementation I’ll resize this so we can see in our console so we’ll create instances of the frontend programmer so I say cons Steven sign to new front-end programmer and I’ll do shift option and down arrow and I’ll just change this to be backand programmer with the name of Alice so now we can call and invoke the method that we inherited which is the code method here so it is defined on the parent object which is programmer so we can do steven. code and we could do alice. code and here save it we get the expected output so the benefits of using the extend function the first is encapsulation so by encapsulating The Inheritance logic in the extend function we avoid redundancy and make the code more maintainable and second is reusability the extend function can be reused across the project wherever inheritance is needed promoting consistency and reducing the chance of errors this approach not only streamlines The Inheritance process but also makes the code base more organized and easier to manage by using a generalized method for extending prototypes you ensure the old derived classes correctly inherit from their parent class without manually setting the Prototype and Constructor each [Music] tire what are the benefits of using a generalized extend function to set a prototypical inheritance in JavaScript explain how it improves encapsulation and reusability in your code using a generalized extend function to set a prototypal inheritance in JavaScript has several benefits one being encapsulation the extend function wraps The Inheritance logic in one place so you don’t have to repeat the same code for every new child Constructor this makes your code cleaner and easier to maintain and the second benefit is reusability once you have the extend function you can use it whenever you need to set up inheritance saving time and reducing the chances of mistakes this ensures consistency across your code base overall it makes your code more organized and easier to manage to demonstrate method overwriting we’ll redefine the code method in front-end programmer to include additional Behavior specific to front-end programming So currently we have this derived object the frontend programmer which inherits the properties and methods from the base programmer object so when we call or invoke the code method it simply calls the function derived in its parent but we can override this function it so here before I instantiate it I will scroll up so I’ll resize this then before instantiating it so I can say frontend programmer. prototype. code and assign this to an anonymous function so I’ll say programmer so that Constructor function for the parent. prototype. code. call and then I’ll pass the this keyword so this calls the base implementation defined up here now I can say log and I’ll do back ticks this.name is coding in HTML CSS and Java script so now I will save this and we’re invoking the code method on a frontend programmer we can save it let’s restart the live server so command shift and P live server open let’s resize this right I’ll close this one out open up the developer tools so command shift and J so now I close the sidebar with command b or controlb and I get the expected output I get Steven starts coding which is the output defined in the programmer implementation of the code method and in this derived object where we did method overwriting I also log out Steven is coding in HTML CSS and JavaScript so an explanation of method overwriting this setup showcases how a prototypical inheritance Works in JavaScript when you call the code method on an instance of frontend programmer JavaScript first checks the frontend programmer prototype for this method since we’ve overwritten code in front-end programmer this version is executed which also calls the Base Class method to maintain the general programming Behavior then add specific Behavior so if I were to comment this out it would simply overwrite it and simply log out what we Define here right so just this expected output so some key points the first is Method lookup javascript’s prototype chain means that method lookup starts with the object itself and moves up the chain until it finds the method or reaches the top of the chain and second using the call method for base methods to include the Base Class methods functionality when overriding methods use call to specify the context passing in the this keyword and ensure the base method executes correctly for the deriv class instance by following these principles you can effectively manage and extend behaviors in JavaScript allowing for more flexible and reusable code [Music] structures how do you override the code method in frontend programmer to include additional Behavior while still calling the Base Class method to override the code method in frontend programmer and include additional Behavior while still calling the Base Class method you could do the following first you would Define the new code method on frontend programmer. Prototype inside this method you call the base code method using programmer. prototype. code. call and passing in the this keyword and this will keep the original behavior and then you would add the new Behavior specific to front programmer this way when code is called on a front-end programmer instance it will first run the base code method and then add the new Behavior what is the significance of using call when invoking the Base Class method in an overb method in JavaScript using call when invoking the Base Class method in an overwritten method is important because it ensures the base method runs in the correct context by using call you pass the current object which would be the this keyword to the Basse method so it behaves as if it was called directly on that object this allows the base method to properly access and modify the object’s [Music] properties polymorphism is a key Concept in objectoriented programming so polymorphism stands for many forms and it is what allows objects of different classes to be treated as objects of a common super class through inheritor it’s essentially the ability for different objects to respond to the same method call in different ways first let’s look over this starting code that we’re using we have the extend method which is a utility function that we’re using so that a child object can inherit methods from parent object and make sure that we are resetting the Constructor we have a base object for our programmer which just sets a name property and we Define a method named work who simply logs out a string then we have two derived objects front-end programmer and backend programmer so both of them inherit the name property from this Bas programmer object and we are calling the extend method so we’re inheriting the work method so now we have this spoiler play code let me resize here so implementing polymorphism we have our specialized programmer types which is front-end programmer and backend programmer when want each of them to have a unique implementation of the work method before instantiating an instance of front-end programmer we can do frontend programmer. prototype. workor and assign this to an anonymous function so we are overwriting this method we can do log and we’ll do back tick is designing and coding the front end we have implemented that method overwriting implementation now we can do backend programmer. prototype. workor sign this to Anonymous function and we will log it out back ticks we can say this. name is developing server side logic right let’s create a backend programmer so I’ll scroll up and I’ll do shift option and down arrow and I’ll just name this to be Alice Alice and backend programmer so we’ve instantiated two instances so one for the frontend programmer and one for the backend programmer so using polymorphism so let’s create an array of programmer objects which can be either a front-end programmer or backend programmer so since we are utilizing inheritance we know that a frontend programmer is a programmer and backend programmer is a programmer right so the concept of is a is very important such that our in makes logical sense so by creating this array we’ll say programmers this will demonstrate how each object can use the work method differently according to their specialized class definition so create an array and first I’ll pass in Steven so that front- end programmer and Alice the backend programmer so now let’s iterate through this programmer’s array I can do that with a for of loop so I’ll say for for let programmer of programmers and it will call programmer. workor and so now it will call its unique implementation of the work method so the frontend programmer will call this method and the backend programmer will call its own implementation of the work method so now let’s save this and we’ll see the output in the console so now on the right we see Steven is designing en coding the front end and for the backend programmer Alice is developing server side logic so some key points the first is no type checking is needed so with polymorphism you don’t need to check the type of each object before calling the work method each object knows its own implementation of the work method allowing them to behave correctly according to their specific type and the second is code flexibility and reusability polymorphism simplifies code management and enhances its reusability by allowing you to use a general interface for a range of different objects this example demonstrates how polymorphism can be leveraged in JavaScript to interact with objects from different classes through a common interface enabling flexible and easily manageable code this approach is particularly useful in systems where new types might be added but existing code shouldn’t need extensive changes to accommodate them how does polymorphism allow different objects to respond to the same meth method call in different ways polymorphism allows different objects to respond to the same method call in different ways by using method overloading each object even if they are of different classes can have its own version of a method so when a method is called the correct version for that specific object is executed what are the benefits of using polymorphism in terms of code flexibility and reusability as demonstrated by the programmer example polymorphism increases code flexibility and reusability by allowing objects of different types to be treated through a common interface in the programmer example it means that you can call the same method in this case it is the work method on any programmer object without worrying about a specific type making the code simpler and easier to extend with new types of programmers [Music] understanding inheritance in composition with the programmer function while inheritance is a powerful feature in object Orient programming it’s important to use it carefully to avoid creating overly complex and fragile systems so potential issues with inheritance inheritance should always satisfy the is a relationship meaning that a subass should represent a more specific version of the super class for instance a front-end programmer which is the subass or drive class is a specific type of programmer with programmer being the super class or Base Class however problems can arise if the subass inherits methods that do not logically apply to it leading to an inappropriate relationship example of inheritance complexity so consider a scenario where you are expanding the programmer function to include different types of technical staff in a company so I can resize this Implement a base object so this will be an employee object which has a name parameter this. name and we’ll set the name value now we can create a more specific version of an employee so this subass would be programmer so it takes in a name and we call employee. call then the this context for the first argument referring to this programmer object and and the name so this now inherits the name property if we can create another subass or derived object and this would be a manager so this will also inherit from the employee based object so a programmer is an employee and a manager is an employee so it satisfies the is a relationship so I can call employee. call this and the name so manager inherits from employee now if the employee had programming methods those methods would not logically apply to a manager object so this example shows that the inheritance hierarchy can become inappropriate and bothersome as you don’t want to inherent methods that don’t make logical sense so this would happen in the case if this. employee had a method like code and then we’ll log out right code so it would make logical sense for a manager to have that functionality clear that so as a best practice you want to limit The Inheritance depth in general it’s best to keep inheritance hierarchies shallow ideally not going Beyond one level deep inheritance trees can become difficult to manage and understand favoring composition over inheritance an alternative to inheritance is composition where you build classes out of components rather than using a strict parent child relationship this approach often provides greater flexibility and reduces dependencies between classes when you think of the term composition imagine it as a has a relationship whereas inheritance represents and is a relationship with composition an object includes instances of other objects and their functionality allowing it to have the behavior it needs without relying on hierarchical structure implementing composition with mixins in JavaScript composition can be achieved using mixins where functionality can be mixed into a class for example instead of having a programmer inherit all behaviors specific functionalities like can code can review can design might be mixed in as needed so const can code which would be a JavaScript object literal and within it we can have a method for coding so I’ll say log and I’ll say this.name is coding I can Define another object say can review and I will Define a review method the log and I can say this.name is reviewing code so now let’s actually move this up so I move it up with shift and the up Arrow so I’ll just reorder that so we have these objects defined before the implementation of our programmer Constructor function so let’s create an instance of a programmer so I’ll say cons Steven equals new programmer just pass in my name so now for this programmer Constructor function to utilize the code method and review method we can do object. assign this as the first argument and we’ll pass in can code and can review so I can add a comment here scroll up and I’ll say composing the object with necessary functionalities so now let’s create an instance of programmer so I can say con Steven equals new programmer I’ll pass in my name so then I can do steven. code and steven. review I and save that and I get the expected output so in summary in software design while inheritance might seem like a straightforward way to reuse code it’s essential to evaluate whether it introduces unnecessary complexity often composition provides a more flexible and robust alternative allowing objects to be constructed from discreet reusable behaviors this approach aligns with the principle of favoring composition over inheritance help me to maintain clean and manageable code [Music] bases what is composition composition is a design principle where an object is made up of one or more other objects allowing it to use their functionality it represents a has a relationship meaning that an object contains and uses other objects rather than inheriting from a parent class what are potential issues with inheritance and why is it important to ensure that a subclass satisfies the is a relationship with its super class potential issues with inheritance include creating complex and fragile systems if subclasses inherit methods that don’t logically apply to them it’s important to ensure that a subass satisfies the is a relationship with its super class to maintain logical consistency for example a front programmer should be a specific typee of programmer how does composition offer a more flexible alternative to inheritance in software design and how could it be implemented in JavaScript using mixins composition offers more flexibility than inheritance by allowing objects to include and use functionality from other objects avoiding complex hierarchies in JavaScript it could be implemented using mixins where specific functionalities are added to an object as needed this way you can add functionality without relying on inheritance what is a mix in a Mixon is a reusable piece of code that adds specific functionality to objects or classes in JavaScript mixin are used to share Behavior across multiple objects by copying properties and methods into [Music] them in JavaScript object. assign is a powerful method used used to copy properties from Source objects to a Target object this capability is particularly useful for implementing mixins where common functionalities can be shared across different objects without forming a rigid inheritance structure here’s how you can apply this to a programmer function allowing programmers to have modular capabilities like eating walking and coding so defining mix and objects first let’s define simple objects that contain methods which can be mixed into any Target object so we can Implement a can e method and within it has an e method set this to an anonymous function so I can say this. hunger is decreased and I can log use back ticks this do name is eating so end that with the semicolon now Implement two other objects so the next will be can walk it will’ll have a walk method so I’ll say a function and we will log it out I’ll say this. name is walking we end that with a semicolon and then we have can code so can have a method coding and we will log out this. name is coding end that with a semicolon I’ll just add a period here just to be consistent with the other strings that we’re outputting so using object. assign to mix capabilities you can use object. assign to add these capabilities to a programmer so I scroll up I’ll Define a Constructor function for a programmer this takes in a name parameter variable so we set the name and we’ll set a property for the Hunger so this will be the default hunger level so now we have the mixin functionalities into the programmer’s Prototype so you can do object. assign programmer. prototype so this would be the Target and the source objects that we want to copy will be can eat can walk and can code so now we can instantiate a programmer so I’ll say cons programmer and then new programmer passing in my name and I call each of these methods so first let’s just log this out I can log programmer let’s resize this so we can see it in the console and I’ll save it so here when we expand we see the property for hunger and the name right so our expected properties so now let’s call programmer. Cam see programmer. e and then I’ll do shift option down arrow just to make copies of this and then I’ll say walk and then I’ll say code save that and here I get the expected output so Steven is eating Steven is walking and Steven is coding so to create a reusable mix and function to stream the process of mixing capabilities into different objects you can create a reusable mixin function so let’s define that just at the top so I can say function and I’ll name it mix in now for the parameters we’ll specify a Target object and we will use the rest operator with three dots sources so we can pass in one or more values as an argument so we’ll utilize object. assign the Target and then we will spread the sources right so now when we use this rather than doing object. assign let’s expand this so we can see it better so now I can comment this out and we utilize our Mix end function so here I can say mix in so the target is programmer and we can pass in a variable number of arguments ments so I’ll say can eat can walk and can code so let’s resize this and when I save it I get the same expected output so this approach demonstrates the flexibility of composition over inheritance by composing objects from smaller function Focus objects you can easily extend functionality without the constraints of strict class hierarchy this method not only makes your code more reusable but also makes it modular and easier to understand using Mixon with object. assign allows for dynamic capabilities to be added to objects promoting code reuse and reducing the complexity typically associated with deep inheritance hierarchies this method aligns well with the modern JavaScript best practice of favoring composition over inheritance providing greater flexibility and easier maintenance [Music] how does using object. assign facilitate the implementation of mixins in JavaScript and what are the benefits of this approach compared to traditional inheritance using object. assigned in JavaScript makes it easy to implement mixin by copying properties from multiple Source objects to a Target object adding new capabilities without using inheritance this approach offers greater flexibility avoids complex inheritance hierarchies and promotes code reuse by allowing you to combine only the needed functionalities this section delved into several Advanced topics essential for mastering object or programming in JavaScript we covered creating her own prototypical inheritance so we explored how to establish custom inheritance chains using javascript’s prototype base inheritance system we covered resetting the Constructor the importance of properly resetting the Constructor property when modifying object’s prototype was emphasized to maintain proper linkages we covered calling the super Constructor so techniques for invoking a superclass Constructor within a subass were discussed to ensure that inherited properties were correctly initialized we covered intermediate function inheritance We examined how to implement inheritance through intermediary functions enhancing flexibility and how inheritance is applied we covered method overwriting the course covered strategies for overwriting methods in sub classes to tailor or enhance functionality derived from a super class we covered polymorphism we discussed how polymorphism allows objects of different classes to be treated as objects of a common super class facilitating flexible and dynamic code we covered when to use inheritance guidelines are provided on appropriate scenarios for using inheritance focusing on maintaining a clear is a relationship and we cover mixin the use of mixin was introduced as a flexible alternative to inheritance for composing objects with multiple behaviors or capabilities without forming rigid hierarchical structures by understanding and applying these advanced concepts you can write more robust maintainable and scalable JavaScript applications this knowledge will enable you to leverage the full power of object R programming in JavaScript adapting to various programming challenges with effective Solutions so let’s go over modern JavaScript classes which is syntactic sugar over prototypical inheritance in modern JavaScript the class syntax provides a cleaner and more intuitive way to define Constructor functions and manage prototypical inheritance this new syntax simplifies the creation of objects and their prototypes even though it is essentially syntactic sugar over the existing prototypical inheritance model this syntax introduced in es6 which stands for ecmascript 2015 is part of a specification that enhances JavaScript by adding new language features to modernize it so consider the traditional Constructor function for a programmer that we’ve been working with so if I use the function keyword and I name it programmer I specify two parameters name and prefer language then I set the properties with the this keyword so this.name is assigned to name and this. prefer language is assigned to Preferred language Now to create a method I’ll use the this keyword and I’ll name My Method code signning this to an anonymous function so let’s log to the console back tick this. name is coding in this do preferred language so now I can create an instance of this with the new keyword to create a new object in memory so I’ll say cons programmer is assigned to new programmer I’ll pass in my name Steven and the preferred language is Javascript so now I can call programmer. code and we can output that to the console and here we see our expected console log statement so let’s rewrite this Constructor function using modern class syntax which makes it clearer and more structured so we can comment this out so this is the syntax that you would use in modern JavaScript applications you would use the keyword class and then you name that class so in this case it’s programmer and now you would Define a Constructor function so classes in JavaScript have one Constructor function and this is the function that has called when you use the new keyword so it is named Constructor right so that’s the keyword and in this case the parameters our name and preferred language and within it we set our properties so this not name set a name in this preferred language is set to Preferred language so now to Define our method we’ll name it code and we will log the same output statement so let me just copy it here just to save us some time so this is the modern way to define our classes in JavaScript rather than using Constructor functions so and when we save it we will get the same output right so once again we get step’s coding in JavaScript so understanding the underlying functionality despite the use of the class keyword the underlying me mechm Remains the Same so consider the type of operator even with the class syntax programmer is still a function in terms of javascripts type system it’s specifically a Constructor function so let’s log that out so I can demonstrate that and then I do log and then tab if I do type of and then programmer we will see that the type is a function so when we save this we see that it is a function es5 compatibility for environments that do not Support es6 classes tool like Babel available at babeljs doio can trans file this modern JavaScript back to es5 compatible code ensuring that the classes work across all browsers so consider the benefits of using class syntax the first benefit is Clarity and simplicity the class syntax is easier to read and understand especially for developers coming from other object oriented languages like Java or CP the second benefit is encapsulation using class syntax encourages better encapsulation and a more declarative structure for defining object Constructors and methods and the third benefit is standardization it offers a standardized way of object creation and inheritance that aligns with other program languages using the learning curve so in summary by utilizing modern JavaScript class syntax you could write cleaner more maintainable code while still leveraging the powerful prototypical inheritance model that JavaScript offers this approach not only enhances readability but also simplifies complex coding structures making it an essential skill for developers working in modern JavaScript environments how does the class syntax and modern JavaScript improve the process of defining Constructor functions and managing prototypical inheritance the class syntax in modern JavaScript makes it easier and clearer to create objects and their prototypes it provides a straightforward way to Define Constructor functions and methods making the code more readable and organized compared to the older method even though it looks different it still works the same under the hood what are the benefits of using class syntax over traditional Constructor functions in JavaScript there are three main benefits of using class syntax over traditional Constructor functions in JavaScript the first being Clarity the class syntax is easier to read and understand the second benefit is encapsulation it helps organize code better by keeping related methods together and the third benefit is standardization it aligns with how other program languages handle classes making it easier to learn and use so for your exercise update this function Constructor to use the es6 class syntax so here I’ll call item. display and I get the output of the name of the item and the quantity so to implement this I’ll comment this out so now I’ll do class and name the class grocery item then curly braces and then I’ll Define The Constructor function which will be executed when I use the new keyword so the parameter is the name and the quantity I just assign this with the this keyword to set the properties and for the quantity Now define a method so I’ll say display and I’ll just copy this console loog statement and face it here so let’s clear our console and I’ll save it and we get our expected [Music] output in JavaScript functions can be defined using either function declarations or function Expressions both methods serve similar purposes but have key differences in Behavior particularly regarding how they are hoisted so let’s consider function declarations function declarations are hoisted to the top of their containing scope this means that they are moved to the top during the compile phase allowing you to call them before they are physically defined in the code so to demonstrate this I’ll Implement a function I’ll name it GRE and then I’ll log out hello world now to demonstrate function hoisting I can call or invoke the Greet method before it is defined so if I save this I get the expected output so because of hoisting JavaScript will move this function to the top of the file during the compile phase so now considering function expressions in contrast function expressions are not hoisted which means you cannot call them before they are defined in the code trying to do so will result in a reference error so to demonstrate this I’ll just comment this out we don’t need it I can say cons say goodbye set this to an anonymous function and then we will log out goodbye so now if I try to invoke it for it is defined let’s clear this out and I save it here we see we get a reference error so you can comment this out so now let’s apply this concept to the programmer class context so we scroll up now let’s consider this class that we defined in our previous lesson when working with classes it’s crucial to understand that like function Expressions class declarations are not hoisted this means you must declare a class before you can instantiate it so let me move above it just to demonstrate that we cannot instantiate it before it’s being defined I can say conev is assigned to a new programmer I’ll say my name and the preferred language of JavaScript and I’ll just save that and here we see we get a reference error we cannot access programmer before it’s initialized so using class Expressions just as with function Expressions classes can also be defined using a class expression syntax which is not hoisted and allows for more Dynamic declarations so to demonstrate that I’ll just to find this here I can say cons my programmer class set this to the keyword of class and then curly braces and then I want it to have the same functionality as this programmer so I’ll just copy this over let’s clear let’s common out this line so we don’t need that so we’ve created this class expression and let’s create an instance of it below its declaration so I can say con programmer and new my programmer class pass in Steven and in this case I’ll say JavaScript and then we can call the method programmer. code let’s clear this out and we’ll save it and we get our expected output so here we are creating instance of it after its declaration now if I were to move it up so I’m moving it up with option up Arrow end up here so now that I try to instantiate instance of this before its declaration if I save it now then I get a reference error note that you wouldn’t actually use this class expression syntax very often but I wanted to demonstrate it just show that it is possible in conclusion choosing between function declarations and expressions or class declarations and expressions can impact how you structure your JavaScript code for Simplicity and Clarity especially when defining Constructors and methods within a class using class declaration syntax is often preferred however being aware of hoisting rules is crucial for avoiding runtime errors and ensuring that your JavaScript code executes AS intended [Music] what is the main difference in Behavior between function declarations and function Expressions regarding hoisting in JavaScript the main difference is that function declarations are hoisted to the top of their scope so you can call them before they are defined in the code function expressions are not hoisted so you must Define them before calling them otherwise you’ll get a reference error why is it important to understand hoisting rules when working with class declarations in JavaScript it’s important to understand hoisting rules because class declarations are not hoisted this means you must define a class before you use it or you’ll get an error knowing this helps you avoid mistakes and ensures your code runs [Music] correctly an object going in programming especially within JavaScript classes we distinguish between instance methods which act on instances of the class and static methods which are called on the class itself and are often used as utility functions so let’s consider the programmer class that we have defined so whenever we create an instance of a programmer it has access to the code method to demonstrate that we have dev. code when we save that we get the expected output which is this console log statement so now let’s define a static method which should be accessible through the programmer class so I’ll use the static keyword and then I’ll name this method compare skill and this will accept two parameters so I’ll say programmer one and programmer 2 and this will return a Boolean value comparing programmer one and their preferred language and strictly equal to programmer 2. preferred language so let’s create another instance of this programmer so I’ll do shift option and down arrow to create a copy and I’ll name this Dev to I’ll change the name to be Alice now to compare it I will log the result of that pan value so I’ll use let me scroll up and see better and I’ll say log I’ll do programmer and then the static method so I do dot compare skill now I’ll pass in Dev and Dev 2 and we’ll expect this to be true because they’re using the same programming language so when I clear this first and then save it so we get the output of true because they both have JavaScript as their preferred language so let’s scroll back up so we can review our class so instance methods like code are used to perform actions that are relevant to the individual objects created from the class and static methods such as compare skill are used for operations that are relevant to the class as a whole or involve multiple instances of the class but don’t depend on any single object state so understanding the utility of static methods static methods are particularly useful for utility functions where the operation does not depend on the state of a particular instance but rather on the parameters provided to the function this makes them similar to functions provided by the math object in JavaScript such as math. round or math.max which perform General utility operations and are not tied to a specific object in conclusion understanding when to use instance methods versus static methods in your javascrip classes can significantly impact the design and functionality of your applications instance methods are best for manipulating or utilizing the state of individual objects while static methods are ideal for tasks that require a broader scope ones that involve the class itself or interactions between multiple instances this distinction helps in organizing code logically and maximizing the efficiency and readability of your JavaScript applications what is the difference between instance methods and static methods and JavaScript classes instance methods are used on individual objects created from a class and act on the data within those objects static methods are used on the class itself and are typically utility functions that don’t rely on the data of any single object why are static methods useful in JavaScript and when should they be used instead of instance methods static methods are useful for tasks that don’t depend on the data of a specific object but rather on parameters provided to the method they should be used for General utility functions or operations involving multiple instances of the [Music] class so for your exercise to add a static method to the grocery item class you can Define the method with the static keyword so static methods are called on the class itself rather than on instances of the class so for your exercise create two instances of the grer item class and have each of these objects have different names and quantities then Implement a static method named compare quantities to compare the quantities of the two items and print out the result so if the quantity of item number one is greater than item number two then log that the name of the first item has more quantity than the name of the second item if the quantity of item one is less than item two then log that the name of item two has more quantity than the name of item one otherwise output that both of them have the same quantity so to implement the compare quantities static method I’ll use the static keyword and we name it compare quantities then it takes in item one and item two then I’ll use an if statement so if item 1. quantity is greater than the quantity of item two qu then I will log use back tick so I can use interpolation item one. name has more quantity than item 2. name else if item 1. quantity is less than item 2. quantity then I will log out item 2. name has more quantity than let’s fix this move that y then item one. name else will be the case when they’re equal and log out item one. name and item 2.n name have the same quantity so let’s create two instances of the grocery item class so I’ll say cons I’ll call this apple equals new grocery item and then the name is Apple and the quantity is four so I’ll just copy this line with shift option and down arrow and I’ll rename this to be banana let’s just copy this over and I’ll update this value to be seven so now I can call this static method with grocery item do compare quantities of apple and banana so let’s save that and here we get the expected output that banana has more quantity than Apple let’s switch these values around just so we get the expected result we’ll clear it out and then we say it you get apple has more quantity than banana and in the case when they’re equal we get the apple banana have the same quantity let’s go over understanding the this keyword in different contexts with the programmer class the this keyword in JavaScript behaves differently based on how a function is called this Behavior can lead to unexpected results especially when functions are detached from the object context so let’s first illustrate this with a programmer Constructor function so we’ll use the function keyword we’ll name it programmer this accepts a parameter of name so we’ll set the name property then we’ll Implement a method named code so we assign this to an anonymous function then log and then tab and we will log out the this keyword so let’s create an instance of the programmer object so we’ll name it programmer assign to a new programmer and I’ll specify my name so Steven and then I will call the code method so now want to Output this and save it here I see outputs this instance of the programmer so that object and memory so here we see the property of the name and the code method so now let’s consider detaching a method when you detach a method from its object and call it independently the this keyword loses its original context in JavaScript functions are objects so we know that this method or in other words this function is just an object in memory so to get access to it I can call it detach code methods and I set this to a reference to that object right so functions are objects and so now this identifier detach code will reference this function however because it’s detach it has lost context of its this keyword so now let’s invoke this so I can say detach code and then let me clear this out so we can see it and so when I save it here I see in the original instance when I call code it logs out the programmer object however when I call detached code it logs out the window object so in web browsers the this keyword will reference the window object and in nodejs it will reference the global object so how can we fix this we can utilize strict mode so we go up here in JavaScript strict mode changes the behavior of the this keyword in function calls not associated with an object so in strict mode the this keyword becomes undefined instead of defaulting to the global object so if I were to use use strict a string end it with a semicolon and I would specify this to be the first line in the program so now let’s clear this out and when I save it the first time when I call the code method and it console logs the this keyword it references the current object that it’s referring to however in the case when we call a detach method previously it was referencing the window object but now since we’re in strict mode it outputs undefined so here we’re using a Constructor function now if we were to to use classes they implicitly use strict mode to avoid these issues instead of using a Constructor function I’ll specify it to be a class so I Define The Constructor method this sets the name property and I’ll Define a method for code and it outputs to this keyword so let’s comment this out so we don’t need to explicitly specify use stript let’s clear this out and when we save it so because we’re using the class syntax it is implicitly using strict mode so let’s cover the benefits of strict mode in class bodies the first benefit is safety it prevents functions from unintentionally modifying Global variables which can lead to difficult to track bugs and the second benefit is consistency it ensures that the this keyword behaves consistently making the code more predictable and less prone to errors in conclusion understanding how this keyword behaves in different context is crucial for JavaScript development ERS by using strick mode and being cautious of how methods are called developers can write more robust and secure code the implicit use of strick mode within class bodies in modern JavaScript helps enforce these best practices preventing common mistakes associated with the this keyword in global [Music] context what are the potential consequences of detaching a method from its object context in JavaScript detaching a method from its object context in JavaScript can cause the this keyword to lose its original reference instead of pointing to the object it belongs to that this keyword May point to the global object like window in browsers or be undefined in strict mode this can lead to unexpected behavior and bugs because the method no longer has access to the object’s Properties or methods how does strict mode in JavaScript enhance code safety and consistency particularly in the context of class body strict mode in JavaScript makes code safer and more consistent by changing how certain things work in class bodies it ensures that

    the this keyword is not accidentally pointing to the global object instead if the this keyword is not set it will be undefined which helps prevent bugs strict mode also stops you from making some common mistakes like creating Global variables by accident making the code easier to understand and less prone to errors so understanding abstraction with the programmer class abstraction and programming involves hiding complex implementation details and exposing only the necessary parts of an object this is commonly achieved through private properties and methods let’s apply the concept of abstraction to a programmer class where certain details like the programming language proficiency level might be internal to the programmer’s operations let’s consider the first approach where we achieve PR private properties through the naming convention so one approach is to use an underscore prefix to indicate a private property so if we create a programmer class and we have the Constructor picking a name in language then we can do this doore language language assign to language I’ll just add a comment here it’s not truly private just a naming convention so now if we were to instantiate it cons programmer new programmer passing in Steven and the language of JavaScript here I log out it do programmer doore language so here it outputs JavaScript so we still have Public Access but the use of the underscore indicates to the programmer that this is supposed to be a private property now there are issues with this and the issue is that this method relies on the naming convention and does not provide true privacy properties are still accessible from outside the class so let’s consider a second approach which uses es6 symbols a more secure way to implement private properties is using es6 symbols which provides a way to create unique identifiers so before I create my class I will saycore language instead it to a symbol value which is a unique identifier unique value so rather than setting it through notation underscore language I’ll use the square bracket notation and I’ll pass in the symbol as a key just to demonstrate this this is more private but still accessible through reflection so here if we try to access underscore language that’s not a property defined in it so we can actually access this but it is not straightforward but the demonstrate you could I will log out object. getet own property symbols it’ll pass in the identifier for our object let’s save that so here we see an array of symbols so using this if I want to get the value at the zeroth index I could do so so if I want to access that value at the zeroth index I can say cons language symbol it’s assigned to and not just cop this value over and the zeroth index so I can use this as the key in order to get the language do log programmer and then square bracket notation the language symbol and it outputs the value of JavaScript so here we see that this property is still accessible through the outside although it is not intuitive so some observations symbols provide a pseudo private mechanism as they are not accessible through normal property access methods however symbols can still be accessed through object. getet own property symbols so it’s not completely private so let’s consider private methods using symbols similarly you can use symbols to create methods that are not accessible directly via the class instance so let’s say if I were to define a symbol I’ll say underscore code and set that to a new symbol so unique value now I can create a private method so use square bracket notation then the symbol as the name of that method and then let’s log and I’ll say this.name is coding in and I’ll say thisor language and that with a period and a semic so in conclusion while symbols enhance privacy they do not provide a foolproof solution for private properties or methods for truly private class Fields es 2022 introduces private class fields and methods using the hash symbol or the hash prefix so this also called the pound symbol or Octor symbol but I’ll refer to it as the hash symbol and this is the best approach going forward for ensuring data encapsulation and adhering to the principles of abstraction and object orent programming so let me clear all this so we can start from scratch I’ll clear this out now we can say class programmer now I’ll create a private property name it language and here we see it as prefix with the hash symbol now let’s define our Constructor which takes in a name in a language and we do this dot language is assigned to the language and let’s set the name to this. name the name now we can define a truly private method we can do so with hash and then code so we can say log coding in thish language now let’s create an instance of this class so we’re creating a new object and memory programmer passing in my name and the language let’s log this programmer object and when we output it we can expand it and we see the name and the language now if we try to access the property of language let’s try doing that here programmer dot if I do hash and then language here we see the private fi hash language must be declared in enclosing class so in other words it is not accessible if wey to access it by language we get the value of undefined so this method ensures that the language property and code method are completely private it encapsulated within the programmer class and not accessible from outside this approach align closely with the principle of abstraction keeping implementation details hidden and interfaces clean and [Music] straightforward what are the benefits and limitations of using symbols for creating private properties in JavaScript classes you using symbols for private properties in JavaScript classes has benefits and limitations now the benefits are improve privacy symbols make properties less accessible through normal methods adding a layer of privacy another benefit is unique identifiers symbols create unique property Keys reducing the risk of naming collisions now the limitations the first limitation is that it is not fully private properties created with symbols can still be accessed using methods like object. get own property symbols another limitation is complexity using symbols can make the code harder to read and understand as accessing these properties isn’t straightforward how do private class Fields introduced in es 2022 improve data encapsulation compared to previous approaches private class Fields introduced in es 2022 improve data encapsulation by providing true privacy for properties and methods using the hash prefix the these private fields are completely hidden from outside access ensuring they can only be used within the class this prevents accidental or unauthorized access making the code more secure and easier to maintain compared to previous approaches like naming conventions or symbols which didn’t fully hide the data so your exercise is to implement private properties and methods with es 2022 in a grocery lless application in this exercise you will create a grocery list class and a grocery item class to manage a grocery list application the goal is to understand and apply the concept of abstraction by using ES 2022 private properties and methods this will help you hide the implementation details and expose only the necessary parts of these classes so let’s do a quick overview of the instructions for this exercise the first is to create the grocery item class this class should have private properties for the items name and quantity it should include a Constructor to initialize these proper properties and Implement a method to display the item details this method should be public and provide a formatted string of the items details second create the grocery list class this class should have a private property for the list of grocery items include methods to add an item to the list remove an item from the list by name and display all items in the list and ensure that the internal list of items is not directly accessible from outside the class now the third instruction is using es2020 to private properties and methods use the hash prefix to Define private properties and methods in both classes ensure that no implementation details are exposed outside the class so the example code here is the starting point for the grocery item in grocery list classes so we’ll create a grocery item class so we have a Constructor which takes in the name and the quantity now it will have a public method to display item details so I’ll name this display item now let’s create our grocery list class and I’ll scroll up so we can see it better so this will have a Constructor it will have a public method to add an item to the list so we name that add item and that takes in name and quantity we have a public method to remove an item from the list by name can name that remove item pass in the name as the parameter and a public method to display all items in the list name that display list so this is this is our starting point code so now the task checklist first Define the grocery item class create private properties name and quantity implement the Constructor to initialize these properties and implement the display item method to return a formatted string of the items details task number two Define the grocery list class create a private property items to hold the list of grocery item objects implement the ad item method add a new grocery item to the list implement the remove item method to remove an item by name implement the display list method to display all items in the list the third task is to test the classes create an instance of grocery list add multiple items to the list display the list to ensure items are added correctly remove an item and display the list again to ensure the item is removed correctly by completing this exercise you will gain hands-on experience with es 2022 private property and methods enhancing your understanding of abstraction and encapsulation in JavaScript so now for our grocery item let’s declare our private properties which is name and quantity now we will set these prate properties so this as name is set a name and this quantity is assigned to quantity now now to display the items we can log and actually I will have it return the value rather than log so I use back ticks and I can say item this and then hash name and then quantity this quantity so we’ve implemented that class let’s expand this so you can see a it better let’s scroll now we want to create a private property for our list of grocery items so we’ll name the items and we The Constructor is where we will initialize this array so this items assign to an empty array I’ll scroll that so for adding an item I will create a new grocery item object so item new grocery item passing in the name and the quantity so now I will push to the end of the array so item push adding that new item so now for the remove method say this items is assigned to this. items we use the filter method we pass in a callback function this is a predicate so the item. display item so that output here which includes the name and the quantity so if that includes I’ll use back tick item and then the name then in that case it would be filtered out in the case when it is not included and now to display everything I can say return this items. map then pass in our call back item display item and I can say do join and we’ll specify a new line so all the items will be displayed on their own line so now let’s resizes so we can see our console so now we want to create a new instance of the grocery list new grocery list grocery list let’s add some items so do add item so I’ll say apples the quantity of five and I’ll do shift option down arrow so to add bananas and we’ll specify the quantity to be three then we can call log grocery list dot display list let’s save that so here we see the expected output so it’s calling the display item method for each of them so now let’s remove an item so I can say grocery list. remove item so remove apples and then let’s copy this and we will call it again so now let’s say if I clear it and we run it again we see for the first output is apples and bananas and after we call the remove method it successfully just displays what is left in our grocery list which is bananas weak map provides a way to securely store private data for an object without preventing garbage collection when the object itself is no longer in use here’s how you can use weak map to implement private properties and methods within the programmer class so let’s define underscore language and instantiate a new week map and consor work new week map so this data type allows it to store key value pairs so now we will create a programmer class The Constructor will take in a name and a language so now we can set the name to be a public property but in this case we want the language to be private I’ll just add a comment here to better describe what we’re doing so store language in a week map with this as the key so I can set underscore language do set so here we are set in the week map so for the first argument we specify the object so in this case it would be the this keyword which refers to this current programmer object and we will specify the value being language right so the value that we pass in to the Constructor so now let’s store a private method in a week map so underscore work right this week map that we created up here we will set the this keyword referring to this current object and for the value we would specify a callback function So within it we will log use back ticks this.name is coding in do the weak map which is named uncore language. getet and the this keyword as its key so now we can save that so now let’s Implement a method named code so this is a public method and this will call the private method that we have stored in the weak map so I add a comment access and invoke the private method so underscore work which is the name of that week map call the get method and we pass in the this keyword so this current object which is the key and now we need to call or invoke this method so open and closing parentheses to call that method so now let’s create instance of this programmer class so I’ll say cons programmer new programmer with my name as Steven and the language of JavaScript and let’s call that public method code and we save that we see Steven is coding in JavaScript so we call the code method we this call the method defined in our weakmap which is a private method so let’s go over a discussion of the week map data structure and the benefits in usage so first is garbage collection A major benefit of using weak map is its handling of keys if there are no other references to a key object in this case an instance of programmer it can be garbage collected this helps prevent memory leaks and applications where objects are dynamically created and destroyed the second benefit is encapsulation using weakmap for storing private data ensures that these details are not accessible from outside the class this is much more secure than using properties prefixed with an underscore as these are only conventionally private third is Arrow functions and the this keyword Arrow functions do not have their own this keyword contexts instead they inherit the this keyword from the enclosing execution context within underscore work this refers to the programmer instance allowing access to the instance’s name and other properties securely stored in the week map so let’s consider an alternative with a single week map you can also group all private properties into a single weak map entry per object though this might make the code slightly more verbose short an example of that let’s comment out this implementation we will create a new one so I’ll say cons private props new week map so now we will create a new implementation of programmer so the Constructor takes in the name and the language let’s remove that underscore so our C braces now we will say private props move this up do set so for the key it is this current object so the this keyword and for the value we will specify a JavaScript object so here we will store key value pairs so we’ll specify the name the language so now let’s specify the work method so we’ll specify a call back so we will log back tick private props doget the this keyword and the property of the name is coding in private props doget the this keyword. language so now we Implement our public method code and this will call Private props doget this keyword and calling the work method so now when we output it we get the same expected result to in conclusion using weakmap for managing private data in JavaScript classes provides a robust way to ensure encapsulation and data security this approach is particularly useful in scenarios where data privacy is crucial and helps maintain clean API boundaries within your [Music] classes how does using weakmap for private properties and methods enhance data encapsulation and Security in JavaScript classes using weakmap for private properties and methods enhances data encapsulation and security by ensuring that private data is not directly accessible from outside the class this keeps the implementation details hidden providing a secure way to manage private data within objects what are the benefits of using weakmap in terms of garbage collection and how does this prevent memory leaks in JavaScript applications weak map allows objects to be garbage collected when there are no other references to them even if they have private data stored in the week map this helps prevent memory leaks by ensuring that memory used by objects no longer in use is freed up automatically what distinguishes week map from the es 2022 hash Syntax for private properties and methods and why might you choose to use week map weak map allows you to to store private data for objects without preventing their garbage collection when they’re no longer in use making it useful for managing memory efficiently the es 2022 hash syntax provides built-in support for private properties and methods making them truly private and not accessible from outside the class you might use weak map if you need private data that can be automatically cleaned up by garbage collection to prevent memory [Music] leaks so we’ll start by demonstrating how to store a private property in a programmer class using a weak map and then show how to define property accessors so let’s set language to a new week map and we’ll Define a programmer class so once again we have our Constructor setting the name in the language let’s remove that underscore we’ll set the name and the language with the weak map so but this operat Ator or this keyword rather for the current object and the language so this property is public and this is private now we’ll Define a method named get language in order to access this private property with the private value which is the language so we will return language doget and then the this keyword so we’ll create a new programmer so cons programmer is assigned to new programmer Steven and the language of JavaScript so now let’s call the get language method we need to call the console log so log and then programmer doget language save that and we get the value of JavaScript so now using object. Define property to define a getter for cases where you want the property to be accessible more like a property rather than a method you can use object. defin property so rather than calling the get language method we prefer to access it through a property named language so here we can set object. Define property so the first argument is the this keyword so this current object now we will name the property so this case I’ll name it to be language and then we’ll pass in an object so use the get keyword word set this to Anonymous function and here we return language. getet and this right so we don’t need this method anymore now we can access it through notation through this property that we created so rather than doing get language you can access it with language as that is the name of the property that we specified here so now when we call it let’s clear it actually and let’s say save it we get the expected result as this is calling this function defined here cleaner es6 Syntax for Getters and Setters in es6 Getters and Setters can be defined within the class body providing a more concise and readable way to access properties so let’s delete here we Define the property and let’s define a getter so we use the get keyword and then space and then the name of the property so we’ll name it language and this return returns right so we’re using the weak map here get and then the this keyword so now let’s define a Setter so we’ll set the language the parameter will be new language let’s move this up so if new language is falsy in the case when it’s an empty string for example then we’ll throw an error saying language cannot be empty and that with the semicolon otherwise we will update the value stored in the week map so set so the key is the this keyword so this current object and we’ll update the language all right so now we can access language as if it were a property so here let’s clear this when we save it we get the expected result so now let’s update the language so I can say programmer. language and I’ll set this to a new language such as python so let’s scroll up so let’s log this out programmer. language and I save it here I see the value has been successfully updated to be python as when we set this value so programmer. language is assigned to python we are calling the setter let’s expand this and I’ll discuss it so first let’s consider the weak map which we Define here this provides a way to securely store private data associated with an instance so object. Define property this method is useful when you need to create Getters or Setters that appear like properties but are backed by methods it allows for fine grain control over property characteristics es6 Getters and Setters these provide syntactic sugar that makes accessing and modifying properties intuitive and similar to accessing traditional class properties this method is particularly useful for validation logging or handling side effects during property access in conclusion these different approaches allow JavaScript developers to encapsulate and protect data within classes effectively ensuring the implementation details are hidden and that public interfaces are clean and easy to use using these features appropriately can help maintain and scale large code bases making your code more robust and easier to manage how do es6 Getters and Setters enhance the encapsulation and control of property access within classes es6 Getters and Setters enhance encapsulation and control by allowing you to Define methods that get or set property values this provides a way to add logic when accessing or modifying properties such as validation or transformation while keeping this syntax similar to regular property access what are the benefits of using the get and set keywords in es classes compared to traditional methods for accessing and modifying properties using get and set keywords in esess classes allows for more intuitive and cleaner Syntax for accessing and modifying properties similar to regular property access they also enable adding custom logic such as validation when getting or setting a property enhancing encapsulation and [Music] control so let’s cover inheriting and extending the programmer class we’ll start with a base programmer class that has a Constructor for initializing a programmer with a name and a basic method for coding so we’ll specify our class and our Constructor except a name now we’ll just set this name property and we have a simple method for coding so this will log out do back ticks this.name starts coding so we’ve implemented our Base Class so now let’s create a derive class which would be a front-end programmer so we will extend this General base programmer class to create a front-end programmer class that includes additional properties and methods relevant to front-end programming so Implement that just below it so it would be class frontend programmer and we’ll use the special keyword extends programmer so the derived class will inherit from the base class when we use the extend keyword and this is because the front-end programmer is a programmer so this is how you would achieve inheritance using the es6 class syntax so we inherit the properties and the methods from the base class so let’s create our Constructor function this accepts the name and we’ll specify an additional parameter which will be tools so we can call Super and then name and so this keyword super this calls the super class Constructor with the name argument so we’ll call this Constructor of the base class so let me add a commment here just to better describe that I’ll say calls the super class Constructor with the name now we’ll set the tools based on the argument passed in so I’ll add a comment to describe this as well I’ll say additional property specific to frontend F camers so now we will specify its own code method so we’ll say super . code so this calls the generic code method from the programmer based class and I we add additional functionality so I’ll log out I’ll use back ticks I’ll say this. name codes with I’ll say this. tools land it with a period and a semi let me extend this so we can see it better so now we can add methods specific to a frontend programmer so I’ll say design let me scroll up so we can see now I will log out back TI this.name also designs the user interfaces so here we see our derived class frontend programmer is a more specific version of the programmer Base Class and has additional functionality so now let’s use this deriv class we create an instance of the front end program class and we’ll demonstrate the use of both inherited and specific methods so I’ll say cons front and Dev assign to a new front end programmer I’ll pass in my name and I’ll specify the react JavaScript library as the tool so let’s resize it so we can see the output and I’ll say front end Dev and we call the code method we save it so here we see Steven starts coding and Steven codes to react so that first log statement Steven starts coding is implemented in the general or the base programmer class right that is because we called super. code and then we see it outputs the log statement in the front end programmer so I resize it when it says Steven codes with react so now let’s call another method I’ll say frontend dev. design Implement that and here we see this log statement we specified here which is Steven also designs the user interfaces so let me expand this and we can discuss it so we covered inheritance so the front-end programmer class inherits from the programmer Base Class gaining access to its methods while also being able to introduce new properties and methods or override existing ones like how we did with this code method we use the keyword for super so the super keyword is essential for calling the Constructor of the base class so in this case the programmer class from the derive class it ensures that all the initialization logic in the super class is properly executed before additional setup in the subass and we covered method overwriting the code method is overwritten in in front-end programmer to extend its functionality but it also calls the superclasses code method to maintain the general coding behavior in conclusion this example clearly illustrates how to effectively use inheritance in JavaScript to create a hierarchy of classes where derived classes extend and specialize the behavior of their base classes this pattern is crucial for structuring complex applications in a way that promotes code reuse and logical organization [Music] how is the super keyword used in the front-end programmer class the super keyword in the frontend programmer class calls the Constructor of the programmer Base Class ensuring that the name property is initialized correctly before adding more Properties or methods specific to frontend programmer what are the benefits of using inheritance when extending the programmer class to create the front end programmer class using inheritance to extend the programmer class allows the front-end programmer class to reuse existing code add new properties and methods and override existing ones making the code more organized and easier to [Music] manage let’s go over method overwriting with es6 classes we will start with a base programmer class that has a generic work method then we’ll create a specialized front-end programmer class that extends programmer and overrides the work method to add specific behavior so let’s Implement our Base Class so that will be a programmer we’ll implement the Constructor to accept a name parameter so this.name is assigned to name now let’s implement the generic work method so we’ll say log and tab back tick then this.name is solving problems so this is our Base Class which we will extend so we Implement class front and programmer extends the programmer base class because the frend programmer is a programmer so this accepts and name and we call the super classes instructor so comment initialize the Base Class part of the object and we will override the work method so we’ll call super. workor so this calls the Base Class method and now we will add our own specific functionality so I’ll say log say this.n name is also designing and implementing UI components so now let’s use our derived class say cons I’ll say Steven equals new front end programmer so it accepts a name parameter so we’ll pass Steven as the argument now we’ll say steven. and we’ll save it and here we see our expected output so calls super. work so calls the Base Class implementation of the work method so we see Steven is solving problems and then we will log out Steven is also designing and implementing UI components so let’s expand this so understanding the method lookup and the super keyword so method lookup when a method is called the JavaScript engine first looks for it on the object itself if it can’t find the method it walks up the Prototype chain to find the method in the parent class so in this case frontend programmer its prototype or its parent is the programmer Base Class and able to achieve inheritance through the extends keyword so using the super keyword the super keyword is crucial in subclass methods to call corresponding methods defin in the super class this feature allows subclasses to enhance or modify the behavior methods they inherit without completely rewriting them thus promoting code reuse and reducing duplication in conclusion by overriding methods and using the super keyword effectively you can ensure that subclasses not only tailor inherited methods to their specific needs but also leverage and extend the functionality provided by the super classes this approach is beneficial for maintaining logical and maintainable code and objectoriented JavaScript applications as it minimizes redundancy and ensures a clear and efficient inheritance structure [Music] what is method overwriting in es6 JavaScript classes method overwriting in es6 jvip classes is when a subass provides a specific implementation for a method that is already defined in its parent class replacing the parents method with its own version how does method look up work when calling a method method on an object in JavaScript when calling a method on an object in JavaScript the engine first looks for the method on the object itself if it’s not found it checks the object’s prototype and continues up the Prototype chain until it finds the method or reaches the end of the chain what is the role of the super keyword in a subclass methods in JavaScript the super keyword in subclass methods and JavaScript is used to call methods from the parent class allowing the subass to build on or modify the behavior of those methods so let’s summarize what we covered in this section es6 classes we explored how es6 class syntax provides a clearer more concise way to define Constructor functions and manage inheritance classes make the the structure of object ored JavaScript cleaner and more similar to other programming languages which helps in organizing code and improving readability hoisting the concept of hoisting was discussed to understand how JavaScript interprets function declarations and variable declarations differently we noted that function declarations are hoisted to the top of their containing scope allowing them to be used before they appear in the code static methods we learned about static methods which are called in the class rather than on instances of the class these methods are useful for utility functions that operate independently of class functions the behavior of the this keyword in different context was examined especially it can vary depending on the scope and the manner in which functions are called private members using symbols the use of ESX symbols as a way to somewhat hide implementation details was covered symbols provide a way to create properties that are not easily accessible from outside the class private members using weak Maps we discuss using weak maps to securely store private data for objects providing true encapsulation by ensuring that these details are inaccessible from outside the class and are eligible for garbage collection when no longer needed Getters and Setters the implementation and benefits of Getters and Setters were explored these are used to control access to the properties of an object allowing for validation logging and other side effects when properties are access or modified inheritance we covered how classes can inherit from other classes allowing for shared Behavior or across different types of objects and reducing code redundancy method overwriting the ability to override inherited methods was demonstrated showing how subclasses can modify or extend the behavior of methods defined by their super classes this section aimed to deepen your understanding of modern JavaScript features and best practices enhancing your ability to write clean maintainable and efficient JavaScript code in a professional development [Music] environment as app grow in size and complexity managing all the code in a single file becomes impractical and hard to maintain to address this issue it’s beneficial to split the code into multiple smaller files each encapsulating a specific functionality or feature these smaller files are called modules let’s go over the benefits of modularity the first benefit is maintainability smaller modular files are easier to understand debug and test the second benefit is code reuse modules can be reused across different parts of an application or even in different projects reducing code duplication the third benefit is abstraction modules allow developers to hide implementation details while exposing a clear interface making it easier to interact with the code practical implementation imagine you have a programmer class and its related functionalities divided across multiple modules for better organization you would place the programmer base class in its own file and for example the frontend program class in a separate file as these classes grow and gain more methods and enhance functionality managing them becomes easier since each class is in its own file or in other words its own module module systems in JavaScript historically JavaScript did not support modules natively and various Solutions were developed one of them being AMD which stands for a synchronous module definition this was primarily used in browsers and this format allows modules to be loaded asynchronously another module system is commonjs this is used in node.js and this format is designed for server side development another module system is UMD which stands for Universal module definition this combines the approaches of AMD and commonjs making modules usable in both the browser and node.js environments es6 modules with the introduction of es6 javasript now natively supports modules in the browser this system uses Import and Export statements to handle dependencies this course will cover commonjs for serers side applications and ESX modules for browser based JavaScript providing you with the skills to work flexibly with JavaScript in multiple environments in conclusion understanding and using modules and JavaScript not only improves the structure and maintainability of your code but also enhances its scalability and reusability by adopting modern JavaScript module standards like es6 modules and commonjs you ensure that your applications are robust maintainable and ready for growth what are the key benefits of using modularity in JavaScript applications and how do modules improve maintainability reuse and abstraction the key benefits of using modularity and JavaScript applications include maintainability this leads to smaller modular files that are easier to understand debug and test the second benefit is code reuse modules can be reused across different parts of an application or in different projects reducing code duplication the third benefit is abstraction modules allow developers to hide implementation details while exposing a clear interface making it easier to interact with The Code by organizing code into modules you make the application more manageable enhance its scalability and improve overall code quality how do commonjs and es6 modules differ and why is it important to understand both for developing JavaScript applications in various environments commonjs and es6 modules differ primarily in their usage and syntax with commonjs it is used in node.js for serers side development and it uses the require function to import modules and module. exort to export them with es6 modules this is supported natively in browsers and it uses Import and Export statements to manage dependencies understanding both is important because it allows you to work flexibly across different JavaScript environments using commonjs for Server applications and es6 modules for browser based applications ensuring compatibility and leveraging the strength of each module [Music] system modularity is a fundamental Concept in software architecture that helps organize code in a way that enhances maintainability reusability and scalability let’s apply these principles using the programmer class in a node.js environment so let’s consider the principle of cohesion cohesion refers to how closely related and focused the responsibilities of a single module are high cohesion within modules often leads to better code maintainability and understanding in the context of node.js you can create a module for the programmer class so each module and node.js has its own scope and anything defined in the module is private unless it is explicitly exported so let’s create new folder and I’ll name this undor nodejs now within it I’ll create a new file and I’ll name this programmer. JS So within it I can Define the programmer class so I’ll say class programmer Define my Constructor function so it takes in a name and the preferred language of the programmer so I’ll say this.n name and this. language now Implement a simple method for code which is just console log I’ll say this.name is programming in this. language and that with a period so now this class is only accessible within this file so within this module so we want to export it so a comment export the programmer class as the modules default export so in order to make this class available in other files I can say module. exports and will assign it to the programmer class so by doing this this makes this class the default export now I could also put it inside a JavaScript object and by doing this it now becomes a named export rather than a default export so I’ll undo that with command Z so now using the programmer module in another file I’ll create index.js and I want to utilize the programmer class in this file so I need to import that so I can do cons programmer and I will use the buil-in require function and pass in a relative path to where the programmer class is or the programmer module is so be4 slash meaning the current directory and the name of the file which will be program I can end that with a semicolon so now I can create an instance of a programmer so I can say const I’ll say Steven equals new programmer passing in my name and the preferred language of JavaScript and I can call step. code so the importation here utilizes the require function provided by Common JS in nodejs so nodejs refers to serers side environments so let’s bring up the integrated terminal and I’ll navigate to node.js and I will run the index file so node index.js and here we see outputs what we expected as the console statement so I log here the console statement defined in the code method so this was achieved through a default export now if I were to use a named export right so I put it inside a JavaScript object and save that in order to utilize this I would need to destructure it put it within curly braces now if I bring up the integrated terminal up arrow and run it again we get the expected result but in this case since we are just exporting one class it makes more sense to make it a default exporter clean this up the command D so encapsulation and privacy by structuring your application into modules and only exporting what is necessary you enhance encapsulation for example if there were private methods or properties within the programmer class these would not be accessible to Consumers of the programmer module who only receive what is explicitly exported so the encapsulation ensures that only the intended public interface of the programmer class is exposed and use in inclusion this lesson highlights the importance of modularity in software development particularly in node.js using commonjs modules by organizing code into cohesive modules and properly managing exports developers can create maintainable reusable and scalable applications the modular approach not only supports good software design principles but also ensures that each part of the application can evolve independently why is H cohesion important in software modules and how does it contribute to the maintainability and understandability of the code High cohesion in software modules means that the functions and responsibilities within a module are closely related and focus on a specific task this is important for two main reasons the first being maintainability modules with high cohesion are easier to update and debug since changes are localized to specific area with related functionality this reduces the risk of introducing errors elsewhere in the system the second reason is understandability high cohesion makes the code more intuitive and easier to understand when a module has a single well-defined purpose developers can quickly grasp what it does and how it works without needing to sift through unrelated code in summary High cohesion leads to more organized manageable and comprehensible code making the development process smoother and more efficient explain the concept concept of encapsulation in the context of modular programming how does using modules and node.js enhance encapsulation and what are the benefits of this approach encapsulation and modular programming refers to the practice of keeping a module’s internal details private and only exposing a limited necessary interface to other parts of the application and node.js using modules enhances encapsulation by scope isolation each module has its own scope meaning its variables and functions are not accessible outside unless explicitly exported by only exporting necessary parts of a module you control what other parts of the application can interact with reducing the risk of unintended interference and misuse now there are three main benefits the first is improv security sensitive or complex logic is hidden preventing unauthorized access and potential misuse the second benefit is the ease of Maintenance encapsulated modules can be updated or refactored independently without affecting other parts of the application and the third benefit is clear interfaces while defined interfaces make the system easier to understand and use promoting better code organization and collaboration in summary encapsulation via modules and no. JS leads to safer more maintainable and better organized code what is the Syntax for exporting a class or function as the default export in a commonjs module and how do you import and use this default ort in another file in commonjs to export a class or function as the default export you use module. exports to import and use this default export in another file you use the require [Music] function so for your exercise create a file named grocery item. JS and Implement a grocery item class with the properties of name and quantity then Implement a display method export that file or module and utilize it in index.js so for your exercise here in the node.js directory I’ll create a file and I’ll name it grocery item. JS So within it I’ll implement this class so it’s class grocery item then our Constructor so it’ll take in a name and quantity so I’ll assign these properties for the name and for the quantity and then we’ll have a display method so log and then tab back tick so I’ll say the interpolation of this.name times this. quantity so I implemented this simple class and now I want to export it so that I can import this class and utilize it elsewhere so module. exorts and I’ll make it a default export assign this to the grocer item class and so this enables me to import and utilize this class in other files so in the same directory I will create a file index.js and I will use the commonjs syntax to import it so I’ll say and the name of that export is grocery item assign to and I use the buil-in require function in commonjs and the directory is grocery item so now I can utilize this class grocery item as if it was defined in this file so I can say cons item new grocery item so the first parameter it accepts is name so I’ll say Apple apples as the the argument and for the quantity I’ll say four so now I want to call item. display let’s bring up the integrated terminal so I’ll do command J it’ll be control J on Windows and I will navigate to this file so I’ll run node index.js and here I get the expected output so let’s cover modularizing the programmer class using es6 modules in the previous lesson we use commonjs modules in order to Import and Export modules in serers side environments using node.js so with es6 modules this provides a modern and cleaner syntax in order to achieve the same thing for JavaScript files that run in web browsers so consider the scenario we want to ensure that certain properties of our programmer class such as skills are kept private and managed through a weak map we’ll separate the concerns into two modes one for the week map and the other for the programmer class itself so here in our directory _ practice I’ll create a new file and I’ll name this programmer skills. JS so this module will maintain a weak map to store private data related to programmers so let’s create that week map structure so programmer skills is assigned to a new week map so now we’ll create a function so I’ll name the set skills this will accept two parameters so a programmer object and the skills and we will just update the week map so it be programmer skills. set so the first parameter that we need to pass is the key so that would be the programmer object or instance and then the value so that will be the skills so now we’ll create another function for retrieving the value so we’ll name this get skills this accepts one parameter which will be the programmer and we’ll use that as the key in order to return the value so programmer skills. getet and then programmer as the argument so these functions are only available within this file so if we were to use commonjs syntax in order to export these two functions so we can use it elsewhere in our program we need to do module. exorts then a JavaScript object and specify set skills and get skills but with es6 modules we have a cleaner syntax to accomplish the same thing so we can remove this and just use the export statement so now both these functions are available to be used in other files so let’s create another file in our undor practice directory and I’ll name this programmer. JS so this module defines the programmer class and imports the functionality from programmer skills to manage skills privately so we use es6 module syntax to import those two functions so I’ll use the keyword of import and then curly braces set skills and get skills now we use curly braces because we are destructuring it so we use the from keyword and then we’ll specify the path to the file so it’s for slash for the current directory and then programmer skills. JS so now we can utilize these two functions in our class so it’ll be class programmer we’ll Define our Constructor function this accepts two parameters so the name and the skills so now let’s assign the name property and let’s utilize that function in order to set the skills and manage it privately so the first argument will be the this keyword meaning this current programmer object and the value will be these skills so let’s define another method I’ll name this code so this will log so Tab and then back ticks this.name is coding in then we’ll utilize the get skills function that we imported and pass into this keyword so this current programmer object so once again we will use the export keyword which is provided in es6 modules and we’ll utilize this in our index.js file so once again we use our import statement import the programmer from programmer. JS so let’s create an instance of this object I’ll say Dev new programmer the name of Steven and the skills of JavaScript so now we will call the code method so now in order to utilize ESX modules and have it executed in our web browser we need to update this script tag so instead of the type being text/javascript we’ll update this to be module so it’s treated as es6 module so let’s start live server so we’ll bring up the command pet with command shift andp then it’s live server open with live server and then we can inspect let’s go to our console and let’s resize this so here we see our expected output when we call the code method which is Steven is coding in JavaScript so another thing I want to show here in our program rjs file we exported our programmer class but we could also make this a default export so rather than using the export statement here I’ll remove that and I can say export default programmer so now when we go to our index.js file because it is a default export I can remove the curly braces and save it let’s see our output and here we see actually let’s clear against just so make it more easily viewable I can save it again and I get our expected output so this shows how we can use es6 modules in order to organize our code so as our applications grow in size we want to split up our functionality into different files so let’s cover some key points the first is modularity and privacy by separating the programmer class and its skills management into different modules we keep implementation details hidden and only expose what is necessary through exports es6 modules using Import and Export statements we can clearly Define dependencies and how modules interact this approach is cleaner and more maintainable than older module systems webpack and browser modules while modern browsers understand es6 modules natively complex applications might benefit from tools like webpack for abundantly modules managing dependencies and optimizing load times in conclusion this setup illust rates how to effectively use JavaScript modules to encapsulate logic manage privacy and expose a clean public API this modular approach not only AIDS in code organization but also enhances security and scalability and web development [Music] projects how do es6 modules enhance code maintainability and organization compared to older module systems es6 modules improve maintainability by providing a clear structure for defining and managing dependencies with Import and Export statements this helps keep the code organized and easier to manage what are the benefits of using tools like weback in conjunction with es6 modules for modern web development using tools like webpack with es6 modules helps bundle and optimize code managing dependencies more efficiently this improves load times and ensures that all necessary modules are correctly included making the development process smoother and the application [Music] faster so for your exercise use the es6 module syntax and create a file named grocery item. JS and Implement a grocery item class with the properties of name and quantity then Implement a display method export that file and utilize it in index.js so you imp imped this exercise previously and you use the commonjs module syntax in a node.js environment but in this case you implement these files and utilize it in a web browser so to implement this in the directory undor practice is where I have my index HTML file so I’ll create a new file grocery item. JS so I didn’t implement this in the previous lesson so to help us save time I’ll just copy this and I’ll paste it in here but currently I’m using the commonjs syntax but instead I want to use the es6 module syntax so I’ll make the grocery item class a default export so I can do that with export default and then grocery item so now I can import this in my index.js file so I’ll use the keyword import and then grocery item from grocery item. JS so now let’s create a new item equals new grocery item of bananas bananas and a quantity of five then I will call item. display and I will save it let’s resize this so we can see the web browser close the sidebar with command B and here I see the expected output of bananas times 5 in the landscape of modern JavaScript development especially when building browser applications the roles of transpilers and bundlers are crucial these tools help manage and adapt code for various environments ensuring compatibility and efficiency trans filers a trans filer is a type of tool that transforms source code written in one program language or version like modern JavaScript es6 into another version they may be more compatible with current environments such as older JavaScript es5 the old browsers can understand a popular transpiler is Babel one of the most widely used transpilers it allows developers to write modern JavaScript while ensuring that the code runs smoothly in environments that only support older standards for instance features like classes the let keyword the cons keyword Arrow functions and template literals introduced in es6 are not universally supported in older browsers so suppose you have a programmer class defined with modern JavaScript features using Babel this can be transpiled to be compatible with environments that do not support the latest JavaScript syntax now let’s consider bundlers a bundler Aggregates all the modules in your project and sometimes their dependencies into a single file or a few files this process is crucial for optimizing load times and managing resources efficiently a popular bundler is webpack webpack is the most popular bundler in the modern web development toolkit webpack not only bundles files but also minifies code and provides optimization like tree shaking which refers to removing unused code so an example with webpack you can configure webpack to bundle your JavaScript modules including the programmer class module into a single file this bundled file is then included in your web application ensuring that all script dependencies are resolved and manage efficiently so why would you use these tools well one reason is compatibility it ensures that modern code Works in environments that are not up to date with the latest ecmascript standards the second reason is performance it reduces the size of the code and the number of server requests required to load your application and third is for development efficiency it simplifies development by allowing you to use modern JavaScript features without worrying about browser compatibility while these tools are essential for browser applications due to their varied support for JavaScript standards across browsers nodejs environments generally do not require such tools for running JavaScript code AS no. JS is typically up to date with the latest JavaScript features however bundlers like webpack might still be used in nodejs applications for optimizing the application deployment in conclusion understanding and utilizing transpilers like Babble and bundlers like webpack is essential for any modern web developer looking to create efficient maintainable and compatible web applications they are especially important when the application needs to be scaled or maintain across different browser environments what is the primary function of a transpiler in modern javascrip development and why is it important the primary function of a transpiler in modern JavaScript development is to convert code written into newer versions of JavaScript like es6 plus into older versions like es5 that is compatible with a wider range of environments including older browsers this is important because it ensures that modern JavaScript features can be used by developers without worrying about compatibility issues allowing the code to run smoothly across all browsers how does bble help in making modern JavaScript features compatible with older browsers Babble helps make modern JavaScript features compatible with older browsers by converting newer JavaScript syntax and features like classes the let keyword the cons keyword and arrow functions into older syntax the all browsers can understand this process called transpiling ensures that code written with the latest JavaScript standards can run on any browser regardless of its version what role does a bundler like webpack play an optimizing web application performance and Resource Management a bundler like webpack optimizes web application performance and resource management by combining all your JavaScript modules and their dependencies into a single file or a few files it also minifies the code and removes unused Parts by utilizing tree shaking which reduces the file size and the number of server requests needed to load the application this leads to faster load times and more efficient resource usage why might nodejs applications generally not require transpilers like Babble but still benefit from using bundlers like webpack node.js applications generally do not require transpilers like Babel because node.js often supports the latest JavaScript features however it can still benefit from using bundlers like webpack to optimize performance by combining multiple files into one reducing file size through minification and managing dependencies more efficiently this makes the application faster and easier to deploy so let’s set up our JavaScript development environment so first we will cover installing essential tools with mpm before you start ensure that nodejs is installed on your machine as it comes with mpm which stands for node package manager this tool is crucial for managing ing third party libraries and development tools with mpm we can install open source packages to utilize in our projects so let’s open up the integrated terminal I can do that with command J or control J from Windows so ensure that no JS is properly installed by checking its version in the terminal I can do that with node DV and here I see I have version 20.1 16.0 so now let’s create a new directory for our project and we will navigate to it so rather than clicking on this icon I can just do that through the command line so I’ll do mkd for making a new directory and I’ll name it es6 actually I’ll name it underscore es6 hyphen tooling now I specified the underscore so that this directory shows up first when I view my project files in vs code so now let’s change directory into that new folder that we created so now we will create a package.json file so first let’s cover what Json is Json stands for JavaScript object notation and it is a lightweight data interchange format that is easy for us to read and write and easy for machines to parse and generate it is often used to transmit data between a server and web applications serving as an alternative to XML XML standing for extensible markup language so J Json is a more modern way to do this Json data is structured as key value pairs within curly braces and supports nested objects and arrays so let’s run the following command to create a package.json file in this new directory that we created and this file will help us manage all of our projects dependencies and other configuration so I’ll run mpm and then the keyword in it and then D- yes to accept all the default settings so after I run this this creates a new file named package.json to help manage by mpm dependencies so I can close this so here I see it is just a JavaScript object containing properties so now let’s focus on setting up Babble so this is to transpile Modern JavaScript and es6 plus to Backward Compatible JavaScript like es5 and we will use Babble to accomplish this so let’s clear this out so step one is is we want to install the necessary Babel packages you could also reference the documentation at Babel SL usage so now let’s install the necessary Babel packages using mpm these include Babel CLI Babel core and a preset package Babel preset environment which includes all the latest ecmascript features so we can do that with mpm install then app at Babble SL CLI then at Babble SL at Babble slash preset environment and we will specify a flag for Save Dev so it’s two hyphens save hyphen and then Dev and so what this does is that this installs the packages as developer dependencies so let’s discuss what these packages stand for so Babel CLI this provides the Babel command line interface for running Babel from the command line so Babel core this contains the core functionality of the Babel transpiler and Babel preset

    environment this includes plugins to enable Transformations for all modern JavaScript features so let’s run this so our packages have been installed successfully so I’ll do command K to clear this and then command D to close it and here we see our three developer dependencies have been installed and they are now listed in our package Json file so now we need to configure Babble so we want to update our scripts here so our scripts determine different command line scripts that we can run so I’ll add comma and I will name this script Babble so the value will be what command we want to run which will be Babble then index.js which will be our project file and we’ll specify the output with- o and it will be in the build directory SL index.js so let’s create a build directory in here so it be build and let’s create another file index.js so here we replace our es6 JavaScript and after transpiling it the result will be stored in the build directory so we also need to add a file and it will be period Babel RC so if you’re fixing it with a period this means that this is a hidden file so Babel RC is a configuration file used by Babel which is a JavaScript compiler to specify options and presets for transforming your JavaScript code the name Babel RC stands for Babble resource configuration so we just Define this object here so the key will be presets and the value will be an array with the string add babble /pret environment we can save that so let’s go back to our index.js file and let’s write code es6 which uses modern features so I’ll specify a class and I’ll name it programmer I’ll Define a public field so I’ll say the role of the programmer and we just assign this to developer that will Define a private field this is a modern syntax and I’ll name it experience so now let’s define our Constructor function this takes in the name this takes in the technology they work with and I’ll say experience so we will set the name we can set the technology they work with and let’s set the private field of experience so assign this to experience let’s fine I’ll close the sidebar so we can see the code better so command B I’ll name it develop and then this will log out back tick this.name develops software using this. technology with this. experience this is actually a private so I need to pass for it years of experience so we can save that and I have another method which is get experience for accessing this private field and this will return this uh experience and also we will export it so we use that export keyword so here we see this class is using the modern features of having a private field but this language feature is not supported in JavaScript es5 so that’s why we need Babble to transpile this index JS file to es5 syntax so let’s navigate again to our package Json and we have the script that we Define and so we can execute this from the command line and it will run this command specified here as the value so let’s bring up with command J or control J and I’ll run mpm run and then the name of the script which is Babel so here in our output if we view the build directory the result of transpiling this modern es6 code can be found here and this is the result of using Babble so this code is now usable for browsers that only support older versions of JavaScript so now let’s cover integrating webpack for more efficient builds while B is excellent for single files webpack is more suitable when your project consists of multiple files as it bundles all your Project’s JavaScript into one or few files webpack will Minify both your code and the final bundles to reduce file sizes minifying JavaScript code involves removing unnecessary characters like spaces comments and line breaks to reduce file size and improve load times without changing its functionality so step one for setting up webpack you will install webpack and configure it to work with Babble to handle the entire project not just individual files and second we can automate with mpm scripts so we now navigate back to package.json we will update package.json to include a script that runs webpack ensuring all your JavaScript files are processed through Babel and bundled correctly we will cover this in the next lesson so in conclusion by following these steps you set up a modern JavaScript development environment capable of handling es6 plus syntax and producing code compatible with older browsers this setup ensures that your development process is efficient and your applications are robust and maintainable [Music] what command do you use to initialize a new mpm project and what file does it create to initialize a new mpm project use the command mpm in it– yes this command creates a file named package.json which manages your Project’s dependencies and configuration why is Babel use in a JavaScript development environment and what does it transform Babble was used in a JavaScript development environment to convert modern JavaScript code so this refers to es6 and newer into an older version so this is es5 that can run in any browser this ensures that new features and syntax can be used without worrying about browser compatibility what is the purpose of the Babel RC file and how is it typically structured the purpose of the babble RC file is to configure Babel specifying how JavaScript code should be transformed it is structured in Json format and usually contains an object with properties like presets and plugins that Define which transformations to apply webpack is a powerful tool that bundles JavaScript files into a single file optimizing load times and simplifying deployments webpack is a very large topic and it’s a very configurable technology so this course lesson will just scratch the surface of his capabilities so that you are familiar with it and you can explore the documentation at web pack.jpg file or a smaller amount of files so Babel on the other hand transpiles modern JavaScript so es 2015 or newer into backwards compatible versions so that our code can successfully run on older browsers and while in development we can still utilize the newest language features in syntax of modern JavaScript so let’s continue with the project that we were working on in our previous lesson let’s bring up the integrated terminal with command J or control J and we’ll run MC TM install and we’ll install the package of webpack webpack CLI Val loader will specify the flag of save Dev and– Legacy pure dependency SS package web pack is a powerful module bundler for JavaScript applications it takes modules with dependencies and generates static assets representing those modules so webpack CLI this is a command L interface for webpack it provides commands to initialize run and configure webpack from the terminal so this package Babel loader this is a webpack loader that allows Babel to transpile JavaScript files it converts modern JavaScript code so es6 and newer into backwards compatible versions so es5 using Babble in this flag Legacy period dependencies this tells mpm to use an older algorithm for resolving peer dependencies which can help bypass conflict so we’ll install this so successfully installed we can view our package.json and here we see these packages have been added to our developer dependencies so now let’s create a webpack doc config.js file so we’re going to right click webpack doc config.js so it is not mandatory to provide a custom configuration file for webpack as it does have a default convention before this course we’ll create a simple configuration file so we want to use the commonjs module syntax to import a library so that’s path require and then path and then we would do module. exorts assign this to a JavaScript object and here we will Define our configuration so we can specify the mode so for now it’s just development we’ll Define the entry point of our application so we’ll say that is in source and then index.js and we will Define the output so after webpack bundles everything where will it Place those files so we’ll specify the path and here we will use this path that we imported and so what this will do is this will create an absolute file path to where we want the output to be so there’s a keyword so that’s two underscores and directory name and we’ll specify the name of the directory to be disc for distribution so with this configuration we’re basically telling weback after you bundle all of our files and Minify our code Place everything in a directory named disc and we’ll specify the file name of the output and OB be main.js so now we use module we will Define some rules because we want to utilize Babel so this actually an array let’s update that so now it’s the object and then test so it’s a regular expression of for slash 10 back SL period to escape it JS a dollar sign and then another forward slash so basically we’re telling webpack every JavaScript file or every file that ends with the JavaScript extension we can say exclude node modules so the node modules directory so we don’t want to include the dependencies and we can say use and we want to utilize Babel to transpile our es6 code into backwards compatible es5 code so we can save this so this is our custom configuration don’t worry about memorizing all this this is just to demonstrate what web pack is so you have more insight so here we Define the entry point of our application to be in the source directory in the index.js file but currently our index.js file is at the root of the project so let’s create a new directory and I’ll name it source and this will contain our source code so I will copy this into that directory so I’m going instance of this programmer class so I’m going to say cons Dev new programmer say the name of Steven the technology of JavaScript and the experience I’ll say 10 and I will call the develop method now let’s go to our package Json file we wanted to find another script so that we can utilize web pack so I will name the key to be build and the value to be webpack so last thing I want to do is I want to create an index HTML file so index.html at the root of the project so exclamation point and then tab and I just want to create a simple H1 tag and I’ll say using web Haack I also want to specify a script tag so this will be in the distribution directory and the output will be main.js so now let’s bring up the integrated terminal with command and J and I’ll clear this out so we want to run our build script so we’re going to run webpack so mpm run build so webpack successfully bundled our code for our very simple project so here we specified our output directory to be disc for distribution and so this is the output that webpack generated to create backwards compatible code so once again it’s because this modern synex that we use is not compatible with older web browsers so we use Babel to trans file our code into es5 syntax and so webpack is used to bundle our code for production so this is a really simple example because we just have one file but you can imagine as our projects grow and we have hundreds of JavaScript files then weback comes a mandatory tool to optimize your code for production so here we can see what was generated now I can also update this so if I go to the webpack configuration file I specifi the mode to be development let’s change this to be production and I’ll bring up integrated terminal and let’s run the build command again so here we see the code has been minified so everything is placed on one line and all theace es and new lines have been removed to make the file size as small as possible this will help make our application faster once it’s running in a web browser so we can see this in action and actually see this in a browser so I’ll resize this and let’s open up the integrated terminal and I’ll do open and then period so this will open up finder on my Mac so now I’ll drag my index HTML file and drag it to my browser so let’s close this out so here in our index HTML file I have the H1 tag saying using webpack so we see that here and in our script tag this is referencing the production code that webpack and babble generated for us so this code and so the code that we were using in development was utilizing the programmer class with modern es6 syntax I created an instance of the programmer and called the develop method so it logged this out let’s check that it did that in our browser I can bring that up with doing the developer tools we drag that over here in our console we get our expected log statement view our sources and here we see the production code that webpack generated for us so I can close this so this is a very quick and brief overview of webpack just so you have a better understanding of what it does so in conclusion using webpack and babble together simplifies the process of modern JavaScript development by bundling and transpiling your code this stream line setup ensures compatibility across browsers and improves developer efficiency so for more detailed and advanced configuration refer to the webpack documentation at web [Music] pack.jpg and maintain code by breaking it into manag ible reusable pieces we covered commonjs so we explore commonjs which is a standard for modularizing JavaScript that allows the encapsulation of functionality into reusable packages which has been widely used in nodejs es6 modules this section covered es6 modules a native JavaScript feature that supports static Import and Export of code offering a more integrated and optimized way to handle modules directly in the browser or in node.js environments es6 tooling this topic address various tools and technologies that support es6 development enhancing code compatibility across different browsers and environments Babel we discuss Babel a JavaScript compiler that allows developers to write modern JavaScript code that is then transpiled into Backward Compatible versions for better support across all platforms webpack the lesson on webpack provided insights into how this powerful tool bundles JavaScript files and dependencies into a single file improving s speed and efficiency each topic was designed to equip you with the necessary skills to effectively use modern JavaScript tools and practices streamlining your development process and ensuring your projects are robust and [Music] maintainable node.js is an open- Source cross-platform runtime environment that enables the execution of JavaScript outside of a web browser it’s primarily used for building servers set applications and networking tools node.js supports the development of back-end Services commonly known as apis this stands for application programming interface these are essential for powering client applications such as web and mobile apps so key features of node.js one of the key features is its versatility and backend development node.js is suited for creating highly scalable data intensive and realtime applications its non-blocking event driven architecture allows it to handle numerous simultaneous connections with high throughput making an excellent choice for developing services like chat applications and online gaming servers a second feature is that it is quick to start and agile friendly nodejs is known for its ease of use and minimal setup enabling developers to quickly start building applications this attribute aligns well with Agile development practices where time to Market and adaptability are critical another feature is real word usage prominent companies such as PayPal Uber Netflix and Walmart leverage no. JS in their production environments these organizations have reported benefits such as reduceed development time decrease number of code lines and files which in turn contribute to enhanced performance in terms of request handling and response times another feature of node.js is that it enables you to use JavaScript for your backend and front end this allows developers to use the same language for both server side and client side scripts promoting skill reuse and reducing the learning curve for new Developers it provides a uniform programming language across the stack which leads to a clearer and more consistent code base njs also has a rich ecosystem nodejs benefits from a vast ecosystem of open- source libraries available through mpm which stands for node package manager which simplifies the addition of functionalities and accelerates the development process in conclusion nodejs is a popular choice for developers looking to build efficient and scalable web applications its ability to run JavaScript on the server side along with its robust tooling and supportive Community makes it a dependable and practical choice for modern web development what is node.js node.js is a runtime environment for executing JavaScript outside of a web [Music] browser so let’s go over understanding runtime environments a runtime environment is a setting where programs are executed it provides built-in libraries and manages the program’s execution offering various services such as handling IO or network request so JavaScript and web browsers historically JavaScript was primarily used within web browsers each browser comes with its own JavaScript engine which interprets and executes JavaScript code so Microsoft Edge uses the chakra engine the Firefox browser uses the spider monkey engine and Google Chrome uses uses the V8 engine these different engines can lead to variations in JavaScript Behavior across browsers within a browser JavaScript interacts with the document object model otherwise known as the Dom to manipulate web pages using methods like document. element by ID with the ID being root for this example the evolution to nodejs in 2009 Ryan do the creator of nodejs proposed an Innovative idea which was enabling JavaScript to run outside the web browser he leveraged Google Chrome’s V8 engine known for its speed and embedded it within a C++ program this integration birth node.js which is essentially an executable or aexe program that extends javascript’s capabilities Beyond web browsers so node.js does not have browser specific objects like the Dom because it is not intended for controlling webpage content instead it includes additional modules that provide JavaScript the ability to interact with the file system create servers handle networ protocols and more for example fs. read file can be used for reading files from the system and HTTP create server for creating a web server these functionalities demonstrate that node.js is equipped to handle backend Services making it ideal for building scalable Network applications what node.js is and is not node.js is not a programming language it uses JavaScript as its scripting language node.js is not a framework it does not impose any specific way way of organizing your project it merely provides a runtime environment with useful libraries node.js is a runtime environment it extends javascript’s reach to the server side offering tools and libraries that are not available in a browser context in conclusion nodejs revolutionized javascripts programming by expanding its scope from the client side in browsers to include serers side applications this advancement has made JavaScript a versatile powerful choice for full stack development node.js continues to thrive as a popular runtime environment due to its efficiency and the vast mpm ecosystem which provides numerous libraries and tools to enhance [Music] functionality node.js operates on a non-blocking asynchronous model which can be likened to a highly efficient restaurant service so let’s consider a restaurant analogy think of node.js like a single waiter serving multiple tables instead of waiting for one table’s meal to cook before taking another table’s order the waiter keeps taking orders and serving food as it becomes ready this demonstrates the asynchronous operations that node.js supports so now a technical explanation of this in node.js when a request is made the request is processed without blocking other operations nodejs does not wait for the database response but instead places a call back in the event Q which will be executed once the response is ready this allows the node server to handle other requests in the meantime contrasting this with synchronous operations in more traditional synchronous models like those used by Frameworks such as Ruby on Rails each request might be handled by one thread if the thread is busy it cannot take on more work this can lead to inefficiencies as other requests have to wait until free threads are available or additional Hardware resources must be provided synchronous operations have blocking Behavior in such synchronous environments a thread handling a database query will remain idle until the data is returned which is inefficient compared to nodes a synchronous approach so let’s go over the benefits of the node.js model the first benefit is efficiency node.js can handle numerous simultaneous operations on a single thread thanks to its event driven model this increases efficiency as the server can manage multiple tasks without waiting for any single task to complete the second benefit is scalability the ability to handle many requests on few threads allows node.js applications to scale effectively without requiring significant Hardware resources this is particularly beneficial for Io intensive applications such as web apis or real-time data processing and the third benefit is Resource Management nodes model promotes better resource utilization as the server remains active and non-idle even when data operations are pending let’s consider ideal use cases for nodejs node.js is well suited for applications that that require real-time data processing such as an online gaming application chat applications and live streaming services it excels in environments where the application needs to handle a large volume of short messages or commands that require low latency let’s consider the limitations of node.js node.js is less ideal for CPU intensive task for applications that require intensive data processing task such as video encoding image manipulation or large scale mathematical calculations no JS might not be the best choice its single thread in nature means CPU heavy tasks can block the entire system leading to delays and processing other concurrent operations in conclusion node.js leverages an asynchronous non-blocking model to provide efficient and scalable solutions for many modern web applications while it excels in handling iio operations it’s less suited for tasks that are heavily CPU bound understanding when and where to use node.js can help developers maximize their application perform performance and [Music] efficiency how does node js’s a synchronous non-blocking model improves server efficiency and scalability compared to traditional synchronous models no. js’s asynchronous non-blocking model improves server efficiency and scalability by allowing a single thread to handle multiple requests simultaneous L unlike traditional synchronous models where thread waits for a task like a database query to complete before moving on no JS processes requests without waiting it places task in an event queue and continues handling other operations this approach prevents idle waiting maximizes resource utilization and allows node.js servers to manage more requests with fewer Hardware resources making them highly efficient and scalable what types of applications are ideally suited for nodejs and what limitations should developers consider when choosing it for their projects node.js is ideally suited for applications that require realtime data processing and handle many simultaneous connections such as online gaming chat applications and live streaming services it excels in managing a large volume of short low latency messages however developer should consider its limitations for CPU intensive tasks like video encoding or large scale mathematical calculations no js’s single thread in nature can cause performance bottlenecks in such scenarios making it less suitable for applications requiring heavy data [Music] processing node jss module system is a powerful feature that allows developers to organize the code of large applications efficiently modules are discrete units of functionality that could be imported and used in other parts of a nodejs application or even across different nodejs applications so what are modules a module and node.js encapsulates related code into a single unit of functionality this could be anything from a library of utilities to a set of related functions that handle specific functionalities like database interactions file operations or network communications so why do we need modules modules are essential for several reasons one reason is maintainability by dividing applications into smaller manageable pieces modules make the code base easier to understand and maintain the second reason is reusability modules can be reused across different parts of an application or even in different projects which reduces code duplication and effort the third reason is namespace management using modules helps avoid Global namespace pollution by confining variables and functions within a local scope rather than cluttering the global scope so how do modules work in node.js in node.js each file is treated as a separate module node.js provides a simple and efficient way to create modules and expose them to other parts of your application so step one of creating a module you can create a module by placing the code into a separate Javascript file for example if you creating a utility module you might have a file named utility. JS so step two is exporting module contents node.js uses exports and module. exports to make functions and objects available to other files for instance if our utility. JS file contains a function to check if a number is prime you can export it like this so Implement a function I’ll name it is prime this accepts a number as a parameter so I’ll implement this if the number is less than equal to one return false if the number is equal to two return true since two is prime now if the number is divis by two then we return false let N initialize that to three we’ll take the square root of the number so don’t worry about memorizing this this is just to demonstrate so while n is less than equal to the Limit if the number is divisible by n then we know that it is not Prime so update the value by two only want to consider odd numbers otherwise it is prime so to make this function usable outside of this file or outside of this module we need to export it so we use the commonjs syntax module. exorts is prime so now let me create another file and I’ll name this index J so step three is importing a module so we use the require function to include the module in another file so I can say cons is prime then the requir function I’ll pass in a relative file path to the utility and save that utility. JS now I can utilize that and say log is prime I’ll pass the number of five let’s bring up the integrated terminal and I will run node index.js say we see the output of true because five is prime let’s do the value of six for example run it and here we see the value of false so this demonstrates how you would Implement a function export it and utilize it in another file so creating your own modules creating your own modules is as simple as writing any regular Javascript file and then using module. exports to expose parts of the module to other parts of your application you can expose objects functions or any JavaScript data structure in conclusion understanding how to effectively use the node.js module system is crucial for developing scalable and maintainable node.js applications by leveraging modules developers can create well organized modular code that enhances code quality and development [Music] efficiency how does the nodejs module system contribute to the maintainability and scalability of large applications the node.js module system contributes to maintainability and scalability by organizing code into smaller reusable units making it easier to manage understand and update individual parts of a large application without affecting the entire code base what advantages does the modular approach in node.js offer in terms of code organization and reuse across different projects the modular approach and node.js improves code organization by encapsulating functionality into separate units reducing complexity it also enhances code reuse allowing modules to be easily shared and used across different [Music] projects in nodejs Global objects are special objects that are available in all modules these objects provide essential functionality that could be access anywhere within a node.js application making them a fundamental part of the node.js runtime environment let’s cover the builtin global objects node.js comes with a set of predefined global objects that are readily available for use these objects serve various purposes from fundamental JavaScript objects to node specific objects that provide functionality unique to the nodejs environment the first one we will cover is the global object this is similar to the window object in browsers Global is the top level object in nodejs almost all other objects are either properties of this object or derived from it let’s consider the process global object this is one of the most important Global objects in node.js it provides information about and control over the current node.js process through process you can access environment information read environment variables communicate with the terminal or exit the current process the console global object this is used to print information to the standard out and standard err it acts similarly to the console object in browsers the buffer global object this is used to handle binary data directly it is built specifically for managing streams of binary data in node.js now let’s consider Global functions which consist of set immediate clear immediate set timeout clear timeout set interval and clear interval these globals are timer functions that help you schedule task to run after a specified duration or at a regular interval creating your own Global objects while node.js manages a variety of built-in globals developers can also Define their own Global variables that need to be accessible throughout the application here’s how to define and use custom Global objects and noj s Step One is defining a global object you can attach your custom Properties or objects to the global object this makes them accessible from anywhere in your nodejs application so we’ll use the global built-in object We’ll add a property and I’ll name this my config let’s assign this to a JavaScript object close it with a semicolon so we’ll add the property API URL we’ll just do a sample URL of https api. example.com we another property so at Port 3000 step two is using the global object once a property is attached to the global object it could be accessed in any module without requiring Imports or passing it explicitly so we can log this out we’ll do log and then tab for that keyboard shortcut then we’ll do global then that property we just Define which is my config API URL I’ll bring up the integrated terminal so I use the keyboard shortcut of command andj or control andj I’ve already navigated to where this file is in this directory so I’ll run node and I name this file five Global objects and here we get our expected value which is that API URL value that we added so caution when using Global objects while Global objects can be incredibly useful for sharing information across modules their use should be minimized due to the potential for creating tightly coupled components and the difficulty in tracking changes throughout the application it’s generally better to explicitly pass objects you need within modules through module exports and require statements in conclusion Global objects and node.js are powerful tools for developing applications which shared functionalities understanding both built-in and custom globals can help you effectively manage application-wide settings and maintain State across various parts of your application however limited use of globals is recommended to maintain a clean and manageable code [Music] base how to buil-in Global objects and nodejs facilitate application-wide functionality and control buil-in Global objects in node.js provide essential tools that can be accessed from anywhere in the application allowing for easy control and management of the node.js environment they enable functionalities like Process Management timing operations and handling binary data without needing to import or Define them explicitly in each module this makes them crucial for application-wide tasks and system level operations what are the potential risk of using custom Global objects and node.js and how can they be mitigated using Global objects and node.js can lead to tightly coupled code making it harder to track changes and debug issues globals are accessible everywhere so unexpected modifications can cause bugs that are difficult to trace to mitigate these issues it’s better to minimize the use of globals and and instead pass needed objects explicitly through module exports and imports this keeps the code base cleaner more modular and easier to maintain Global objects provide essential functions and variables that could be accessed from anywhere within a JavaScript environment whether in a browser or a node.js application let’s go over common Global functions the first one being console.log this is a global function that outputs to the console useful for debugging and logging application data second is set timeout this allows you to schedule a function to be executed after a specified delay this function is very handy for executing code after a pause clear timeout this is used to cancel a timeout previously established by calling set timeout set interval this schedule is a function to be run repeatedly at specified intervals this is useful for tasks like updating the UI at regular intervals clear interval this stops the repeated execution set using set interval so let’s cover Global scope in browsers in browser based JavaScript the global object is window all Global variables and functions are attached to this window object accessing globals when you declare a variable or function at the global level it’s accessible through the window object such as window. set timeout or window. message Global scope and node.js node.js does not have a window object because it does not run in a browser environment instead it uses a global object to provide a similar functionality so let’s discuss node.js globals in node.js you can access built-in modules and Global functions through the global object such as global. console.log or global. set timeout so an example of that we to do global. console.log this is a global console call and that with the semicolon now if we were to run let’s save this and execute it we get our expected console output now let’s call set timeout set timeout so the first argument to pass is a callback function so we’ll specify an errow function here so I’ll say log and then tab I’ll say this happens after a timeout now for the second argument for the set timeout Global function we specify the time in milliseconds so I’ll say a th so after 1 second we’ll execute this again we get our expected output and then after 1 second we see this console output so both of these set timeout and console.log are available globally so let’s further discuss variables and Global scope unlike in browsers if you declare a variable with the VAR keyword let keyword or cons keyword at the global level in node.js it does not attach to the global object this Behavior encapsulates the variables within the module scope avoiding unintentional conflicts so for example let’s comment this out fire do let message sign to follow world and then we log that out say global. message clear this out with command K up arrow and run it we see the value undefined so even though this message variable was defined at the global level it is not attached to the global object so it is enclosed within this file within this module so let’s cover an example using set interval and end interval so we can comment this out let’s define a function and I’ll name it update time so we’ll set the current date so new date and then we will log it out so back ticks to create a template literal I’ll say current time and then our dollar sign and curly braces now. two local daytime string so now we will WR a comment set an interval to run update time every second right so every thousand milliseconds I’ll say cons interval ID set interval and you want to call update time every second so this returns an interval ID which we will use to cancel it so we want to eventually stop the interval and we’ll do so after 5 seconds so we’ll call set timeout once again the first argument is a callback function so we’ll use our modern Arrow function syntax and after 5 Seconds we want to clear the interval to stop it and we need to pass the interval ID then we can log out interval cleared no more time updates now for the second argument we’ll pass in 5,000 for 5 seconds so let’s run this we’ll clear this out run it so shows the current time every second then after 5 Seconds we see interval cleared no more time updates so let’s discuss best practices while Global objects and functions are extremely useful you should limit their use reason being is you want to avoid polluting the global scope adding too many objects to the global scope can lead to conflicts and difficulties in maintaining the code it’s generally better to keep Global usage minimal second is you want to use local scope where possible you want to encapsulate variables and functions within a local scope such as within functions or module to avoid uned interactions and make the code easier to manage and debug in conclusion Global objects and functions are fundamental in both browser and node.js environments providing developers with powerful tools for performing common task understanding how to use these tools effectively and responsibly is crucial for developing robust [Music] applications how do Global objects differ in scope and behavior between browser based JavaScript and nodejs environments in browser based JavaScript the global object is the window object and Global variables and functions are attached to it and no. JS the global object is named Global but variables declared with the VAR keyword Le keyword or con keyword are not attached to it rather they are scoped to the module or in other words the file that they are defined in this difference helps prevent Global scope pollution at node.js making it easier to manage variables and avoid conflicts what are the best practices for using Global functions and variables in JavaScript to maintain code quality and avoid conflicts best practices for using Global functions and variables in JavaScript include minimizing their use to avoid polluting the global scope which can lead to conflict and difficult to maintain code instead encapsulate variables and functions within local Scopes such as functions or modules to keep your code organized and reduce the risk of unintended interactions this approach helps maintain code quality and makes debugging easier in JavaScript defining variables or functions directly in the globos scope is straightforward but can lead to complications and larger applications so let’s consider the global scope in browsers in a browser environment when you declare a function or a variable using the VAR keyword at the top level it is added to the global scope which means it is accessible through the window object so for example if you were to use VAR say hello and assign this to Anonymous function that logs out hello you can access it with window. say hello so that will successfully call the function now problems with global scope while convenient using the global scope can lead to several issues the first being namespace pollution the global namespace can become cluttered with too many variables and functions making it difficult to track down where specific things are defined the second problem is accidental overwriting if multiple parts of an application inadvertently use the global variable names they can overwrite each other leading to bugs that are hard to diagnose for example defining say hello in multiple files will cause the class loaded script to override all earlier definitions so for example in file one if we have VAR say hello set to Anonymous function and in file two we have a function with the same name so here if in file two if that is imported after file one then when we call say hello this will always log hello from File 2 regardless of expectations so the importance of modularity to mitigate the risk associated with global scope it’s essential to adopt modularity in your development approach so let’s cover modules and node.js in node.js every file is treated as a module and anything defined within that file is local to the module unless explicitly exported this encapsulation ensures that variables and functions do not inadvertently interfere with each other across different parts of an application the benefit is that it is private by default variables and functions are private to their module providing a clean namespace and preventing accidental interference and second is explicit exporting to make a function or variable available outside its module it must be explicitly exported adding a layer of control over what is exposed so for example in a node.js file we Define say hello assign this to an anonymous function log and then tab and we just log out hello to export it we use module. exports set to hello so we have to explicitly export it so this function can then be accessed in another file by importing it so we need to use the require function and then we can invoke it which we properly call the imported function so let’s cover the advantages of using modules the first is Clarity each module has a clear purpose in scope reducing complexity and enhancing readability the second Advantage is reusability modules can be reused across different parts of an application or even in different projects the third Advantage is maintainability changes in a module are localized impacting fewer parts of an application and thus reducing the risk of bugs in conclusion avoiding Global variables and embracing modularity is crucial in JavaScript development especially in larger applications or when working in a team environment by using modules developers can ensure their code is organized maintainable and less prone to unexpected behaviors caused by namespace pollution [Music] what challenges can arise from using the global scope in JavaScript especially in larger applications using the global scope in JavaScript can lead to several challenges and larger applications including namespace pollution where too many Global variables and functions make it hard to manage code and accidental overwriting where different parts of the appli unintentionally use these same Global names causing conflicts and bugs that are difficult to track down this can result in code that is harder to maintain and debug how does modularity in JavaScript help in maintaining clean and manageable code bases modularity and JavaScript helps maintain clean and manageable code bases by encapsulating code into self-contained units which we refer to as modules each module has its own scope reducing the risk of name collisions and accidental overrides this makes the code easier to understand debug and reuse as changes in one module are less likely to impact other parts of the application it also promotes better organization and Clarity leading to more maintainable and scalable [Music] applications so let’s go over creating and managing a module in node.js in this lesson we go through the process of creating a simple logging module in node.js this module will encapsulate all the functionality related to logging messages and can be reused in different parts of your application or even in other applications so setting up the logger module so let’s create the module file so here in this directory which I named loading a module so right click and I’ll name this logger JS so second we will add the functionality so we want to specify the functionality we want to encapsulate in this file otherwise referred to as a module con URL and assign to http my logger.log and we’ll Define a logging function we name it log the parameter it will accept will be a message so in a rle scenario you might send an HTTP request here but in our case we’re just going to log to the console and we’re going to log this message now this function as well as this constant is only accessible within this file or within this module so we want to make the module contents public so once again since variables and functions in a node.js module are private by default you need to explicitly export any data or functions you want to make available to other parts of your application so for exporting the functionality we would use module. exports to make the log function and the constant right this URL available outside the module so we would do module. exports and we can name this export log and assign this to this log function we also do module. exports do URL and set this to URL alternatively you could rename exports to provide a more intuitive interface to module consumers so rather than naming this URL we could rename this to be endpoint so let’s cover some best practices for exporting the first best practice is selective exporting in rro applications modules can contain numerous variables and functions it’s crucial to export only what is necessary to keep the module easy to use and understand this practice helps maintain a clean public interface the second best practice is the stability of the public interface the public interface of a module should be stable and not expose too many implementation details this this approach ensures that changes inside the module do not affect other parts of your application that depend on it so now let’s use the loger module I’ll create a new file in this directory and I’ll just name this index.js so here we need to import it so I’ll say const logger but I’ll name it I’ll use the requir function and I’ll use a relative path to where the logger file or logger module is and now we can call that so I’ll say logger log I’ll pass on the argument this is a message right so when we call logger.log I go back to logger JS you’re is calling this function which we exported and I’ll also log out so I’ll say log logger endpoint which is this constant that we defined and we named it endpoint when we exported it so let bring up the integrated terminal and I’ll run node index.js and we get our expected console log output so in conclusion by creating modules and node.js you encapsulate specific functionalities and expose a controlled interface to the rest of your application this modularity enhances code reuse simplifies maintenance and keeps your application organized when designing modules it’s essential to consider what should be private to maintain module inte integrity and what should be public to ensure [Music] usability what are the benefits of encapsulating functionality into modules When developing node.js applications encapsulating functionality into modules in node.js helps to organize code making it more manageable and reusable it allows developers to isolate specific functions or data reducing the risk of conflicts and making the codebase easier to maintain modules also enable better code reuse across different parts of an application or even in other projects leading to a more modular and scalable development approach how does careful management of a module’s public interface contribute to the maintainability and stability of a nodejs application careful management of a module’s public interface in node.js ensures that only necessary functions and variables are exposed keeping the internal implementation details hidden this reduces the risk of unintended interference with other parts of the application and makes it easier to update or refactor the module without breaking dependent code it contributes to the overall maintainability and ability of the application by providing a clear controlled and stable interface for other modules to interact with so let’s cover loading modules and node.js with the required function node.js uses the requir function to import modules which is a fundamental aspect of managing dependencies and modularity of your application this system differs from how scripts are loaded in your browser and is specific to the node.js environment so cover the basic usage of the requir function when you need to use functionality Define in another file or module you use require to load it so here are the steps of how it works Step One is loading a module so to load a module you pass the relative path of the Javascript file to the required function nodejs resolves the path and loads the module so for example you would have con logger this will be assigned to require and then you pass in/ logger so in this case the logger file is in the same directory or in other words the same folder node.js automatically assumes JS as the file extension if it’s not specified second is accessing exported members the requir function returns an object that represents the exported API of the module this object contains all the members that are exported from the module so if we were to do console. log and then logger this would output that function you can then use these members in your application like how we did logger.log and passing in the message best practices for using require the first best practice is using the cons keyword for requiring modules it’s a best practice to use the cons keyword as this prevents accidental reassignment of the module variable within your code which can lead to runtime errors so if we were to import that with con logger attempting to reassign a constant will result in an error helping catch mistakes during development so if we were to sign it for example to the number one this will throw an error if logger is declared with the con keyword the second best practice is utilizing tooling for code quality tools like JS hint can be used to scan your JavaScript code for potential errors and bad practices running JS hint on your code can help identify issues like improper use of variables before they cause problems at runtime so in your terminal you would run JS hint and the name of your file so in this case app.js this tool will report problems related to your usage of JavaScript potentially saving you from bugs that are difficult to diagnose exporting a single function sometimes you want to export a single function from a module rather than an object this can simplify the usage of the module where only one functionality is being provided so if we have our logger function we can do module. exports and assign that to the log function so we’re exporting just the function and then when we utilize that in your application file we import it with cons log and utilize the required function and then we can simply invoke it by just calling log and passing in the message as the argument in conclusion the required function in nodejs is essential for modular programming allowing you to include and use JavaScript files and modules efficiently by following best practices for module loading and leveraging code quality tools you can ensure your node.js applications are robust maintainable and airfree what role does the require function play and managing dependencies and modularity within a node.js application the required function in node.js is crucial for managing dependencies and modularity by allowing you to load and use code from other files or modules within your application it enables you to break your application into smaller reusable components making your code more organized maintainable and scalable by importing only the needed functionality require helps keep your application structure clear and modular how can following best practices when using the require function contribute to the maintainability and reliability of a node.js code base following best practices when using the required function and node.js such as using the cons keyword for module Imports and keeping modules small and focus helps maintain a clear and consistent code structure this reduces the risk of Errors makes your code easier to understand and improves its reliability it also prevents accidental reassignment of modules and ensures that changes in one part of the code don’t unintentionally affect other parts contributing to a more maintainable and robust code base so let’s go over how nodejs processes modules node.js has a unique way of handling JavaScript code which differs significantly from how scripts are executed in a browser environment so let’s discuss module wrapping in node.js when node.js executes a module it does not run the code directly as written instead it wraps the module code inside a function this approach is not immediately apparent to the developer but it is fundamental to how nodejs operates so here’s what happens under the hood first is function wrapping each module is wrapped in a function before it is executed the function wrapper helps to isolate module from the global scope which means variables and functions defined in a module do not pollute the global scope so just to show an example of what this might look like we have in parenthesis can we Define function exports then require module and we’ll discuss this more in detail in this lesson just want to demonstrate a visual example of what this will look like directory name then the function block so your module code lives here let me rename this lives here so we to do say Con X assigned to below then we can log this out so when we Define these two statements so cons X assigned to a string and then logging it out node.js will implicitly wrap this module code inside a function so second is the module wrapper the function that wraps each module takes several important parameters which we specified here so the first is exports this is used to export module functions and variables the second is requir a function used to import the exports of another module the third is module which represents the current module next is the file name so two underscores and then file name so this refers to the file name of the module and then directory name so third is exporting from modules you can add properties to exports or module. exports to make them accessible to other modules like in our previous example when we did module. exports. log and assign this to the log function or we can do exports. log assign to log however replacing exports entirely won’t affect module. exports because exports is just a reference to module to exports using built-in modules node.js comes with a variety of built-in modules that provide rich functionalities like file system manipulation HTTP server creation and handling system pass these modules are essential tools for node.js developers and are thoroughly documented in the node.js API documentation so an example of using a built-in module here to do cons path and then we require the path let’s comment this out now we can get the path object so I’ll say path object sign two path dot parse then pass in file name and let’s log this out path object bring up our integrated terminal we’ll run this file and here it outputs this object showing my current file so in conclusion understanding how node.js executes module code and utilizes function wrapping provides a clearer picture of the runtime environment this process ensures that Global variables and functions from one module do not interfere with another fostering a more organized and secure coding environment furthermore node.js built-in modules are powerful tools that extend the functionality of node applications enabling developers to handle a wide range of system level tasks [Music] efficiently how does node.js module wrapping mechanism contribute to isolating module scope and preventing Global namespace pollution no. js’s module wrapping mechanism isolates each module scope by wrapping the module code in a function this prevents variables and functions defined in one module from leaking into the global scope reducing the risk of naming conflicts and ensuring that each module operates independently this mechanism helps maintain a clean and organized code base where Global namespace pollution is minimized making the application more secure and easier to manage what benefits do node.js built-in modules provide for handling system level tasks and application development no. js’s built-in modules provide powerful tools for handling system level task such as file manipulation network communication and managing paths these modules save developers Time by offering ready to use optimized functionality that integrate seamlessly with the nodejs runtime by using these built-in modules developers can efficiently manage system resources build robust applications and avoid the need to reinvent common functionalities leading to more secure maintainable and performant [Music] applications so let’s go over retrieving system information with the node.js OS module When developing applications that require system level data node.js provides a built-in module called OS which allows you to gather information about the underlying operating system so let’s cover using the OS module step one is to import the module so at the very start of file we’ll say cons we name it OS require and the name of it is OS for operating system so step two is to retrieve memory information so the OS module provides several methods to get system information such as os. tootal memory and os. free memory which Returns the total and free memory of the system respectively so we can do that const I’ll say total memory os. total M and then free memory os. free memory let’s log this out so I’ll say log I’ll use back tis say total memory and then hold on memory and I’ll do shift option and down arrow to copy this I’ll say free memory and let’s just copy and paste it here so open up the integrated terminal so that’s command J so let’s run this file with node and then the name of the file so here I get the expected output so this provides insights that are not typically accessible from client side JavaScript code which runs in the browser so in conclusion the OS module is a powerful tool in node.js for accessing operating system level information this can be particularly useful for applications that need to monitor or manage system resources using node.js developers can write server side code that interacts directly with the operating system offering capabilities beyond what is possible in a browser environment this makes nodejs a great choice for building more complex system sensitive backend [Music] applications how can the nodejs OS module be utilized to gather essential system information for applications that require insights into the operating systems resources the node.js OS module can be utilized to gather essential system information by providing methods to access details like total and free memory CPU architecture network interfaces and more this information is crucial for the applications that need to monitor or optimize system resources especially in server environments we’re understanding the underlying operating system can help in managing performance and resource allocation effectively the OS module allows developers to write scripts that interact directly with the operating system offering insights that go beyond typical client side capabilities what advantages does nodejs offer for building resource sensitive backend applications that need to interact with the operating system directly nodejs offers several advantages for building resource sensitive backend applications that need to interact with the OS directly it provides built-in modules like the OS module which allows access to system level information such as memory usage CPU details and network interfaces this direct interaction with the OS enables better monitoring management and optimization of system resources additionally node. js’s non-blocking I model makes it well suited for handling multiple tasks efficiently which is critical in resource sensitive [Music] environments so let’s go over understanding the node.js file system module node.js provides a powerful built-in module called FS for interacting with the file system this module is essential for reading from and writing to files on the server so first you would import the fs module so at the top of your script you can do const FS require and the name of it is FS for file system now let’s discuss the methods in the fs module so the fs module includes a variety of methods to handle file operations which comes in two primary forms the first being synchronous which is blocking and asynchronous which is non-blocking so for the first form which is the synchronous methods synchronous methods block the execution of further JavaScript until the file operation completes they are straightforward to use but can significantly slow down your application especially under heavy load so an example of this could be cons files and then fs. read directory sync so the pass in the current directory we can do console.log files so this will log all files in the current directory let’s run this and integrate a terminal so it’s node and the name of this file so here we see all the files in my current directory I’ll clear this out with command and J now the second form is asynchronous methods asynchronous methods on the other hand perform operations in the background and accept a callback function that runs once the operation completes this approach is non-blocking and allows node.js to handle other tasks while waiting for the file operations to complete so an example of reading directories asynchronously below I can do pass and also say async files just to give a different name so fs. rir directory first argument is the current directory and then it takes in a callback function so I’ll specify that to be an errow function so eror and then files So within it if there is an error and I will simply console log it so erir and then else console. log will say the result files so this will log the files once it’s read so let’s comment this up for now and let’s see the output when we do so asynchronously so once again we get the same result outputting all the files in my current directory so best practices for using FS methods the first best practice is avoiding synchronous methods in production while synchronous methods are easy to use and understand they should generally be avoided in production especially for iey operations a nodejs process runs on a single thread and using synchronous methods can block This Thread leading to Performance bottlenecks when handling multiple requests the second best practice is to prefer asynchronous methods asynchronous methods allow your node.js server to remain responsive by freeing up the main main thread to handle other requests while waiting for file operations to complete this approach is crucial for maintaining performance and applications that serve many clients simultaneously exploring the documentation for a complete list of available methods and additional details visit the official node.js documentation for the fs module this documentation provides comprehensive insights and examples for both synchronous and asynchronous methods in conclusion understanding and utilizing in the fs module and node.js is crucial for performing file operations effectively by preferring asynchronous methods you can ensure that your node.js applications remain efficient and responsive underload making full use of node. js’s non-blocking architecture what are the benefits and drawbacks of using synchronous versus asynchronous methods when performing file operations in node.js synchronous methods in node.js are easy to implement and use but they block the execution of further code until the operation completes which can lead to Performance issues especially under heavy load a synchronous methods perform operations in the background without blocking the main thread allowing the server to handle other tasks simultaneously this makes them more suitable for production environments ensuring better performance and responsiveness the draw call back is that they require handling callbacks or promises which can add complexity to the code why is it important to prioritize a synchronous methods for file system operations in production environments when using node.js it is important to prioritize asynchronous methods for file system operations and node.js production environments because they allow the server to remain responsive by freeing up the main threat to handle other task asynchronous operations prevent the application from being blocked by long running task which is crucial for maintaining high performance and efficiently serving multiple client requests simultaneously this helps ensure the application can scale and handle High loads without performance bottleneck so let’s go over understanding events and nodejs node.js is built around an event driven architecture primarily using an event Loop mechanism which makes it efficient for Io heavy operations so the core concept of events and node.js and event signify something that has occurred within the application for example when a server receives a request at a port it’s an event the nodejs runtime handles this event by generating a response so let’s go over using the event emitter class event emitter is a core class in node.js used for handling events within your application so here’s how you can use it step one would be importing the event emitter so first you need to import the event emitter from the events module so name this event emitter and I’ll use Pascal naming convention the require function and then events so step two is creating an instance so event emitter is a class and you must create an instance of this class to use it so this instance will manage the events for your application so we’ll name our object emitter use our new keyword to instantiate the new object so step three is registering listeners listeners are functions that are called when a specific event is emitted so use the on method to register a listener for an event so we’ll do emitter then the method on so we’ll name the event so this will be message log then we pass in a callback function so I’ll use the modern errow function syntax and we’ll just log out to the console and I’ll say listener call and save that so step four is emitting events the emit method is used to trigger an event when this method is called all register listeners for the event are invoked so we can do emitter do Emit and then we’re using the same name of the event for this event to have occurred so so it’s important to register listeners before emitting the event as they will not be triggered retroactively so let’s bring up the integrated terminal and we’ll run this file so here we see when we emitted this event it called the event handler which we pass in as the second argument here so let’s discuss event arguments events can also pass data to their listeners and you can send multiple parameters to The Listener function by passing them as additional arguments to emit so here we currently have an empty parameter list but we can specify this to be ar for example so let’s include that in our console log statement say R now when we emit it we could pass in an object so I can say the ID is one and the URL is Sten cod.com so now this second argument that we pass will be the argument that our event listener or event handler receives so let’s call this again and here we see we successfully passed data to our event listener so let’s discuss the Practical usage event emitter is widely used in node.js core modules like handling HTTP requests and web servers or reading files asynchronously developers can use this pattern to handle custom events in their applications enhancing the modularity and separation of concerns in conclusion the event emitter class is a fundamental part of node.js that helps manage events and listeners facilitating the event driven architecture that nodejs is known for proper use of this class can help you build robust and maintainable node.js applications by organizing operations around the handling of various system and custom [Music] events how does no js’s event driven architecture enhance the efficiency of handling IO operations node js’s event driven architecture enhances the efficiency of handling IO operations by using an event Loop

    to manage multiple tasks without blocking the main thread when an i operation is initiated node.js can continue processing other tasks while waiting for the operation to complete this non-blocking approach allows node.js to handle many concurrent operations efficiently this non-blocking approach allows node.js to handle many concurrent operations efficiently making it ideal for applications that require high performance and scalability and auto intensive environments what role does the event emitter class play in managing events and listeners within node.js applications the event mitter class in node.js plays a central role in managing events and listeners it allows you to create and handle custom events within your application by using event emitter you can Define events register listeners that respond to those events and emit the events when certain conditions are met this helps organize your application around an event driven architecture enabling more modular maintainable and responsive code especially in applications with a synchronous operations so let’s go over handling data with events and node.js when working with a node.js event and M class it’s common to send additional data about an event this can help listeners perform their tasks more effectively by providing them with the necessary context so let’s cover emitting events with data when triggering an event you can pass data as arguments to the emit method this data can be accessed by the event listeners so first we will cover passing multiple arguments while you can pass multiple arguments separately it is generally more manageable to encapsulate them in an object as we did in the previous lesson so I’m going make a copy of this so I’ll sh option and down arrow so in the previous example we passed all the data and capsulate within an object but we also can just pass them as an argument so passing in the ID value and the URL but this is less manageable as it has less context so we prefer to use an object because the name of the property indicates what this value represents so it’s not just a magic number right it has more context so by passing an object you can include multiple pieces of data under a single event argument which makes handling this data in listeners simpler and more organized let’s clear this out so now let’s cover registering listeners to handle data listeners can be set up to receive event data here’s how to define listeners to handle the data pass to them so using a function to listen for events you can Define listeners using either traditional function syntax or es6 Arrow functions both methods allow you to access the event data passed from the emit call so in the previous lesson we use es6 Arrow functions to copy this we could also used traditional function syntax so remove that arrow and this will work as well so in both cases the argument right so this parameter that we specified also commonly called event args or simply e represents the data object pass from the imit method so I remove this and we’ll stick with the more modern syntax so let’s go over a practical example which is a custom logging event so consider a scenario when you want to log custom messages so you can set up a specific event for logging messages and emit data related to those messages so let’s do we can comment this out since you don’t need that right now emitter Doon and we’ll name this event to be logging the pass in an eror function this accepts parameter of data and we’ll log out I’ll say receive message and we’ll do comma data. message so now we can emit a logging event with the message data so emitter emit so the name of this event which is logging we’ll pass in that data object which has a proper a message and I’ll just say hello so I’ll bring up the integrated terminal command J then the name of this file we run it with node and I get the expected console output when we call it emit for this event to occur so here the logging event is configured to pass an object containing a message and The Listener logs this message when the event is emitted so in conclusion using event emitter and nodejs to handle events with additional data is a powerful pattern for developing modular and responsive applications by encapsulating data in an object and passing it through events your application can maintain clear and manageable communication between different parts of your system this approach not only keeps your code organized but also enhances its flexibility and scalability how does passing data through events improve communication and modularity within a node.js application passing data through events in a nodejs application improves communication and modularity by allowing different parts of the application to interact efficiently it’s able to do so without direct dependencies it enables event listeners to receive relevant data when an event occurs promoting a clear separation of concerns this modular approach makes the code more organized flexible and easier to maintain as components can respond to events handle data independently what are the benefits of encapsulating event data in an object when using the node.js event M Class encapsulating event data in an object when using the node.js event emitter class provides several benefits it allows you to pass multiple related pieces of data as a single argument making the event handling code more organized and easier to manage this approach also enhances readability and scalability as the object structure can easily be extended to include additional data without altering the function signatures or logic it simplifies the communication between different parts of the application ensuring a cleaner and more modular [Music] design so let’s go over integrating event emitter into custom classes in Rob applications it’s uncommon to use event emitter directly instead you typically extend event em emitter in a custom class to encapsulate related functionalities along with event handling capabilities extending event emitter allows you to build self-contained components that can generate events and handle their own functionalities this is particularly useful for creating modules that need to perform actions and then notify other parts of your application that those actions have completed so we’ll go through the process of creating a logger class that extends event emitter to handle logging operations and emit events so Step One is defining the loger class we create a new directory and I’ll name this 15 custom class event emitter so in this directory I will create logo. JS let’s import event emitter this will be the base class that is from events so now we’ll Define our custom class which is lo ER and we want to extend the functionality CU logger is in an event emitter extends event emitter so it inherits all its functionality so now let’s define our log method the log takes in message as its parameter variable I a comment here and I’ll say logic to log and HTTP request or any message so do console.log of the message add another comment so I’ll say emitting an event when the log method is called so I’ll say this so This current object I’ll call emit since logger is an event emitter We inherited this emit method for to call or invoke an event this will call the event logged event and we’ll pass in the ID and the URL just say stepen craft.com just for example now once again this class is only available within this file or within this module so we need to explicitly export it so I’ll say module to exports on to logger so we’re exporting this class create a new file here and I’ll name it app.js and we want to utilize this logger class we just defined let’s import it so logger require it’s name logger I’ll instantiate it right so we’re creting a new instance of that log class that we defined a comment here and I’ll say registering a listener for the message log event right so we need to Define this event and listener before we call it right so we named it message logged so I’ll say logger do on message log for the second argument takes a callback function so we use the modern P6 errow function syntax log to the console and we will log out listener received an argument and now let’s actually call that log function so add a comment here I say calling the log method which will trigger the message logged event right so we’re calling this method that we Define here so I’ll say logger.log of not to say hello world let’s bring up the integrated terminal then I’ll navigate to this directory that I created with 15 custom and now I’ll run node app.js so here we see it logged out we go to the implementation of this it logged out the message which was hell world and then it logged out what we had in this event listener so listener received and then the data that we passed to it so let’s go over the benefits of this approach the first benefit is encapsulation the logger class encapsulates both the logging functionality and the event handling making it modular and easier to manage the second benefit is reusability by abstracting the event emitter Behavior into a class you can reuse and extend this class wherever needed without rewriting the event handling Logic the third benefit is maintainability having a dedicated class for logging and event emission helps maintain and modify logging Behavior independently from the rest of your application let’s go over a common mistake so a common mistake when starting with event emitter is to create multiple instances of the emitter when only one is needed or to bind listeners to different instances than the emitter that emits the event this is why encapsulating the event emitter within a class as shown ensures that the event listeners are correctly associated with the specific instances of the class that emits the events in conclusion by extending event emitter and custom classes like logger nodejs applications can handle complex functionalities while efficiently communicating events across different modules this pattern enhances the modular architecture of the application promoting clean and manageable code that aderes to Modern software design [Music] principles what are the advantages of integrating the event emitter class into custom classes when building modular components in node.js integrating the event emitter class into custom classes and node.js allows you to build modular components that can handle specific task and emit events related to those tasks this approach encapsulates functionality and event management within a single class making the code more organized reusable and easier to maintain it ensures that event handling is tightly coupled with the relevant functionality improving the overall architecture and communication between different parts of the application how does extending event emitter and custom classes enhance the reusability and maintainability of node.js applications extending event emitter in custom classes enhances reusability and maintainability by encapsulating both functionality and event management into a single self-contained mod modol this allows the class to be easily reused across different parts of an application or in other projects without duplicating code it also simplifies maintenance because the logic for emitting and handling events is centralized making it easier to update or modify without affecting the rest of the [Music] application so let’s cover creating a web server with no. JS node.js provides the HTTP module a powerful tool for developing networking applic such as web servers that listen for HTTP requests on a specified Port let’s cover the basic web server setup so the first step is to import the HTTP module the HTTP module includes the functionality necessary to create server instances so we can do cons HTTP require HTTP so the second step is to create a server use the create server method to create a new server the server can handle http requests and responses we do cont server assign to http create server step three is listening to events the server object created by HTTP create server is an instance of event emitter this means you can listen to events like connection for lower level Network events you can do server.on the event of connection and we’ll pass in our call back so the parameter will be socket and we’re using our modern es6 errow function syntax ended with the semar colon and for now we’ll just log to the console new connection and save that so step four is starting the server we’ll have the server listed on a port such as 3001 to handle incoming requests so we could do server. listen at 3001 and we’ll log out to the console listening on Port 3001 so now let’s run this and integrated a terminal so here we see it’s listing on P 3001 if we navigate to our web browser so now if I navigate to Local Host 3001 let’s resize this back in vs code we see it says new connection which is this console log statement here close this out and contrl C to stop this program so handling HTTP requests more efficiently while the above method works for simple demonstrations handling HTTP requests based on different routes can be done more effectively so step five would be refining the server to handle requests instead of listening to the connection event you can directly handle HTTP requests by providing a call back to create server that deals with request and responses so here where we called create server we pass in the call back function so the request and the response using our Arrow function syntax so if the request URL is at the index right so just a for slash we can do response. right hello world and who will end the response otherwise we can say if request URL is at API courses we can say response. right json. stringify we’ll just say an array of one two and three and response. end so let’s run this again up Arrow run so once again it’s listing on that Port you can navigate to it I’ll say Local Host 3001 and here we see hello world as specified and we did response. right now if we navigate to this path add this to the end and here we see this array that we specified here so this setup directly responds to http get requests at the root with the for slash as well as at API SL courses which sends a Json response in this case an array let’s close this with contr C close it out so using Express for complex applications for more complex web applications managing routes with the native HTTP module becomes cumbersome this is where Express a web application framework built on top of the HTTP module comes in handy so let’s discuss the advantages of Express the first being simplification of routing Express provides a much cleaner and organized way to handle different HTTP routes with minimal effort second Advantage is middleware support Express allows you to use middleware to respond to http requests handle errors and process data and third is enhanced server capabilities while Express uses the underlying HTTP module it simplifies many tasks and adds powerful new features and to discuss what an example of this might look like you need to utilize the express mpm module and create a package.json file after you import Express you can create an instance of of it by calling Express then you can Define the get request for both the root path as well as the API for/ courses path so in conclusion starting with node js’s HTTP module is great for learning the basics of network communications in JavaScript however for building more sophisticated applications such as a framework like Express can greatly simplify your code and enhance your server’s functionality making it easier to maintain and expand [Music] what are the benefits of using the node.js HTTP module to create a basic web server and when might you consider using a framework like Express instead using the node.js HTTP module to create a basic web server is beneficial for learning the fundamentals of network communication and handling HTTP requests directly it offers full control over the server’s Behavior with minimal overhead how however for more complex applications a framework like Express is preferable because it simplifies routing supports middleware and adds powerful features making the development process faster more organized and easier to maintain as the application grows how does the event driven nature of node.js influence the design and functionality of a web server created with the HTTP module the event nature of node.js influences the design and functionality of a web server by allowing it to handle multiple requests concurrently without blocking the main thread this non-blocking iio model ensures that the server can efficiently manage incoming connections and process requests as events responding to them asynchronously this design is particularly well suited for high performance applications where the server needs to remain responsive and scalable even under heavy load so let’s summarize what we covered for the node module system first we covered an introduction to nodejs this part of the course provides a foundational understanding of what node.js is and the benefits of using it then we cover node.js architecture we explain the internal architecture of node.js including its non-blocking event driven nature that allows for high performance across rward applications we did a deep dive into nodejs functionalities where we covered how node works so we learn more about the underlying Mech mechanisms that power node.js such as the event Loop and asynchronous programming we covered an introduction to the node module system where we discussed the modular structure of node.js applications emphasizing how modularity is achieved and managed we covered working with node.js modules which includes Global objects so this covers buil-in Global objects and node.js which are accessible across all modules covered modules and focus on the importance of modules and node.js for organizing and maintaining code we went through creat and loading modules we covered practical guidance on how to create your own modules and how to import existing ones module wrapper function this section covered how node.js wraps module code within a function to maintain module scope and privacy then we went through and covered specific nodejs modules starting with the path module so this introduces utilities for handling and transforming file paths the OS module which provides information about the computer’s operating system where the nodejs application is running the file system module so this demonstrated how to work with the file system for reading from and writing to files and the events module so we discussed the event emitter class and how to handle custom events and applications we went through more advanced Topics by covering event arguments which detailed how to pass and handle data with events using the event emitter then we extended the event emitter where we learn how we can enhance and customize the event emitter for more complex event handling scenarios lastly we covered the HTP module so this outlined how to to use node.js to create web servers and handle HTTP requests effectively in conclusion this section covered the fundamentals of how to use nodejs and its module system for building scalable and efficient applications by understanding and utilizing the core modules and Architectural principles of node.js developers can create robust backend services and applications suited for a variety of world world tasks [Music] in node.js development managing third-party libraries and modules is facilitated by package managers the two primary package managers used in the nodejs ecosystem are mpm which stands for node package manager and yarn so first let’s go over understanding mpm mpm is not only a package manager but also a registry that hosts a vast collection of free open source libraries these libraries can be easily integrated into your nodejs projects to add new functionalities let’s go over mpm Basics the registry visit npmjs.com to explore a wide range of packages available for various functionalities these packages are open source and free to use installation mpm comes bundled with node.js so when you install node.js you automatically get mpm installed on your system to check the version of mpm that you have installed in your system from the command line you can run mpmv So currently I have 10.8.2 installed on my system now to update mpm and to ensure that you have the latest features and security patches you can update mpm to a specific version globally using the following command so here I’m using a Mac so I’ll use the command sudu mpm install then the flag DG mpm at latest or enter my password this will update it so I use the latest version now we use mpm to install open source packages to add a package to your project you would use the command mpm install and then the name of the package so let’s discuss Global versus local installation by default mpm installs packages locally within your project however some tools need to be available globally to be run from anywhere on your system so you would do that with mpm install then use the flag – G and then the package name introduction to yarn yarn is another popular package manager that could be used as an alternative to mpm it was created by Facebook and is known for its speed reliability and improved Network performance installing yarn unlike mpm yarn is not bundled with no JS and must be installed separately you can install yarn globally using mpm so the command to install it is mpm install DG and then the package name which is yarn using yarn let’s cover how you can add a package with yarn similar to mpm you can add packages to your project with the command yarn add and then the name of the package why use yarn yarn caches every package it downloads so it never needs to download the same package again it also paralyzes operations to maximize resource utilization and thus install packages faster publishing your own package if you’ve developed a functionality that could benefit others you can publish your own packages to mpm making it available to the global node.js community so first you would prepare your package so ensure that your package is well documented has a clear readme file and includes all necessary metadata in your package.json file step two is publishing so you would run the commands mpm login after you loging with your credentials then you would run the command mpm publish in conclusion mpm and yarn are essential tools for any node.js developer they simplify the process of integrating thirdparty libraries into your projects manage independent effectively and helps you contribute back to the community by publishing your own packages whether you choose npm or yarn depends on your specific needs and preferences as both provide robust features to streamline development workflows what are the key differences between mpm and yarn in terms of speed reliability and package management features the key differences between mpm and yarn are speed reliability and package management so when covering speed yarn generally installs packages faster than mpm because it paralyzes operations and caches packages locally reducing the need for repeated downloads for reliability yarn ensures consistency by using a lock file which is named yarn. loock to keep track of exact package versions which helps avoid version mismatches so when considering package management yarn offers better off find support and more efficient dependency resolution while mpm is more integrated with the node.js ecosystem and its package registry how do package managers like mpm and yarn contribute to efficient dependency management and no. JS projects package managers like mpm and yarn contribute to efficient dependency management and node.js projects by automating the process of installing updating in organizing thirdparty libraries they manage versioning to ensure compatibility handle dependency trees to prevent conflicts and streamline workflows through commands for adding removing and updating packages both tools also maintain lock files to ensure consistent environments across different development setups making it easier to collaborate and maintain project stability so let’s cover setting up a node.js project with mpm when starting a new nodejs project one of the first steps is to set up a package.json file this file contains metadata about your project and manages the Project’s dependencies so let’s go over creating a new project directory I’ll open up the integrated terminal let’s expand this and we’ll create a new directory so mkd and I’ll name the directory mpm DDO we’ll change into that new directory now we will initialize our package Json file so before adding any node packages to your project you need to create a package.json file this file will track your project dependencies and store other important project information we’ll create this file by using the command mpm andit so mpm initialize so this command will prompt you to enter several pieces of information such as the Project’s name the version description the entry point such as an index.js file the test command repository keywords author and license so these details help Define and document your project so I have to say enter so the project name will be mpm demo the version is 1.0 the description I’ll say lesson on node package manager entrypoint index.js file test Comm I to say enter author I’ll say Steven Garcia license and I’ll say yes so now if we list that we see it has created our package.json file so let’s view this by expand here in mpm demo this is the package.json file that it created for us now let’s cover automating package.json creation if you prefer to skip the manual input and use default values for your package.json you can use the D- yes flag so previously we just did mpm and nit but instead you can do mpm andit D- yes so this command automatically fills in default values for all the fields in the package.json file speeding up the setup process so let’s cover the importance of the package.json file the first is Project metadata the package of Json file holds key information about your project which can be useful for package management and during deployment so let’s discuss dependency management it lists all the packages your project depends on allowing mpm to automatically install and manage these packages for you script shortcuts you can Define scripts and package.json that you can run with npm this is useful for tasks like starting the server running tests or custom build processes best practices one best practice is regular updates keep your package.json file updated as you add or remove dependencies update scripts or change project metadata Version Control include package.json in your version control system such as get Version Control to ensure that team members and deployment environments use the correct project settings and dependencies in conclusion the package.json file is a fundamental component of any nodejs project serving as the blueprint for managing the project settings and dependencies by starting your project with the creation of this file you ensure that all dependencies are correctly tracked and that your project metadata is well documented from the beginning this initial setup is crucial for maintaining a health manageable codebase as your project grows why is the package Json file crucial for managing dependencies and project metadata in a node.js project the package.json file is crucial in a node.js project because it serves as the central hub for managing project dependencies scripts and metadata it tracks all the libraries your project relies on ensuring consistent installation across different environments additionally it stores important project information such as the version author and Licensing details and provide scripts for common tasks making the project easier to manage share and deploy this file is essential for maintaining an organized and efficient code base how ises initializing a node.js project with mpm and knit contribute to better organization and maintainability of the Project’s codebase initializing a no JS project with mpm a nit contributes to better organization and maintainability by creating a package.json file that centralizes project metadata and dependency management this file keeps track of all libraries and modules the project depends on ensuring consistent setups across different environments it also allows you to Define scripts for common task making your workflow more efficient and the project easier to manage as it grows this structured approach prompts a well organized and maintainable code base from the start adding a third-party library to your node.js application integrating thirdparty libraries into your node.js project can enhance functionality without the need to write additional code libraries such as underscore provide a range of utilities for common programming task so Step One is choosing a library so begin by choosing using a library that suits your needs for instance underscore is a popular JavaScript library that offers helpful functional programming utilities you can search for underscore or other libraries on npmjs.com which also provides installation instructions and documentation for each package so step two is installing the library to add a library like underscore to your project use the mpm install command this command downloads the library from the mpm registry and adds it to your project so let’s open up the integrated terminal with command J we can run mpm install underscore alternatively you can use a shortcut mpm icore when you install a package using mpm two important things happen the first is an update to your package.json file so here when we install underscore it is added within the dependencies object this entry ensures that any one else working with your project repository can install the same dependencies and the second is Library storage the library files are downloaded and stored in the node modules directory within your project so here we see has created a node modules directory which contains our dependencies so step three is using the library in your application so after installation you can require and use the library in your application files so let’s create a new file in our mpm demo directory and name it index.js as that is the entry point of our application let’s close the sidebar now we can utilize the underscore Library so I’ll say require and underscore so by convention we use the underscore when using this library now we can say cons is even underscore and then the method sum so I’ll pass in an array 1 2 3 4 and five and for the second argument I’ll pass in a call back so a number if a number is divisible by two then we’ll log out let me make let me rename this to be is even then I’ll log out is even so this method sum checks if at least one of the elements is even let’s run this so I’ll say node index.js and here I see the output of true so in conclusion adding thirdparty libraries like underscore to your node.js projects streamlines development by allowing you to utilize pre-built functionalities this practice not only saves time but also enhances the capabilities of your application always ensure to use while maintained and trusted libraries manage your dependencies through package.json keep your projects organized and maintainable what are the key considerations When selecting and integrating third party libraries into a node.js project When selecting and integrating thirdparty libraries into a node.js project key considerations include ensuring the library is wellmaintained and widely used which indicates reliability and Community Support check for compatibility with your Project’s node.js version and evaluate the library’s documentation and features to ensure it meets your specific needs also consider the potential impact on your Project’s performance and security properly manage these dependencies in your package.json file to maintain an organized and maintainable codebase how does managing dependencies through mpm enhance the organization and maintainability of a node.js application managing dependencies through mpm enhances the organization and maintainability of a node.js application by automatically tracking all required libraries in the package.json file this ensures that all dependencies are documented and can be easily installed or updated by other developers or in different environments mpm also handles versioning preventing conflicts and ensuring consistent environments across different setups this structured approach helps keep the project organized and simplifies dependency management making the application easier to maintain over time using thirdparty libraries like underscore can significantly streamline complex operations and no JS applications so in our index.js file we imported our underscore Library so it’s common to use the underscore symbol as the variable name for this particular Library so the require function follows these steps to locate the under underscore module it first checks if underscore is a core node.js module failing that it looks for underscore as a relative or absolute path in the project lastly it searches within the node modules directory so the underscore Library provides a wide range of utility functions that are highly useful for working with collections arrays and objects for example to check if an array contains a specific item you can use the contains function so here I can comment this out so command and Port slash so I can say cons does contain uncore do contains so for the first argument I’ll pass an array containing one two and three and for the second argument I’ll pass the value two and let’s log out the result does contain so we’ll do up arrow and run and here we see the value true let’s say if I change this to be the value four then we would see that it does not contain the value of four to better understand all available functions and their uses in the underscore Library visit the documentation so when viewing this particular library on npmjs here when it says homepage you can view the documentation for the library that you installed so this can provide insights into additional methods and their potential applications in conclusion using libraries like underscore and nodejs projects helps to reduce the amount of code you need to to write while increasing functionality and readability it is essential for developers to familiarize themselves with importing modules and understanding the path resolution mechanisms of node.js to effectively manage and utilize various libraries this practice ensures your applications are both efficient and [Music] scalable what are the benefits of using thirdparty libraries like underscore and no. JS projects and how can they enhance the efficiency of your Cod cod using third party libraries like underscore and node.js projects provides ready-made utility functions that simplify complex task reducing the amount of code you need to write this enhances code efficiency readability and maintainability by leveraging well tested functions from libraries you can focus more on building unique features rather than Reinventing common functionalities leading to faster development and more robust applications how does understanding no. js’s module resolution process help and effectively managing and integrating external libraries into a project understanding no. js’s module resolution process helps in effectively managing and integrating external libraries ensuring that you know how node.js locates and loads modules this knowledge allows you to correctly structure your project avoid conflicts and troubleshoot issues related to module pass it also ensures that the right version of dependencies are used which is crucial for maintaining a stable and predictable development environment this leads to smoother integration of external libraries and more reliable application [Music] Behavior When developing applications with no JS managing external libraries and dependencies is commonly handled using mpm which stands for node package manager so here’s how you can install a package like axios which is widely used for making HTTP requests to apis so we’ll open up our integrated terminal let’s clear this out we’ll use mpm and then I for install and then the name of the package which is axios so this command fetches the package from the mpm registry and installs it into your project you can view our package.json file and here we see axos is now included in the dependencies object if we view our no modules we also see the axios has been installed here so you’ll notice that it contains not only axios but also several other directories these are dependencies that axios requires to function properly so we can close this directory and navigate back to our index.js file so let’s discuss dependency management so when considering the file structure in the past mpm used a nested structure where each package would have its own known modules directory containing its dependencies this often led to duplication and a deeply nested directory structure which would cause path L issues especially on windows so for the current approach now mpm installs all dependencies in a flat structure in the root node modules directory of your project this change helps avoid redundancy and the complications of deeply nested dependencies handling version conflicts if different packages require different versions of the same dependency mpm will Nest the conflicting version locally within the requiring packages directory to avoid version clashes at the root level so let’s discuss the benefits of the current approach the first being simplification the flat structure simplifies dependency management by reducing redundancy and the potential for version conflicts across your project the second benefit is efficiency it minimizes dis space usage and improves installation speed since mpm no longer needs to install multiple instances of the same package across different locations the third benefit is compatibility it reduces issues related to file pad limits on certain operating systems which is particularly beneficial for Windows users so let’s go over a practical example with the axos library so now that we installed it we can start using it in our nodejs application to make HTTP requests so here’s a simple example to include axios in our project so we can do const axios use our require function the name of it is axios let we close the sidebar so we can do a.get for making a HTTP get request and we’ll make a request to an open source URL so https Json placeholder do typec code.com SL too SL1 then we’ll do then cuz it returns a promise which we will cover in the next section so response then we want to log this out response.data we’ll also include or chain catch for handling if any err occurs so we will log out the air console. a air. message and we’ll end that with the semicolon also we need to add another parentheses here to get rid of those errors so let’s run this with node index.js and here we see the data that we retrieved from this backend endpoint so this object contains a user ID an ID a title and a property of whether it is completed or not for this to-do item so in conclusion installing and managing node packages with mpm is a straightforward process that enhances the functionality of your applications understanding how mpm handles dependencies allows you to better organize and optimize your projects by using tools like axios developers can easily make HTTP requests in their applications making the development process more [Music] efficient what are the advantages of mpm’s flat dependency structure in modern node.js projects particularly in terms of efficiency and compatibility mpm’s flat dependency structure improves efficiency by reducing redundancy as it avoids multiple copies of the same package being installed in different locations this structure also minimizes disc space usage and speeds up installation times in terms of compatibility it reduces the likelihood of Path Lane issues especially on Windows and simplifies dependency management by making the directory structure less complex and easier to navigate this approach leads to a more streamlined and manageable project setup how does understanding mpm’s dependency management process benefit developers when integrating external packages like axios into a node.js application understanding mpm’s dependency management process benefits developers by ensuring that they can effectively handle and resolve potential conflicts between different versions of packages required by their node.js application it helps maintain a clean and organized project structure preventing issues like redundant installations or version mismatches this knowledge is crucial when integrating external packages like axios as it ensures smooth installation compatibility and Optimal Performance of the application leading to a more reliable and maintainable code [Music] base so first let’s discuss the role of know mod modules so its role is the storage of dependencies so let’s go over managing node modules and nodejs projects when working with node.js the node modules directory can become quite large because it contains all the packages you’ve installed using mpm along with their dependencies here’s how to efficiently handle this directory especially in collaborative environments so node modules hold all the packages that your application needs to run which are installed based on the list of dependencies found in your package.json file so why exclude known modules from Version Control so when working with applications we use G Version Control in order to manage our project as well as collaborate with other developers now we want to exclude the no modules directory when working with virion control the first reason being is size considerations this folder can become quite large and grow to hundreds of megabytes or more due to the nested dependencies typical in node.js projects including it in vers control would significantly increase the size of your repository and slow down operations like cloning and pulling changes the second reason is reproducibility so every dependency and its exact version is already specified in our package.json file so here if I view that so this means that node modules can be recreated on any Machine by running mpm install so there’s no need to include it in Version Control so let’s discuss these steps to exclude node modules so we want to exclude the known modules when using get Version Control and this is essential for keeping our repository clean and lightweight so I open up the integrated terminal with command J so in this course I won’t cover get Version Control in depth I’ll just provide a quick explanation of how you can exclude no modules so we can initialize get in our current project so I’ll say get a nit so this initializes a new get repository so we can now use Version Control to manage our project we can do get status and we can all the files in our project now we want to create a dog ignore file so this file tells G which files or directories to ignore in your projects so I’ll create that here I’ll say touch. get ignore so let me close this with command J and we’ll view this file we just created so this is a hidden file and that’s why I prefix it with a period so we want to add the following line and this will specify that the node modules directory should not be tracked by git so I’ll say say node modules and then slash indicating the directory so we save this so now when we run get status to see what files are in our project here it doesn’t include the node modules directory so we can now add and commit our changes so we will add our changes to the staging area so we’ll say get ad and then period meaning all files let’s do get status again and here we see our project files are now staged and ready to be committed so we can do get commit Das message and I’ll name it initial commit so now these files are being tracked and I can collaborate with other developers who also have access to this project and are using get Version Control so let’s discuss restoring no modules if you clone the project or need to restore dependencies simply run mpm install in your command line so this command looks at your package.json file and installs all the necessary packages from the mpm registry so in conclusion excluding known modules from Version Control is a best practice in nodejs development it keeps your project repository manageable speeds up operations like cloning and ensures that all developers are working with the same dependencies as defined in package.json so this approach Fosters a clean more efficient development environment [Music] why is it important to exclude the node modules directory from Version Control and how does it benefit the management of a node.js project it is important to exclude the node modules directory from Version Control because it significantly reduces the size of the repository making operations like cloning and pulling changes faster the node modules can can be recreated at any time by running mpm install which installs all necessary dependencies based on the package.json file this approach ensures that everyone on the project works with these same dependencies while keeping the repository clean and efficient to manage what are the best practices for managing dependencies and restoring them in a node.js project particularly in a collaborative environment best practices for managing dependencies in a node.js project include using a package.json file to track all dependencies and their versions this ensures consistency across different environments in collaborative environments it’s crucial to exclude the known modules directory from Virg control to keep the repository lightweight and avoid unnecessary duplication to restore dependencies use the mpm install command which installs everything listed in package.json ensuring all team members work with the same setup reducing the risk of conflicts or errors so let’s cover understanding semantic versioning and nodejs semantic versioning is a standard for versioning software which is widely adopted in the development Community including nodejs packages it helps developers understand the potential impact of updating a package so let’s discuss the components of semantic versioning a typical version number format includes three components the first being the major version the minor version and a patch version so for the major version this indicates significant changes that make API changes which are not backwards compatible upgrading to a different major version could break existing functionalities so for the minor version this adds new features in a backwards compatible manner it does not break or change existing functionality but adds to it and for the patch number this includes bug fixes and minor changes that do not affect the software’s function ality or API so it’s also backwards compatible so for example for the axios package that we installed one is the major version seven is the minor version and five is the patch version let’s discuss the carrot and the Tilda inversion name so here we see the semantic version number is prefix with a carrot so when you see a carrot in front of a version number in package.json it means mpm can install updates that do not modify the leftmost nonzero digit in the semantic versioning string so here for this particular example so here when considering axios since it is prefixed with a carrot it can install any version as long as the major version does not update even if the minor or patch version is higher than specified in our package.json file now you may also see a Tilda symbol so a Tilda allows updates that only change the most right-and digit that is not zero in the semantic versioning string assuming that the most right hand digit is the patch version so for example if the version was 1.3.6 mpm can update to 1.3x where X is any patch number greater than six this means you get bug fixes and minor changes that are unlikely to break your project so we can discuss installing packages with mpm so when someone CLS a repository and runs mpm install mpm installs the dependencies based on the rule set in the package.json file using the Carro symbol or tiled operator this allows for a controlled upgrade path that balances stability with getting timely patches and features specifying exact versions in some cases especially when ensuring absolute consistency across environments or dealing with very sensitive dependencies you might want to pin dependencies to an exact version to do this you can specify the version without any prefix this configuration guarantees that no version larger than the semantic version number specified will be installed avoiding any issues due to minor updates or patches in conclusion understanding how semantic versioning works with mpm helps manage dependencies more effectively ensuring that applications remain stable while still receiving necessary updates and Bug fixes it allows developers to control the risk associated with automatically updating packages and ensures that all team members and production environments run the same versions of each package how does semantic versioning help developers manage dependencies and ensure stability and node.js projects semantic versioning helps developers manage dependencies by clearly indicating the impact of updates through version numbers it uses three components a major minor and Patch to Signal the type of changes made major versions indicate breaking changes minor versions add new features without breaking existing functionality and Patch versions include Backward Compatible bug fixes this system ensures that developers can update packages safely maintaining stability while still receiving important updates and fixes reducing the risk of unexpected issues in your project what are the implications of using the carrot symbol or toota operator inversing when managing package updates and no. Js using the carrot inversing allows updates to minor and Patch versions while keeping the major version stable ensuring backwards compatibility the Tilda operator restricts updates to only patch versions keeping both major and minor versions fix these operators help manage package updates by allowing controlled upgrades the carot symbol offers more flexibility by permitting minor updates while the Tilda operator provides stricter control reducing the risk of breaking changes this helps maintain stability while still applying necessary updates so let’s discuss checking installed versions of a nodejs package so when managing a nodejs project it’s essential to keep track of the versions of packages installed to ensure compatibility and stability so here’s how you can determine the versions of the packages you have installed so viewing installed versions the first thing you can do is manual checking sometimes you may want to manually check the version of a specific package installed in your project this could be done by looking at the package.json file within each package’s directory and know modules so if I were to expand know modules and View axios and then package.json I see that the exact version installed is 1.7.5 so if I close this now we get back to our package at Json so the second way that you can check your installed version is using mpm commands so this is a more efficient way to view all installed packages and their versions by using the mpm list command so this displays the tree of packages installed in your project running this command in your project directory will show you a tree structure of all packages including their dependent packages so let’s open up the integrated terminal and we’ll run mpm list so this is a small project so we see our two mpm packages that we have in installed however this output can be extensive because it includes all nested dependencies in the case when we’re considering a large production application so the third way that we can check the version that we have installed is by running mpm list and then depth set to zero so if you’re only interested in the top level packages so those directly specified in your projects package at Json you can simplify the output using the depth set to zero option so this command restricts the output to the first level of the dependency tree showing only the packages that you have directly installed in your project so why this matters the first reason why this matters is compatibility knowing the exact versions of the packages you have installed helps manage compatibility between different parts of your application and its dependencies the second reason is debugging when troubleshooting issues in your application knowing the exact versions can help determine if a specific version of a package might be causing the problem the third reason is updates and upgrades regularly checking installed package versions can help you decide when to upgrade to a newer version and take advantage of new features or important bug fixes in conclusion effectively managing package versions in a node.js project is crucial for maintaining the stability and reliability of your applications using tools like mpm list helps streamline this process are providing a clear overview of what is installed thus enabling better version control and dependency management by routinely checking and upgrading your dependencies you can ensure your application remains secure efficient and up to [Music] date why is it important to regularly check the versions of installed node.js packages in a project regularly checking the versions of installed node.js packages is important to ensure compatibility and stability in your project it helps you identify potential issues caused by outdated or conflicting dependencies and allows you to take advantage of security patches bug fixes and new features keeping track of package versions also AIDS in debugging as knowing the exact versions can help pinpoint problems related to specific updates or changes in the package ecosystem this practice contributes to maintaining a reliable and secure application how can using npm commands help streamline the process of managing and verifying package versions in a node.js project using mpm commands streamlines managing and verifying package versions by providing quick and detailed insights into the installed dependencies commands like mpm list display all installed packages and their versions while options like the depth set to zero focus on top level dependencies making it easier to track and manage them this approach helps ensure your project remains stable and up toate by allowing you to easily monitor an update packages as needed all from the command line when working with mpm packages it is often necessary to understand their dependencies versions and other metadata to ensure they fit well within your project so let’s go over viewing package metadata on npmjs.com so here on the mpm official website search for a package you’re interested in such as axios so in this input field I’ll look up axios we will click on the official package so on the package page you will see comprehensive details including the latest version the licensing the GitHub repository the number of weekly downloads and the package dependencies so using mpm commands to view package information for a more direct and detailed exploration of a package metadata you can use mpm commands so open up the integrated terminal with command and J move this up so to see a summary of metadata for a package directly in your command line you can use the mpm view command so I’ll do mpm View and then the name of the package so this case it’s axios so this command let’s move this up so this command outputs information such as the latest version the description of the package the main entry point the repository keywords the author the license now let’s go over viewing dependencies if you’re specifically interested in what dependencies a package has you can directly view that information by typing in mpm view the name of the package so axios and then dependencies so this will list dependencies required by axios showing you what packages it relies on to function so checking available versions to view all versions of a package that have been published to mpm you can use mpm view the name of the package and then versions so this is particularly useful if you need to upgrade or downgrade to a specific version it lists every version available helping you make informed decisions based on the features or fixes included in each so a practical usage of package information the the first practical usage is for making upgrades knowing the version and dependencies can help you decide whether to upgrade a package you can assess the changes between versions and determine if the upgrade addresses any issues you face or offers new features you need compatibility checks viewing dependencies ensures that the package is compatible with other components of your application especially if there are specific versions of dependencies that your application requires debugging and issue resolution detailed metadata can assist in debugging issues related to package configurations or interactions between multiple packages in conclusion understanding how to retrieve and utilize metadata about mpm packages is essential for Effective package Management in no. JS projects whether it’s through browsing npmjs.com for a high level overview or diving deep with mpm view commands for specific details these tools provide critical insights that help maintain the health and functionality of your application [Music] why is it important to regularly check the dependencies and versions of mpm packages in a nodejs project and how can this practice impact the stability and compatibility of the application regularly checking the dependencies and versions of mpm packages in a node.js project is crucial for maintaining stability and compatibility it ensures that all packages work well together preventing conflict that could arise from incompatible versions this practice also helps identify when updates or security patches are needed reducing the risk of bugs or vulnerabilities by staying on top of package versions developers can keep the application reliable and ensure it runs smoothly across different [Music] environments When developing applications you might occasionally need to install a version of a package that isn’t the latest due to compatibility issues specific features or other dependen in your project this can be accomplished easily using mpm commands specifying package versions to install a specific version of a package append the version number to the package name using the at symbol for example to install a version 1.7.3 of axios you would do mpm install axios then the at symbol 1.7.3 so this command tells mpm to fetch and install the exact version of axios from the mpm register so verifying installation after installing the package it’s a good practice to verify that the correct versions have been installed you can use the mpm list and then the flag D- depth set to zero command to check the versions of the top level packages installed in your project so we can do npm list D- depth and set that to zero so this command provides a list of all packages directly installed in your project ignoring their dependencies and specifies their version numbers it allows you to quickly verify that the correct versions are installed so why specify versions the first reason is compatibility certain projects or dependencies might require specific versions to maintain compatibility breaking changes in new versions could disrupt the functionality of your application the second reason is bug fixes some versions might include bug fixes not present in newer versions or new versions might introduce bugs that were not present in previous versions and the third reason is for features older versions might have features that have been deprecated in the latest release but are still necessary for your project in conclusion understanding how to specify and install particular versions of packages with mpm is crucial for precise dependency management and software development this practice helps ensure that your application remains stable and behaves as expected regardless of changes and updates in the package ecosystem by specifying package versions you maintain control over your development en and reduce the risk of unexpected issues why might a developer need to install a specific version of an mpm package how does this practice contribute to project stability a developer might need to install a specific version of an mpm package to ensure compatibility of other dependencies maintain access to certain features or avoid bugs introduce and newer versions by specifying and controlling the exact version the developer can stabilize the project ensuring the updates or changes in the package ecosystem don’t unexpectedly break the application or alter Its Behavior this practice helps maintain a consistent and reliable development environment across different setups what are the benefits of verifying installed mpm package versions after installation and how does it ensure consistency in a nodejs project verifying installed mpm package versions after installation ensures that the correct versions are in place which is crucial for maintaining consistency across different development environments this practice helps prevent unexpected issues caused by version mismatches ensures compatibility with other dependencies and supports stable project Behavior by confirming that the specified versions are installed you can confidently manage dependencies and avoid problems that might arise from automatic updates or version conflicts [Music] so let’s go over managing outdated mpm packages maintaining the dependencies of your application ensures you benefit from the latest bug fixes performance improvements and security patches here’s how to identify and update outdated packages in your nodejs project I’ll open

    up the integrated terminal so command J and I’m currently in the mpm demo directory that we created so this contains our package.json file to check which packages are outdated in your project you can use the mpm outdated command this will display all dependencies with newer versions available showing the current version you’re using the latest version available and the desired version the desired version is the highest version permitted by your versioning rules in your package.json file so currently for our project here if I view the dependencies we have installed we have axios and we have underscore both of these are currently the latest versions so I run mpm outdated nothing will show up since these are the latest possible versions to demonstrate that I’ll do mpm outdated so currently there is no result because I have the latest versions navigate outside of this directory and so if I run mpm outdated this will show the outdated packages that I have installed globally on my system so here this demonstrates the current version I have installed the desired version and the latest version so let’s go over updating packages to update old packages to the newest versions that do not include breaking changes so this typically includes minor updates and patches you can run the following command saw Run mpm update so this command updates the packages within the semantic version and constraints specified in your package.json file it will not update packages to a new major version that could contain breaking changes so let’s go over handling major updates sometimes you may need or want to update packages to their latest major versions which might include breaking changes to handle this you can use a tool called mpm check updates so let’s install that globally so I’ll use the sudu command mpm install dasg then mpm check updates I’ll enter my password so now we can run mpm check updates to see which packages have new major versions available so I can run mpm check updates you can then use the tool to update your package.json to the latest major versions so you would do mpm check updates and then the flag – or the shortcut ncu dasu so to reinstall dependencies after updating package. Json with mpm check updates the packages themselves are not automatically updated in your node modules directory you need to reinstall them to sync your directory with the updated package at Json so you can run mpm install let’s go over best practices the first best practice is testing always thoroughly test your application after updating dependencies especially when major versions are involved to ensure no breaking changes disrupt your application the second best practice is Version Control commit changes to your package.json and package lock Json file after Updates this ensures that your team or deployment environments use the same versions so in conclusion regularly updating the mpm packages in your node.js projects is crucial for maintaining the security efficiency and reliability of your applications tools like mpm check updates helps manage the life cycle of your dependencies allowing you to take advantage of the latest improvements while car carefully managing the risk of breaking [Music] changes what are the best practices for safely updating mpm packages particularly when handling major version changes best practices for safely updating mpm packages include first to review updates so use tools like mpm outdated or mpm check updates to identify and review available updates the second is to test thoroughly after updating especially when upgrading to a major version thoroughly test your application to catch any breaking changes third is to use Version Control always commit changes to package.json and package lock. Json to ensure consistency across environments and fourth update incrementally where possible update packages incrementally rather than all at once to isolate issues more easily these steps help maintain stability and minimize the risk of [Music] disruptions managing dependencies and node.js projects in node.js development it’s important to differentiate between dependencies required for the application to function and production and those needed only during the development process so let’s go over understanding dependencies first let’s consider production dependencies these are the packages your application needs to function correctly in the production environment such as Frameworks like Express or a database Library like or any other libraries necessary for the runtime execution of your app so the second type of dependency is development dependencies development dependencies are tools and libraries used only during the development process such as compilers like Babel testing Frameworks like mocha or static analysis tools like JS these are not needed in production and should not be bundled with your production build so let’s go over installing development dependencies to install a package as a development dependency use the save Dev flag this tells mpm to save the package under Dev dependencies in your package.json file this distinction is crucial for keeping production environments Lightweight by excluding unnecessary packages so we going to run the command mpm install JS hint save D so here running it in the directory that contains the package.json file and I see another property has been added named Dev dependencies which includes the package that I just specified so let’s go over the benefits of correctly categorizing dependencies the first is optimize production builds by segregating development dependencies you can ensure that your production environment only installs what is necessary reducing deployment size and potentially improving application performance the second benefit is clear project organization keeping a clear distinction between dependencies and Dev dependencies in your package.json file helps maintain organization and Clarity this makes it easier for other developers to understand the project setup managing node modules both production and development packages are stored in the node modules directory when installed the distinction in package at Json helps mpm understand which packages to install in different environments and you would use the environment variable node M and set it to development or to production so let’s discuss deploying to production when deploying your application you can ensure that only production dependencies are installed by setting the environment variable not environment to production and running mpm install mpm will skip developer dependencies in this case so in conclusion properly managing production and development dependencies is vital for efficient development workflows and optimized production deployments by categorizing your packages appropriately and package at Json you can maintain a lean an efficient application setup that ensures only necessary packages are included in production environments this practice not only optimizes performance but also enhances security by minimizing the attack surface of your [Music] application why is it important to differentiate between production and development dependencies in a nodejs project differentiating between production and development dependencies in a no. JS project is crucial because it ensures that only the essential packages needed for the application to run are included in the production environment this reduces the deployment size improves performance and minimizes security Risk by excluding unnecessary tools used only during development such as testing Frameworks or build tools proper categorization also helps maintain a clean organized project structure making it easier to manage and understand how does proper management of dependencies impact the efficiency and security of a node.js application and production proper management of dependencies in a node.js application impacts efficiency by ensuring that only necessary packages are included in the production environment reducing the application size and improving performance it also enhances security by minim minimizing the attack surface as fewer packages mean fewer potential vulnerabilities by installing only production dependencies you avoid including unnecessary tools that could introduce risk leading to a leaner more secure and optimized application and production so let’s go over uninstalling a package over time you may find that certain mpm packages are no longer needed in your application removing these packages helps keep your project lean and prevents unnecessary bloat in your no modules directory to remove an installed package you can use the mpm uninstall command followed by the package name this command removes the package from your node modules directory and updates the dependency list in your package.json file so if I wanted to remove the JS hint package that we installed in the previous lesson I can do mpm uninstall and then the name of the package so in this case JS I could also use the Shand which is mpm and then un then the name of the package so here I see my package.json file has been updated so let’s discuss the effects of uninstalling when you uninstall a package mpm automatically updates your package.json file removing the package from the list of dependencies or Dev dependencies depending on where it was listed so updating known modules the corresponding package directory and its contents are removed from the node modules folder this cleanup helps reduce the overall project size and and declutters your development environment so let’s discuss best practices the first is to verify dependencies before uninstalling a package make sure it is not required by any other part of your application you can check where and how a package is used in your project to avoid removing a package that is still in use the second best practice is to commit changes after uninstalling a package and verifying that your application still functions as expected commit the changes to your version control system this keeps your repository up toate and allows other developers to be aware of the changes and dependencies the third best practice is regular maintenance periodically check your package at Json file and your project dependencies to identify and remove packages that are no longer necessary this practice keeps your project clean and minimizes potential security risks associated with outdated or unused packages in conclusion regularly updating and cleaning up your Project’s dependencies are crucial steps in maintaining a healthy code base uninstalling unused pack P ages reduces the complexity of your project decreases lad times and lessens the risk of conflicts or security vulnerabilities by keeping your package at Json and node modules directory streamlined you ensure that your project remains efficient and [Music] manageable why is it important to regularly remove unused mpm packages from a node.js project how does this practice contribute to project maintenance regularly removing unused mpm packages from a nodejs project is important because it helps keep the project lean and efficient it reduces the size of the node modules directory improving load times and minimizing potential security risk from outdated or unnecessary packages this practice also simplifies project maintenance by reducing clutter preventing dependency conflicts and ensuring that only essential packages are included in the application keeping the coase clean and manageable enhances the overall health and stability of the project what steps should developers take before and after uninstalling mpm packages to ensure that node.js project remains functional and up toate before uninstalling mpm packages developers should verify that the package is not in use by checking where and how it is utilized in the project after uninstalling they should thoroughly test the application to ensure functions correctly without the remove package it’s also important to update the version control system by updating the changes to package. Json and package lock. Json this process ensures that the project remains functional clean and up to date so let’s go over working with global packages in node.js development some packages are not tied to a specific project but are rather tools or utilities used across multiple projects these are typically in install globally on your system so let’s go over installing Global packages first let’s discuss the purpose of global installation Global packages are typically command line tools or utilities that you want to run from anywhere on your system not just within a specific project for instance this could include package managers like mpm itself or project scaffolding tools like angler CLI which is a framework for building web applications these two packages for example are commonly installed globally to install a package globally you would use the – G or hyphen G or the– Global flag with the mpm install command this tells mpm to place the package in a special systemwide location that no JS can access from any directory so for example if you installing the angler web framework you would run the command mpm install then the flag DG and then the name of the package which is angler SL CLI this installs the angler CLI globally which you can then use to create new projects from anywhere on your system so step three is updating mpm itself mpm can also be updated globally using the same flag this is useful to ensure that you have the latest features and security updates so to do this you would run the command sudu mpm install DG mpm now a note for permissions on Mac OS and Linux you might need to use the Pudu command to install Global packages this depends on your system’s permission settings however setting up mpm to run without Pudu can avoid permission issues and is recommended for security reasons managing Global packages to manage and update your Global packages you can check which ones are outdated by running mpm outdated and then the flag – G this command lists all globally installed packages that have newer versions available upgrading Global packages if you find outdated Global packages you can update them by reinstalling with the mpm install –g command specifying the package you wish to update let’s discuss best practice IES for Global packages the first is to minimize Global installations install packages globally only when necessary overuse of global installations can lead to version conflicts between projects and complicate dependency management the second best practice is regular updates keep your Global packages updated to leverage new features and security enhancements the third best practice is to document globally installed tools for team projects document the tools required globally so all developers set up their envirment consistently in conclusion Global mpm packages are essential tools for development offering functionalities that extend across multiple projects properly managing these packages ensures that your development environment is both effective and secure by regularly updating and maintaining the global packages you can avoid potential conflicts and keep your system optimized for all your development [Music] needs what are the benefits and potential risks of installing mpm packages globally instead of locally in a node.js development environment so the benefits of global installation is that Global mpm packages are accessible from any directory on your system making them ideal for command line tools or utilities used across multiple projects such as project scaffolding tools or linters so for the potential risk overusing Global installations can lead to version conflicts between projects as different projects may require different versions of the same tool it can also complicate dependency management and make it harder to maintain consistent environments across different machines or for different team members how can developers effectively manage and maintain Global mpm packages to ensure a consistent and secure development environment developers can effectively manage and maintain Global mpm packages by following these steps the first is to minimize Global installation so only install packages globally when necessary to avoid version conflicts and simplified dependency management step two is regular updates frequently check for outdated Global packages using the mpm outdated and- G flag and update them to ensure security and access to the latest features and step three is documenting requirements clearly document any Global tools needed for a project ensuring that all team members can set up consistent and compatible environments these practices help maintain a stable and secure development environment so let’s go over publishing a package creating and Publishing your own mpm package can be a rewarding process allowing you to share your work with the wider no. JS community so to do this step one is to set up your package so let’s open up the integrated terminal and I will make a new directory and I’ll just call this new library we’ll change into this new directory so step two is to initialize the package we’ll use mpm and nit to create a package.json file with the default values so we will pass the D- yes flag which Auto accepts the default options so we can run mpm and nit D- yes so let’s create the package of Json file so we see our new directory here opening up the integrated terminal again with command J let’s scroll down so step three is to create the main file so we’ll create an index.js file where we will write the code for our package so from the command line I can do touch index.js to create that new file so we see that added here now we will add some functionality so I can say module. exports. add and I’ll assign this to a function which takes two parameters and Returns the result of adding them so a plus b and this with a semicon so now you need to create or use an mpm account so for the account setup if you don’t already have an mpm account you will need to create one this could be done from the mpm website or directly from the command line so you can run mpm add user if you already have an account and simply log in with mpm login and you will be prompted to enter your username password and email address so step three is to publish your package so to prepare for publishing ensure that your package.json file includes a unique name for your package mpm requires that package names be unique to the registry so now you’re ready to publish the package once you are ready and have verified that all information is correct you can publish your package to mpm using the command mpm publish so this command uploads your package to the mpm registry making it available for others to install so now you want to verify installation you want to test it so to ensure that your package can be installed from another project create a new directory Elsewhere on your system and install it so so for example you can do make directory and then name that directory and change into it then you can run mpm install and then that package that you created so test the functionality in this new project environment to confirm everything works as expected so after publishing you want to be sure to perform updates and maintenance so after publishing you might need to update your package with improvements or bug fixes so make changes in your local project increment the version number in your package.json file following the semantic versioning rules and run mpm publish again so now discuss metadata and visibility mpm automatically adds metadata to your publish package this includes information like the publication day version history and dependencies this metadata is crucial for users of your package to understand its history and stability in conclusion publishing a package on mpm is a straightforward process but requires careful setup and attention to detail to ensure that the package is functional and useful to others by following the steps you can contribute your own modules to the npm ecosystem and potentially help thousands of developers [Music] worldwide what are the key steps involve in creating publishing and maintaining an mpm package for the node.js community the key steps to create publish and maintain an npm package involve first setting up so create a directory initialize it with npm and nit and write your packages code step two is publishing so create or log an mpm account ensure your package name is unique and publish it using mpm publish step three is verifying so test the package by installing it in a different project to ensure it works as expected and step four is maintaining update your package as needed increment the version number and republish it to keep it current and useful for others why is it important to verify and test your mpm package after publishing and how can this impact its usability by other developers verifying and testing your mpm package after publishing is crucial to ensure it works as intended in different environments this step helps identify and fix any issues that might arise ensuring that the package is reliable and userfriendly for other developers if a package is not properly tested it can lead to errors and frustrations for users reducing its adoption and usability thorough testing enhances the package’s credibility and usefulness within the developer community so let’s go over updating a published package when you made changes to your mpm package such as adding new features or fixing bugs you must update the package’s version before republishing it this ensures that users can keep track of changes and upgrade their installations appropriately so step one is to make changes to your package so here we can modify the code so in your package directory you can make any necessary changes so for example if you wanted to add a multiplication function to your package so I can say module. exports do multiply set that to a function which takes two parameters and returns a * B so step two is to update the package version in your package.json file so here the current version is 1.0.0 and before we can publish it we need to update its version so mpm uses semantic versioning which includes major minor and Patch updates so once again the major version makes incompatible API changes the minor version adds functionality in a backwards compatible Manner and the patch version makes backwards compatible bug fixes so from the command line we can run mpm version major for breaking changes mpm version minor for new features that are backwards compatible mpm version patch for backwards compatible bug fixes so this case we can run mpm version and then minor and here we see our version has been updated in our package or Json file to be 1.1.0 this command updates the version number in your package Json and creates a new commit if your package directory is a g repository so step three is to publish the updated package so after updating the version you are now ready to publish the updated package P AG so you can run mpm publish if you try to publish without updating the version mpm will return an error because the package version must be unique following the version update the publish command should succeed additional considerations before publishing an update thoroughly test your package to ensure that new changes do not introduce bugs or break existing functionality documentation update your readme markdown file for any documentation to reflect changes made in the new version especially if You’ added new features or May significant modifications in conclusion updating a published mpm package requires careful attention to version management and compatibility by following semantic versioning rules you can communicate the nature of changes in your package updates to users effectively always ensure that your updates are well tested and documented which helps maintain and enhance the package’s utility and credibility in the community why is semantic versioning important when updating npm package how does it help communicate changes to users semantic versioning is important when updating an mpm package because it clearly communicates the type of changes made helping users understand the impact on their projects by using version numbers to indicate major breaking changes minor new features or patch bug fixes developers can manage expectations and allow users to update dependencies safely this practice ensures that users can confidently upgrade to newer versions without unexpectedly breaking their applications which best practices should developers follow when updating and republishing an mpm package to ensure its reliability and usability when updating and republishing an mpm package developers should follow these best practices the first is to use semantic versioning clearly communicate the type of changes which could be major minor or patch to users then do thorough testing ensure all new changes are well tested to prevent introducing bugs or breaking existing functionality third update documentation provid read me markdown files and other documentation to reflect the latest changes and new features then commit those changes and tag if necessary if using Version Control commit the changes and tag the new version before publishing these practices help maintain the package’s reliability and usability [Music] synchronous versus asynchronous code so let’s set up a new project we’ll open up the integrated terminal with command J or control J if you’re on Windows we’ll run the command make directory and we’ll name it async demo let’s change directory into that new folder we created now we want to initialize a new node.js project we do that with mpm anit then we’ll pass in the flag D- yes to accept the defaults just created our package.json file we clear this out now we want to create a new file we could do this from the command line and we will run touch index.js so now if we expand this directory and click into our index.js file first we will write synchronous code so we can add the following console statements we can do log and then tab for that keyboard shortcut and we’ll log out the string before so now we’ll do shift option and down arrow to copy this line and then we’ll do after so this code is a simple example of synchronous or blocking programming so here the program awaits for the first console log statement to execute and to complete before moving on to the second one we can just output this node index.js and we get our expected console log output so introducing asynchronous programming in contrast asynchronous programming allows the program to move on to other tasks before the previous ones have completed so we will modify our file here we will use the set timeout method set timeout so for the parameter we will pass in a callback function so we’re using the modern es6 syntax or eror functions So within this code block we can I’ll say a comment simulate a call to the database so let’s say we’re making a call to a database that contains information on our grocery list you can do log and we’ll say reading a grocery item from a database so for set timeout the first argument that we pass in is the call back function it also accepts a second argument which is the time to wait before executing this code this is represented in milliseconds so we’ll say 2000 represent 2 seconds and let’s execute this program so let’s open up the integrated terminal with command J up arrow and run it again so here we see before then after for our set timeout it waits 2 seconds and then it logs out this console log statement so this is an example of asynchronous programming so this demonstrates that set timeout schedules the task to be performed later without blocking the execution of subsequent code understand asynchronous programming asynchronous programming is not the same as concurrent or multi-threaded programming in OJs asynchronous code runs on a single thread it’s crucial because operations involving disk or network access in node.js are handled asynchronously allowing the program to remain responsive asynchronous programming helps ensure that your application can handle multiple operations efficiently without getting stuck waiting for one task to complete before starting another [Music] how does asynchronous programming improve the efficiency and responsiveness of a node.js application especially in handing iio operations asynchronous programming improves the efficiency and responsiveness of a node.js application by allowing the programs to continue executing other tasks while waiting for I operations such as a database call or file access to complete this non-blocking approach ensures that the application remains responsive and can handle multiple operations simultaneously rather than being helded up by slow operations as a result the application can serve more users and manage more task without delays or bottlenecks leading to better performance overall what are the key differences between synchronous and asynchronous programming in the context of node.js and why is it important for developers to understand these differences synchronous programming and node.js executes task one after the other blocking the execution of subsequent code until the current task is finished asynchronous programming on the other hand allows the program to initiate tasks like iio operations and move on to other tasks without waiting for the previous ones to complete understanding these differences is crucial because asynchronous programming helps prevent Bott necks making applications more efficient and respons by not allowing a single slow operation to Hal the entire [Music] program so let’s discuss patterns for dealing with asynchronous code let’s first go over an example of incorrect synchronous code so we’ll buildt upon the previous code snippet that we did in our previous lesson so we have our console log statement outputting before and then we call set timeout so let’s abstract this and let’s put this into a function so we use the function declaration syntax and we’ll name it get grocery item and it takes in an ID or curly braces and let’s move this so we’ll copy this and we can paste it in the block so rather than just console logging we will return a JavaScript object which contains an ID and a name so we’ll say apples is the name of the grocery item and it with a semicolon so now let’s call this function I can say cons grocery item say get grocery item and I’ll pass in the value of one is the ID let me just add a comment here so we know what to expect so we cannot get a grocery item like this as we will see then let’s do console log we will output the grocery item so note that when we do this this will have the value of undefined the reason is because when we call get grocery item the item isn’t returned immediately because we call set timeout there’s a 2C delay before we get this grocery item object let’s open up the integrated terminal up arrow and we will execute this file so here we get before undefine then we get this output after and then this console log statement within the set timeout so this function get grocery item is intended to simulate fetching an item from a database however due to the set timeout function it does not return the grocery item immediately instead it schedules the operation to occur after 2 seconds so the console log and then the grocery item executes before the grocery item data is available resulting in undefined the key reason this does not work as intended is because set timeout is asynchronous the function does not wait for 2 seconds to return the grocery item data rather it returns immediately and the code continues executing so let’s correct this approach when dealing with asynchronous operations like database calls the result is not immediately available here are three common patterns to handle a synchronous code in JavaScript the first being callbacks the second being promises and the third being a syn8 so first let’s discuss using callbacks so we will fix our code to utilize that pattern so we have our console lock statement actually let’s comment this out and we will start again from scratch so here can do console.log I’ll put the string before then we can Implement get grocery item this takes in an ID and it will accept a second parameter which is a callback function we can call set timeout and this also accepts callback function with a 2C DeLay So within it let it’s output I’ll say reading a grocery item from a database and we’ll say call back then we’ll pass in the object right the grocery item object the ID and then the name which we will say is Apple and that with the semicolon so we want to utilize the get grocery item function in its implementation it is using the asynchronous method of set timeout so we can call get grocery item pass in one as the ID and then for the call back we specify an es6 arrow function right so we’re using the modern syntax grocery item arrow and then the curly braces and here we will Define our implementation and here we will just output the GR item that is returned right so this object is passed into the call back and so this object will be the grocery item that we are outputting to the console and then one more log which is the string after so now we will execute this up Arrow so we can run this so we get before and after then it waits 2 seconds and then we see reading a grocery item from a database and then our expected grocery item object if I scroll up previously when we had our synchronous code we were outputting the grocery item and getting the value of undefined so this is a pattern known as callbacks so I’ll TR a comment here and I’ll say callbacks and for now I will comment it out and paste it so now we will update this and you will use promises so we have our console lock statement saying before and then we have the get grocery item function so rather than calling set timeout as this we can utilize a promise object so A promise is an object that holds the eventual result of an asynchronous operation so we can use the return keyword and I’ll say new promise this accepts two parameters so resolve in the case when it worked successfully and reject in the case when there was an error so this is an arrow function right so a call back we will explore each of these Concepts in more depth throughout this section just wanted to introduce it to you all at once so we moved up the set timeout to be within the Callback function now we can remove call back and rather than saying call back we say resolve because it successfully returns a grocery item so now we have to change how we’re utilizing this so we only need to pass on the ID but we have special methods in order to access the data within the promise so we use a special method which is then which is executed in the case when the promise successfully resolves so we’ll take in the item and we will console log it now we also need a method. catch let’s end this with the parthy in the case when there is an error so if there is an error in the case when it is rejected then this code will run so I’ll say console. error and then the error and that with semicolon so now open up our interor terminal we run this so we see before after and once again this waits for 2 seconds then it returns a promise so we can access the data within that promise with the then method and then we output it to the console right so explore this more in detail in future lessons for now just at a comment I’ll say promise let’s copy this and we’ll build upon it for our next example we’ll comment it out for now now we will cover async away so async away are special keywords allow us to execute this code with cleaner syntax so here we are using the then and catch methods and chaining them in order to access the data that is returned from our promise so we’ll keep our get grocery item function to be the same but we can have different syntax to make this cleaner to read so I can use a special keyword known as async which means that this function contains an asynchronous operation so I’ll name the function display grocery item so we will say grocery item then we’ll use another keyword O8 and then we will specify our function which has the asynchronous operation so in this case the set timeout function then we can simply log it out grocery item so rather than using this syntax and changing the then and do catch methods we can just call display grocery item and pass in the ID of one open up our integrated terminal run it again so we see once again before and after and once this asynchronous operation completes after 2 seconds then we successfully log it to the console let’s do a quick summary first we covered callbacks so these are functions passed as arguments to be executed once an asynchronous operation is complete Rec cover promises which are objects representing the eventual completion or failure of an asynchronous operation and lastly we covered async 08 so this is syntactic suar sugar over promises making asynchronous code look synchronous understanding these patterns is crucial for handling asynchronous operations such as database calls in [Music] JavaScript what are the main methods for handling asynchronous operations in JavaScript and why is it important to understand them the main methods for handling a synchronous oper ations in JavaScript are callbacks promises and async 08 callbacks involve passing a function to be executed after any synchronous operation completes promises represent the eventual completion or failure of an asynchronous task and provides methods like then and catch for handling results a syn8 is built on promises allowing a synchronous code to be written in a more readable synchronous like style understanding these methods is crucial for managing tasks like database calls ensuring efficient and correct code execution how does the asynchronous nature of JavaScript impact the execution order of code and what are the strategies to manage this effectively the asynchronous nature of JavaScript means that code doesn’t always execute in the order it’s written some tasks like iio operations run in the background while the rest of the code continues this can lead to unexpected result results if not managed properly to handle this developers use strategies like callbacks promises and a snle we to control the flow of asynchronous operations ensuring that tasks complete in the desired order and that results are handled correctly so let’s discuss callbacks in more detail first if you look over our example of the incorrect synchronous code where we call a function get grocery item which is utilizing set timeout with a 2-c delay when we output it we get the value undefined because the value is not immediately available so this code mimics trying to get a grocery item from a database but it doesn’t work as intended because the function get grocery item use this set timeout making it asynchronous so the console lock statement executes before the Grocer’s data is available resulting in undefined a call back is a function that is passed as an argument to another function to be executed once an asynchronous operation is complete so let’s go over use callbacks correctly so we have our updated version of the code which utilizes callback so we have our call back parameter and then we invoke it within the asynchronous operation so let’s discuss accessing nested asynchronous data so to handle multiple asynchronous operations such as fetching a user’s grocery list and then fetching the grocery item data you can Nest callbacks so here when we call get grocery item we’re currently just outputting it so let’s say we actually recalling get grocery list this takes in an ID and then a parameter which is a callback function this is an asynchronous operation so we’ll mimic that with the set timeout function pass in our Arrow function which has a 2cond delay I’ll add a comma and I’ll say simulate a call to the database log and I’ll say fetching grocery lists from the database and then we’ll utilize our call back and we’ll pass in the argument which is a JavaScript object representing the grocery list say a property of items which takes it an array so let’s say apple bananas and we’ll say bread so end that with a semic coin let’s update our G grocery item so I can say I’ll say fetching grocery item from I’ll say the grocery list just better to describe what we’re trying to implement here so I’ll say call back and we’ll say the array is apples bananas and bread so now we want to utilize get grocery list so rather than calling get grocery item we say get grocery list this accepts an ID so we’ll say one and then our call back function so it’ll be a grocery list we’ll pass an arrow function so log and I’ll Alpha grocery list comma grocery list so now I will simulate getting the grocery list items and I’ll say get grocery list items grocery list ID and then a callback function containing the items we could output that with items and then outputting that to the console and we’ll end it with a semicolon so this is an example of nested callbacks meaning that you have w a SN operation and once that completes and we have the data that we need then we make another asynchronous call utilizing that data so let’s comment this out save it and then in our integrated terminal up arrow and then run so here we get before and then after then we get fetching the grocery list and then the data that we received and then we call our nested callback function here so fetching a grocery item and we get the items so this demonstrates utilizing nested callback functions so in summary callbacks are functions passed as arguments to be executed once an asynchronous operation is complete properly handling a synchronous code is crucial when dealing with operations like database access which may take some time to [Music] complete why is it important to handle a synchronous operation properly in JavaScript particularly when dealing with tasks like database access handling asynchronous operations properly in JavaScript is crucial because it ensures that tasks like database access which may take time to complete do not block the execution of other code this allows your application to remain responsive efficiently processing multiple tasks without waiting for each one to finish sequentially proper management of a operations such as using callbacks promises or a syn away prevents issues like incomplete data retrieval or unexpected Behavior ensuring that the application functions correctly and smoothly what challenges can arise when using callbacks to manage multiple asynchronous operations and how can these be effectively addressed when using callbacks to manage multiple asynchronous operations challenges like callback hell can arise where nested callbacks make the code difficult to read and maintain this complexity increases the risk of errors and makes debugging harder to address these issues developers can use techniques such as modularizing callback functions or better yet use promises or a sync o08 syntax which allows for more readable and maintainable code by flattening the structure and handling errors more effectively so let’s further discuss nested callback structure in our previous example we use callbacks to handle asynchronous operations so we will expand upon this and we will add another asynchronous operation so we can add that with I’ll name it check item availability this will accept one parameter which is the grocery item and this utilizes the asynchronous method of set timeout pass in our call back and I’ll say checking availability then we can say return true just for Simplicity so if you want to utilize it need to do so within the get grocery item call back so we are dependent on that data this takes in you can say items at the zero index so the first item let’s clean this up a bit so you can clear this and just so we can more easily see our Nest callbacks we’ll remove the outer console log statements so here we see we have get grocery list which is an asynchronous operation once that completes then we call get grocery item which is also a synchronous and then the asynchronous method check item availability so this is simulating making calls to a backend database or a backend API so in this scenario each call back depends on the completion of the previous one resulting in a nested structure this pattern is often referred to as call back hell or the Christmas tree problem because of its shape and complexity so let’s compare this to synchronous code so just as a demonstration of what this would look like if all functions were synchronous right so it would have your log statement same before and then getting the list for get grocery list takes in the ID of the grocery list and then we get the items of the grocery list following get grocery list items say list ID then we’ll check the availability of an item check item availability and we’ll say the first item in the list then we output so log and tab after so this is an example of how clean and easy to read our code would be if it were synchronous however we know that these functions are asynchronous so the data isn’t available immediately there is a delay before we can receive that right let me just add in the 2cond delay to our callback function which I forgot to do so however synchronous code blocks the execution of other operations until the current one finishes which is not ideal for I bound tasks like database queries so let’s discuss the term of call back how we scroll back up so using callbacks for a synchronous code can become difficult to manage and read here we see our nested structure so let’s discuss a simple solution to avoid callback how we can use promises and a syn await syntax so discuss using promises promises provide a cleaner way to handle a synchronous operations so here’s an example for now we will comment how we are utilizing our asynchronous functions and rather than calling set timeout rather we will return a promise right once again A promise is an object that holds the eventual result of an asynchronous operation so we’ll say return new promise and within it it accepts a call back so we’ll say resolve for now we will close that and we can move this up we can move it up with option up Arrow close this so rather than saying call back you can remove that parameter it’s no longer needed and rather we call resolve because it resolved or completed successfully we updated this one to use promises let’s update the other functions return new promise so also accepts callback function will resolve so this here once again option up arrow and within here let’s um do command and then the right bracket better format this code we do the same here so it looks cleaner so once again we removed this call back it’s no longer needed and we call resolve it successfully Returns the grocery items now we have our last one we check availability so once again return new promise tickes in call back function with resolve then option up Arrow to move up in this case it just Returns the value true so in this case we can just say resolve we to say the value of true so now we want to utilize this so for now we can delete this example we had of syn this code and just to demonstrate what we would like the syntax to look like make some space here and now we will utilize these functions that are utilizing promises so we can call get grocery list takes in the value one then get the list and we call get grocery items TI in the list ID then we can change then right so the result of get grocery list item or get grocery item so get the items and we’ll say check item availability items at zero we’ll just say not then we’ll say availability console.log availability and then this value we also include our method or chain our method for catch in case there’s any error console.log actually we do console. eror and then the eror so this is an example of utilizing promises so we use the then method and catch methods so we are rather than having the nested structure we just chain our then methods we can execute this so up arrow and run before and after and there are two second delays as the asynchronous operations complete so everything worked as expected and we have cleaner syntax so let discuss using async AWA so the async AWA syntax built on top of promises further simp simplifies the code So currently and say in get grocery list we are returning a promise let’s say if we’re using the async away keywords so we can mark it as a sync and when we mark it as async we can now utilize the AWA function within it so rather than calling get grocery list and then changing all these methods we’ll create a new method and we can name it display availability we will mark it as a sync so once we mark it then we will utilize the AE keyword within it we’ll wrap it in a TR catch console. air and now we want to utilize these asynchronous operations so because these are asynchronous and they’re returning a promise we can use the await keyword we’ll say list AIT get grocery list pass in the ID then once this data is available then we can call wait get rery item with the list ID right so once this returns right we await this result then we check the availability await check item availability items at zero and then say [Music] console.log Avail ability and then this resolve so rather than utilizing this syntax comment this out and we’ll just call display availability so this function which utilizes the async a keywords is the equivalent of this function call with the chain methods but our code here which utilizes async away looks more similar to synchronous code so it’s easier to read so let’s run this so we see before and after 2C delay and we get our expected result with cleaner syntax so this is the modern way to do it with a SLE we so summary callbacks can lead to nested structures that are difficult to manage promises and asyn we provide cleaner more readable ways to handle asynchronous code what are the benefits of using promises and asyn a weight over callbacks in managing asynchronous operations in JavaScript using promises and a single we in Java JavaScript offers several benefits over callbacks the first being readability promises and Ayn we result in cleaner more linear code that is easier to read and maintain avoiding the nested structure of callbacks otherwise known as callback hell the second benefit is air handling promises provide better air handling through the dock catch method and TR catch blocks with the async aake keywords making it easier to manage asynchronous errors the third benefit is control flow promises and asyn weight allow for more intuitive control flow helping developers manage asynchronous operations more effectively how does the use of promises and a single weight help prevent issues like callback how in JavaScript programming the use of promises and a single weight in JavaScript helps prevent callback how by making a synchronous code more linear and easier to follow promises allow chaining of a synchronous operations with the then method instead of deeply nested callbacks while a snle way further simplifies the syntax making the code look and behave more like synchronous code this reduces complexity improves readability and makes air handling more straightforward resulting in cleaner and more maintainable [Music] code so now let’s discuss name functions so we use name functions to simplify callbacks when dealing with nested callbacks you can replace Anonymous functions with name functions to flatten and simplify the structure of your code this approach makes your code more readable and easier to manage so here’s you can refactor nested callbacks using name functions so implement this from scratch just to ensure that everything makes sense and it’s good to get more practice so once again we have our log statement say before then shift option down arrow after now we Implement our function again get grocery list takes in an ID and a call back so that’s C two parameter variables it accepts then set timeout which is an asynchronous operation the argument takes in is a callback function and here we are simulating a call to the database we can log that out so log out fetching grocery list from the database once again this calls the call back and invokes it pass in the object which is an ID and a name what is say that’s weekly groceries and that with a semicon and there is a 2cond delay so now to help us save some time we can just copy this and paste it and we’ll rename it to be get grocery items so for our console log we’ll say fetching grocery items so for our call back this accepts an array and we’ll just say milk bread and eggs as the data that we pass in once again we can copy this and paste it and we’ll name this to be check item availability so we’ll update our console lock statement which will be checking item availability so for our call back we’ll pass in a JavaScript object which will contain the item and the availability so I’ll say available set to true so now we implemented three asynchronous operations each which have a 2cond delay now in order to actually utilize this we want to have name functions so let’s Implement some functions here and I’ll call this handle grocery items this takes in a list and I’ll call get grocery items the list ID and handle item availability l so not Implement picks in the items and within it this calls check item availability so let’s say the first item and then I’ll pass in call back so display availability so now we need to implement that name function this takes in the availability this outputs to the console availability pasting that here so now I can call get grocery list the ID will be one and then for the call back I’ll say handle grocery item so that will call this function which will call get grocery items and then for the call back is handle item availability then this calls check item availability and then after within it the display availability is called logging to the console we execute this before and after then we get our 2C delays and our expected console outputs so here we see item is not defined let’s see here in checking item availability yeah so for ID it’s supposed to be item run it again now we get our expected output we just need to change the name of that parameter so explanation let’s first discuss name functions by defining name functions let’s scroll up by defining name functions like handle grocery items handle item availability and display availability you can avoid deep nesting and improve the readability of your code let’s discuss passing references note that we are passing references to these functions so this includes handle grocery items handle item availability and display availability instead of calling them directly so what are the advantages the first is readability the code is easier to read and understand the second Advantage is reusability name functions can be reused elsewhere in the code if needed limitations while using name functions helps it’s not the most efficient way to handle asynchronous code for better approach consider using promises so using promises promises provide a cleaner more manageable way to handle asynchronous operations compared to nested callbacks so here you can convert the above example to use promises so here for each of these functions that we implemented we want to call return new promise this object takes in the call back so resolve then we just move this up option up arrow and then instead of call back we just call resolve we can remove call back parameter we just repeat this so return new promise Pi in and resolve move that up option up Arrow save that and one last time oh yeah you can have to remove the call back parameter and then call result then last time we get return new promise takes in resolve and we move this up save that and we call resolve here now in order to utilize that we will no longer be calling or invoking it like that rather we will call get grocery list passing in the ID of one and then we have our methods then and catch so we chain these methods list so I know we did cover this before but repetition is very good especially if this is the first time that you are going over promises so then items and we’ll call check item availability which is the first item in the list do then say availability console.log availability and then this parameter variable then we end it with catch so we path in the error to one urse console. error and then the eror end it with a su icon so now we execute this code which is utilizing promises as opposed to callback functions we have before and after and then 2 second delays for our expected console output now we get cleaner syntax without having to pass all these references to all these functions we created so using promises makes the code more straightforward and easier to handle especially as the complexity of asynchronous operations [Music] increases how can ref factoring nested callbacks into name functions improve the readability and maintainability of asynchronous code in JavaScript refactoring nested callbacks into name functions improves the readability and maintainability of asynchronous Code by reducing complexity and avoiding deeply nested structures known as callback how name functions makes the code more organize easier to follow and allows for better reuse of code this approach simplifies debugging and understanding the flow of asynchronous operations making it easier to manage and maintain the code base as the application grows in complexity what are the limitations of using name functions for handling asynchronous operations and how do promises provide a more efficient solution the limitations of using name functions for handling asynchronous operations include increased complexity when dealing with multiple asynchronous task and a tendency to create deeply nested structures while name functions improve readability they don’t fully resolve the issue of callback how promises provide a more efficient Solution by allowing for a more linear and manageable flow of asynchronous tasks through chaining which improves readability and simplifies air handling leading to cleaner and more maintainable code so let’s discuss promises JavaScript promises are a powerful tool for managing asynchronous operations A promise is an object that represents the eventual result of an asynchronous operation it can be in one of three states the first being pending so this is the initial State when the promise is still waiting for the asynchronous operation to complete the second state is fulfilled the operation completed successfully and the promise has a value and the third possible state is rejected so the operation failed and the promise hasn’t air so Crea a promise to create a promise you can use the promise Constructor which takes a function with two parameters resolve and reject and these parameters are functions used to indicate the completion of the asynchronous operation either successfully which would be the case when it resolves or unsuccessfully in the case when it rejects so to demonstrate this say cons B and then new promise this takes in a call back so resolve and reject our Arrow function syntax then we can start in a synchronous operation such as accessing a database or calling a web service so if the operation is successful then we call resolve with the result if the operation fails then we call reject with an error so in the first case we’ll say resolve to demonstrate an example of a successful operation so output value of P and we run this we get the promise with the value of one better yet do then so we’ll say result console.log the result and we’ll just chain these methods actually so do catch error console. eror passing in that eror object so we run this again and we get the value of one which is the value that was passed in when we resolved this promise likewise if we were to call reject we pass in an error so I can say new error and I’ll say erir message in the case of a failed operation we execute this and we get our expected error message so let’s discuss consuming a promise so once you have a promise you can use theben and do catch method as we did to handle the result or the error let’s go over an example of handling errors so we’ll update this example to simulate an a synchronous operation that failed so we can call set timeout pass in call back and we’ll say it has a 2cond delay let’s move this up so option an up Arrow so now when we do this let’s update this to be console.log and we will log out the message of the air right so in this case it would be air message so now when we run this and integrated terminal command J up arrow and run there’s a 2C delay and then we get the airor message so in summary a promise starts in the pending state it transitions to fulfilled if the asynchronous operation complete successfully it transitions to rejected if the operation fails we use the DOT then method to handle the successful result and we use the catch method to handle errors finally let’s discuss best practices whenever you have an asynchronous function that takes a call back consider modifying it to return a promise for better readability and maintainability this approach helps avoid callback hell and makes the code easier to follow how do promises improve the management of asynchronous operations in JavaScript particularly compared to traditional callback methods promises improve the management of asynchronous operations in JavaScript by providing a more structured and readable way to handle tasks compared to traditional callbacks they allow you to chain operations like then for success and catch for errors handling callback hell and making the code easier to follow promises also offer better air handling and simplify the process of managing multiple asynchronous operations leading to cleaner and more maintainable code why is it beneficial to modify asynchronous operations that use callbacks to return promises instead and how does this practice enhance code readability and maintainability modifying asynchronous functions to return promises instead of using callbacks is beneficial because it simplifies the code structure making it more readable and easier to maintain promises allow for chaining operations and handling errors more cleanly with then and catch methods reducing the complexity associated with nested callbacks known as callback H this approach leads to more organized and modular code which is easier to debug and scale as your application grows so let’s discuss resolving callback outl by using promises so in this code that we wrote in a previous lesson this demonstrates nested callbacks also known as callback how which can make your code difficult to read and maintain so here in this case we have three asynchronous methods and they depend on each other so these run one after another now you can imagine if we had to perform other asynchronous operations then we will continue to have to indent and continue to Nest these callbacks so this video is just a reminder that we want to utilize promises when working with asynchronous code we we do this to improve the readability and maintainability of our code base so in this case instead of utilizing callbacks we are returning a promise right once again A promise is an object that holds the eventual result of any synchronous operation and then we can utilize the built-in methods so then and catch to chain these methods and work with the asynchronous data this approach makes the code more linear and easier to read eliminating the Deep nesting associated with callback how so in summary promises these are objects representing the eventual completion or failure of an asynchronous operation now these promises can be in different states so promises can be in one of three states so it can be pending fulfilled or rejected so methods that promises have include the then method to handle resolve values and catch to handle errors and lastly converting call back based functions to return promises can significantly improve code readability and maintainability how do promises help in resolving the challenges of callback how in a synchronous JavaScript programming promises help resolve the challenges of callback how and asynchronous JavaScript programming by allowing you to chain asynchronous operations in a more linear and readable manner instead of deeply nesting callbacks promises use then and catch methods to handle sucess sucess and errors respectively this flattens the code structure making it easier to understand maintain and debug by converting callback based functions to return promises developers can write cleaner more manageable code while avoiding the complexity and pitfalls of nested callbacks what are the key benefits of converting callback based functions to return promises particularly in terms of code readability and maintainability converting callback based functions to return promises offers key benefits in terms of code readability and maintainability Promises allow for chaining operations using then and catch which results in a flatter more linear code structure making it easier to read and understand this approach eliminates the deeply nested hardto manage code typical of callbacks known as callback how additionally promises provide a consistent way to handle errors further enhancing the maintainability of the code [Music] base so let’s go over creating subtle promises sometimes you might need to create a promise that is already resolved this can be particularly useful for unit testing where you need to simulate a successful asynchronous operation such as a web service call to create a resolve promise you can use the promise. resolve method which returns a promise that is already resolved so we can create a new file here from the command line I’ll say touch prom api.js so we can go into this new file that we created and then we can call comp P assign to promise do resolve we’ll pass in an object so in this case it will have a property of ID the value one and then to access this value we use the then method and we pass in a call back so we’ll get the result and we’ll just output that right output in the result open up the integrated terminal with command J or control J and then we will run node promise api.js and here we get the expected resolve value so this code snippet creates a resol promise with an object containing ID of one and logs the result to the console now let’s go over creating rejected promises similarly you might need to create a promise that is already rejected for instance to simulate a failed asynchronous operation in a unit test you can use the promise. reject method to create a rejected promise so we can close this out so command J and we’ll update this to instead use reject and then for the argument we pass in a new erir object so new error and then the message will be reason for rejection and three dots so now it’s p. pen we can call do cach in this case we can do error console.log and I can say error. message so because we are expecting an error or the rejection rather we just include the cach method right so we remove the then method so let’s run this and we’re expecting the error message reason for rejection say for rejection so this creates a rejected promise with an airor message and we log the air to the console so in summary resolve promises use the promise. resolve and then pass in the value to create a promise that is already resolved and for rejected promises use promise. reject and passed in an air object to create a promise that is already rejected these methods are useful for simulating different scenarios in unit tests or when you need immediate resolution or rejection of promises these methods are useful for simulating different scenarios in unit tests or when you need immediate resolution or rejection of promises how can creating resolved and rejected promises with methods like promise. resolve and promise. reject be useful in testing and simulating asynchronous operations creating resolved and rejected promises with methods like promise. resolve and promise. reject is useful in testing and simulating asynchronous operations

    because they allow developers to immediately generate success or failure outcomes without needing to perform actual asynchronous task this capability is particularly valuable in unit testing where you may want to test how your code handles resolved or rejected promises such as simulating successful API responses or air conditions ensuring your code behaves correctly in different [Music] scenarios so let’s discuss running multiple asynchronous operations in parallel sometimes you need to run several asynchronous operations simultaneously and perform an action once all of them have completed for example you might call different apis like Facebook and Twitter or X and once both calls finish you return the result to the client let’s go over an example of this so we’ll have a simulation I’ll say simulation for calling Facebook API so I’ll say cons and I’ll say P1 for the first promise new promise so we know this takes in a callback takes resolve as the first parameter and within it we’ll have set timeout as our asynchronous operation this also takes a call back and we’ll say the delay is 2 seconds right so 2,000 milliseconds then we will log a say async operation Three Dots and then resolve with the value one and then we’ll have a simulation we’re calling the Twitter or X API so we’re can actually just copy this because it’ll be the same syntax just to change it to be P2 to represent the second promise I’ll say a sync operation 2 and I’ll say syn operation one just so we can differentiate these console statements so now I’ll say running both a synchronous operations let’s scroll up so we can see it better I can say promise.all and then I’ll pass it an array containing both of these promises so P1 and P2 now I’ll call then sixes s the result and I will console log the result and I also do. catch let me remove the semicolon so this takes in an err console.log and I’ll say airor air. message now we can end that with the semicon so this code kicks off two asynchronous operations and uses promise.all to wait until both promises are resolved the then method is called with the results when both operations complete so let’s execute this so command J control J and then node index.js so once both of them are completed then we see async operation one async operations 2 and then you see the two values that they return that they resolve to let me update this to be two I’ll run it again so once again we get the expected out so now let’s discuss handling promise rejections if one of the promises fail then promise.all will reject in the catch method will handle the error so if any one of them reject then the catch method will be executed so you can say for example rather than this being resolved we’ll specify the second parameter of reject and we will invoke that so this operation failed we can run that so here we see the error with the value of undefined so rather than passing one let pass in new error and I’ll say async operation one failed right for a descriptive error message rather than just the value one now we got our expected error message so in this example if P1 right the first promise right the simulation for calling the Facebook API if that fails then the entire promise.all will reject and the error will be logged so’s discuss using promise. race if you need to proceed as soon as possible as one of the promises is fulfilled or rejected you can use promise. race so rather than promise at all we can do promise. rce and in this case with promise. race the first promise to resolve or reject will determine the outcome if it resolves first the then method will be called with the result of the first fulfilled promise if it rejects first the catch method will handle the error so we can see an example of this let’s run it again so in this case the P1 rejected before the second operation likewise let’s say if I do comment this out and if I say resolve with the value one so once again promise. raise will resol or reject based on the first outcome so here we see for the result was the value of one as the async operation one completed first so in summary with promise. all this waits for all promises to resolve if any promise rejects the entire promise is rejected with promise. race this resolves or rejects as soon as one promise resolves or rejects these methods help manage multiple asynchronous operations effectively ensuring that your code is cleaner and more maintainable [Music] what are the advantages of using promise.all and promise. R for handling multiple asynchronous operations in JavaScript promise.all allows you to run multiple asynchronous operations in parallel and waits for all of them to complete before proceeding it’s useful when you need all tasks to finish successfully before taking the next step if any promise fails the entire operation fails so with promise. Ray it resolves or rejects as soon as one of the promises completes making it useful when you want to proceed based on whichever task finishes first this approach can help optimize performance when only the quickest result is needed how can managing multiple asynchronous operations with promises enhance the efficiency and readability of JavaScript applications managing multiple asynchronous operations with promises enhances the efficiency and reliability of JavaScript applications by allowing tasks to run concurrently reducing weight times with promis at all this ensures that all tasks complete successfully before proceeding making the application reliable when multiple results are needed with promise. rce this allows the application to respond Faster by acting on the first completed task improving performance in scenarios where the quickest result is prioritized these tools help structure and control complex asynchronous workflows leading to cleaner more maintainable code so let’s go over simplifying our asynchronous code with the async await keywords javascript’s async and await features provide a more readable and straightforward way to write a synchronous code resembling synchronous code so here’s an example using promises that we did in a previous lesson so here we see we have three functions which use an asynchronous operation so each of them are using set timeout and each of them return a promise so to utilize these and to get access to the result of the synchronous operation we use the then methods in order to access the data and we chain the methods now we can also implement this using the async away keywords so rather than doing it like this I can Implement a function and I’ll use the async keyword we can name this display item availability so we can say con list now we use the await keyword to await the result of the asynchronous operation we we call get grocery list we’ll pass in the ID of one then we’ll get the items say a wait get grocery items we’ll say list. name see yep so the name of the list then we’ll get the availability the await keyword check item availability so the first item in the list and then we’ll output availability and then we output the result of that so now let’s comment this out for now and we’ll just invoke this method so now if we were to execute this file need to change into the correct directory that would be nine I can run so here I get the output of after then fetching grocery list from the database fetching the grocery items and then the availability of the item so an explanation of this code we use the await keyword so this keyword allows you to wait for a promise to resolve and get its result you could use it only inside functions marked with the async keyword so let’s discuss async this keyword is used to declare that a function is asynchronous it ensures that the function returns a promise when using await the JavaScript engine pauses the execution of the function until the promise settles this makes the asynchronous code look like synchronous code which is easier to read and understand so handling errors with Ayn away in the promise based approach the catch method is used to handle errors and with a SN away you use a tri catch block so once again again we update this so I’ll say try let’s highlight all this and we’ll do option up Arrow to move it up then we can say catch air and then we can log this err out so that would be air do colon air. message better format this and then we save it so in summary asyn and wa provides a cleaner way to write a synchronous code that looks like synchronous code for for air handling we use try and catch blocks to handle errors when using a sync and a we using a sync and a we can make your asynchronous JavaScript code much more readable and easier to maintain this syntactic sugar over promises simplifies the code structure [Music] significantly how do the async and aw keywords simplify the process of writing and understanding a synchronous code in JavaScript the async and awake keywords simplify writing a synchronous code in JavaScript by making it look and behave like synchronous code async marks the function as asynchronous automatically returning a promise while await pauses the function’s execution until the promise resolves this eliminates the need for complex promise chains and nesting resulting in more readable maintainable and easier to understand code especially when dealing with multiple asynchronous operations what are the benefits of using a syn and a weight for a handling and a synchronous JavaScript code compared to traditional promise-based methods using async and a weight for error handling and JavaScript provides a more straightforward and readable approach compared to traditional promise-based methods with a SN in away you can handle errors using try and catch blocks which are familiar with synchronous code making it easier to understand and manage this approach of avoids the need for chaining catch methods resulting in cleaner code that is easier to debug and maintain especially in complex asynchronous [Music] workflows so let’s summarize what we covered in this section so this section was about synchronous versus asynchronous code understanding the difference between synchronous and asynchronous code is fundamental in JavaScript synchronous code executes sequentially blocking further execution until the current task is completed in contrast a synchronous code allows other operations to continue while waiting for an asynchronous task to complete improving performance and responsiveness let’s go over the patterns for dealing with asynchronous code JavaScript offers several patterns to manage asynchronous operations the first being callbacks these are functions passed as arguments to other functions to be invoked once an asynchronous operation is complete the second pattern is promises these are objects representing the eventual completion or failure of an a synchronous operation providing a cleaner way to handle a synchronous Logic the third pattern is a synon away this a syntax that makes a synchronous code appear synchronous enhancing readability let’s go over callbacks callbacks were the original method for handling a synchronous code in JavaScript they involve passing a function to another function to be executed after an operation completes so let’s talk about the concept of callback how these are nested callbacks which can lead to callback how which is a situation where code becomes deeply nested and difficult to manage this pattern complicates both reading and maintaining the code named functions to mitigate callback out name functions can be used to flatten the structure instead of nesting asynchronous functions you Define separate name functions and pass them as callbacks promises promises provide a more manageable alternative to callbacks a promise represents an operation that hasn’t completed yet but is expected in the future promises have three states pending fulfilled and rejected replacing callbacks with promises promises help avoid the complexity of nested callbacks by returning promises from functions you can chain asynchronous operations more straightforward using the them method for resolve promises and do catch for errors consuming promises consuming promises involves using the themm method to handle resolve values and do catch to handle errors this approach results in a more readable and maintainable code base creating subtle promises JavaScript provides promise. resolve and promise. reject methods to create promises that are already settled either fulfilled or rejected this is particularly useful in testing scenarios running promises in parallel using promise. all multiple promises can be executed in parallel and you can perform an action when all of them are resolved if any promise is rejected the entire promise. all is rejected async and a wa async and a wa keywords provide a way to write a synchronous code that look synchronous functions declared with a sync return a promise and a wait pauses the execution of the function until the promise is resolved or rejected making the code easier to read and maintain error handling is done using try and catch blocks by understanding and applying these patterns you can effectively manage asynchronous operations in JavaScript leading to more efficient and maintainable code

    By Amjad Izhar
    Contact: amjad.izhar@gmail.com
    https://amjadizhar.blog

  • Russian Movie Karamazov Family: Crime, Confession, and Descent

    Russian Movie Karamazov Family: Crime, Confession, and Descent

    The provided text immerses the reader in the tumultuous lives of the Karamazov family and their interconnected relationships. A bitter inheritance dispute between Fyodor Karamazov and his son Dmitry ignites a chain of dramatic events. The arrival of Ivan Karamazov further complicates matters, introducing philosophical and romantic tensions. Various characters grapple with love, jealousy, faith, and moral dilemmas, leading to intense confrontations and scandalous behavior. The narrative hints at a potential crime and its investigation, intertwining the personal struggles with broader societal issues. Through passionate dialogues and chaotic encounters, the text explores the complexities of human nature and the search for meaning amidst turmoil.

    The Brothers Karamazov: A Study Guide

    Quiz

    1. Describe Fyodor Pavlovich’s marital history and how his first two sons, Dmitri and Ivan, came to be raised apart from him.
    2. Explain the circumstances surrounding the birth and upbringing of Fyodor Pavlovich’s illegitimate son, Smerdyakov. What was his relationship with the other Karamazov brothers?
    3. What were the primary points of conflict between Dmitri Fyodorovich and his father, Fyodor Pavlovich, at the beginning of the narrative?
    4. Describe Ivan Fyodorovich’s intellectual pursuits and the impact of his article on church courts. What radical idea is associated with him?
    5. Explain Alyosha Karamazov’s decision to enter the monastery. What were his initial motivations, and what was the Elder Zossima’s instruction to him?
    6. Describe the complex relationship between Dmitri Karamazov and Katerina Ivanovna. What was the initial agreement between them, and how did it evolve?
    7. Explain the significance of Dmitri’s encounter with Grushenka. How did this meeting affect his relationships with Katerina and his father?
    8. Summarize Ivan’s “Grand Inquisitor” poem. What are the central themes and arguments presented within the poem?
    9. Describe the events leading up to Fyodor Pavlovich’s murder as presented in the provided excerpts. Who were the key individuals involved and what were their motivations?
    10. What were Dmitri’s actions and state of mind immediately following the discovery of his father’s death, according to the excerpts?

    Answer Key

    1. Fyodor Pavlovich was married twice. His first wife, Dmitri’s mother, came from a wealthy family who initially opposed the marriage. She eventually abandoned Fyodor, and after her death, Dmitri was raised by servants and later relatives. His second wife, Ivan and Alyosha’s mother, also died after giving birth, and these two sons were also largely neglected by their father and raised by others.
    2. Smerdyakov was the illegitimate son of Fyodor Pavlovich and a local “holy fool.” He was raised by the servant Grigory and his wife. Smerdyakov grew up resentful and isolated, with a cruel streak. His relationship with Dmitri, Ivan, and Alyosha is not explicitly detailed in these excerpts, but he is clearly positioned outside the family’s emotional core.
    3. The primary conflict between Dmitri and his father centered on Dmitri’s belief that he was entitled to an inheritance from his mother. Dmitri accused his father of squandering this money and sought to claim what he believed was rightfully his, leading to heated arguments and legal disputes.
    4. Ivan Fyodorovich was a brilliant intellectual who wrote influential book reviews and a controversial article on church courts. This article, notable for its tone and surprising conclusion, caused a significant stir. He is associated with the radical idea that “if there is no immortality, then everything is permitted.”
    5. Alyosha initially entered the monastery because the “road of humanity” had struck him early, and it presented him with ideals of love emerging from worldly malice. Elder Zossima, sensing his potential to help others in the world, instructed him to leave the monastery and be near his brothers, but not too close.
    6. Dmitri and Katerina Ivanovna were initially engaged, with Dmitri receiving money from her. However, Dmitri’s profligate lifestyle and his growing infatuation with Grushenka strained their relationship. Katerina continued to feel bound by her promise, while Dmitri felt increasingly trapped and drawn to Grushenka.
    7. Dmitri’s encounter with Grushenka ignited a passionate desire in him. This meeting intensified his conflict with his father, who also desired Grushenka, and further complicated his relationship with Katerina, to whom he felt indebted but no longer loved in the same way.
    8. The “Grand Inquisitor” poem depicts Christ’s return to Earth, where he is imprisoned by the Grand Inquisitor. The Inquisitor argues that the Church has corrected Christ’s work by offering people miracle, mystery, and authority, which they supposedly need more than freedom. The poem critiques the burden of free will and suggests that the Church provides a more comforting form of control.
    9. The excerpts depict Dmitri in a state of agitation, seeking money and confronting his father. Fyodor Pavlovich is shown to be fearful and anticipating trouble. Dmitri is described as having blood on his hands and clothing shortly after the murder. Smerdyakov’s feigned illness and evasiveness also suggest his involvement or knowledge of the crime.
    10. Following the discovery, Dmitri is described as being covered in blood and acting erratically. He confesses to having been at his father’s house but denies killing him. His attempts to explain his financial situation and his behavior suggest a state of panic and an effort to conceal something, though not necessarily murder in his own eyes.

    Essay Format Questions

    1. Analyze the theme of fatherhood and the complex relationships between Fyodor Pavlovich and his three sons as presented in the provided excerpts. How do the different sons react to their father, and what does this reveal about their individual characters?
    2. Explore the contrasting ideologies and beliefs represented by Ivan and Alyosha Karamazov. How do their views on faith, morality, and the human condition differ, and what significance do these differences hold within the narrative?
    3. Discuss the roles of the female characters, Katerina Ivanovna and Grushenka, in shaping the central conflicts and motivations of the male characters, particularly Dmitri. How do their desires and actions influence the unfolding events?
    4. Examine the significance of money and inheritance as driving forces in the relationships and conflicts depicted in the excerpts. How does the pursuit of wealth and the disputes over property contribute to the tragedy?
    5. Analyze the presentation of moral and philosophical ideas within the excerpts. How are concepts such as free will, faith, justice, and guilt explored through the characters’ actions, dialogues, and inner thoughts?

    Glossary of Key Terms

    • Miso family: Likely a misspelling of “Meso family,” referring to a family of middling wealth or social standing, below the aristocracy but above the peasantry.
    • Seminarian: A student studying to become a priest or other religious minister.
    • Courtyard hut: A small, basic dwelling located in the yard or grounds of a larger house, often used for servants or outbuildings.
    • Gymnasium: In 19th-century Russia, a type of secondary school emphasizing classical learning.
    • Caucasus: A region in southeastern Europe, between the Black Sea and the Caspian Sea, known for its military activity during the time period.
    • Dolgov: Likely a surname, possibly referring to an individual Dmitri interacted with during his time in the Caucasus.
    • Sprees: Periods of unrestrained activity, often involving excessive drinking or spending.
    • Frivolous: Lacking seriousness; carefree and superficial.
    • Inheritance: Property or money legally passed down to an heir upon the death of the owner.
    • Foster care: The temporary care of children by people other than their biological parents.
    • Nervous female disease: A vague and outdated term used to describe various psychological or emotional ailments in women.
    • Illegitimate son: A son born to parents who are not legally married.
    • Holy fool: In Russian Orthodox tradition, individuals who behave in unconventional ways, often appearing foolish, but are believed to possess spiritual insight.
    • Slander: The making of false and defamatory statements about someone.
    • Chervonets: A gold coin formerly used in Russia.
    • Mortar (referring to “iron dog”): Likely a heavy iron pestle used for grinding substances in a mortar, not a literal dog.
    • Novice (monastic): A person who has entered a religious order and is undergoing a period of training before taking final vows.
    • Fanatic: A person filled with excessive and single-minded zeal, especially for an extreme religious or political cause.
    • Mystic: A person who seeks by contemplation and self-surrender to obtain unity with or absorption into the Deity or the absolute, or who believes in the spiritual apprehension of truths that are beyond the intellect.
    • Worldly malice: Ill will or evil intent associated with the concerns and temptations of secular life.
    • Bride: A woman who is engaged to be married.
    • Lawsuit: A claim or dispute brought to a court of law for adjudication.
    • Fateful arrival: An arrival that is destined to have significant and often negative consequences.
    • Simple-minded: Having or showing a lack of intelligence or common sense.
    • Enthusiastic gratitude: Intense and eager appreciation or thankfulness.
    • Healed (in this context): Refers to a perceived improvement in health or condition, possibly through faith or suggestion.
    • Fox (colloquial): A sly or cunning person.
    • Duckweed: A small, simple aquatic plant that floats on the surface of still waters. Used here figuratively to imply something worthless or insignificant.
    • Elder (religious): In some religious traditions, a wise and respected senior figure, often with spiritual authority.
    • Clairvoyant: Having or exhibiting an ability to perceive events in the future or beyond normal sensory contact.
    • Prophecy: A prediction of what will happen in the future.
    • Wei Phantom: Unclear meaning, likely a colloquialism or exclamation.
    • Hymn to Joy: A famous ode written by Friedrich Schiller, celebrating unity and brotherhood.
    • Harit: Likely a misspelling of “Charites,” the Greek goddesses of charm, beauty, nature, human creativity, goodwill, and fertility.
    • Voluptuousness: Characterized by or giving sensual pleasure or gratification.
    • Kamaz: Unclear meaning, possibly a colloquialism or a reference specific to the context.
    • Bourbons: A European royal house of French origin.
    • Ensign: A junior officer rank in the military.
    • Rubles: The basic monetary unit of Russia.
    • Orderly (military): A soldier assigned to perform menial tasks for an officer.
    • Twilight: The time of day immediately following sunset.
    • Frost: Atmospheric moisture frozen into ice crystals on a surface.
    • Thou: The second person singular pronoun (used here for formal or archaic effect).
    • Thee: The objective case of “thou.”
    • Thy: The possessive case of “thou.”
    • Sword: A weapon with a long metal blade and a hilt with a hand guard, used for thrusting or striking.
    • Lieutenant Colonel: A mid-level officer rank in the military.
    • Softening in the brain: An outdated and non-specific term for a neurological condition.
    • Hieromonk: A monk who is also a priest in the Orthodox Church.
    • Minnows: Small freshwater fish.
    • Gudgeon: A small freshwater fish often used as bait. Used figuratively to represent someone easily deceived.
    • Woo: To seek the affection of (someone), typically with a view to marriage.
    • Madhouse: An outdated term for a mental institution.
    • Jester: A person who habitually plays the fool; a clown.
    • Astarti: Unclear meaning, possibly a misspelling or a local term.
    • Phantom: Something that appears real but is not; a ghost or apparition.
    • Lenten: Relating to Lent, a period of fasting and penitence in the Christian calendar.
    • Kulebyaki: A Russian baked pie, usually filled with fish, meat, or vegetables.
    • Artist (in this context): Possibly referring to someone skilled or clever, perhaps sarcastically.
    • Gender donkey: A nonsensical phrase, possibly a misunderstanding or a term of derision.
    • Baptism: The religious rite of sprinkling water onto a person’s forehead or of immersion in water, symbolizing purification or regeneration and admission to the Christian Church.
    • Islam: The religion of Muslims, a monotheistic faith regarded as revealed through Muhammad as the Prophet of Allah.
    • Christ glorifies: Expressing praise and honor for Jesus Christ.
    • Scoundrel: A dishonest or unscrupulous person; a rogue.
    • Broth: A savory liquid made by simmering meat, bones, or vegetables in water, used as a base for soup or gravy.
    • Jelly: A food made by boiling sugar and fruit juice, causing it to set. Used here sarcastically in response to “broth.”
    • Jesuit: A member of the Society of Jesus, a Roman Catholic order of priests founded by St. Ignatius Loyola. Used here metaphorically to describe someone perceived as cunning or deceptive in their faith.
    • Chervonets: A gold coin formerly used in Russia.
    • Zooi: Unclear meaning, possibly a derogatory term.
    • SRV: Unclear meaning, likely an abbreviation or local reference.
    • Lama: A title for a Tibetan Buddhist monk, especially one of high rank. Used here figuratively, perhaps sarcastically, to describe someone’s appearance or demeanor.
    • Toto: Unclear meaning, possibly a personal reference or a nonsensical word.
    • Rayka’s nuts: Unclear meaning, likely a vulgar or nonsensical phrase.
    • Washcloth: A small cloth used for washing.
    • Punk (colloquial): A worthless or contemptible person.
    • Satisfaction (in the context of a duel): The act of avenging an insult or affront, often through a formal duel.
    • Cross bomb: Unclear meaning, possibly a nonsensical phrase or a colloquialism.
    • Cherry tree: A type of tree that produces cherries.
    • Pomari: Unclear meaning, possibly a local term or a misspelling.
    • Tel: Unclear meaning, possibly an abbreviation or a personal reference.
    • Bra: Unclear meaning, possibly an exclamation or a local term.
    • Cherma Chersh: Unclear meaning, likely a place name or a nonsensical phrase.
    • Eno: Unclear meaning, possibly an exclamation.
    • ONT: Unclear meaning, possibly an abbreviation or a sound effect.
    • Adj: Abbreviation of adjective, used here nonsensically.
    • Mho T: Unclear meaning, possibly a nonsensical phrase.
    • Bё: Unclear meaning, possibly a sound effect or a nonsensical word.
    • A good I do not repent for your blood: A confused and possibly delirious statement.
    • Stink water: Foul-smelling water.
    • Trough: A long, narrow open container for animals to eat or drink out of.
    • Sl zavt Ah heart Oh oh: Unclear meaning, possibly expressing pain or distress.
    • Bastard: A person born out of wedlock (used here as a derogatory term).
    • Wallpaper: Decorative paper for the walls of a room.
    • Sima: Likely a personal name.
    • Kolya: A diminutive form of Nikolai, a personal name.
    • Agrafena Alexandrovna: A personal name.
    • Angel: A supernatural being who serves as a messenger of God. Used here figuratively to describe someone admired or loved.
    • Pear: A type of fruit. Used here as a nickname or term of endearment for Grushenka.
    • Bucket: A roughly cylindrical container, typically open at the top and fitted with a handle, used to hold liquids or other material.
    • Stinkers: A derogatory term, possibly referring to Smerdyakov or someone else considered contemptible.
    • Bike (colloquial): A lie or fabrication.
    • Rusya: A diminutive form of a Russian name.
    • Pear tree: A tree that produces pears.
    • Pof nusi: Unclear meaning, possibly a playful or nonsensical phrase.
    • Dragee: A sugar-coated pill or candy.
    • Ok Petka Petka: Likely a playful or familiar address to someone named Pyotr.
    • Petka: A diminutive form of Pyotr, a personal name.
    • Panya: A respectful form of address for a lady in Polish.
    • Noble: Belonging to a hereditary class with high social or political status; aristocratic.
    • Pan: A formal title of respect for a man in Polish.
    • Rublevsky: Relating to rubles or the ruble currency.
    • Troika: A group of three people or things, especially a vehicle drawn by three horses abreast.
    • Bari: A term of address for a lady, similar to “madam” or “miss” in Russian.
    • Maryu: Likely a misspelling of Marya, a personal name.
    • Tguk: Unclear meaning, possibly a playful sound or nonsense word.
    • Bancho: Unclear meaning, possibly a card game or local term.
    • Ve: Likely an abbreviation or colloquialism.
    • Yano: Likely a personal name or a term of endearment.
    • Gutov: Likely a surname.
    • Pani: A formal title of respect for a woman in Polish, equivalent to “madam.”
    • Khokhlova: A surname.
    • Puddle: A small accumulation of water, typically rainwater, on the ground.
    • Zhartuy: “Are you joking?” in Russian.
    • Pove Rony: Unclear meaning, possibly a misspelling or a local term.
    • Greena: Likely a misspelling of a name.
    • Vrublevsky: A surname.
    • Bodyguard: A person or group of people employed to protect someone.
    • Zhi rye pono Ji: Unclear meaning, possibly a nonsensical phrase.
    • Coat: An outer garment worn over other clothes.
    • Fur coat: A coat made from animal fur.
    • Hat: A covering for the head, typically having a shaped crown and brim.
    • Pan houses: Likely referring to the residences of Polish gentlemen.
    • Togo plush: Unclear meaning, possibly a combination of Russian and another language, or nonsense.
    • Negroes: An outdated and often offensive term for Black people.
    • Kitty: A term of endearment, often for a girl or woman.
    • Bato: Unclear meaning, possibly a personal reference or a local term.
    • Countess Alexandra: A noble title and personal name.
    • Eh: An exclamation.
    • Gates of paradise: The entrance to heaven.
    • Saint: A person acknowledged as holy or virtuous and typically regarded as being in heaven after death.
    • Smelled: Gave off a particular scent.
    • Lap: The area between the knees and the hips when sitting.
    • Bert: Unclear meaning, possibly a personal reference.
    • Zhsh: Unclear meaning, possibly an abbreviation or sound effect.
    • Basenko: Unclear meaning, possibly a term of endearment.
    • Matryona: A personal name.
    • Fiery lake: A mythical place of eternal punishment in some religious beliefs.
    • Guardian angel: A spirit believed to watch over and protect a person.
    • Rakit: A shortened or familiar form of Rakitin, a surname.
    • Lackey: A servant, especially a liveried footman or manservant. Used here derogatorily.
    • Pocket pocket Sun Oh: Unclear meaning, possibly a nonsensical phrase.
    • Pyotr Ilch: A personal name.
    • Plotnikovo: A place name.
    • Deer Dmitry Fyodorovich: A playful or familiar way of addressing Dmitri.
    • IBS: Unclear meaning, likely an abbreviation or a nonsensical word.
    • Pulka: Unclear meaning, possibly a pet name or a colloquialism.
    • Wet (as a place): Likely a local name for a tavern or establishment.
    • Sabbath: A day of religious observance and abstinence from work, kept by Jews from Friday evening to Saturday evening, and by most Christians on Sunday. Used here in a non-literal sense, possibly to refer to a day off or a time of leisure for Misha.
    • Misha: A diminutive form of Mikhail, a personal name.
    • Expensive cart: Likely referring to the vehicle used for transportation.
    • Bad pampering hide shi Degi: Unclear meaning, possibly a nonsensical phrase expressing disapproval.
    • Dmitrich: A familiar form of Dmitry.
    • Riddle: A question or statement intentionally phrased so as to require ingenuity in ascertaining its answer or meaning, typically presented as a game.
    • Aplot: Unclear meaning, possibly a misspelling or a sound effect.
    • Basket: A container made of interwoven strips of material such as straw or willow.
    • Champagne: An expensive sparkling white wine made in the Champagne region of France.
    • Candy: A sweet made of sugar or syrup combined with flavorings and often other ingredients.
    • Guk Girls: Unclear meaning, possibly a local term or nonsense referring to women.
    • Dozens: Multiples of twelve.
    • Shekels: Ancient units of weight and currency. Used here figuratively, perhaps referring to small amounts of money.
    • AHO te deri: Unclear meaning, possibly a phrase in another language or nonsense.
    • Brosay: “Throw” in Russian.
    • Kolya: A diminutive form of Nikolai, a personal name.
    • Sham: A thing that is not what it is purported to be; a deception or fraud.
    • Oysters: A bivalve mollusk with a rough, irregular shell. Some kinds are widely eaten, and others may produce pearls.
    • Genies: Likely a misspelling of “glasses” (as in drinks).
    • Blow up (colloquial): To become very angry.
    • Hi: An informal greeting.
    • Toast: An expression of goodwill or respect made publicly by raising one’s glass and drinking in unison.
    • Itsari: Unclear meaning, possibly a misspelling or a local term.
    • Kick this glass out: An idiom meaning to drink the glass to the bottom or to empty it quickly.
    • Laughter: The action or sound of laughing.
    • Ay: An exclamation of surprise or approval.
    • Woman: An adult female human being.
    • Queen: A woman reigning over a kingdom or territory in her own right and usually by hereditary succession. Used here figuratively.
    • The earth is sad for me: A melancholic statement expressing personal sorrow.
    • Peter Lich: Likely a familiar or slightly incorrect form of Pyotr Ilyich.
    • Yurik: A diminutive form of Yuri, a personal name.
    • Scull: A skull, the bony framework of the head of a vertebrate. Used here figuratively to suggest death or mortality.
    • Master: A man who has people working for him, especially servants. Used here to refer to Fyodor Pavlovich.
    • Throw them down the road into a puddle: An expression of contemptuous dismissal of money.
    • Gypsies: A nomadic people of generally swarthy complexion, believed to have come originally from northern India. Used here to refer to musicians or performers.
    • Lakova: Likely a surname.
    • Pachu: Unclear meaning, possibly a colloquialism or a place name.
    • Rumor: A widely circulated story, statement, or report, typically of uncertain or doubtful truth.
    • Dandruff: Small white or grey flakes of dead skin shed from the scalp. Used here figuratively to describe someone as insignificant or unwanted.
    • Maid: A female domestic servant.
    • Feni: A diminutive form of a female name, possibly Fenia.
    • Iron dog from a mortar: Likely referring to the heavy iron pestle.
    • Ram: An uncastrated male sheep.
    • Police officer: A member of a police force.
    • Barn: A large agricultural building used for storing farm equipment or produce and sometimes housing livestock.
    • Baren: Unclear meaning, possibly a misspelling or local term.
    • Trifon Borisov: A personal name.
    • Pole: A person from Poland.
    • [ __ ]: An obscenity or unintelligible speech.
    • Comrade: A person who shares one’s interests or activities; a fellow member of an organization or team. Used here in a general sense.
    • States dressed Kutya rich people: A confused description, possibly referring to well-dressed individuals or a specific group. Kutya is a sweet grain pudding traditionally served at funerals and memorial services in some Slavic cultures.
    • Pome Maximov naked and rides around in front of different gentlemen: A bizarre and unclear description of someone’s behavior.
    • Borisovich: A patronymic suffix meaning “son of Boris.”
    • Zhitki: Unclear meaning, possibly a local term or a misspelling.
    • Christmas: The annual Christian festival celebrating Christ’s birth, held on December 25 in the Western Church and on January 7 in the Eastern Orthodox Church.
    • Cymbals: Percussion instruments consisting of thin, round plates of metal that are struck together to produce a ringing sound.
    • Violins: Wooden stringed instruments played with a bow.
    • Mary: A female personal name.
    • Steppe: A large area of flat, unforested grassland in southeastern Europe or Siberia.
    • Choir: An organized group of singers, typically performing together.
    • Meanness to the point of disgust: Extreme pettiness or unkindness that evokes revulsion.
    • Lousy: Very poor or bad; of wretched quality.
    • Cassock: A full-length garment of a single color worn by certain Christian clergy and others having some particular office or role in a church.
    • Ai: An exclamation of surprise or realization.
    • Wine and snacks: Alcoholic beverages and light refreshments.
    • Candy pies: Likely small pies filled with something sweet.
    • Girls: Young female individuals.
    • Vodka: A Russian alcoholic spirit distilled from grain or potatoes.
    • Tea: A hot drink made by infusing the dried crushed leaves of the tea plant in boiling water.
    • Sir: A polite or formal form of address for a man, especially one in a position of authority or respect.
    • Blue room: A specific room, likely in the location where the events are taking place.
    • Pozhva Yala cash: Unclear meaning, possibly a phrase in another language or nonsense.
    • Privately have others chambers: Indicating that there are separate rooms for private conversation.
    • Prince Pal: Likely a garbled or humorous mispronunciation of a title and name.
    • Steering wheel steering wheel roleplay what is the Queen or something: A nonsensical phrase, possibly referring to a game or fantasy.
    • Miti: A diminutive form of Dmitri.
    • Penny pan: Unclear meaning, possibly a local idiom or a nonsensical phrase.
    • Liqueur: A strong, sweet alcoholic liquor, typically drunk after a meal.
    • Heaps of money: A large amount of money piled up.
    • Pocket: A small bag sewn into or onto a garment for carrying small articles.
    • [applause]: Sound of clapping, indicating approval or appreciation.
    • Ish: An exclamation.
    • **Walked through the park with you Panya I thought it was more fun Let’s have a drink Mr. and with another Mr. Mrs. Hey, I see, nobles, come on, take it glass pan in Rublevsky now let’s drink to Russia I want Russia and I would also be for Russia old granny all all these Well hooray hooray hooray hooray Well, you what for Russia before the division Poland a couple and not weaknesses to their own so as not to edge it was me I always offend everyone it’s my fault I didn’t want you you have to offend to make it fun. Where? music where are the girls why the girls no give me champagne more champagne Father is gone and the troika with supplies I haven’t even arrived yet, and where are the girls? Yes, girls, here they are are going to Hello Bari Hello Mar Marya So where is Maryu Sir, we’ll deliver soon, please. worry and sent for liquid with cymbal and I have already raised my daughters now I will do everything so let’s go to the hotel girls from the box get some tguk candies and Andrey some vodka he left how did he leave he offended me him I offend everyone but let’s play cards Give M 5 rubles I would also risk it in the tank cards are a great idea great, just need it to be there again it’s fun I’m holding 10 and you’ll lose again come Gentlemen, bye music There’s nothing we can do for now it was fun, maybe we could play bancho when ve Well of course c This is good, very good, Yano agree but what is this late is this then it’s time for Mrs. late late You can’t be boring yourself and make others bored too it was boring Mitya it was them who did it to you sat were silent N he vaguely sees your disinclination and That’s why sad in cards Gutov sir in the map do not agree then let’s start just so the cards are from the owner Pani then pour it the way from the owner is good I understand Let it be from the owner that you are good, Mrs. kar and I already lost 50 rubles to them today Pan was Unlucky Pan may be again happy How much can a bank hold 100 Maybe 200 Thank you three, how much will it be? I want to put a lot of things on you, Mrs. lose take cards laying the bank What do you want? I decided to do whatever you want and it’s not this that bothers you bad timing about general our friend Dmitry Fyodorovich Karamazov familiar just 3 hours ago this a friend came here at this very living room to kill me kill so he I wanted to kill you too also, he already killed someone, please listen to the court I’ll give you VS for just half a minute explain this evening Dmitry Fyodorovich entered the room. carrying a wad of ruble bills in my hands approximately in two or even 3000 rubles hands he had the same face bloody And he himself seemed as if by the way that you judged him the sum of 3000 so that go as if to win a gold prize my God I didn’t give him any money, I didn’t give him any It was he who killed his father. Allow me. Allow me, madam, allow me, are you sure? remember that they didn’t give him any money no Dava didn’t give it to me, I refused him and he he pounced on me and I jumped back I can tell you now how to a person from whom I have nothing to hide He in me you can spit like that imagine madam a a what are we standing there for let’s go Killed killed And how did he kill him like this was Sit down Sit down Judging by everything He had stocked up on a copper pestle in advance. in the kitchen of his mistress and with this pestle I broke the poor guy’s head and now rushes wet with the aim of killing this very one mistress But this is only mine for now I guess I felt it and that Now He killed not me but only one his father is the finger of God were ashamed and then he spat at me with a throw on his neck and that means where galloped But now what are we with you Now I’ll go straight to the police chief and I’ll tell him everything and then he’ll be like himself Mikhail Makarovich knows exactly to him a wonderful person and knows what not to do Should I go with you? No, no, but here it is. if you now with your hand wrote only three lines about money You didn’t give any to Dmitry Fyodorovich. This would certainly not be superfluous. How you are resourceful Pyotr Ilyich You me You simply amaze me It’s amazing that you serve here I have never given in my life on loan to Dmitry Fyodorovich Karamazov 3,000 RUB I swear by All that is holy that exists in our world Khokhlova, go! and save us all brother you should fill the puddle with life Yes sir boy please I have a report about a possible murder the police chief has already informed the police about the murder it is known that the murder was committed after all The yard of the murdered about this reported so mister investigator we’re already waiting for the investigator notified before evening Gentlemen Good evening Good evening more unpleasant incident Gentlemen Yes, good evening, gentlemen, gentlemen. Well, here it is. Nikolay Parfenovich and since the political Kirish prosecutor Vika and our new Zemsky doctor are also with We can go to us immediately we’ll try not to get to the scene of the incident to excite unnecessary agitation in a year I’m afraid Mikhail Makarovich avoid general agitation will not succeed father the murders are too visible events and here psychological ones will rise and spiritual questions are so significant that you and I will find ourselves in the center of attention not only of the city But and all I don’t think I’m in Russia anymore I need to take my leave My Lord respect, well, let’s discuss the details, gentlemen [music] 200 lost, you still bet 200 more 200 Pani nape Stop it Dmitry froch pretty well why Well just spit and go away many lost the zhartuy I’m not kidding at all I’m kidding He’s telling the truth Mitya you’ll lose clear pove Rony do not dare to shout Ms. Greena Clearly Great into two words that sh Madam, please come to that I’ll tell you two words in the room, I’m happy you will be Mr. Vrublevsky is with me Bodyguard Let him go he even certainly Well march where are you my soul I’ll be back in a moment than I could give them do you want to serve? 3000 money Here you go leave zhi rye pono Ji Listen I see you are a man reasonable take 3000 get out of here to all the devils Well, just now this minute and so that forever And what do you have there coat I have a fur coat and a hat. I’ll take everything out right now. the three are laid down and the finishing touches are being made again rubles and rubles again like this 500 rubles now as a deposit and 2500 tomorrow in the city I swear by honor that there will be Mrs. Well and the Land why 700 700 700 and not 500 right now hands of Madam, why don’t you believe in hands 700 Well, what are you saying, I won’t give it to you I’ll give you all three now And you again tomorrow you’ll come back to her and what? No, I don’t have it 3000 Well, at my house there in the city where lie Pan houses hidden whether greedy e God don’t eat yet why do you want to add more pears Togo plush in Russian speak not a single word of Polish I didn’t speak Russian before Have you really forgotten about pa ae a in 5 years? Negroes in Russian Speak or I don’t want to listen to anything, Ms. agrafena I came to forget the old and what was before today forgive me but this Pan Mitya You came to forgive me [music] I’m not a coward, I’m not sorry generous but I was surprised by them lovers Hey Pani Pani I was not her lover how funny I am in front of them protect this pan Mitya gave me life in those chambers to make me leave I spat on the gentleman physical he gives you money Did I give she is pure and corrupt Mitya is shining Yes, it’s not him who takes money from himself I took it, but he wanted all 3000 at once I gave him 700 ass, no problem. Well, I understand. Why does he need 700 when he is known as I have more then that’s why I came get married Mrs. Arepina I I am a knight and not a nobleman Laida apple take you as a spouse but I see pa Swan equal

    Briefing Document: Analysis of “01.pdf” Excerpts

    Date: October 26, 2023 Prepared for: [Intended Audience – e.g., Personal Study, Literary Analysis Group] Subject: Detailed Review of Themes and Important Ideas in Excerpts from “01.pdf”

    This briefing document provides a detailed review of the main themes, important ideas, and key facts presented in the provided excerpts from “01.pdf.” The excerpts primarily focus on introducing the Karamazov family, their complex relationships, their individual struggles, and the early stages of events that appear to be leading towards a significant conflict, potentially a crime.

    Main Themes:

    • Family Discord and Dysfunction: The excerpts heavily emphasize the fractured and abnormal family dynamics of the Karamazovs. Fyodor Pavlovich is depicted as a neglectful and self-serving father, with strained relationships with all his sons.
    • Mitya’s resentment: He feels cheated of his inheritance and views his father with hostility. “He came to his father to explain about the property which he believed was left to him the inheritance after the death of the mother is so small… ‘that’s not it deception vile lie.’”
    • Ivan’s intellectual detachment and moral ambiguity: His controversial article on church courts and his later pronouncements hint at a rejection of traditional morality. “‘destroy in humanity the Faith in his immortality in him will also not run out only love but also every living force moreover, then nothing will happen without everything will be moral everything is permitted everything will be permitted.’”
    • Alyosha’s spiritual seeking amidst worldly turmoil: He seeks solace in the monastery but is drawn back into the family’s conflicts. “Alyosha was not at all a fanatic and not a Mystic if he hit on the monastery road is just because he was early the road of humanity struck at that time And she presented him with, so to speak, ideals…”
    • Smerdyakov’s resentment and nihilistic views: His illegitimate status and harsh upbringing have seemingly fostered a deep bitterness and a belief in the absence of inherent morality. This is explicitly linked to Ivan’s ideas: “‘destroy in humanity the Faith in his immortality… everything is permitted.’”
    • Inheritance and Greed: The dispute over the inheritance from Mitya’s mother is a central point of conflict, fueling Mitya’s animosity towards his father. This highlights the theme of materialism and its corrupting influence on family bonds.
    • Love, Lust, and Jealousy: Complex webs of romantic and sexual relationships are introduced, characterized by passion, betrayal, and intense jealousy.
    • Mitya’s relationships with Katerina Ivanovna and Grushenka: He is engaged to Katerina but deeply infatuated with Grushenka, leading to financial and emotional turmoil. His jealousy of his father’s interest in Grushenka is evident.
    • Katerina Ivanovna’s pride and complicated affections: She seems to be driven by a sense of duty and perhaps a desire to control, even in her relationships.
    • Grushenka’s manipulative charm and past傷痕: She appears to enjoy the attention of both Fyodor and Mitya, possibly seeking some form of validation or revenge for past hurt. “‘We wilful but proud heart and we were one polish officer was unhappy for 5 years back and we loved him and everything to him they brought it and he left us and married another…’”
    • Faith, Doubt, and Morality: The characters grapple with questions of faith, the existence of God, and the basis of morality. Ivan’s nihilistic pronouncements challenge traditional religious beliefs, while Alyosha seeks spiritual guidance. Smerdyakov explicitly links the rejection of immortality to the idea that “everything is permitted.”
    • Social Hierarchy and Class: The excerpts touch upon the social dynamics of the time, with mentions of wealthy families, seminarians, military officers, landowners, and servants. The unequal treatment and social prejudices are subtly present.
    • The Role of the Past: Past relationships, betrayals, and grievances heavily influence the present actions and motivations of the characters. The abandonment of the sons by their father and the misfortunes of their mothers cast long shadows.

    Most Important Ideas and Facts:

    • Introduction of the Karamazov Family: The excerpts clearly establish the core members: Fyodor Pavlovich and his four sons (Dmitry/Mitya, Ivan, Alyosha, and the illegitimate Smerdyakov), along with key female figures (Katerina Ivanovna and Agrafena Alexandrovna/Grushenka).
    • Mitya’s Financial Dispute: Mitya believes his father has squandered his mother’s inheritance and demands his due. This is a major source of tension.
    • Ivan’s Intellectual and Moral Stance: His article and subsequent statements articulate a philosophy where the absence of belief in God and immortality leads to the erosion of moral boundaries.
    • Alyosha’s Monastic Aspirations: He intends to become a novice, seeking a spiritual path, but remains connected to his family’s worldly problems.
    • Smerdyakov’s Background and Ideology: His illegitimate birth, upbringing by Grigory, and adoption of nihilistic ideas, seemingly influenced by Ivan, are established. His epilepsy is also mentioned.
    • Complex Romantic Entanglements: The relationships between Mitya, Katerina, and Grushenka are highly volatile and driven by passion, pride, and jealousy.
    • Fyodor Pavlovich’s Character: He is consistently portrayed as crude, manipulative, and driven by self-interest and lust.
    • The Incident with Captain Snegiryov: Mitya’s past cruel behavior towards Captain Snegiryov and his daughter is revealed, highlighting his impulsive and sometimes violent nature.
    • The Package of Money: Mitya’s attempt to obtain 3000 rubles, his possession of a sealed package of that amount, and his conflicting explanations regarding its origin are crucial plot points.
    • The Elder Zosima’s Role: The excerpts introduce the revered elder and Alyosha’s connection to him, suggesting a source of spiritual guidance within the narrative.
    • Growing Suspicion and Foreshadowing: The narrative hints at impending tragedy, particularly through the escalating conflicts, intense emotions, and the presence of nihilistic ideologies. The final pages of the excerpt strongly suggest a murder has occurred and suspicion has fallen on Dmitry.

    Key Quotes:

    • (Ivan’s Nihilism): “‘destroy in humanity the Faith in his immortality… everything is permitted.’”
    • (Mitya’s Accusation): “‘Well, who’s there hence it dishonestly there is his second wife Sophia Ivanna…’” (implying his father cheated his mother).
    • (Mitya on Beauty and the Human Heart): “‘Beauty is terrible and horrible the thing is scary because it is not Find out here the devil is fighting with God The battlefield of the human heart.’”
    • (Grushenka on her Past): “‘We wilful but proud heart and we were one polish officer was unhappy for 5 years back and we loved him and everything to him they brought it and he left us and married another…’”
    • (Fyodor Pavlovich on Scandal): “‘Case Father doesn’t need money at all, he just needs it scandal.’”
    • (Dmitry’s Conflicting Statements about the Money): Numerous instances of him possessing 3000 rubles, claiming it’s his, then admitting it was meant for Katerina’s sister.
    • (The Detective’s Arrival): “‘Mr. Retired Lieutenant Karamazov I must announce to you that you you are accused of murdering your father Fyodor Pavlovich Karamazov passed in this night.’”

    Conclusion:

    The excerpts from “01.pdf” lay the groundwork for a complex and dramatic narrative centered around family, morality, and passion. The introduction of the Karamazovs reveals deep-seated conflicts and contrasting ideologies that appear to be driving the characters towards a significant and potentially violent climax. The themes of inheritance, love, faith, and doubt are intertwined, creating a sense of unease and foreshadowing the tragic events that seem imminent. The final passages confirm a murder and place Dmitry firmly under suspicion. This material provides a rich foundation for exploring themes of guilt, responsibility, and the human condition.

    Karamazov Family: Key Themes and Conflicts

    Frequently Asked Questions about the Provided Text

    1. Who are the main members of the Karamazov family introduced in this text, and what are their initial relationships like?

    The main members introduced are Fyodor Pavlovich Karamazov and his three (legitimate) sons: Dmitri (Mitya), Ivan, and Alexei (Alyosha), as well as his illegitimate son, Smerdyakov. Fyodor Pavlovich is depicted as a neglectful and scandalous father. Mitya is the eldest, in conflict with his father over inheritance money, and known for his passionate and impulsive nature. Ivan is intellectual and skeptical, having gained some literary fame. Alyosha is the youngest, a novice in a monastery, characterized by his faith and compassion. Smerdyakov is a resentful servant, also believed to be Fyodor’s son, and is epileptic. The relationships are fraught with tension, particularly between Fyodor and Dmitri over financial matters, and a general sense of abandonment by the father is evident in the upbringing of all the sons.

    2. What are some of the key conflicts and disputes that emerge among the characters in these excerpts?

    Several key conflicts arise. The most prominent is the ongoing financial dispute between Dmitri and his father regarding Dmitri’s inheritance from his mother. Romantic rivalries also appear, as both Fyodor and Dmitri are interested in the same woman, Grushenka, and Dmitri is engaged to Katerina Ivanovna while seemingly in love with Grushenka. Intellectual and philosophical conflicts are hinted at, particularly in Ivan’s controversial article on church courts and his later discussions about morality and the existence of God. There’s also an underlying tension stemming from the illegitimacy and social standing of Smerdyakov, as well as the general dysfunction within the Karamazov family.

    3. What are some of the significant personality traits and beliefs revealed about the different Karamazov brothers in these excerpts?

    Dmitri is shown to be passionate, impulsive, and prone to anger, particularly concerning his honor and financial rights. He is also deeply conflicted in his affections. Ivan is portrayed as intellectually brilliant but also cynical and troubled by questions of morality without God. He seems to grapple with the implications of his own intellectual ideas. Alyosha is depicted as kind, compassionate, and deeply religious, seeking spiritual guidance in the monastery and acting as a confidante to his brothers and others. Smerdyakov is resentful, cruel (as evidenced by his childhood treatment of cats), and possesses a twisted understanding of morality, seemingly influenced by Ivan’s ideas.

    4. What role do women play in the unfolding events and conflicts described in the text?

    Women are central to many of the conflicts. The two wives of Fyodor Pavlovich and their fates are briefly mentioned, highlighting his neglect. Grushenka is a point of contention between Fyodor and Dmitri, a woman desired by both. Katerina Ivanovna is Dmitri’s fiancée, but their relationship is complex and strained by his feelings for Grushenka and past events involving money. Lizaveta Smerdyashchaya (Lizochka) is the mentally disabled woman who is the mother of Smerdyakov, her story highlighting societal marginalization. These women are not passive figures but objects of desire, sources of financial entanglement, and individuals with their own agency and complexities that drive the plot.

    5. What are some of the philosophical and ideological themes that surface in the dialogues and actions of the characters?

    Several philosophical themes emerge. The question of morality with or without religious belief is discussed, particularly in relation to Ivan’s idea that “everything is permitted” if God does not exist. The conflict between faith and reason is evident in the contrasting beliefs of Alyosha and Ivan. Ideas about human nature, including the capacity for both good and evil, are explored through the actions and motivations of the characters. Social commentary is present in the depiction of wealth, poverty, and social standing, as well as in the interactions between different classes of people.

    6. What hints or foreshadowing are present in these excerpts regarding potential future events, particularly concerning violence or crime?

    There are several instances of foreshadowing. The intense conflict between Dmitri and his father over money, coupled with their mutual interest in Grushenka and Dmitri’s passionate nature, hints at potential violence. Dmitri’s repeated threats and his volatile temper are clear warning signs. Ivan’s disturbing philosophical ideas about the absence of moral law also create a sense of unease. The introduction of Smerdyakov, his resentment, and his connection to Ivan’s theories could also foreshadow his involvement in future dark events. The mention of Dmitri seeking weapons and his agitated state further suggests the possibility of violence.

    7. How is the theme of family and fatherhood presented in these excerpts?

    The theme of family is presented as deeply dysfunctional. Fyodor Pavlovich is portrayed as a selfish and irresponsible father who has emotionally and financially neglected his sons. The lack of a strong paternal figure has led to the brothers developing in distinct and often conflicting ways. The relationships between the brothers are complex, marked by a mixture of affection, rivalry, and a shared history of paternal neglect. Illegitimacy and its social consequences are also explored through the character of Smerdyakov. Fatherhood is depicted as a failure in these excerpts, leading to lasting damage in the lives of the sons.

    8. What role does religion and spirituality play in the lives of the characters as depicted in these excerpts?

    Religion and spirituality are significant forces in the lives of some characters, particularly Alyosha, who is a novice in a monastery and seeks moral and spiritual guidance. The figure of the “holy elder” suggests the importance of religious figures and faith in the community. However, the excerpts also present skepticism and intellectual challenges to religious belief, most notably through Ivan’s perspective. The tension between faith and doubt, and the search for meaning and morality in a world with or without God, are key aspects of the characters’ internal and external conflicts.

    Karamazov Property Lawsuit

    Based on the sources, there is a significant legal dispute, or lawsuit, over property between Dmitry Fyodorovich Karamazov and his father, Fyodor Pavlovich Karamazov.

    Here’s a breakdown of what the sources reveal about this lawsuit:

    • Origin of the Dispute: The lawsuit initiated because Dmitry Fyodorovich believed that property, specifically his mother’s village of Chersh, rightfully belonged to him. He expected to inherit wealth from his mother and sought to claim it upon reaching adulthood.
    • Fyodor Pavlovich’s Stance: Fyodor Pavlovich contested Dmitry’s claim, asserting that the inheritance was small and had been squandered due to Dmitry’s “frivolous” youth and being a “party animal”. He claimed Dmitry had already spent the value of his property and had nothing left.
    • Formal Legal Action: Dmitry “started a lawsuit with his father over property that belonged to him once his mother village chersh”. This indicates that the disagreement progressed beyond a mere family dispute and entered the formal legal system.
    • Involvement of Ivan Fyodorovich: The arrival of Ivan Fyodorovich in the city is described as “fateful” and serving “as the beginning of so many consequences and our story begins” in relation to this lawsuit. This suggests Ivan’s presence and actions are intertwined with the unfolding of the property dispute.
    • Dmitry’s Belief in his Right: Dmitry strongly believed in his “legal” right to the money and inheritance from his mother.
    • Financial Records: There are mentions of “receipts for everything you had” in the context of Dmitry and his father’s financial dealings, implying that the court proceedings would likely involve examination of such records.
    • Alternative Claims: Dmitry also seemed to believe that 3000 rubles his father had prepared in an envelope (ostensibly for Grushenka) were rightfully his.

    In summary, the central point of the legal action is Dmitry’s demand for what he considers his inheritance from his mother’s property (the village of Chersh), which his father denies him, leading to a formal lawsuit that plays a significant role in the unfolding events of the story.

    Liz’s Apparent Healing and Lingering Condition

    The sources provide some details regarding the healing of a character named Liz.

    According to one of the speakers in the first excerpt, on Thursday, Likiy orite (as understood by the speaker) prayed over Liz and laid hands on her. Following this, there seems to have been an improvement in Liz’s condition.

    • While Liz was still lying in a chair, her night fevers had completely disappeared.
    • On the day the speaker is recounting this, Liz stood up for a whole minute without any reaction.
    • A Dr. Herb was consulted and was reportedly amazed and perplexed by Liz’s progress.
    • The speaker expresses enthusiastic gratitude for this apparent healing.

    Later in the sources, there are other mentions of Liz that may relate to her ongoing condition and recovery:

    • Liz is mentioned in the context of her mother’s worries. Her mother refers to Liz’s “cry” and remembers a “wonderful lead lotion”.
    • Julia brings a handkerchief to Liz.
    • Liz is described as waiting for Alexey Fyodorovich.
    • There’s a discussion about whether a boy bitten by a mad dog could marry, followed by a statement that “angel Mom, he wants to marry me”, which seems to be Liz speaking about Alexey Fyodorovich, though her mother dismisses it as not funny and not for her. This could suggest Liz’s mental or emotional state is still a concern.
    • Alexey Fyodorovich mentions that he hopes Liz won’t think of “stupidity” and that something should not be told to her because it would be harmful. He also states he won’t accept her now and will leave and take her away in the future.
    • In Source 15, Liz has a direct conversation with Alexey Fyodorovich. She discusses money, letters, jokes, and her desire to marry him. She acknowledges being called “cold and dirty” and admits to a “terrible stupid” act. This excerpt suggests Liz is capable of complex thought and interaction, but her behavior is perceived as unusual. She also mentions being locked in (“Mama Alexey Fyodorovich Give me I owe you a big confession with your hand do Here so yesterday I didn’t write you a letter as a joke seriously Lisa That’s great, I was completely I’m sure you wrote it seriously I’m sure I kissed his hand and he you speak beautifully I really want you to like Lisa just I don’t know how to do this, dear Alyosha cold and dirty he was already sure that I wrote seriously How is it? Is it really that way? it’s bad that i was there I’m sure Alyosha is terribly good [music] Well, I’m sorry. I decided I was stupid you said that I cold I took and kissed it turned out terrible stupid [music] dress Alexey Fyodorovich, sit down. [music] but I think we still need it wait with the kisses because we both this is not yet we can Tell me better what you want take me such a fool so smart so replace I’m not worth you, stand still Lisa, I’ll be here in a few days I will leave the monastery Come out into the Light I must get married I know this for sure for me for Sima so I said and who better than you I will take and only Alexey will take me besides you Fedorovich Give me your hand Oh, what are you saying? it is taken away Listen, what are you going to wear? when you leave monastery What a suit don’t laugh it very, very important to me I didn’t think about it. But I’ll wear it whatever you want. I want you to have gray blazer Velvet Grey Pique vest and gray soft hat Alexey Fyodorovich and you will be mine to obey, this must also be decided in advance cm but not in the most important thing Because if in the most important thing is that you will not be with me agree I will have to do as tells me duty Uh-huh Yes, that’s how it is you need to go and look at the animal will he listen Mommy good I I’ll go, but wouldn’t it be better not to look? Why suspect yours of such baseness? mother as baseness And what kind of baseness is this what she is eavesdropping on her daughter is this her right Rest assured Alexey Fyodorovich, what if I become a mother myself? and if I have a daughter like me, then I’m for it I will definitely eavesdrop on her Lisa This not good Oh my God if any I listened to secular conversation and that was it baseness and here the native daughter locked herself in young You know I am a human being and I will be with you spy Alexey Fyodorovich No, I won’t spy on you. never And I will never read a single one your letter because you are right and I No Alexey Fyodorovich Why is that? I’m sad all these days I see that you have there is some special sadness maybe be secret”).
    • There is a reference to Liz being a “child heart” in a seemingly poetic or metaphorical context.

    Overall, the initial healing of Liz, involving prayer and laying on of hands, resulted in the disappearance of her fevers and the ability to stand briefly. However, later references suggest that Liz may still be dealing with some form of illness, possibly neurological or psychological, given the mentions of her being in a chair, her “cry”, strange ideas about marriage, and being referred to as having “completely lost your mind?”. Alexey’s remarks about her thinking “stupidity” and needing to be taken away also point to ongoing concerns about her well-being.

    Katerina Ivanovna’s Assignments

    Based on the sources, Katerina Ivanovna gives several assignments or tasks to other characters, primarily focusing on Alexey Fyodorovich (Alyosha). Here’s a breakdown of these instances:

    • An Important Assignment for Alyosha: In, Alexey is told, “Sorry Alexey froch VS worries this is what he has important for you assignment from Katerina Ivano I went to her, I don’t know her, Mom, he doesn’t he will go and become a monk, he will do so he is saved, he will come, I will send him”. This indicates Katerina had a specific and significant task in mind for Alyosha, although the exact nature of it isn’t immediately clear to Alyosha or his mother.
    • Delivery of Money and a Message from Dmitry: In, Dmitry asks Alyosha to convey a specific message and action to Katerina: “go and tell what do you say that I ordered to bow here so literally tell her you ordered cl e s h recognition hands me money the other day willow 3,000 so that I can send them to her sister in Moscow by mail sent“. This is a direct instruction from Dmitry, to be delivered by Alyosha to Katerina.
    • Taking 3000 Rubles: Dmitry, believing his father has 3000 rubles intended for “my angel pears” (Grushenka), asks Alyosha in to “take you to your father ask his father for 3000“. He then mentions that Alyosha already has 3000 rubles in a package addressed to Katerina, saying “there’s Alyoshka, go there, there’s exactly 3,000 exactly as much as Katya should take their father and her from me take it“. This suggests Katerina was expecting or entitled to this sum of money, and Alyosha was meant to deliver it.
    • Sending Money and a Book via Alyosha: In, it’s mentioned, “Ah Alyoshka the brother comes to the basement that same day orderly with a book to hand over the state sum immediately in 2 an hour later he signed the book and went to bedroom took a gun rolled a bullet and“. This implies Katerina sent Alyosha with a book and money (“the state sum”) to Dmitry.
    • Requesting Alyosha to Bow (Reported by Mitya): Later in, Alyosha is instructed again by Dmitry to tell Katerina, “go immediately now and without fail bow ordered to bow certainly and take a bow“. This reinforces the earlier instruction to deliver this specific act of bowing as an order from Dmitry.
    • Forgetting to Deliver a Letter: In, it’s noted that Alyosha “immediately forgot to pass on a letter to you from the young lady lock it lies with us since lunch“. This indicates Katerina had entrusted a letter to Alyosha to deliver to someone else (presumably the “young lady”).
    • Conveying her Situation to Moscow: In, during a tense conversation with Alexey, Katerina gives him the task of informing her aunt and Agasha in Moscow about her current predicament: “Oh my God, so happy. I’m glad. No, I’m glad. I’m glad not that you’re leaving us, but that that you will personally convey in Moscow auntie and agasha all my situation all my current horror“. This is a significant and personal assignment, indicating Katerina’s trust in Alyosha.
    • Delivering Money to Snegiryov: Also in, Katerina, feeling remorse for Dmitry’s behavior towards Snegiryov, asks Alyosha to intervene: “Angel I have a big favor to ask of you. Alexey Fyodorovich is your brother. Dmitry He offended a man in anger in passions but the name of this one offended me terribly human Snegiryov I would like to ask you to go to him and delicately carefully give here is 200 rubles, he is sure will accept or rather persuade him to accept beautiful“. She emphasizes that this money is from her, not Dmitry, and asks Alyosha to find Snegiryov on Lake Street.

    These examples demonstrate that Katerina Ivanovna actively involves other characters, particularly Alyosha, in carrying out her wishes and dealing with the complex relationships and events surrounding her. Her assignments range from delivering messages and money to more delicate tasks involving emotional reconciliation and conveying her personal struggles.

    Alyosha Karamazov: Monastic Aspirations and Worldly Destiny

    Based on the sources, the topic of becoming a monk is primarily associated with Alexey Fyodorovich (Alyosha) Karamazov.

    Initially, Alyosha announces his desire to enter a monastery as a novice. The first source states: “the youngest of the brothers Alexei He didn’t finish his courses at the gymnasium There was still a whole year left as he announced that he wants to enter a monastery novice to say in advance that Alyosha was not at all a fanatic and not a Mystic if he hit on the monastery road is just because he was early the road of humanity struck at that time And she presented him with, so to speak, ideals the descent bursting out of the darkness of worldly malice to the light of Love of his soul”. This suggests that Alyosha’s decision was driven by a desire for spiritual ideals and a path towards love, away from the perceived “darkness of worldly malice”.

    Katerina Ivanovna also mentions Alyosha’s intention to become a monk, stating, “…he doesn’t he will go and become a monk, he will do so he is saved, he will come, I will send him…”. This indicates her understanding of his choice and her belief that it is a path to salvation for him.

    However, the sources also suggest that Alyosha’s time in the monastery might not be permanent. An old man (elder) in the monastery tells Alyosha: “Bless here stay No son are you there more needed as soon as God allows I will introduce myself to Leave the monastery and here is yours place and you will have to get married and that’s all you will have to transfer it again for now you will return to obedience In the world I bless you Go and be near your brothers, but not too close“. This blessing implies that Alyosha has a role to play in the secular world and that he will eventually leave the monastic life to fulfill it, including the possibility of marriage. The elder seems to have a clairvoyant understanding of Alyosha’s future.

    Later in the narrative, Alyosha himself confirms his intention to leave the monastery. He tells Lisa: “I will leave the monastery Come out into the Light I must get married I know this for sure for me for Sima so I said and who better than you I will take and only Alexey will take me besides you Fedorovich Give me your hand Oh, what are you saying? it is taken away“. This is a significant development, showing that his initial path towards monasticism is changing, and he now envisions a future in the world, including marriage with Lisa.

    Furthermore, Father Pais offers a more introspective and perhaps questioning view of monastic life when he says: “I don’t know if there is the Spirit of God in I’m not at my best I know I only know that I am Karamazov I monk i am monk lisa lisa i monk and this may not be in God I believe you don’t believes“. This suggests that even for those within the monastic order, faith and the presence of God can be a matter of personal struggle and uncertainty.

    In summary, the sources depict Alyosha’s initial decision to become a monk as motivated by spiritual ideals and a desire for love. However, the guidance of an elder suggests a temporary nature to this commitment, pointing towards a future in the world. Alyosha himself later declares his intention to leave the monastery and marry. Additionally, a character already within the monastic life, Father Pais, expresses a complex perspective on faith and his own identity as a monk.

    The Magnificent Elder: Wisdom and Prophecy

    Based on the sources, the figure of a “Magnificent elder” appears to be a highly respected and influential member of the monastery. This elder is also referred to as a “sacred elder” and simply as an “old man” within the monastery.

    Here’s a breakdown of the information about this elder:

    • High Regard: He is described with honor and glory, and his presence is considered significant. The title “Magnificent elder” itself indicates the high esteem in which he is held.
    • Potential for Conflict Resolution: One character suggests bringing Dmitry to the Magnificent elder, believing that the elder’s presence and wisdom could help them reach an agreement regarding property issues. This implies the elder has a reputation for fairness and the ability to mediate disputes.
    • Spiritual Authority: The same character wishes to ask the “sacred elder” for forgiveness for his son Dmitry, highlighting the elder’s spiritual standing and the belief in his capacity to grant absolution or offer spiritual guidance.
    • Interaction with Alyosha and Prophetic Insight: The “old man” in the monastery, likely the same Magnificent elder, has a significant interaction with Alyosha. He blesses Alyosha but also suggests that Alyosha’s time in the monastery is not permanent. He indicates that Alyosha will leave the monastery, return to the world, and even get married. This suggests the elder possesses a degree of clairvoyance or deep spiritual insight into Alyosha’s future path. He advises Alyosha to be near his brothers but not too close and seems aware of the complexities within the Karamazov family.

    In summary, the Magnificent elder is portrayed as a pivotal figure within the monastery, commanding great respect and believed to possess wisdom capable of resolving disputes and offering spiritual guidance. His interaction with Alyosha reveals a deeper, possibly prophetic, understanding of Alyosha’s destiny beyond the monastic life.

    Братья Карамазовы: ВСЕ СЕРИИ ПОДРЯД
    The Brothers Karamazov: ALL SERIES IN A ROW

    The Original Text

    [music] [music] become lead out one two three once once once twice [music] [music] [music] stand forward step by step touch [music] [music] [music] [applause] and here I am [music] [music] [music] mo Mitya Ivan and Alyosha’s father Fyodor Paloch Karamazov was married twice, the first time the wife was from a wealthy Miso family who didn’t want to give her to Fyodor fell the matter was settled with a cart that for a time obel adu willow Despite the fact that Finally, Ivana abandoned the house and ran away. seminarian teacher left in his arms Fyodor Palycha three-year-old son Mitya’s speed of the poor man turned out to be in Petersburg, where she died, either from typhoid or whether from hunger that made me incredibly happy Fyodor Pavlovich [music] The media fdo pa was assigned to the courtyard hut to his servant Gregory and seemed to have forgotten but it happened that I returned from Paris The deceased’s brother, Ivan, having heard VS about sister and having learned that Mitya remained, he straight away announced fdo pa that he would like to take I agreed to raise the child myself was transported by one of the many t his two brothers Ivan and the younger Asha Dmitry Fedorovich grew up in the belief that he still has some wealth and when he reaches adulthood, then it will be Independent Youth and youth of Mitya passed in disorder in the gymnasium he did not I finished my studies and then ended up in a military school then I ended up in the Caucasus and earned my living Dolgov went on a lot of sprees and fought a duel and was Jean Leave the regiment He came to his father to explain about the property which he believed was left to him the inheritance after the death of the mother is so small of what you frivolous young man you are still and you were a party animal, you went through all the money the value of your property you have nothing else no that’s not it deception vile lie Well, who’s there hence it dishonestly there is his second wife Sophia Ivanna Fyodor I took the stick from the old general’s wife where she is was in foster care she gave birth Fyodor Pavlovich has two sons and speed also died from some kind of nervous female disease after laughter happened exactly the same thing as with Mitya were completely forgotten and abandoned by their father and the Armed Forces got to the same Grigory in the same the hut where the general’s wife found them their teacher [music] [music] mothers without offense shro God will pay you quite soon the eldest of the brothers Ivan began to show brilliant abilities for training for which he was sent to Moscow Gymnasium Then he studied at University Where he began to publish very talented book reviews So even became famous in literary mugs Once he printed in one the newspaper a strange article on the issue of in the church court the main thing was in Tone and wonderful surprise of conclusion This article caused a stir among the minds and made an extraordinary impression on the fourth illegitimate son of Fyodor Palycha smerd destroy in humanity the Faith in his immortality in him will also not run out only love but also every living force moreover, then nothing will happen without everything will be moral everything is permitted everything will be permitted They said that she was the mother of the stinkers the town’s holy fool is known throughout the world the city nicknamed Elizabeth the stinking No, I’m not talking about the Master in the barn. someone where [music] baby oh my god the gates are locked how is she climbed over the fence carried her what Du how did it transfer here to to the master he is the Father and you are a fool slander don’t repeat it, it’s not from him but from the carp the whole city was taken away by a fugitive thief says from Fyodor Palych and he has the same my wife will soon give birth shut up you fool God is his judge baby [music] he’s dying, what should I tell the master about God Lord oh Lord Lord forgive me that you I was woken up in the barn there in the barn now you’re still going there Why are you bothering me? Dean Wow you are Mother The Kingdom of God was established heavenly if We cook with your permission with the brand baby yourself left A that would be very good and she was stinking with us and he became be Buden Smerdyakov A Well, happy birthday, Smerdyakov [music] Grigory raised the mortal but how did he himself he expressed the boy grew up without any gratitude to the wild and looking at the light from corner As a child he loved to hang cats and then bury them with ceremony everything is quiet and secret, Grigory I once caught him doing this exercise and painfully punished with a rod You don’t man, you’re just starting out from the bathhouse sputum You who is Smerdyakov As it turned out later I could never forgive him for these words Gregory taught him to read and write and when He turned 12 and began to teach. Sacred history But the matter ended that way what’s wrong and his kingdom will be no more the end of what are you doing The Lord God created nothing in the first place. day sun moon and stars on the fourth day Where did the light shine from on the first day? day and in from what with I declared to you after that incident epilepsy the disease never leaves him for the rest of his life [music] the youngest of the brothers Alexei He didn’t finish his courses at the gymnasium There was still a whole year left as he announced that he wants to enter a monastery novice to say in advance that Alyosha was not at all a fanatic and not a Mystic if he hit on the monastery road is just because he was early the road of humanity struck at that time And she presented him with, so to speak, ideals the descent bursting out of the darkness of worldly malice to the light of Love of his soul destroy the faith in a person in his own Immortality and in it the same not only love but also every living force so that continue world life will disappear little Then nothing will happen without that moral and everything will be allowed this letter Dmitry Read Please m s promise to do something for this I promise you me fulfilling the promises made to his bride brother Katerina Ivana Ivan Fedorovich arrived in the city quite soon as later it became clear from the affairs of Dmitry Fyodorovich having started a lawsuit with his father over property that belonged to him once his mother village chersh with this the fateful arrival of Ivan Fyodorovich which served as the beginning of so many consequences and our story begins [music] Mom, look at Roma, shut up. Likiy orite as I understand it What for you our people love our simple-minded red They came to talk to me about this and about this and much more, but the main thing enthusiastic gratitude you on Thursday prayed over Liz you laid it on her your hands and you healed her as healed after all, she lies in a chair, but at night the fevers have completely disappeared and today She stood there for a whole minute without any reaction I called on Dr. Herb for support says I am amazed I am perplexed Fox thank you same I’m on him And why are you doing this to him? dte And why did he forget all about me? he carried the little one in his arms and taught A to read Now you put a duckweed on him and he’s got me he’s afraid I’ll eat him li Yes what is this you Sorry Alexey froch VS worries this is what he has important for you assignment from Katerina Ivano I went to her, I don’t know her, Mom, he doesn’t he will go and become a monk, he will do so he is saved, he will come, I will send him, and Now forgive me dear ones waiting Well, we’re already here, but Mikito isn’t here. That’s it. And you know me, Mitka. hates And why should he love you? You at the age of three he was given to the servants he threw out his life when I came to pick it up you didn’t even remember that you were raising him do you have a little one remembered Ivan I I remember And then I introduced myself to you what I don’t remember you know that sometimes I I like to suddenly play something unexpected role And today there are no roles plays I promise to give Milon for God’s sake for health servant of God Feodora about Feodor’s health pray and as for the hut, judge for yourself I could have had the children with me at that time contain this disgrace in Sado ask someone in this squirrel where this one is Sima dwells And you to the elder Yes, would you like me I will conduct Let me recommend Tula landowner Maximov let’s go here through these gates old man Magnificent elder honor and glory monastery this is such an old man he is a Chevalier parf who is chevalier old man zama Holy word Holy I think maybe presence of this How to say The lips of the magnificent elder Mitka and we We’ll come to some agreement with him, the old man doesn’t will solve your property issues argue than I’ve already had my share and wasted it and frivolously and wildly and enough about it’s not even me who’s doing this to him, but rather he who’s doing it I owe everything everything Enough is enough I’ve had enough said so what I say equal Senka noon And my son Dmitry is still not here I want to ask you for him forgiveness sacred elder [music] here he is, Katya’s terrible fiancé meters touch Sorry generously that he forced Yes, the servant of the stinkers was sent to me the priest told me that it was appointed in hour I understand that it was deliberately introduced it’s a misconception that you’re late It’s not a big deal I am grateful I could not expect from you kindness Mitya, we were talking about your article here. brother Well, that’s very, very By the way, I’m in You stated in bewilderment what is so natural there is no law to love humanity exists in this case for everyone the moral law of a non-believer in God changes that is, without moral there is no nothing, therefore, any villainy can happen be allowed if it is reasonable exit Let me hear you right villainy must be permitted and recognized as the smartest the way out is like this exactly I’ll remember it that way Divine Old man This is my son Ivan is the beloved flesh my respectful son so to speak Karl [music] sea ​​And this one just entered son Dmitry Fyodorovich, against whom do you have control? I’m not looking for this respectful Franz both of robbers author Schiller Speak without foolishness and do not start insulting your family yours what am I money he got from his mother for hid the boot Well, there is a court Dmitry Fyodorovich and there everything is yours receipts for everything you had how many did you exterminate like this how many what remains and Mitri comes out Fedorovich, what do you owe me? Yes, no. some, but several thousand unworthy comedy reverend father I an uneducated person I don’t even know how you are called but here you were deceived Case Father doesn’t need money at all, he just needs it scandal I know what the holy father is for don’t trust him the whole city N he’s buzzing from these parties of his and where he was before served as an officer he was the bravest of his commander’s daughters Lieutenant Colonel, he is also compromised you know what i’m talking about and now she this is his fiancee Katerina Ivanovna name She came here and he is on her o Keep silent, don’t dare to tarnish the noblest the girl and the only thing that you dare about her I’ll hint that you’re in front of her one local seductress go keep quiet go walk it’s him to keep quiet to me it is he to the father with it to me a Well how I’ll curse then what A yes you are from me you want to get rid of it because you yourself are going to it you start with your love slips you don’t my son I would call you immediately right now I’m going to a duel, tell me everything about it you taught her through the captain’s staff Snegireva seduce me and then bills and to prison and how you want to buy She also told her about the duel for 3,000 but only you won’t buy it on duel through a handkerchief Forgive me but I do not I knew when I came here that my father was jealous of his son. the bad behavior of the woman and myself with this the same creature is trying to put in prison that you said how did you call it Creature creature Yes, that’s what you called her, she’s a creature higher and purer than all of your bald ones genus If it comes down to it ashamed what a shame yes that’s how he put it the creature is holier than all of you who save Hieromonk, you are here cabbage you eat minnows, they eat them and They think God will buy a gudgeon But ugh you see, ugh no sorry sorry all about God, I lived, I don’t understand. Why did he do it to him? bowed let’s go home when you get out let’s go woo [music] Lord And I and I with you Ivan Ivan Well what are you to her I for The madhouse and the madmen are not I’m answering but at least I’ll save myself from going your society dug believe that forever Go Yes go come on yourself I trimmed this whole monastery myself I approved it myself [music] Bless here stay No son are you there more needed as soon as God allows I will introduce myself to Leave the monastery and here is yours place and you will have to get married and that’s all you will have to transfer it again for now you will return to obedience In the world I bless you Go and be near your brothers, but not too close. one and about both Go la I think the old man is clairvoyant and has penetrated the corners what kind of corners are there in your family now When something happens, it happens all over the province. they will destroy the astari in advance of the prophecy the killer’s legs bowed to which one he killed Your brother is a priest for publicity and you are not I thought how it would end, maybe no, no thought [music] Hello, Alyosha, come here quickly. let’s go go why are you looking at drunkenness again Wei Phantom I need two bottles so cancel And I didn’t eat something come in now really get into it I repeat truly Alyoshka I am on everything I love only one person in the world you alone you and this vile one in which fell in love with him to the core disappeared Promise that you will do what wait first hymn to joy Schiller at the chest bark of nature VS that breathes joy drinks all creations all nations for She gave us friends in a flash misfortune thunderstorms juice wreaths Harit insects sweets angel to God insects that God has gifted are coming voluptuousness is this and we are all Kamaz because voluptuousness is storm a Beauty is terrible and horrible the thing is scary because it is not Find out here the devil is fighting with God The battlefield of the human heart I am very uneducated But there is a lot about this I thought what the mind considers shameful then for the heart it’s solid beauty is not broad man even too much wide I would narrowed down however Who has what hurts Who is there and speaks Now listen about Katerina. Ivanovna I never told anyone I’ll tell you first now, of course I exclude Ivan Ivan knows well Ivan is a grave Ivan grave I was in the battalion then ensign Well, I was walking it’s terrible and then he comes from capitals my boss’s youngest daughter Lieutenant Colonel Yes, this is Katerina herself Ivanovna, your bride, the bride later A she had just graduated from college at the time proud of her wealth and education and work the beauty of beauties Well the whole city immediately grab the queen amuses I got some balls too Well done, I’m coming I’m talking, she doesn’t look and her lips Well, she was right, the bourbons were terrible. she was you’re right but I was terribly offended then and decided to take revenge here I accidentally find out that her father lieutenant colonel in the cash register 4,500 rubles not he gets the government money from judged by word papash Katerina Ivanov in her old age threatens Sudzha Soldiers And then I decided how i meet my eldest daughter Colonel Aga Ivano was scared Dmitry, it’s better for him to go. Send him to I’m going to your institute, I’m probably a big fan of her Yes, let her come alone. And I’ll keep a secret. I will save I promise under Ah Alyoshka the brother comes to the basement that same day orderly with a book to hand over the state sum immediately in 2 an hour later he signed the book and went to bedroom took a gun rolled a bullet and [music] [music] Well, I found out all this later, Alyoshka. And at that time evening I was sitting at home twilight winter Frost Tilka Is it you? With my sister told me that you will give 4,500 rubles if I come for them to you I came myself [music] [music] this is 4 thousands Yes I was joking that it was You are too easy to correctly the young lady with I counted two hundred perhaps 4000 for such frivolity [music] You bothered yourself in vain [music] [music] [music] [music] O [music] C [music] [music] [music] [music] become lead out d t once once once two once once [music] Mar [music] stop [music] [music] [music] step forward and touch [music] my sister told me that you will give 4,500 rubles if I come for them to you myself I came [music] this is 4 thousands Yes I was joking that it was You are too faithful to the young lady I thought about two hundred, and 4,000 on such frivolity [music] throw about bothering yourself in vain deigned [music] [music] O [music] [music] [music] H [music] and she left and I took out my sword and wanted to right there myself it must be stabbed from delight and then kissed the blade and invested in knife in the morning lieutenant colonel execute the sum returned but got softening in the brain and at 5 days passed away Katerina Ivanovna returned to Moscow yes are you listening Dada I get it from her by mail 4,500 rubles and in 3 days letter offers itself to me brides love like crazy even though you don’t love me anyway Well I wrote to her and with Ivan in Moscow sent with Ivan Why yes, because Alyoshka is Ivan in Katya in love yes yes yes she herself to me brother suggests here there is a main one tragedy She is out of gratitude to me He wants to rape his fate, that is, She is all in her glory And I the bug is not Brother, I’m going to marry this Grushenka. And Katya will marry willow Tell me the most important thing, you are the groom Katerina Ivanovna is the groom formally she insisted and everything happened Moscow when I arrived Well, how are you Want tear up And you, Alyosha, go and tell what do you say that I ordered to bow here so literally tell her you ordered cl e s h recognition hands me money the other day willow 3,000 so that I can send them to her sister in Moscow by mail sent And I, as if on purpose, with Grushenka Then met thunderstorm struck plague struck and we with Grushenka in the wet 25 miles from here the gypsy got champagne for everyone Champagne quarrel between men [music] Katya Alyoshka said that I sent a message that I would bring a receipt and still do so Not I carry This is mine [music] dishonorable but it is absolutely necessary today To Ekaterina Ivanovna deviate therefore I will take you to your father ask his father for 3000 Mitya, he won’t give it won’t give it It’s me Alyosha is now out of despair especially won’t give but pear tree can he’s not joking and will want to marry me jump and Alyoshka Well, he already has days five as taken out 3,000 rubles large package packed and with a pink smoky coating on top tied up and written to my angel pears If he wants to come, and in 3 days added and film Well you see how in detail I know, now he’s waiting and hoping that she will come for Bucket Well now you understand who I am here I guard her her stinkers will give me know if she comes to her father it’s him I told you about the package there’s Alyoshka, go there, there’s exactly 3,000 exactly as much as Katya should take their father and her from me take it what’s wrong with you Well what do you think went crazy I believe in miracles, chu chu Well Come on and you and I will wait here for an hour I’ll wait and 5 and But at least today even at midnight you will appear to Katerina Ivanovna with or without money and you say bike if e grushenka suddenly comes to your father Rusya I will interfere I will kill whoever I don’t kill her father brother what are you saying Well I don’t know Alyoshka what will happen I’m afraid I won’t be able to hold back Well, go, go go to your father [applause] [music] Alyoshka come join sit down coffee coffee Lenten Lenten monks can have coffee yes, I have stinkers for kulebyaki artist God Yes, Alyoshenka, sit down, my dear. sit down Alyosha Sit down and listen, we have something like this here we have gender donkey spoke And do you know how cleverly cleverly r Quietly, speak up. donkey I was talking about that from Christ and there is no sin in refusing baptism No, listen. that’s what it is Gregory Today I read in the newspaper about our Russian the soldier was captured and they took him there under pain of torture death to Islam go they forced him but he didn’t agree It’s all described in the newspaper he didn’t agree and more that’s what he’s with yourself alive allowed the skin remove Christ glorifies I say that soldier of this must be made a saint true smerdyakov Not agrees scoundrel about under the face Grigory Vasilievich, you should wait a bit. Well, you shouldn’t either. to argue, just go ahead and prove it and that’s it Prove if this commendable soldier the feat was small and I would in his place he refused and it’s not at all it would be a sin Well, how can it be a sin to refuse Christ? Well, How do you judge this for yourself, I barely I’ll only tell my teachers No, I won’t Christian as a quarter of a second not it will pass as the highest divine judgment damned So you are now damned after this how can you reason dare broth And I’m damned jelly My baptism is being removed from me one way or another so you see you see how to turn I I told you, well, shut up, shut up with merkom for a while Come to me come Ivan I love you just as much as Ashka and never believe anyone that I don’t love you I love you, give me a horse. Let’s make a deal, brother. Let’s make a deal quickly if I’m not already a Christian can’t, Lord God ask me as a Christian Well so you yourself have renounced everything in yourself You are my Jesuit of your faith wonderful I believe that the Lord God me forgive you’re lying scoundrel won’t forgive forgive Grigory Vasilievich forgive a chervonets is worth your word from the face And the rest you’re lying Listen, you’re lying, you’re lying you know Fool We are here all from one only frivolity is not We believe in Us there’s always no time you should repent there you denied yourself before the tormentor namely, it was necessary to veto it then and prove was pose so brother I think is a it makes up it makes up but judge Grigory himself Vasilievich If I believed as it is necessary to believe then it would be It’s really a sin. And why am I I will give my skin for no reason rip off get out of here you zooi over there in SRV the chervonets went promised today came floor you are here he all the time years and than You are so curious about him you decided to respect me in no way advanced meat however when is the deadline what will happen the advanced ones will be first such and behind them better yet, I’m tired of everything [music] [music] This is what a Lama looks like from her face thinks she’s everything think think you the hell what thought of it knew how much I hate this one Russia not this one Oh I perhaps Leshka Well at least you believe in it that I’m not just joking in life I believe that it is not only the Jester. I believe that too. you believe and speak sincerely willow Ivanko Well now Seriously, Alyosha exists, God exists Ivan No, there is no death Ivan little immortality no no what comes out there Absolutely zero or still nothing and absolute shi is zero Alyosha is immortal There is both God and immortal and God and the Immortal in God and immortal not Here you go Alyoshka is probably right after all. Oh my God, how many people have given you strength for this faith and all in vain dust is already thousands of years old Yes, eh-eh-eh who is laughing at Toto like that man Alyosha And the devil must be the Devil oh, the hell there is there is no damn thing No It’s a pity It’s a pity you are Ivan, you despise me. Yes, you came to my house. [music] cross bomb Ask Go to the cherry tree Well, eat for a day I’ll go tomorrow if Nastya doesn’t but you won’t go because you’re here need for a lot pomari What What What are you looking at me with your eyes tel You came here with your own mind, Alyoshka. He he looks, he looks, but not Alexey despises don’t love Ivan hears don’t love him on the bra Stop it offend Well Right ok don’t be angry Don’t be angry with me no that there is nothing for you to love Hear me zero in Cherma Chersh you will go there alone little girl I’ll show it there a long time ago watched eno be scared and don’t despise This pearls come on, don’t be angry [music] [music] [music] [music] where is she she’s here I saw her running towards the house Where she don’t let me don’t let me go to him ONT I’m afraid I’m afraid where is she there scoundrel Alyoshenka Alyosha Alyosha she came what do you know that she didn’t come e saw adj then maybe she mho T at least locked key with you Guard, hold the thief, he’s my money There in the bedroom [applause] Hurray, you’re crazy. You’ll kill him, right? that’s what he needs nearby but I didn’t kill so I’ll come again to kill not mouth dmitri go from here to about those one at bё would she be here E not was or was not And no one was expecting her at all Alyosha didn’t say a word to Katerina Ivanovna about money go immediately now and without fail bow ordered to bow certainly and take a bow Describe the scene A good I do not repent for your blood. Beware. old man Take care of your dream because I have one too dream I curse you, I do not renounce myself you are a complete scoundrel scoundrel Well, there he is. That’s it. Stop it. He went to her and he married her she wants it, she won’t marry him, she won’t sing no, it won’t work, he really doesn’t have any money none at all, but I have I feel bad I have a bad heart don’t lie down will go stink water towel turn around he dared me quickly go let me rest go go Lesha Lesha Come to me tomorrow he’s on he dared me, but he didn’t dare you father dared I washed it in a trough He [music] oh and don’t tell anyone Ivan don’t tell that sl zavt Ah heart Oh oh If it weren’t for us, he would have killed him later. dry what Save one a bastard will eat another bastard, wallpaper there and road my head started to hurt, I’ll go out into the yard I’ll go and keep watch at the same time Dmitry may return With Katerina Ivanovna I thank God finally, that’s why I was waiting for you so much I only hope to hear the truth from you from whom did you call me more and Mitya sent Mitya sent me you I felt it he told you bow to the clan and said so Yes clan, maybe there was a mistake in the word no, it’s a clan, he used that word three times repeated That’s the same It would be good if he told me to bow down in passing Without insisting on it in a word it would be horror it would be the end And if he certainly insisted on this word doe and even repeated three times him that means he was beside himself he was in arousal means he doesn’t leave me with a firm step, as if he flew from the mountain so this word clan can’t mean nothing more than just bravado Yes, there is a lot of eyebrows here and I like it too It seems like Kolya is not all that yet lost means he’s not completely dead yet I I can do it again save Take a seat Alexey Fyodorovich Now the main thing is whether he passed it on to you something about money about 3000 Yes and that’s what kills the most Well, do you know him? I asked. sister telegrams and I know that he gave her money didn’t send And I also know how he sent them [music] spent Now he went to that one woman He just almost killed his father because of her. he killed her he won’t marry her because it passion and not love He can be gets married No, she won’t marry him. Because Alexey Fyodorovich is the most the most fantastic of all fantastic creatures I knew she was seductive but now I know how kind and noble Agrafena Alexandrovna My angel please show yourself I was just waiting for you to call him Can you imagine Alexey Fyodorovich? After all, I I just wanted to get to know her and she came at the first call they did not bend to me Yes What are you saying? disdain charming, this is the heart that rejoices Looking at this angel, I have no dear to the young lady Or maybe your affection is not at all I’m standing She’s not standing What are you doing You say, you know, Alexey Fyodorovich, we wilful but proud heart and we were one polish officer was unhappy for 5 years back and we loved him and everything to him they brought it and he left us and married another and only legless old merchant Samsonov literally saved us from death. We even wanted to drown ourselves then, who did it matter? We are now very much attached to him you protect me dear young lady very much hurry up I protect you in everything What are you doing say pear, come on, give it to me yours pen Look at this pen USA what a lovely hand, she makes me happy I brought it today and I’ll take it now her and [music] I’ll kiss you like this and in palm And you don’t touch my lips, my dear Miss, why am I washing my hand in front of Alex? Fedorovich kissed Did I really want to cool you down? you don’t understand me at all, that’s how you are You don’t understand me either. I may much worse than I will bring you I am a bad, willful person at heart, Dmitry Your poor Fyodorovich out of mockery one filled Well, now you have it too you will save and tell that you love another And that he came to marry you. You they gave their word to tell Dmitry F all this No, I won’t tell you that. You gave it to me yourself, I told you everything I didn’t give it to you, but you promised I don’t tell you promised Well, you see what I am like If you want it that way I’ll do it What if I like him again? mitom m well yes vicha you said not at all Well, well, well, I have a tender heart stupid I can feel sorry for Mitya, just think about it just how much does she cost me I transferred it, I didn’t expect it angel young ladies what are you what are you kind noble one come out and let me me yours you know what an angel young lady I’ll take the pen your pen And how do you I kiss you three times I kissed you I will kiss you 300 times, beautiful You impossible and you know what, angel, young lady, I’ll take and Yes I won’t kiss your hand, but what’s wrong with you? and so stay with the memory that Here they kissed my hand and I kissed yours No impudent and Mitki retell here it is laugh at that there goes the scoundrel There goes the sell-out creature. Well, well, well. for sale and the girls themselves are for gentlemen money in the twilight I visited her, she will leave soon and I will leave and you Alyosha Take me away, I’ll give you something nice I’ll say a pretty word, please leave [music] you Dasha I’m a darling for you, eh price [music] your brother the scoundrel Alexey did it Fedorovich, go away. [music] immediately forgot to pass on a letter to you from the young lady lock it lies with us since lunch and didn’t kiss the hand and I ran away, I understand her queen in power Alyoshka I understand She is all here She is in this pen spoke out infernal queen of all infernals in her kind of Delight Well where did she run home then to her to her A Katerina Ivanovna, well, I see right through this one and as never before Pride and challenge to fate all I have the power to want and Grushenka I’ll bewitch you think she’s on Rosh on the handle the first kissed the pear tree No with calculation She fell in love with Grushenka for the truth there is not in Grushenka but in your dream in your nonsense Well, how could you tell those about that day when Katerina Ivanovna came to you I came for money, but Alyosha, I was drunk. in the wet there were gypsies singing and I cried when I was telling and Grushenka everything I understood then and she also cried together with me Well, now Bach dagger in heart Oh how sweet Alyoshka dear Yes How did you manage to escape from them? picking up the cassock of course I do the scoundrel was like crying you are a scoundrel now remember now witness that I would never have before did nothing compare in meanness with that the shame that I now carry on my chest my dishonor my here yoshka and you witness that I can still stop And even half of my lost part turn back I won’t stop You about than money quiet money legal will give me Legal, his nickname is merchant, so this cop is already in his father’s year It’s easier to trade Yes, it diverges due to the price I have a profitable commercial relationship with him offer Well farewell, you now to your dear and I to mine there pass on the name scoundrel I accept if it can console Goodbye Alyosha no pray for me no I stand in a stinking drag of inferno Here you will lick Rayka’s nuts [music] boys for a washcloth for [applause] Let go of the washcloth started let go punk let go please sku you officer you i am officer Find all second and send me satisfaction there [music] swa [music] [music] [music] Dear Alyosha, I love you I love I love since childhood When were you not like now and I love you with all my heart life here i wrote you a love letter Oh my god what am I made now the Secrets of my lost reputation in your hands goodbye from a terrible date to a terrible one [music] [music] dating now Secrets of my deceased reputation is in your hands goodbye terrible date now the Secret is in your hands [music] A [music] [music] [music] become lead out once once once DT times once forward in [music] [music] stop [music] step forward and touch [music] I am waiting for wise advice as a left lord approach here the main question If I now I’ll transfer this grove and all to him illegally will my father give me Czech mister know Well why are you copping it call his name Gorstkin is his nickname The cop is cruelly offended He’s been drunk all day. I drank, what should I do now? I have very important business and I’m hurrying to him Today itself you have to come back and wake up you’ll have to wait it out, he’s apparently not in state God No need now wake up if you knew what I’m in now despair today he is nothing won’t be able to talk Well, I’ll stay here. then I’ll wait to catch the moment I’ll wake up and start And for the candle I’ll pay you for the stay too. remember Dmitry Karamazov well I wish you farewell you have complete pleasure Oh, that’s it stupid all over Honestly It’s absurd, my whole fate depends on him He snores like a strict Planet And this is Snegiryov, beat him, beat him, Come on come on, hit me throw What are you doing to us I’m alone and I’ll kill everyone alone and why you throw stones at me monk in the headset pants Okay I’ll go I don’t want you tease I heard them teasing you I Don’t want Forgive as you please It’s a shame that you what are you doing what I did to you why me Say sorry the fumes fell asleep I am Lieutenant Dmitry Karamazov You have probably already heard from forester that I am the son of old man Karamazov which you wish to trade groves and this you’re lying how is this Uru You’re Fedora Pavlovich you know, I don’t know any Fyodor Pavlovich So you are trading my father I am ready to give you the rights not to grove only on the grove but also on the whole Chermoshnoye This is not joke You dyer yes i am dmitry karamazov and i am to to you with a profitable offer It’s precisely about this for 3000 No you are a dyer you are mine took a contract and came out a scoundrel and I assure you, Mr. Cop, that what those What kind of cop are you? I’m a cop. horn horn I know you’re a horn Oh Lord, what have I done? A mountain man mountain and I mountain and you dyer crawled up Gorski, he warned me mountain mountain mountains it started like a candle [music] Oh my god what despair What a round death [music] By [music] [music] I [music] Alexey Fyodorovich I have been longing for you. We have now Katerina Ivanovna and your brother but not that Terrible A Ivan Fyodorovich and he with she says If you only heard This is a breakdown Oh well, the main thing is Alexey Fedorovich And why if she is hysterical I heard that you came with her then hysteria is what you are having now, hysteria and not with me I didn’t know at all that he was coming How come you didn’t know? Julia told you. that Alexey Fyodorovich came, she came to you were standing on guard, my dear darling Mom, this is terribly not funny right now. your side and if you want correct yourself and say something very Tell your lord something smart Alexei Fyodorovich, who entered, said that he by doing so alone he proved his innocence wit that he decided to come to us today after yesterday and despite that everything is above him laugh Fox, I finally resorted to strict measures Who’s laughing at him? He’s needed here. He Alexey Fyodorovich is needed, I am so unhappy, this is her illness, her whims and Dr. Herzen can’t do anything understand and the tragedy of Katerina Ivanovna is all together so terrible Sorry Give me some rag I hurt my hand and I have her hurts Oh my God, what a wound, what a wound. Oh my God, what why did you keep quiet Mom he could have bled to death Julia water water and ice need to wash the wound you need to put your hand in cold water to the pain stopped It’s mom rather water a dress cup must be sent for the doctor and the doctor will again say that he can’t I can’t understand where Julia ended it water Julia Well, quickly mom quickly for the sake of God go yourself Well, hurry up otherwise I I will die Mom Bring some of this muddy root liquid for cuts I don’t remember what it was they call you have your bedrooms in a glass I’ll bring a sheet of paper to the right in the closet now Just don’t shout. Just look at how firmly Alexey Fyodorovich transfers his suffering Well, where did you rescue her? So it’s time Alexey Yo Yulia Bring a clean handkerchief Now quickly give me back what’s mine I don’t have a letter with me, it’s not true. I knew you would answer like that in your pocket Give me the letter now it’s still there then bring it to me today for sure It was a joke do you hear me in this stupid joke I repent all night you really need Noah laughed absolutely no why because I completely believed yours your letter does not offend me at all As soon as I read the letter I immediately understood that everything is so the elder will order me to leave monastery and get married I realized that it is better I won’t find you as a wife when the legal one comes We will definitely get married in due time I will love you yes, I’m ugly, I’m on the chairs I will drive you I will drive you but I am sure that by that time you will definitely recover You’re crazy You’re such a stupid joke and they came up with such nonsense Oh, here’s mommy Mom Well, is it possible to always call for so long? And now Yuli is bringing a handkerchief, Ah Liz, me your cry Mom, I remembered how this liquid it’s called lead a wonderful lead lotion Angel Mommy Gadget imagine him with the boys on the street got into a fight and this boy bit him on the hand but can he do it after that get married because imagine angel Mom, he wants to marry me. It’s not funny. li This is How to get married Yes, absolutely not. This is not for you. [music] By the way, this boy may be mad Oh mom Are there mad people? boys don’t seem to exist Fox Well, that’s exactly me I said something stupid but it’s your boy he was bitten by a mad dog and became mad The boy bit Alexey Fyodorovich aren’t you afraid of water? Maybe I really am too much hastily said about the mad boy you already are now brought out Alexey Fedorovich Katerina Ivanna I found out that you came and she is waiting for you, mom. Tell her that he can’t now. I suffer too much I don’t suffer at all I can go Oh, that’s how you are, that’s how you are, mom Am I a Monster? Then I will definitely come to you I’ll come and we can talk for as long as we want Mitya, take him away quickly, Litas, completely have you lost your mind? Let’s go Alexey Fyodorovich I am her I’m afraid I don’t want to preface it but you are now you will see everything yourself, the most important thing is happening there Fantastic comedy Katerina Ivanovna loves your brother Ivan Fyodorovich but convinces himself with all his might that he loves your brother Dmitry Fedorovich this terrible Hello, Hello Alexey Fedorovich Ivan Fyodorovich, please stay a little longer. for one minute I want to hear an opinion Alexey Fedorovich Alexey Fedorovich you yesterday witnessed this horror so I To you I trust so I don’t know now I love did I become Dmitry Fyodorovich? He became my pathetic and this is bad evidence No of course you don’t love him wait wait Mila Ekaterina Osipovna I’m still didn’t say what she decided finally this night my decision such Even if he marries that creature I will never leave anyway. I will never leave. I will be faithful to him all my life Well, despite the fact that yesterday transferred and that’s when he will become with that one unhappy creature and it will definitely happen. That’s when he will will come to me and find a friend will find will find a sister who loves and is faithful all her life I will sacrifice my ears to him I will turn into the means for his happiness into an instrument How can I say this to his car? happiness and this is for the whole life is my decision and Ivan Fedorovich highly approves me No, I just said my thought what will your life be Katerina Ivanovna to pass in painful contemplation your own feelings and your own feat But over time this suffering will soften the remaining feeling will deliver a proud intention You have the most complete satisfaction my god how is this not So tell me you Alexey Fedorovich Well then Well, unfortunately tomorrow might be I have to go to Moscow and for a long time leave you tomorrow in Moscow but Oh my God, so happy. I’m glad. No, I’m glad. I’m glad not that you’re leaving us, but that that you will personally convey in Moscow auntie and agasha all my situation all my current horror You yourself are of course irreplaceable to me I’m running I’ll write a letter and Alyosha and Alexey Fedorovich, whose opinion do you really need? I wanted to hear from you I haven’t forgotten about it A why are you so hostile to me at this time Katerina Osipovna, I’m listening to you for a minute. Alexey Fedorovich I never thought I couldn’t Oh introduce why is he going to Moscow? And you screamed that I’m glad you played it like that on purpose theater in comedy played I know It’s not good that I’m saying all this now, but I I will still say that you can tell Dmitry’s brother to be completely and not love from the very beginning and Dmitry may not love you at all but only honors I don’t even know the rights as I do now I dare but I have to tell the truth because no one here wants the truth tell me what the truth is. But what truth are you Invite Dmitry here now. Let him will take you by the hand then will take you by the hand of brother Ivan and join your hands You are torturing Ivan only because love you don’t love him, Dmitry, but only convinced myself this is you little fool this is who you are I was wrong My good Alyosha was never wrong Katerina Ivanovna didn’t love me, she I knew all the time that I loved her even though I never told her the Word about my she knew love but she didn’t love me she kept me with her for of continuous vengeance She took revenge on me for all the insults which brought in an insult from Dmitry first meeting [music] their Katerina Ivanovna, you really only love his That’s exactly how you love him insulting him I would love him if he corrected himself would you throw it you need it for that To contemplate your feat of loyalty and to reproach his in infidelity and all this from yours pride I don’t need a hand you tortured me too consciously so that I can forgive you in this I’ll forgive you in a minute and now not over hands no reward needed to me madam you have done nothing lovely How I am guilty I started You saw it yourself tear Mom why did he act like Angel I have a big favor to ask of you. Alexey Fyodorovich is your brother. Dmitry He offended a man in anger in passions but the name of this one offended me terribly human Snegiryov I would like to ask you to go to him and delicately carefully give here is 200 rubles, he is sure will accept or rather persuade him to accept beautiful [music] kind This is from me this is not from Dmitry in one word Find him He lives on Lake Street in a bourgeois woman’s house Kalmykova you will do This do it and now I’m tired dating tears are a good sign This is Excellent Alexey Fyodorovich, hurry up Now return on this errand hurry up Lisa don’t delay Alexey Fedorovich not a minute no way now no way speak So through the door for what you in Angels got there And for the terrible stupidity [music] Lisa Goodbye [music] Sorry [music] [music] the monk asked the monastery who knew who come No Varvara Nikolaevna this is not tos no I guessed right You came to the same thing business what business Dad it’s him on me complain adj I finger him bitten So it was he who bit you Yes, they throw stones at me on the street with the boys Six people threw at him and he threw I went to him alone and he threw a stone at me I asked what I did to him and he suddenly rushed and bit my finger I don’t know about What I’ll whip you in a minute, I won’t complained I just told Yes he now it seems like there is pain Oh and what about you did you really think that I would be flogged and take it now I will carve out an illusion for yours complete satisfaction No OTC before I whip him I will do my four fingers right now right here in front of your eyes Here this is the number itself Ott for the desire for revenge you something fingers are quite fifth It won’t require and now I understand everything he rushed at me as if I were your brother I understand the offender and my brother repents of his actions as soon as if you wish, he is ready to ask you forgiveness, that is, he pulled out his beards and asked apologies he will do everything that will be for you whatever and this how is it that if i ask his lordship in the square in front taverns kneel before me So he will become Yes and here it is pierced finally shed tears to explain to dad have you heard how she I now ask, I ask, let me cut off komen dova is quite a daddy Stop it if a fool comes you will be smitten we’ve seen, we’ve seen, this is what kind of character we have Now let me introduce you. Arina’s wife Petrovna Yes, you, you Stand up, sir. Karamazov represents you ladies stand up mommy mommy this is this is not that not that Karamazov This is his brother Hello sit down mister chernomazov karamazov KAMAZ mommy Sorry we are from simple Dad, yes, sit down, why did he do this to you? I raised my legs without legs, that is, legs swollen like buckets we used to have when we were military There were many of us such guests, I am a father this is not business equate who is the same and love him Aleksandrovich is a man with a beautiful soul. Anastasia says Petrovna this is Icha dyada Well, I say it’s different for everyone. And you? this is a small pile and there you are says you have to keep it in obedience Oh you I say you are a black sword and who are you I came here to teach and I say air the clean let in the unclean and so it is to me with at that time in my soul it was stuck that here I am sitting the other day I see it here now the general entered here on the holy I came and I tell him yours Excellency Can the noble Let the lady have some free air He says You need a window or a door open here because you don’t have air fresh And I say your air is not I’ll spoil it and I’ll order some shmaki I’ll leave Don’t judge me, don’t judge me because there is a Ved I just got an egg from class pritis and loves Nikolai Ilch at her did I please you forgive me forgive me You make me feel completely alone Well, what about you? my air has become disgusting Goshka pa No need in front of him well you saw have you heard tita already? I’m so scared that I’ll get out of myself, Nikolay I I will satisfy you, put on your hat Alexey Fyodorovich And I’ll take the map Let’s go Let’s go Let’s go let’s go Let’s go Let’s go, you need something serious. say a word outside of these the walls need to be finished Let’s go Jester so your brother is pulling me by my beard from spent and straight to the square A at that time schoolchildren leave school and Ilyusha together with them as he saw me like this I saw dad rushing towards me and screaming dad grabbed me hugs me pull out wants And then he shouts to your brother This is dad my dad forgive me e That’s how he screams Sorry, I grabbed him and his hand. this hand and I remember he kisses. What a face he had then. was not forgotten will not forget not from here I am brother your never said goodbye He insulted not only you but also your bride the noblest must be enemies in the light of each other you have a noble soul You must understand this rub I haven’t seen that kind of money for 4 years A you speak like sisters it’s true I swear really you can’t even understand what it is for Now these 200 Loves can do me I know I’m now Manka and Nochka I will bury my bitter angel yes horse wait Ekaterina Ivanovna to you he’ll give you more and you can take me as from friend as many as you like later give it to me now Would you like me to give it to you now? I’ll show you one trick. Which one? tricks tricks hocus-pocus such here you saw look saw saw here is your money here is your money here is your money here is your money here and what would I say to my boy? if you took money for our shame [music] Well I came to inquire about your health in vain I was worried. However, I knew. that we’ll show up left he’s at Mitki his bride He’s trying his best to fight back. Here That’s why He lives here, He Himself says so to you said I’ve been here for over three weeks now he said well he couldn’t just kill me secretly I came here, really Why are you saying this and what am I saying? I’m telling you, he came here for some reason arrived The truth is that he doesn’t ask for money, that’s what we need give credit where it’s due and then on the other side I won’t give him a single Shisha because he’s a son my Dear Alexey Fyodorovich, I myself I want to be in the male line for about 20 years you understand because Alyoshka, when you make it up, you’ll understand. None of them will come to me anymore, I know none one of my own free will and money for me This is what will be needed. So what? excuse me, I’m saving for myself because here’s I want this square to the very end live Alyosha I don’t need it in the park sweeter, everyone is scolding her Well, after all, in That’s why everyone lives like that. Mystery, mystery fufufu And I’m open to Nate Nate look at paradise your I don’t want Alyoshka Even if he somewhere there and there is I don’t think so you will fall asleep and you won’t wake up and there’s nothing like that Remember me if you want, or if you don’t want to go to hell my whole philosophy But I’ll marry the pears if I want to Zavra Well, how is the money, dearest son Alexey Fyodorovich is and will be all of you You’re the irritant that started yesterday would you like to lay down Well, that’s what you say Well, I don’t I’m angry with you no And tell me Ivan God forbid I would I would grow it like this listen maybe maybe a horse Come on, get yourself some coffee some cold coffee and I will cling to you No, thank you glasses Come on, give me this bread with I’d rather take it with me and not take it with me and you don’t drink Right here under hand Well, that’s right. What it’s annoying and doesn’t give me any peace Well, I just had a glass Well, why didn’t I have a glass You’re dead, but now you’re kinder. became Ah Alyosha son mine I’m you out and endless I love you and with your faces I’m a scoundrel evil I am a man Alyosha is not evil to distort I wanted to ask something when yesterday you came you asked Listen, what if I’m Mitka’s puppy, another one right now you thought this as Do you think maybe he would leave here completely without a pear A I think that if 3.000 is not a lie, everything you’re lying, no need to ask anything I don’t need anything I changed my mind I don’t need anything nothing money to me myself mine I need Miku I’m like a cockroach betraying you know I like the black ones at night cockroaches like this then it will crack Mitka will crack Yours is yours because you are his I love you, I see it. Go away from here. Go Go there is nothing for you here with me And why would you? So and we’ll see each other again, huh Well you think not at all I No, no, no Go Go Me too so accidentally [music] With [music] [music] [music] C [music] [music] [music] [music] [music] [music] become lead out one one two three once once once two three times [music] [music] stop [music] step forward ash touch [music] So you didn’t give the money and gave it to him run away So you would Run after him No Lisa, it’s better that I didn’t run away. better than better because Lisa if he hadn’t trampled and I would have taken this money when I came home in an hour he would have cried about his humiliation And tomorrow he would come to me and maybe I would have thrown away the credit cards and trampled them it would be like then, but now it is not nothing is easier than making him accept these 200 rubles because he honored his proved ah it’s true ah I it’s terrible suddenly I understood on an equal footing Despite the fact that he we have money takes listen Alexey Fyodorovich no Is it true that in all this reasoning of ours is it yours no no let it be ours Is there not contempt for him in the fact that we We are analyzing his soul from above, but no Lisa contempt No because we are like that well not better Alexey Fedorovich you are amazing how good You sometimes seem like a pedant A meanwhile you don’t look at all pedant go look at the door no is eavesdropping Mama Alexey Fyodorovich Give me I owe you a big confession with your hand do Here so yesterday I didn’t write you a letter as a joke seriously Lisa That’s great, I was completely I’m sure you wrote it seriously I’m sure I kissed his hand and he you speak beautifully I really want you to like Lisa just I don’t know how to do this, dear Alyosha cold and dirty he was already sure that I wrote seriously How is it? Is it really that way? it’s bad that i was there I’m sure Alyosha is terribly good [music] Well, I’m sorry. I decided I was stupid you said that I cold I took and kissed it turned out terrible stupid [music] dress Alexey Fedorovich, sit down. [music] but I think we still need it wait with the kisses because we both this is not yet we can Tell me better what you want take me such a fool so smart so replace I’m not worth you, stand still Lisa, I’ll be here in a few days I will leave the monastery Come out into the Light I must get married I know this for sure for me for Sima so I said and who better than you I will take and only Alexey will take me besides you Fedorovich Give me your hand Oh, what are you saying? it is taken away Listen, what are you going to wear? when you leave monastery What a suit don’t laugh it very, very important to me I didn’t think about it. But I’ll wear it whatever you want. I want you to have gray blazer Velvet Grey Pique vest and gray soft hat Alexey Fyodorovich and you will be mine to obey, this must also be decided in advance cm but not in the most important thing Because if in the most important thing is that you will not be with me agree I will have to do as tells me duty Uh-huh Yes, that’s how it is you need to go and look at the animal will he listen Mommy good I I’ll go, but wouldn’t it be better not to look? Why suspect yours of such baseness? mother as baseness And what kind of baseness is this what she is eavesdropping on her daughter is this her right Rest assured Alexey Fedorovich, what if I become a mother myself? and if I have a daughter like me, then I’m for it I will definitely eavesdrop on her Lisa This not good Oh my God if any I listened to secular conversation and that was it baseness and here the native daughter locked herself in young You know I am a human being and I will be with you spy Alexey Fyodorovich No, I won’t spy on you. never And I will never read a single one your letter because you are right and I No Alexey Fyodorovich Why is that? I’m sad all these days I see that you have there is some special sadness maybe be secret And yes, there is a secret, I see that you love me once you guessed it I know that your brothers are tormenting you Father Yes and brothers I am your brother Ivan Fedorovich I don’t like Alyosha, the brothers are ruining themselves and the father The earthly Kamaz force is also ruining here so father pais expressed I don’t know if there is the Spirit of God in I’m not at my best I know I only know that I am Karamazov I monk i am monk lisa lisa i monk and this may not be in God I believe you don’t believes What with you and now besides everything my friend leaves the only person in the world land Lisa leaves you can imagine not can you how i am connected how i am soldering spiritually with this a man and I remain alone I’m coming to you I will come and we will be there from now on together yes together always together for the whole life and now enter Christ is with you I will pray for him and for you Kiss me [music] Alyosha we will happy [music] we will seem we will Alexey twitch come here it’s like this terrible This is terrible This is all childish trifles and nonsense I hope you don’t he will think of stupidity, stupidity and stupidity and just don’t tell her this because she will be excited about this harmful I hear the word wisely a sensible young man is understood whether me so that you only with her because agreed that they didn’t want any contradictions make her angry no not at all I completely seriously with her I said, seriously, it’s impossible here unthinkable First of all, I won’t accept you at all now. not once And secondly, I will leave and take her away Yes why is it so far away, another year and a half maybe we’ll have to wait Alexey Fedorovich, of course it’s true that you are for one and a half years another thousand times from her they quarreled and will separate Well, I’m like this so unhappy unhappy Now the second most important thing what is this letter that she sent you wrote Show me it now now no no need Alexey Fyodorovich in the name of all the Great and the holy name of your dying elder I ask you to show me the letter if If you want, hold it with your fingers and I will. Here you go. so read from your hands No I won’t show Katerina axis If only she would allow I would I still didn’t show it I’ll come tomorrow we’ll we’ll talk to you if you want. And now Goodbye Marfa Yes, come on I am surprised at you, sir. why aren’t you in Cher Mash? you will go Why should I go there? I’ll go. But Fyodor Pavlovich took you there. he begs to go on business Why not leave Tell her what you want and the fact that my situation is terrible Peter Pavlovich pesters me every minute Grushenka didn’t come Why didn’t she come and on the other hand Dmitry Fyodorovich and in front I am guilty of both, but why did I get involved? Why? Dmitry Fedorovich began to transfer and I sudr man gentle sick me yourself you know, epilepsy and tomorrow I suppose with me long epilepsy What a long epilepsy Well, I had a long fit like that once when fell from the attic for 3 days couldn’t come to his senses I can’t predict in advance how you say that tomorrow it will be like this I’m on attic every day I’m climbing Well, I might fall tomorrow too They went into the cellar like that I’ll get to the summer you something I don’t you [music] I understand, pretend or something you want tomorrow on days in there is no way for an experienced person to pretend no work But when I’m sick I will lie down. Even if Grushenka would come to me. Pavlovich won’t take the brother’s hand from the sick one person Ask why that Fyodor Pavlovich every evening it locks and no one opens it. And for me order How Agrafena Alexandrovna these same ones will come knocking on his window secret signs and tell your brother about these signs everything is good I know how brave you are convey You yourself said that she never come to father why Dmitry Speak I want to know your thoughts Yes mine thoughts here are not about the World Cup but only Fedor’s Pavlovich for Graphene Alexandrovna 3000 in the envelope prepared and on the envelope to my angel pears A 3 days later They also added a film and a brau to yours about this envelope good I know from you [music] Oh, what are you like? [music] Only Dmitry is a scoundrel who doesn’t kill his father he’ll go now he could kill him performance as a fool could and consciousness kill and rob not he’ll go, but what if he has money to the last needs will be needed in addition to all that then neither Dmitry Fyodorovich nor you Alexey Fyodorovich nothing after death your parents won’t get a single ruble and you’ll die your parent doesn’t have any of this now it happened like this for each of you 4 ssia the faithful will get it And this is all true Dmitry Fyodorovich also knows who his will hold me if for example someone thinks about me Gregory L pomm after this treatment how log So why am I in Chermoshnoy Absolutely That’s right, as soon as you leave, that’s what will happen I’m going to Moscow tomorrow I’ll leave the most This is the best only maybe that from Moscow they can telegraph you to disturb in any such case and from Chersh they would also have called in somewhere in that case the same thing and from what machines can’t [music] city ​​gentleman city a sit down mister Well done, most noble man you are I was saved because I need it today need to in city ​​3000 just think about it a paltry 3,000 fate is lost human Well I’ll get it because I was just struck by the idea of ​​you, Mrs. Khokhlova you know the widow Skha live untied several Neo educated but rich and doesn’t want me married my fiancee so that she deny me 3,000 so I can please from here to forever I am now to her and Kolya will refuse the end tell me stinkers How do I like Dmitry Fyodorovich? find And why should I know about him? It is known that he does not tell us I thought you know he’s here about graphene Aleksandrovna is guarding And you promised him tell me when she comes your brother with Ivan Fyodorovich is gathering at the tavern have lunch where Capital city I to him from Ivan Fyodorovich ran around the house with an errand I didn’t find him, but the order was passed on to the owners that Ivan Fyodorovich was in the tavern awaits [applause] Alyosha what are you doing here I’m looking for Dmitry he with you You can enter in such a dress in tavern I’m in a separate room [music] Dmitry never showed up. Well, that’s nothing. I’ll tell you some soup from something. You’re one live fish soup Come on And some tea I’m hungry and cherry jam you little cherry jam loves and you give me jam and now I love I heard Bring me fish soup tea jam everything Carry it Will be done I remember Ashka I’m all I remember I remember you until you were 11 15 and 11 What difference does it make between brothers in these years never there is understanding I even I don’t know if I loved you then But now I’ve been living here for four months now, we’re friends Not even a word to a friend they said and you seem to Why do you love I love me and Alyosha Ivan brother Dmitry Ivan Mogil says about you And I say Ivan, you are a mystery to me even now. it’s a mystery but I’ve already mastered something in you what is this? And you won’t get angry Well, the fact that you are the same young man like all young people people are the same young fresh yellow-mouthed boy Well, what’s wrong? Are you offended? on the contrary, I was amazed I fell into it after that explanation All I think about is Katerina Ivanovna my yellow growth and you straight from this you’re starting out right Alyosha I’m a greenhorn boy I live no reproaches of any kind logic I really want to live that I live And even if I don’t believe the order of things Alyosha Let all the horrors visit me human disappointment Let once I am confident in my dear woman Well, you see dear to me sticky leaves blooming in spring dear blue sky dear another person whom you meet someone and you don’t know why, but what if you won’t fall in love with your mind here logic is here lyush Do you understand anything in my chi and no Yes, eat, eat, come on, fish soup Slav It’s good here Well, three times I love them you are wonderful [applause] said waited waited Dmitry Fyodorovich marvel at my instinct, I knew it what are you doing to me I’m waiting for you extremely I know what’s more important after what happened to Katerina Ivanovna You did the courts couldn’t help but come, that’s realism I am in a desperate situation in life If you you won’t help me everything will fail but I I’m dying in a fever, madam. I’m in I’m delirious I know you’re in a fever Sit down Dmitry Fedorovich I know VS VS what will you say about I know I sew up the SZh judge I am a very experienced spiritual doctor of the court If you are an experienced doctor then I am experienced I have a sick feeling that you will help me Just please listen I came to court in the last degree desperation to ask you for 3000 as a loan on bail on verney security for you you need 3000 I will give you more immeasurably more than a trial wound you are so kind you you save a person from violence death by gun I will save you Dmitry Fedorovich But you must me listen and I will give you infinitely more how 3,000 I don’t need that much only these fatal 3.000 are quite Dmitry Fedorovich And what do you think about gold gold mines and gold mines dates nothing I never thought about them, but I did. I changed my mind and I’ve been following you for a whole month now I even used you for this purpose I forgot how by gait by gait Dmitry Fedorovich madam well these 3,000 these 3,000 are yours it’s like having 3000 A3 in your pocket Milna in the shortest time I will tell you I will say that you will find gold mines and you will make money millions you will come back and become an activist and you will guide us moving towards good madam madam I will follow this your advice may be very smart I’ll follow your advice and go Maybe there to these mines but 3.000 I beg I beg you, I need it today, now, Dmitry Fedorovich, quite a question, have you decided? Will you go to the pris or not, please answer mathematical From the blow I will go where if you please, but I beg you wait wait This is what I was looking for, Dmitry Fedorovich is from Kyiv from the relics of the Great Martyr Barbara Let me put it on your neck myself and to bless you with a new life and new exploits I don’t even know how Are you generous? Let me give you permission. I’ll open it I changed it where i was dishonest being being can be despises rubles Well I don’t have 3,000 rub How did you express it that they all just like in my pocket No you me You misunderstood, I was talking about the prize, Dmitry Fedorovich If you thought you didn’t have money I have no money now, I’m just fighting with manager and she herself borrowed 500 rubles from me Usova and you know If I had I wouldn’t give you money How is that possible? Well, first of all, I don’t give it. to lend means to quarrel But I would not give you much love for you to save you only one thing is needed mines mines and pris What the hell to you what to do you need to find a pear where She Well, that’s it And why are you so worried? Alyoshka And God is still ahead with you knows how long is eternity if you leave tomorrow what eternity Well, we’ll have time for our own talk about our own why we are here came Why are you looking at me with We were so surprised Why are we here? Arsha came together to talk about love Katerina Ivanovna about the old man and Dmitry and abroad about the fatal situation Russia does not exist for this you understand this yourself, it means that it is not for why are you on me for 3 months waiting probably a week to ask about the main thing is do you believe brother uvan or not you don’t believe this is what your three months came down to Alexey Fyodorovich’s views are not so you’re laughing at me I’m laughing Alyoshka I’m laughing Well, you said it yourself I’m the same Russian boy like you and how are we Russian boys are in charge Russians the boys go to the tavern, sit in the corner and about world issues nothing else Is there a god Is there Immortality and those who are in God those who do not believe in the remaking of humanity socialism But it’s the same question. only from the other end isn’t it? Yes So are there any questions for real Russians? Is God Immortality or how are you you speak questions from the other end of this first question first of all so here’s what I I’ll tell you Alyoshka, there’s nothing more stupid than that Russian boys are engaged and imagine It is impossible for one Russian boy Alyoshka I love it terribly somehow it’s wonderful let me down Oh well Let’s start order where to start with God Does God exist or what? Yes, but you Yesterday my father announced that I didn’t have it you were teased by those Talk to me transportation by sdi that i have no friends I want try Well, imagine that to myself what can be and I God I accept this is unexpected for you yes yes Unless you’re still joking are you kidding? you’re kidding This is Davi u The elders said that I I’m kidding No I decided to accept God created he is a man or man created him this we will never know i decided for myself never again about this I think I decided to accept God to accept him a goal completely unknown to us and the eternal harmony in which we believe in the end everything will merge and so on and so forth other We have a lot of words on this subject put on Well, I’m on a good road yes yes Well, wait, that’s not what I want for you say so Imagine yourself in the final result of this world I don’t accept God’s You understand I don’t accept God I do not accept the world created by him I accept and justify with a wonderful ending what’s going on with I can’t with people Well, you explain I’ll explain It’s no secret that VL just understand bro Tishka I’m not trying I might move you from your Faith vice versa I want to be healed by you without my loved ones You can only love from afar without breaking your heart. But there is one exception Alyosha children children you can love them close and even dirty sick bad face Because children They they are innocent, pure in soul and as if originally created for love that’s true yes So why God? allows them suffering For what sin did I say about children VS from newspapers I collect for example Here they recently sang about a little five year old girl father and mother are educated and well-mannered People, that’s what it said in the newspaper educated and brought up from the fact that The girl did not ask to be hated at night e beat and locked them in the latrine at night but frost all night long This is only for teach e a small creature locked in begs in a vile place he can’t comprehend what’s wrong she cries and asks God for her protect and God does not protects Do you understand this nonsense? brother you are my novice you are my humble They say that without evil a person could not exist to know on Doro And why to know this good and evil Yes, this whole damn world knowledge is not worth these tears of a child Gods, why do they suffer for the sake of future world harmony so here I am from such a supreme harmony absolutely I refuse, is it worth it to be one of Zinka’s God appreciated his tormented road the future harmony is beyond our means I only pay for the entrance and that’s why I’m my summer respectful to him I’m returning This is a riot riot rebellion And you yourself in your soul could forgive those who have a child like this what do the parents of this child do? What Shoot for your own moral purification Shoot Well speak Alyoshka Shoot bravo bravo Well done Schema-monk If you said so, then here it is what kind of devil is sitting inside you, Alyoshka Karamazov Well, there is Christ’s Love he who can forgive everyone and he himself gave up all the innocent and for you forgot all about Christ’s love is in him Christ’s love Alyosha is the Impossible on earth there was a miracle Christ was God but we were not we are gods [music] people they are I have not forgotten I forgot about it, I even wrote a whole poem about it You wrote a poem about Christ, you didn’t write it invented and I remembered the thing, the ridiculous Kamaz one there would be a breakdown here for Mitya I liked it I am called the Great Inquisitor the action takes place in Spain in Seville in the century during the time inquisition imagine the area in front of the cathedral flame and Smoke Cardinal Grand Inquisitor Watches into the fire of the bonfire on which, by his order, must burn heretics 15 centuries ago Christ gave promise humanity has been begging to return for 15 centuries Lord, appear to us and here he desired appear before the people in his boundless mercy he passes once again between people in the same in the human form in which he walked for three years between people 15 centuries back Imagine the air smells of laurel and lemon and then he appears [music] [music] [music] take [music] his a [music] K [applause] [music] Hri it you I see it’s you [music] J [music] [music] [music] jus [music] C [music] [music] become output 1 2 3 times times times twice times [music] [music] C [music] stop [music] forward move at a step [music] [music] Imagine the square in front of the cathedral flame and Smoke Cardinal Grand Inquisitor Watches into the fire of the bonfire on which, by his order, must burn heretics 15 centuries ago Christ gave promise humanity has been begging to return for 15 centuries Lord, appear to us now he passes once more between people in that in the very human form in which walked for 3 years among people 15 centuries ago Imagine the air smelling of laurel and [music] lemon and here he appears [music] [music] take it [music] [music] [applause] I’m not quite I understand that having learned of Christ they take him away prison that this is a mistake inquisitor Yoshka, modern realism has spoiled you so much that you can’t stand anything listen to the fantastic listen This you I see it you Why are you came and Christ is with you all the time is so silent you don’t honors you told this to people poya years back and people themselves brought us freedom theirs and humbly laid it at our feet Now they are confident that they are completely free we are completely free What kind of freedom is this? the old man makes fun of Christ my Grand Inquisitor puts himself in the merit that he fought for freedom for to make people happy because people don’t need freedom but bread but in the gospel these words are spoken to Christ devil 15 centuries ago spirit of the desert showed you the way by which it would be possible make people happy yoke Father Lovo I didn’t turn it into bread, but they said Then feed us and ask us the virtues rose up and destroyed the temple your wanting to make them free you acted with them as if he didn’t love them at all and tired of this Freedom the Weak and The wicked ones came to us and said to Us take us away but feed us us and bowed before us you don’t do this you expected free love and this a pathetic creature only needs to be in front of They bow down to someone the same way weak and mean but sometimes they remember their freedom can even be against sbn tova authorities and fill them with blood the earth but when all the disobedient are destroyed each other remaining attached to our name and for there are only three forces on earth capable of making people happy this miracle mystery and Authority is nonsense It can’t be such a fantastic face like yours The inquisitor leads people in the name of Christ but the way of the devil and who are these your carriers Secrets that took upon themselves the Curse for people of Dani do not believe in happiness and wealth This is Rome And not all of Rome This is not true these are the worst of catholicism inquisitors And how does yours end? the poem or is it finished finish it It is possible so The Grand Inquisitor falls silent And waiting for him to answer the prisoner and he is silent Say at least one word, even the most terrible one [music] Enter and come no more [music] don’t come at all never No secret of your Great inquisitor No he just doesn’t like God believes That’s the whole Mystery, enough about that and I, like any writer, can’t resist critics but in this you are right my Great The Inquisitor does not believe in God, it is you who believes in God. you don’t believe Hello, what are you taking this so seriously, but this is what nonsense is a stupid poem by a stupid person a student who has never seen two in his life there are no poems wrote to me it’s time leaves about blue sky about beloved women how can there be such hell in their heads there is such a thing as love it’s singing in debauchery Yes and perhaps it is maybe until the age of 18 and then run away and that’s it allowed this about yesterday’s SC koto so he got offended and picked up Yes, perhaps so that’s all allowed thought I in the whole world at least you I have it and now I see that it is in your heart too I’m not here But from the Formula everything is permitted I renounce I do not renounce that now you will renounce me for this [music] Yes everything literary stealing is from my poetry stole Akaka Lyoshka if ever I have enough strength stickers leaves then remember them I will only be you loving If you want, take it as recognition in love but on these topics no one else will talk to me don’t say a word about Dmitry anymore never all already negotiation no no I’m not here for myself not for you [music] I don’t eat converges rojo [music] [music] gave [music] M a [music] [music] [music] [music] [music] order them to send for horses in the morning I’m leaving for good Moscow, what kind of person are you anyway? yeah Okay so what and Okay listen Ivan Do it for me anyway favor Well, come to Chersh Well, what You have to go straight to the left right from the station 12 miles Here it is the railway is 80 miles away 7 pm just to make it in time Well you’ll have time the day after tomorrow Well, you should In the end, I can calm my parent down there Ivan Al arrives deeds of sale Gorstkin wants to buy it like this He gives 11,000 And I would like to know now He is lying a bastard or maybe he’s telling the truth And I’m here I won’t do anything I have no eyes Yes I do I’ll tell you all the signs, Vanya sit down go listen here you see should he look at his beard? on the beard if the beard is shaking And he himself he would become angry and want to do something he speaks the truth, he sits like that and has a beard on his left side with his hand so wide and grinning, lying, scoundrel you see, so I would like to know now is he telling the truth or lying? And if he is telling the truth so I’ll fly there myself, I don’t have time save me from all of you without a heart You yourself are the ones who put me in Chermoshnaya damned [music] push Hello darling have you seen your brother the elder to whom I bowed I didn’t see it today. I didn’t find it. in the morning leave everything and hurry up maybe you’ll still have time terrible I will then warn the Great Future he bowed to his suffering, the words are unclear your What suffering awaits he had one like that the look was horrified I am in my heart to what this person is preparing for himself once or twice in my life I have seen some people have similar facial expressions as if depicting their entire fate and then you came true maybe your Brotherly Face will help he gets everything from Gentlemen All destinies ours I will get up now everyone is moving away from each other and instead of the fullness of life it turns out to be just loneliness and that’s it will remain until everyone will understand that besides his own he is the sinner for everyone and everything I’m guilty but I blame my sin on others you will end up with people and with God revive God you thirsted love but life earthly and there are no feats in my love [music] [music] [music] we believe I am resurrected and God who died from will come with him to you by the good word of the Lord as we who live remaining in the mind of the Lord’s coming go to the Voice Archangel Christ will rise again first we who live leaving VNO with him we will be delighted on clouds of time not only from the late Star ANO There was no spirit, but the fragrance was exuded. expected to be there for the post strict allowed himself sweets re cherries With I love to know that God’s judgment is not that human Where will you be in time for work? Blagovest Or are you of little faith? [music] [music] Alexey, why are you angry or something? who yes Oh here we are how it is you from that old age failure Do you really believe it? that he will start to perform miracles the thirteen year old schoolboy is now not believes I believe I want to believe and I will believe Well, what do you need? to mock the most righteous of the righteous for what who judged this is the highest Justice I don’t want a miracle but justice So you are against your God I rebelled against my God rebel peace you don’t accept it What the what nonsense are you today you need to eat something you know you have I have sausage in my pocket just in case chance you won’t become sausage Come on sausages Yes, that’s how you are Ashka is already completely barika these dem neche pom to me I water you and me Give me some vodka Oh, how I see my brother this is a tough business Wait, you know? where would we rather go now anyway wherever you want, such a minute has come let’s go pears and if you go, let’s go pears Let’s go, let’s go Well I’m asking you [music] It’s been 4 years since the merchant Samsonov brought to this house from the provincial city eighteen years old and sad there were rumors that she was deceived by someone some kind of officer and then more precisely and was abandoned to them and remained in disgrace and [music] in poverty the family name was Svetlova agrafena Alexandrovna is the benefactor of her merchant Samsonova Grushenka, although she struck So that he couldn’t live without her but capital he still didn’t give her a big one, but but he separated the capital of the Small and the Soviets how to use this capital helped quite a lot and I must say that it’s a pear ended up on this side through SPO [music] She was engaged in buying up bills of exchange for for next to nothing and then bought it on these bills of exchange for a ruble per hryvnia So that In the end, many called her a real Jew [music] koi If you have to choose between two Karamazovs father or son then choose father but so that the scoundrel is on you got married and signed over the capital beforehand Don’t go down this path with Mitko will be Who is there not he others these nothing, you’re a smart one Lord, who did you scare? brought that not got it, order some candles to bring a fen Bring him a candle Well, you found the time when bring him I thought it was cute lomi I Lesha brother I’m afraid of him today Why mittens you’re afraid it seems not with him I locked myself here timidly, waiting for news golden and news So Mitya don’t need Fenya, have you looked around, maybe he is hid looking out everything locked everything closed I look at it every minute myself fear third discharged where are you telling you news of one I’m waiting for Anya to talk to the racket when there is such a guest here Alyosha, my dear, is standing here, looking at you. I don’t I believe how you are with me it’s not the right moment now and I tell you glad But here are Rakitin What things come true today And why am I so happy to see you? Lesha, I don’t know myself. I know Well, you don’t know why you’re happy yourself pestered me Bring me Yes Bring me I had a goal before you I had another goal now was not the time Alyosha Why is that? sadness are you afraid of me let me come to you on your knee sit here so I cheer you up my boy pious you are angry Okay, enough of the chit-chat, better get going serve champagne for a long time after you you know the truth Alyoshka I’ll give you champagne promised if Fenya brings you nya Fenya Bring us that bottle that Mitya left. run faster I want to sew with you, what’s the news? you are waiting for a secret not a secret And you yourself You know Rakitin officer is coming my officer is coming already close in the wet now from there horses will send min now he knows what he knows if he knew I would kill you, keep quiet, Rakit, I won’t think about him Want He ground my whole heart, but about the sheke I can think Alyosha my dear Come on change at least on me, well, on my stupidity, well, on my joy changed las How he looks and I was afraid that you were angry on me for the young lady for Katerina Ivanovna dog I was that’s what no that’s good that So something bad happened it was good she called defeat me I wanted my chocolate seduce No, well, it’s good that it is so it worked out, yes, here it is I’m afraid you’re angry. She’s angry with you. actually afraid of it that I love you Oh you shameless and this She declares her love to you. So what? I love and officer A Golden News from wet is one thing and this is another. Here it is as it turns out according to Bato Don’t make me angry, Kitty, I am Alyosha, I like champagne differently True, Alyosha, I had one for you the thought is vile Yes, I am vile, I am the excitement of Countess Alexandra and beyond drink yourself a glass and go dancing Eh Alyosha, take a glass, show yourself for what let’s drink to the gates of paradise for some heavenly doors no no need but bragged If so, I won’t be against God. his rebelled sausage was going to eat and why so yes old Saint his today he died and smelled Well, get old The holy elder died like this oh my god i didn’t know this Mr. And I’m on his lap I’m sitting Rakitin, don’t tease me. What am I doing? I rebelled against my god I have nothing against you and you Be kinder I lost such a treasure that you never had and you don’t have now rights to judge me Look better here at I saw her as she saw me now I spared I came here vile evil wanted I found an evil soul but I found a loving soul she spared me now Grafena Alexandrovna I’m talking about you I tell you my soul now restored so and saved you Yes she wanted to swallow you did you know that keep quiet Kitka, you are silent both of me everything I’ll tell you Alyosha, shut up because there are such your words shame me Bert because I evil not kind that’s what i am and you are a whale be quiet because you zhsh there was such a mean thought that I wanted swallow it but now it’s not the same now you’re lying and I don’t want to tell you anything anymore I didn’t hear you ohm Relax now they will start Only here is that I have a racket I’m angry but I still served some onions you see onions, this is me, rakitki praised that onions I gave this to you for a different purpose, I’ll tell you, and you Rakit sit in the corner and be quiet like mine Lackey Listen Alyosha my Basenko I from my cook’s matryona I heard There was a living person The woman is angry prize and died and not a single one remained after her good the devils grabbed her and threw her into fiery the lake is not I will endure and here stands her guardian angel And thinks What a good deed she could do for me remember to tell God I remembered she says she says in the onion garden pulled out and beggars gave it to him, Lord, take that you say this very bow, hand it to her lake Let grab and stretch and if if you get the woman out, then let the fra go if the onion breaks, it will stay there the angel handed the woman a bow and became her pull Yes, other sinners stood for her grab and the woman started to kick them with her feet I am not attracted to you, my onion as soon as she said this she fell into The lake did not pull out the angel woman broke off onion Here is my fable Alyosha by heart I remembered because I am the one angry woman Rakitki praised that onions I gave it to you differently I’ll just say that I have onions I just filed it and that’s it virtues and don’t praise me I’m a rakitki 25 rub promised Kolya you the truth will lead to me swallowing you wanted to ratka accept debt accept I bet you won’t refuse And I would still refuse Fools exist Profit for the smart to the person and now shut up you don’t love us So keep quiet, they love you for something, but you tell me what did you both do why should I love you but you won’t understand this, but He will understand Alyosha Tell me now what should I do? the officer who offended me seduced and abandoned forgive or not you I have already forgiven and in direct forgave what a vile heart for a vile heart mine and you are discharged why Or maybe she hasn’t forgiven yet you know you are the racket of my whole heart here I’ll go to him and sit down until the big one. Have you seen it? what shall I say now Well, that’s it remain merciful sir or I’ll take a knife with me there not yet decided well let it flow river Misha be merciful here is a lawyer appeared Yes, did you fall in love with her or something? Agrafena Alexandrovna so he fell in love with you were defeated by the evil soul Barney, be silent darling taranda from wet behind you and letter letter clicked whistled crawl little dog I’m going Farewell Farewell Lesha the fate is decided the pear flew to Novaya life of an elephant [music] drunk touch go to Alyosha, bow to me, tell me what Grushenka loved him for one hour of time just one hour of time and loved Let he this hour all his life life remembers went and stabbed his brother, Tinka, and even orders to remember ka all his life converted the harlots to the path of truth with this demon Now you’ll accept me for these 25 rubles betrayed a friend but you are not Christ to me A I’m not Judas to you I forgot about it myself now I remind everyone and everything and why I got involved with you, the devil knows I know you I don’t want it anymore Go away Your way [music] [music] Us [music] [music] become output one one one two three one one one two three [music] A [music] [music] [music] stand forward step by step ash touch with [music] Well enough Well, with God, Ivan You will come to God when you are still in life come I always I am especially glad you Don’t swear, let’s go with God, with God SBO you see in Moscow I’m going then People are right when they say that an intelligent person and pleasant to talk to [applause] what a scoundrel I am [music] [music] [music] [music] Grigory Vasilievich Grigory Vasilievich Fedorovich fell, Marfa had a seizure Ignatievna fma fma [music] where is she here Fenya for the sake of our Lord God Tell me where is Christ? she is my dear father I don’t know she is she I didn’t come home, I went to my father’s No you’re lying there, I can see from your fear that there oh my god he kill someone wants a [music] o o Ouch the rival is happy ipo [music] pear pear pear pear agrafena Girl my you where are you and she here entrance I’m going now I’ll open Marfa, I think I forgot the gate lock up go badly close Martha became weak boogeyman a house without guards is so dangerous time Lord Dmitry stop [music] old man [music] H [music] [applause] [music] [music] Alexander came back but she is not at home, where is she? about the bar bathhouse left an hour ago in the wet in wet Why not know this I can, and to the officer some They they horses they sent it but he won’t come back by any chance I told the janitor not to let him in like that there is no janitor there the janitor left alone Prokhor is standing nephew [music] his Say now where who is she with in the wet now I’ll tell you everything now I’ll tell you nothing ate to which officer to his former to the previous 5 years that o was not and abandoned Fenya How could I not have thought about him? She thought about him, but not about him. she said she said it was from him The letter arrived And today he arrived A yesterday I arrived still wet, leave now FT had another letter and she went And she shouted another hello to the mittens and to convey that I loved him only for an hour one hour and I loved you And what hands you have Dmitry Fyodorovich, all this is in blood only for an hour She loved me I said how could I not think Well nothing nothing now Perez Ren What with this is blood from you Fenya blood human God why did it spill [music] Senya is here alone the fence is one high fence and scary view but tomorrow at dawn it will take off sun mitenka through this fence and recount don’t understand what fence Well, nothing, nothing, everything equals tomorrow you will hear and understand everything And now goodbye, goodbye. [music] [music] [music] Gregory Vasilievich Grigory Vasilievich Where are you? and he feels bad [music] Gregory again Vasilievich Grigory Vasilyevich Grigory Vasilyevich Where are you? A [music] Oh my god [music] va [music] r [music] Riri killed it he killed his father Run, call, oh, Gri, call [music] Gris Run Holi Vasilievich Help help Mikha Vasilievich dying help Trouble trouble Let’s go where is Fedor Pavich trouble Grigory Vasilyevich mind Fyodor Pavlovich trouble Fedor Pavic Fedor Pavic at [music] whites Barina Belle What happened? Barina killed Grigory Vasilyevich dies all in blood I heard the killer screaming at my father Grigory shouted And who killed? I don’t know. Oh my God, he killed me, oh my God, what what do you do, boss, you have to do it report to the lawyer, when will it be? we ourselves didn’t see anything to report on ourselves take a look Sorry for invasion come in you have my pawn pistols A yes excellent pistols nut with pleasure Dmitry Petr Ilch opposite me he came for them and brought money I’m in a hurry with gratitude Pyotr Ilch no time please hurry up and you blood fell that Let’s go to my washbasin Magnificent magnificent ru where Yes in pocket pocket Sun Oh, that’s nonsense, Pyotr Ilch. Let’s get to work. let’s finish with the pistols and you give them to me Please return it, I really need it. And here’s the money for you. your money is very much needed not a drop of time there is not a second Yes, there will be no change smaller no, they’re all the same, and why are you like that? Dmitry Fedorovich, you got rich. And you? you know, I’m going to send my boy to bench tightly I’ll send him running away, they close late and they’re changing Misha, come on, one leg there, the other here I understood Come on Great thing Plotnikovo, come on, tell them that deer Dmitry Fyodorovich ordered and he himself now will be Yes here another there Come on let’s go let’s go let’s go wash Let’s Dmitry remove the IBS Just put your money on the table Let me tell you I’ll help you and you have a hand in it blood No, it’s not much, here are the sleeves just not all of it, but also this pocket handkerchief through pocket blood leaked Where did you end up like this? fought with whom A let’s go yes yes yes yes Follow me, please. please Dmitry Fyodorovich uh do you still have face blood here here on the left cheek Yeah yeah … yes yes yes Dmitry Fedorovich you are in this shirt and when you go, look, there’s blood on your cuffs Oh yeah, the blood. blood Well then, change it. underwear Yes I have no time and I just cuffed it like this I’ll wrap it up and you won’t see it. Yeah, Dmitry. Fyodorovich, where did you end up? again at the tavern they fought again, didn’t they? this captain, like who else then nailed nonsense it’s me it’s me the old lady I just crushed one old lady they crushed the old man, damn it, they didn’t kill him did you have anyone a Yes no when they got into a fight and make peace, break up buddy there is no time or second, you understand I would talk to you yes So where is the money Yes, there on the table Dmitry fch for you money what quarrels or water Yes, that’s right Here’s your key pistols yesterday they were pawned for 10 rubles and now you thousands you will lose ek Dmitry Fedorovich in where are you actually going Here she is, Pulka so if she’s in my brain It will be interesting to come in and take a look. What is it like? she And by the way nonsense Ah Pyotr Ilch if only you knew to what extent degrees all nonsense Well, give it to me paper piece smooth for writing egg God, I’ll go and tell someone now. so that you don’t go anywhere Dmitry Fyodorovich was allowed in. And yet where are you going And in the wet in the wet Why do you need it now? it’s wet to drive A and why wet Yes woman Peter Ilch listen Dmitry Fyodorovich, even though you are wild, I always you treated me well somehow liked Yes Dmitry Fedorovich Now everything is ready to go. I I’m worried about you woman Peter Ilic and quite and Sabbath Misha and I forgot about you Thank you expensive cart Pyotr Ilch we are going don’t dare don’t dare don’t dare go go from here in my house it is not accepted bad pampering hide shi Degi tomorrow eat at ru s Listen, let’s go to the wet place together. Why should I go with you wet? Listen Dmitrich, do you want me to give you a bottle? I’m going to have a drink together now, I want to drink Most of all with you Well, we never drank together brother Well let’s go to the carpenter in Let’s have a drink in the back room Pyotr Ilyich Well Do you want me to tell you a riddle? Well make a wish like this and I punish myself for my whole life I’m punishing you, I’ll go and tell you now to someone and you won’t have time my dear aplot whom let’s have a drink Why do you need it? so what kind of basket is that what’s in it here 400 rubles and there is no reason to doubt this basket of champagne, half a candy and no more than an hour delay and no more than an hour so that more Guk Girls there love it Guk what about dozens and why those four A dozen shekels is enough. Come on, give it to me. I’ll check the bill for you AHO te deri Dmitry Fedorovich Brosay your money Kolya free profit here come here sham with oysters first oysters most last time I got the hell out of oysters I got them Not I never eat oysters and I have no appetite don’t be angry with me friend I never liked all this disorder Who loves him anyway? disorder Dmitry Fedorovich three genies champagne for a man Yes, it’s anyone will blow up Yes, I’m not talking about that, not about that Listen Dmitry Fyodorovich, everything is yours to me. pistols I see a gun hi, come on, let’s drink and not fantasize here is champagne Let’s Here please for life my dear for life Let’s drink to life, I propose a toast to life and to one queen itsari come out well well for life well perhaps for yours queen Oh, what do you need Misha? Misha, my dear. Come on. Come on, come on, knock this glass out. Well. why do you need him? Well, let me. Well, I want. Well, remember longer me Well, what are you standing there for? [laughter] drink Well done ay Well done woman I love woman And what There is woman queen the earth is sad for me Peter Lich sad remember gata i’m so sad so sad poor guy, radio Yurik It may be me, poor Yurik and there is poor Yurik right now and scull then Dmitry Fyodorovich everything is ready you can go Dmitry Fedorovich Dmitry Fyodorovich, my dear, don’t ruin the master and don’t ruin him he’ll marry I’m on the table I’ll throw them down the road into a puddle choosing not to kill anyone will not destroy anyone a stupid person will not destroy me but I have offended I forgive you and by A about now already the last one touch Andrey we’re flying away quickly go fool, even though he is a good boy Well what is he doing there now business Be careful not to they cheated me What am I to him as an uncle What’s wrong Karamazov has 3000 where could he have it from? 3000 he said that Lakova gave him here something is wrong, Fyodor needs to go to the pachu nothing happened Dmitry rumor threatened kill everyone here heard him and said exactly that yes, it’s all a look Most likely I’m like an official dandruff to his house he was breaking in to find out if he had been killed I’d rather treat this maid Feni properly I’ll ask I’m running I’m running Well, tell me what you know, Dmitry Fedorovich did something wrong, where did he get the money from? He killed you so that you know this or so do you think he killed me for barn? He killed me himself repented how repented that it was blood human said that he was human he killed himself he said he says a lot You tell me what with your own eyes I saw him take an iron dog from a mortar I came back without the dog and there was blood on my hands. dripping dripping dripping Well let’s put the blood at it didn’t drip from his hands, they were just smeared with it he killed for a ram it is necessary to the police officer to go Well to the police officer so I can go Well, something is wrong here, they don’t behave like that the killers are not they lead him so he went to the barn wet baren killed Al I don’t know, father, I don’t know, to correct run to corrected by Gregory Vasilyevich, we will speak in reference and if he’s still alive, we’ll take a look ourselves first Let’s go and have a look now [music] head Dmitry Fyodorovich you again we find stand Trifon Borisov same the main thing here is she is Agrafena Alexandrovna Yes, here she arrives with whom the guests have arrived one official in a conversation with a Pole Well, [ __ ] with him comrade Al who will figure it out states dressed Kutya rich people Yes what Kutya Dmitry Fyodorovich is a small figure small sit pome Maximov naked and rides around in front of different gentlemen and that’s all and that’s all now the main thing is three Borisovich how cheerful she is laughs Yes It seems he doesn’t even laugh very much he sits very sadly. Now is the best time the main thing Let’s go for the gypsy gypsy us at all I can’t hear Dmitry Fyodorovich agree boss But here are the zhitki in Christmas is like that on the cymbals they play violins, you could follow them send send send definitely send and let’s get the girls going like then to especially steppe Mary I’ll give you 200 rubles for the choir. I’ll give you that for that. money VS village I will raise so come on quickly quickly only Why the Master for such a reason such a sum of meanness to the point of disgust determine quickly what kind of girls they are there are lousy ones Yes, I will give you my daughters I’ll raise you for free And when they go to sleep, I’ll put them to bed I’ll kick you in the back and sing for you I’ll make you wear more than one cassock that time thousands grow up grow up my dear how could you not remember 3 maybe we are left with that now Well, you see, Ai Trifon Borisovich has arrived. So now the most important thing is to listen and understand, in an hour the wine and snacks will be delivered candy pies And you now while this open the basket and put it on the table Yeah Come on, come on, girls, girls girls here’s 15 rubles for three, 50 for vodka your readiness love remember andrei karamazov i’m afraid Sir, 5 rubles for tea, please, no more I will accept Trifon Borisovich as a witness forgive my stupid word you are afraid and To hell with you if you’re afraid Sir, father, what is the gun for? Well, come on. Take me there, oh, they’re in Blue. room like we did in Blue Well, wait a minute let me look at them first and the main thing is that they don’t see me didn’t notice A quietly Come on Pozhva Yala cash [music] se [music] Gentlemen, I have arrived too. pa we here privately have others chambers Hello Mr. Karamazov Maksimov and you are here, how am I so sorry and you too? here Ah How did you shake my hand Prince Pal broke my arm shook hands gentlemen Mrs. Mrs. and drink world Lord I brought this [laughter] if my will allows steering wheel steering wheel roleplay what is the Queen or something oh i find it funny how are you say sit down Miti and don’t scare Kolya anymore you won’t be I’m glad to scare you, am I glad to scare you? scare I’m glad you came hear me very much to you I’m glad I want him to sit here with us If he leaves, then so will I. I’ll leave as my wish Queen that the law of penny pan to our company [music] [music] Well Mrs. let’s drink I need to drink today because what lord you don’t do this anymore Vsky needs to be drunk and I brought it, it’s great I’ll drink it myself, but I’ll have to put up with this liqueur. I can’t. Did you come here to party or something? Well, then with heaps of money, hide it in your pocket only got it With [music] I [music] [applause] A [music] [music] [music] [music] [music] [music] become lead out 2 times once once twice [music] [music] stop [music] [music] forward move at a step [music] [music] [music] [music] [music] ish [music] I walked through the park with you Panya I thought it was more fun Let’s have a drink Mr. and with another Mr. Mrs. Hey, I see, nobles, come on, take it glass pan in Rublevsky now let’s drink to Russia I want Russia and I would also be for Russia old granny all all these Well hooray hooray hooray hooray Well, you what for Russia before the division Poland a couple and not weaknesses to their own so as not to edge it was me I always offend everyone it’s my fault I didn’t want you you have to offend to make it fun. Where? music where are the girls why the girls no give me champagne more champagne Father is gone and the troika with supplies I haven’t even arrived yet, and where are the girls? Yes, girls, here they are are going to Hello Bari Hello Mar Marya So where is Maryu Sir, we’ll deliver soon, please. worry and sent for liquid with cymbal and I have already raised my daughters now I will do everything so let’s go to the hotel girls from the box get some tguk candies and Andrey some vodka he left how did he leave he offended me him I offend everyone but let’s play cards Give M 5 rubles I would also risk it in the tank cards are a great idea great, just need it to be there again it’s fun I’m holding 10 and you’ll lose again come Gentlemen, bye music There’s nothing we can do for now it was fun, maybe we could play bancho when ve Well of course c This is good, very good, Yano agree but what is this late is this then it’s time for Mrs. late late You can’t be boring yourself and make others bored too it was boring Mitya it was them who did it to you sat were silent N he vaguely sees your disinclination and That’s why sad in cards Gutov sir in the map do not agree then let’s start just so the cards are from the owner Pani then pour it the way from the owner is good I understand Let it be from the owner that you are good, Mrs. kar and I already lost 50 rubles to them today Pan was Unlucky Pan may be again happy How much can a bank hold 100 Maybe 200 Thank you three, how much will it be? I want to put a lot of things on you, Mrs. lose take cards laying the bank What do you want? I decided to do whatever you want and it’s not this that bothers you bad timing about general our friend Dmitry Fyodorovich Karamazov familiar just 3 hours ago this a friend came here at this very living room to kill me kill so he I wanted to kill you too also, he already killed someone, please listen to the court I’ll give you VS for just half a minute explain this evening Dmitry Fyodorovich entered the room. carrying a wad of ruble bills in my hands approximately in two or even 3000 rubles hands he had the same face bloody And he himself seemed as if by the way that you judged him the sum of 3000 so that go as if to win a gold prize my God I didn’t give him any money, I didn’t give him any It was he who killed his father. Allow me. Allow me, madam, allow me, are you sure? remember that they didn’t give him any money no Dava didn’t give it to me, I refused him and he he pounced on me and I jumped back I can tell you now how to a person from whom I have nothing to hide He in me you can spit like that imagine madam a a what are we standing there for let’s go Killed killed And how did he kill him like this was Sit down Sit down Judging by everything He had stocked up on a copper pestle in advance. in the kitchen of his mistress and with this pestle I broke the poor guy’s head and now rushes wet with the aim of killing this very one mistress But this is only mine for now I guess I felt it and that Now He killed not me but only one his father is the finger of God were ashamed and then he spat at me with a throw on his neck and that means where galloped But now what are we with you Now I’ll go straight to the police chief and I’ll tell him everything and then he’ll be like himself Mikhail Makarovich knows exactly to him a wonderful person and knows what not to do Should I go with you? No, no, but here it is. if you now with your hand wrote only three lines about money You didn’t give any to Dmitry Fyodorovich. This would certainly not be superfluous. How you are resourceful Pyotr Ilyich You me You simply amaze me It’s amazing that you serve here I have never given in my life on loan to Dmitry Fyodorovich Karamazov 3,000 RUB I swear by All that is holy that exists in our world Khokhlova, go! and save us all brother you should fill the puddle with life Yes sir boy please I have a report about a possible murder the police chief has already informed the police about the murder it is known that the murder was committed after all The yard of the murdered about this reported so mister investigator we’re already waiting for the investigator notified before evening Gentlemen Good evening Good evening more unpleasant incident Gentlemen Yes, good evening, gentlemen, gentlemen. Well, here it is. Nikolay Parfenovich and since the political Kirish prosecutor Vika and our new Zemsky doctor are also with We can go to us immediately we’ll try not to get to the scene of the incident to excite unnecessary agitation in a year I’m afraid Mikhail Makarovich avoid general agitation will not succeed father the murders are too visible events and here psychological ones will rise and spiritual questions are so significant that you and I will find ourselves in the center of attention not only of the city But and all I don’t think I’m in Russia anymore I need to take my leave My Lord respect, well, let’s discuss the details, gentlemen [music] 200 lost, you still bet 200 more 200 Pani nape Stop it Dmitry froch pretty well why Well just spit and go away many lost the zhartuy I’m not kidding at all I’m kidding He’s telling the truth Mitya you’ll lose clear pove Rony do not dare to shout Ms. Greena Clearly Great into two words that sh Madam, please come to that I’ll tell you two words in the room, I’m happy you will be Mr. Vrublevsky is with me Bodyguard Let him go he even certainly Well march where are you my soul I’ll be back in a moment than I could give them do you want to serve? 3000 money Here you go leave zhi rye pono Ji Listen I see you are a man reasonable take 3000 get out of here to all the devils Well, just now this minute and so that forever And what do you have there coat I have a fur coat and a hat. I’ll take everything out right now. the three are laid down and the finishing touches are being made again rubles and rubles again like this 500 rubles now as a deposit and 2500 tomorrow in the city I swear by honor that there will be Mrs. Well and the Land why 700 700 700 and not 500 right now hands of Madam, why don’t you believe in hands 700 Well, what are you saying, I won’t give it to you I’ll give you all three now And you again tomorrow you’ll come back to her and what? No, I don’t have it 3000 Well, at my house there in the city where lie Pan houses hidden whether greedy e God don’t eat yet why do you want to add more pears Togo plush in Russian speak not a single word of Polish I didn’t speak Russian before Have you really forgotten about pa ae a in 5 years? Negroes in Russian Speak or I don’t want to listen to anything, Ms. agrafena I came to forget the old and what was before today forgive me but this Pan Mitya You came to forgive me [music] I’m not a coward, I’m not sorry generous but I was surprised by them lovers Hey Pani Pani I was not her lover how funny I am in front of them protect this pan Mitya gave me life in those chambers to make me leave I spat on the gentleman physical he gives you money Did I give she is pure and corrupt Mitya is shining Yes, it’s not him who takes money from himself I took it, but he wanted all 3000 at once I gave him 700 ass, no problem. Well, I understand. Why does he need 700 when he is known as I have more then that’s why I came get married Mrs. Arepina I I am a knight and not a nobleman Laida apple take you as a spouse but I see pa Swan equal and Demons what before Well what is this before And you were like that before, you laughed The song that sang to me was the Falcon. And this drake Yes, it’s not him at all It’s his father I’m such a fool Damn Niska you 5 I waited for years, tormented myself, exhausted I see the edge My dear, it was a forest to relax with a friend [music] we are the garden owner proni you throat RV As you say, I am a beast, but in what katy game te touch [music] Here it is, my deck, sealed, he has it I put it here and replaced it with my own [music] no A put you there Where you came from in you drive away and chased away shema kurva [music] [applause] [music] doctors caused by a blow the body is most likely metal the subject of mavrik mavrik is already wet left Excellent I sent the station to the wet so that we can hold it until our arrival the criminal is under surveillance and even VP will shoot himself And here is this one the subject is obviously with this pestle it he broke the head of his father and the Lord we found the gun murders crown ran dog hands push tail tail for [music] King Naro Neli [music] chka gifts He and he and he wears expensive ones gifts not [music] Well, well, you’re not yourself Well, well, well tell me how are you How did you get here How did I find out that you came running to my house? Yes I do there in the kitchen there What what what what are you frown [music] Thea left to know that he will recover in 10 years life would be one Yes God be with him with the sick You I’d better tell you, you’re good for everything for me you will go No, no today tomorrow I will tell you one word I’ll tell you And did you want to today? [music] don’t sharpen your curly hair, don’t sharpen my seedlings you were smoking my seedlings yalya you I poured I poured you I poured you not watered Dila went went rush rush and Ivo his but to the left city nane [music] Velichka where is the patient when did the seizure start yesterday, father yesterday yesterday I fell into the cellar and so it began cool gentlemen write down the envelope the inscription on the envelope is torn 3,000 rubles to my angel pears If if you want to come, you’ll have time chicken envelope torn apart Khust money it is obviously the same money that was stolen which killers are now drunk in the wet gentlemen Yes, now we have everything. reasons to produce arrest are you coming with us or staying here with the wounded servant I remain with him everything will be fine but i’m curious watch another servant epileptic you understand such long oed great rarity besides, he doesn’t live here. But here Dear sirs or not, I ask watch Our drunk bear deck bear water a girl climbs into a raspberry scares his mother his name is Daria Marya copper at [music] oh he’s dead anyway [music] lies girls let’s kiss to have mercy And I started come to life go to the oven so that there is nowhere [music] Pellets to How old is this bear? I sing and he lies down in the cage Oh, he lives at home hundreds of years [music] live for us I won’t go [laughter] Masima [music] [music] [music] you trin be near so that it doesn’t lead Lord yes I am Mauritius Mauritius with him inseparable and the gun is me gone God Live I’ll turn around, because you did miracles, Lord the same sinners as me If the old man is alive I will steal the money I’m stirring from under the ground I’ll get there, there won’t be any traces of shame left except as always forever right now for tonight nave Mia even a minute of love is taken away queen why were you looking for me yes no why I need to look for you, you’re angry, let’s go for a walk it’s too late have mercy For God’s sake it’s even as much as you like [music] slept oh Luda Luda slept saved us alien oh Lude Lude thank you field lule his yid here and there about lule lule back and forth back and forth in all directions lule sides I’m going to Lele [music] I was 17 years old then I was just driving to him and all the way I thought when I meet him what will I say how to look We will be all souls towards each other I froze and he definitely washed me out of Shaki I poured it on him, I didn’t recognize him, did I? spoiled it before with the same was Lord Damn it Let it be what are you like [music] Do you hear? Tell me who I am I love one person here which This man is what Tell me came in davichi alone heart so whispered you fool that’s who you love came in everything lit up Mitya how am I a fool Well yes So what if I love someone else after you do you forgive me Mitya or not Do you love? love and I’m sorry that I tormented everyone with malice to aim Falcon, why don’t you kiss me once? kissed and look do you hear me are you listening to me? Kiss me harder. so love you ku love No, I don’t I want to Join easier your slave I will be a slave for the whole life and now guilt I want to get drunk drunk Want I’ll go dancing drunk [music] [applause] [music] lury no you’ll fall my Why am I so good I’m very good wok [music] blue new new new new zhee hola younga do nae roka ho dela young before [music] naka dawn of navy navy Zare launched a blast from the right sleeve onto she let [ __ ] out of her right sleeve onto the shelves sobony on kavala on sobony flight [music] Not touch said it’s yours and you don’t touch spare the vile here I am not obedient I think reverently and disgustingly Here it is necessary that this is despised it will be fair from now on honestly and for us to be honest good ones are not animals but good ones take away can you hear me Don’t want here to I’ll take you far, far away I’ll give my whole life for one year Now I just wish I didn’t know about this blood Which blood pear That’s what you want honestly I’m a thief I stole money from Katya Disgrace Shame on Katka, young lady, give it back to me. take from Give Now everything is mine yours and not hers love her no more love you love you alone in Siberia I will start loving Siberia, well, you can go to the seventh if you want in yourself [music] stop snowing love stop Dmitry Fyodorovich, come and join us here. A and there is an urgent need with you explain old man old man his blood I understand, Mr. Retired Lieutenant Karamazov I must announce to you that you you are accused of murdering your father Fyodor Pavlovich Karamazov passed in this night [music] on [music] A [music] [music] [music] become lead out once once once two T once once once two [music] [music] stop [music] [music] step forward ash touch [music] there is an urgent need explain yourself to me Mr. retired lieutenant Karamazov I must inform you that you are accused of the murder of your father Romaz Fyodor Pavlovich who came to this [music] I don’t spend the night in this blood guilty wanted to kill but not guilty not me it’s my fault, it was me who tortured him before I and the old man were driven to this by anger I’m to blame and you’re to blame, you’re the main one You are a criminal, you are debauchery, my completely there will be chaos Mikhail Makarovich will interfere together with the investigation judge us to execute with him even to the death penalty I’ll go take action accept pear life is my sanctuary my oh Lord calm down Dmitry Fedorovich sit down Don’t believe it, it’s not her fault not in what, well, where is what there disperse So you claim that in you did not die because of your father’s death guilty guilty of the blood of Gregory and mourn but not in the blood of the father absurdity impossibility you in vain So Are you worried about your servant Gregory? despite the grave harm you caused him the beating is alive, alive, alive and will live undoubtedly and the doctor is sure of it Lord lives I thank you for the greatest miracle I’m one second this is impossible Gentlemen, I’m only here for a moment. a moment to tell her that the wash was gone this blood that i am not a killer Calm down Lord you resurrected me it was old man Grigory, he washed me in a trough carried me in his arms when I When you were three years old, your father left you do you consider yourself guilty or No, just wait. Give it to me. sigh not drum skin man oh Lord I’m a little drunk but I’m still I understand that there is a terrible suspicion on me horror horror I’ll prove it to you We’ll end this in a moment then With your consent we will record that the accusations brought against you denies guilty of grievous bodily harm beatings for the poor old man guilty in the depths of his heart guilty it is not write these depths of the hearts of Casa Calm down Well, in the murder of the old father Well, this is wild. I will prove to you the Lord’s thought Yes, you will laugh at your suspicion but you were in a quarrel calm Fedor Pavlovich You threatened to kill him when witnesses threatened and in Kili the elder for Simy threatened and almost did so in front of witnesses killed him go if not then who killed him then gentlemen I understand you I’m sorry Oh, I’m amazed myself Where is he? killed like killed we found him lying on the floor with with a broken head [music] [music] what caused your feeling of hatred towards he has a feeling of jealousy jealousy and not just one only jealousy, a dispute over money, because of money dispute it seems went about 3 as if not bottom to you inheritance more she more de Well yato decided to make peace with I desperately needed three 3000 Gentlemen, these 3000 are not under the pillow he prepared for the pear I and their Lord considered sewing on his own actually Dem you considered it yours property I understand, but I’m not afraid of evidence against myself I speak to you Lord says the man did something mean Noro Mitenka measures to take Dmitry Dmitry calm down calm down Why calm her down Calm down Dmitry Petrovich, I ask you to calm down. [music] Sorry Fenn got carried away I am guilty before you head Michal Makach on let me go no no no He killed my father because of me suffer Give me a word to him say forgive me christian soul but you can’t KMU you tell him that you were for me calm and uden gentlemen from yours permissions Dmitry Fedorovich Agrafina Asanovna sent me to tell you that you were calm Mikhail Makarovich it against all the rules she is smart with you good Please forgive me Mikhail Makarovich What? you do and political kitsch you must accept measures So what will you convey to her? calm no I will be calm I will be angelic soul Mikhail Makarovich, please tell me that I I’m so happy I’m going to laugh now Here As soon as I finish I’ll be free and go to her right now Let him wait and wait Let the gentlemen I now see her with noble ones people Yes, I’ll give you my whole soul now I’ll open it She will open it for me loves proud and in nothing I am guilty, she is an ugly, shameful creature loves me now Ute I am now completely yours Lord Yours You You can’t imagine Dmitry Fyodorovich how this readiness encourages us and we from our side use everything that is from us It depends on the Lord, leave it to me to do it myself then I’ll tell you everything now fine and tell me but first Confirm one fact that is very important to us Curious, is it true that on the eve of this murders You had no money at all and you even borrowed from Pyotr Ilch Khotin 10 rub I pawned the gun with him for 10 ruble returned to the city and pawned it. And you went for city ​​When and where I was the one who went to the local merchant 3000 money busy 3000 And why exactly? 3000 so gentlemen wait V 3000 debt to pay off who am I positively refusing to say this question is not relevant refers to the debt of honor wanted give Let me write down what you answer this question refuse to do I do you a favor, gentlemen, you have a lot of time, but record Dear Sir, you have full the right not to answer questions But ours it’s up to you to explain the harm you are doing to yourself this produce Well Gentlemen, I beg you, Dmitry Fyodorovich continue So you tried to borrow 3,000 merchant gava you got them from him [music] yo [music] So, the much needed amount of 3,000 neither the merchant Galov nor the lady had a ruble You couldn’t borrow Khokhlova Oh no I managed to write this down. I ask you to write it down. confirm that there is no other money Then you are not was write write write write gentlemen This is God himself Well, that’s not it. the main thing is I was ready to go out rather cut the crown find these 3.000 get them out from under the ground And here are these words I would like to stab you, would you allow me? write down whether this object is familiar to you Here Damn, again about the wrong thing [music] eh, why run to your father and what did you have the goal of the leader is such with what weapon did he grab it and run away? However I don’t know dogs, it’s dark just in case A Before you also took Going out at night some street weapons literally impossible to speak write grabbed the pestle and killed my father with a blow to the the head is now satisfied, they let off steam So you stood with this pestle in your hand your parent’s open window So what? happened then then then killed him, grabbed him in the subject and cut him up through After all, that’s how it is in your opinion, in our opinion Well and in your opinion, in my opinion, it was like this pear pear pear Agrafena Girl my you where are you Grushenka Krusha my joy glory to God agrafena aln Oh you scoundrel Oh you scoundrel tears are the mother of the face my god beg I don’t know but the devil was defeated I rushed from the window and ran to fence But you didn’t tell me a single word Not believe Why do you do this? you conclude because I am the main daughter arrived and he wanted to kill the pestle too took it out and suddenly from the window I’m running away Who will believe this poem in in verses, haven’t you noticed? ran off What door was the door of the house open And you found it open And who could have opened it? And this is Us. would like to visit you find out The thing is Dmit fch that the murder did not happen through window a in room it is undoubtedly clear from the situation the killer entered this door and committed murder through her and came out Yes it is It’s impossible, I didn’t go in there, but there were signs only me and the stink without these signs the old man would not have helped anyone there is no world opened What these are the signs signs are for the father to open the door and Smerdyakov gave them to me And these signs were known only to you and the servant of the stinkers not yet and about the sky Write it down Well, what if it is so Dmitry Didn’t Fyodorovich force the stinkers? your father to open himself then and committed the crime of the stinkers painful chicken And why would he kill the old man? after all he is his illegitimate son you know that Yes, we have heard this Legend, but you have heard it too. sytem Mary kill It’s mean, I told you this myself told Well, he didn’t kill me, he saved me my guardian angel what are you doing again your own That what did he tell you Smerdyakov was mean can i talk about this ask we found the servant of the stinkers without memory in an extremely severe attack epilepsy illness Well then I killed the old man Damn, we understand you are exhausted, Dmitry. Fedorovich and we will give you a rest But First, tell us about the guns. why did you suddenly need them to here at dawn a bullet to his head stick a piece of paper in your pocket cooked hotina wrote read When did you come to Mr. Khotin for did you have pistols You weren’t afraid of suspicions, but I was VS equally Lord I would at dawn if you shot yourself you wouldn’t have had time to do anything if your father hadn’t been killed you would have come here you didn’t arrive when you entered Mr. Khotin kept in a bloody [music] Sai No I won’t say and I’m very sorry about this damage knew Lord knew that here SHIM foreheads but you can’t say and that’s it but Can you at least announce What was the amount of this sum? quite so washing in front of you money here is money read on [music] [music] [music] [music] Mitka tas Nesi, can’t you see the bench? Plotnikov left 300 rubles to Khotin 10 his boy is 10, the driver is 20 at cards 200 were lost and they gave Maximov 25 and Maksimov is only 25 together it comes out to about one and a half thousands, then, but you said that you brought 3,000 with them said A where I must now do the rest detailed inspection of the dress yours Please turn out your pockets as necessary. will be removed take off clothes so so it is forbidden undress straight here at least behind the curtain Let me go behind you the curtain too the shirt I’m asking you to take it off for the second time or not to shoot we will give you a shirt we will notify you of the money you’re looking for this just like with the thief Ani as with officer And what is this? you blood blood blood Ippolit Kirillovich take a look then you will have to have the shirt take the trouble to take off your socks, you’re joking we don’t have time jokes Let the accepted ones sign the act I’m not here to inspect, is there an order? stay Here is another frock coat this is Van Trifon Borisovich donates I don’t want to dress in someone else’s clothes. Return it. my it is impossible your things have been attached to collection of material evidence [music] [music] Well, why should you flog me with rods now? start there is nothing left Dmitry Fyodorovich, your reluctance explain to us the origin the amount of money you had with you pushes you us to think that this is what you have ring ring Yes, this one on the ring finger fingers With lomi what kind of stone is this And this smoky topaz do you want to see me I’ll take it off. Don’t you really? you see, if I really killed father would I really start to wiggle, lie and hide Well, Dmitry Fyodorovich, what are you saying? me the one who is a bull at the door is the one who killed [music] We have a witness who shows that they entered What kind of witness are you, Grigory, who was wounded by you? he before noticing you running away I managed to see a door to the fence at home open nonsense Present it look Dmitry Fyodorovich is familiar to you this the subject is that envelope Yes father’s Oh this is the inscription here is a chicken you you see 3,000 you see we see but we have money they didn’t find him, he was lying torn apart half [applause] it’s Smerdyakov Now it’s clear it’s him but you They also knew about the envelope, but I didn’t know where is it located but you told us that the envelope was lying under the deceased’s parents pillows we have it written down as nonsense I’m on boom said under the pillow well so They say money is always under the pillow. Where is it? the envelope was lying there, only he knew Smerdyakov Lord, arrest him Wednesday when I Father would not have opened the door to anyone without signs to anyone Dmitry Fyodorovich’s life has no signs there was no need to hand over the door, it was already there the door is unlocked unlocked Yes, this is nonsense, Lord, this is Phantom God against me Well judge for yourself dmi on one side is a door and on the other hand your fierce silence about the origin of the money Here you claim that we are cold price tags and we don’t believe in the nobility of your soul but understand our situation as we do we can help you believing is good Gentlemen, I am fine. I will reveal my shame to you so that later don’t blame either you or yourself, that’s good. And Believe me Dmitry Fyodorovich, what’s wrong with you? full sincere confession it will help about Gentlemen, this money was mine. wait wait Dmitry Fyodorovich but by your own admission you didn’t have money then, you were everywhere they tried to get them were mine were my stolen and there were their rubles Where are you from? their took shi and took here from here here they were hanging on me sewn up in a rag for a whole month stolen wore them here with shame and disgrace yes Who are you talking about? appropriated from she is at Katerina Ivanovna’s Verkhovcevo at the ex-bride my stole yes I am a scoundrel that here now about her I say but the money is from a month ago she gave me 3,000 to send it to my sister Well, I’m in the cancer hour of my life fell in love with another here in the wet bit through half with her these damned 3,000 and the other half held on, held on and carried here as his own shame And yesterday I printed it out Have mercy, but you skipped class a month ago. there is not half but three and who thought that there were three but you yourself told everyone that three Well he said well, the absence is not three but one and a half A I sewed the other one and a half into a bag and wore it Here you told someone that kept half the amount for yourself Yes, you Of course, no one is crazy, but I don’t understand what prompted you to make such a thing out of it secret As you say, it’s just a shame temporary appropriation of other people’s money and not at all not stealing is a frivolous act above even to a degree frivolous but not at all shameful you don’t understand why shame No, you better explain to us Why did you separate this amount from what purpose You saved 15,500 oh Lord I I didn’t explain the main thing to you you understood me in a moment, I’m mean to the pear I thought that she would not forgive me for my poverty Look, Father prepared 3000 for her in an envelope. I have two twenty-grivennik coins and they suddenly get tired of tormenting me will say I love you Ani him then what do a take me away he will say to the ends of the earth I scolded her for the money to take her away. I sewed up half of these needle novta year with calculation even before I scolded my drunkenness drunkenness Well, once I sewed it up, well and good the rest half of the time he went drinking meanly Dmitry Fyodorovich, I think they did it not mean at all, but even reasonable morally well, not everyone held on what’s the use oh Gentlemen, you terrify me Yes, you understand that all this is happening to me it’s been going on for a month Every day and every hour I told myself You are a thief. the thief from that was fierce from that fought in tavern and father beaten because he felt that thief Tell me however dmit cha a great whether was eh how did you her call Lanka on your neck a 100 ruble note in the chat he folded the value here Why And where are you her Delhi asked where exactly are you what Are you laughing or something? I can’t do it anymore I can’t I want to see that you didn’t believe me after all You didn’t believe a single word of this be you Damn them, will we have some tea? on soul my di [music] Gods Child God [music] It’s not reasonable for Dane Ali know sinful You are the soul [music] mine is not pokost yes O O [music] cheerfulness as souls I am Nikolai Parfenovich Nev District Investigator court before asking Dorina Dmitry fdo as the accused was brought in [music] leading to the murder of the Father his nobleman Fyodor Karamazov Pavlovich, gentlemen, and with the pear that she is not guilty of anything, what are you with her will you make comfort We don’t have any motives for this yet Thank you Gentlemen, you are honest and fair People, I myself am lost, I see disappeared But now you have lifted the burden from your soul my what now now what to jail You let go come on come on come on later then me let your soul in let’s continue like this and inflict grave harm bodily harm to servant Vasily Gregory and Taking into attention that the accused does not plead guilty to nothing about the crimes brought against him he did not provide any justification for his actions and meanwhile the witnesses of his circumstances quite [music] ulica chero [music] [music] and not bridle hollow [music] those [music] child heart di heart go heart chue zhy [music] S [music] [music] Why is the Child crying? What is it from? [music] cries why cries Child why is she crying? [music] A [music] [music] [music] A [music] [music] [music] become output 2 3 times one time two three [music] M [music] stand forward step by step ash touch [music] [music] the evening is fading [music] [music] moina module on [music] nae and moe child heart my heart my heart my go [music] Why is the Child crying? What is it from? [music] cries why cries Child Why is it crying? [music] [music] Dmitry Fedorovich Dmitry Fedorovich you need to read and sign protocol I slept an hour more you need protocol read I won’t read I’ll write like this Yeah, get ready. I had a good dream Gentlemen, here you go here I have to for you Resolution and Considering that the accused does not plead guilty to nothing about the crimes brought against him he did not provide any justification for his actions management of the articles of the regulation on punishments decreed for the suppression Karava zovu dvi Fedorovichu sposobov evade a court investigation conclude him in the prison castle about what the accused [music] declare well gentlemen I don’t blame you Gentlemen I am ready Mauritius Mauritius HIV you will take yes yes let it be so I accept flour accusations of national disgrace I want to suffer and suffer I will clean but not mine guilty Gentlemen, you are kind and humane, allow me fast for the last time definitely but Is it no longer possible? presence Forgive me pear for my love I told you that I am yours and I will be yours I will go with you forever wherever you are decided [music] Farewell God People don’t want to go at all you kill why do we need a second cart, no fight, no let me poke you, I’m not you are Trifon Borisovich Goodbye Goodbye Dmitry Fitch Goodbye, goodbye, my dear. Human goodbye zhaou [music] What kind of people are they after this? there may be people [music] A [music] [music] e [music] With [music] [music] [music] Ivan Fyodorovich, get an attack from Smerdyakov night of murder is undoubtedly yours question but he wasn’t pretending, no, he had a seizure extremely dangerous I was even afraid for him life then I took action he stayed in alive but his mind was partly upset so is he crazy now or something? in the full sense but there is strangeness thank you you can come with me speak I can, but you did it in advance knew something that that night it will happen Who could? I know that your brother will behave like this not about Dmitry, you knew in advance that in the cellar you’ll get it, you predicted to me in advance that the attack will happen when you climb into the hole and you already showed this during the interrogation No, well, I’ll show you. certainly And I already judge everything to the master the investigator the whole conversation OZH then did not conveyed And what did you tell him? conveyed Well, what do I have a premonition in advance had you predicted the exact day for me then and hour Well, I go to the cellar every day I climbed and every time I climbed I thought about you I thought you were thinking about me what besides you I protect from your I have no brother from anyone And you on that day left and Dmitry accuses you that you killed and stole Who would believe it, sir? After all the evidence, you judge, sir. ourselves If I really had then I planned the murder, would you have told me? in advance what to study I introduce myself in advance to tell such evidence, and even to my own son Yes, you judge me only by this testimony from accusations protect the vain I’m not going to defend you I’m a fool because I don’t suspect at all I even consider you to have such a suspicion funny you don’t need anything there is nothing in everything Thank you I will come soon sir If you are the investigator of that conversation, let me know then I won’t announce what do you want by this I mean that I am your accomplice [music] nonsense nonsense finally adj Do you want coffee Yes I’m hungry f bring me coffee and pies with these pies um came out what Again with Yes how not I’ll come to him and we’ll have a fight today piggy threw on the floor trampled Why what happened to be jealous of the Pole [music] supr was jealous of you too to whom maids girls Yes I won’t give you any more pies, you know, for the time being that’s why my house is so fancy standing blessings It is insignificant to squander on those who are more needed than me. that the Pole is asking for money again now ruble asks for [ __ ] [applause] then to de I felt sorry for him and took him there them Alyosha poverty bes kushine poles sit without Now there’s a ruble for firewood he only asks that you are jealous of Mitya on purpose How on purpose And he doesn’t care that I’m with the Poles I go he [music] wives what about Only about this Katya to me he says the same thing, he says it to me in the eyes Praises the doctor from Moscow for him Katya the lawyer wrote out the very first one save him Katya [music] she called, he loves her ls loves knows the rally that is in front of me guilty Here is this jealousy I came up with the idea that I was with a Pole and that’s how it was he is with Katka no Mitya Katerina Ivanovna Not [music] loves Nothing you Alyoshenka With all the mind you don’t understand your own he loves her Ivan Fyodorovich from her to him walks like he goes and tells me that Ivan he has never came and blabbed But she started chatting I’ll tell you secretly he goes in threes they do something Mitya thought of it, he says it’s a secret Yes, yes. What a secret. Mitin has planned to leave me, that’s all secret And he lies to me that Ivan is in Katya in love well tell me tell me honestly decide me really it’s Ivanov Katya No pear Soon judge ite irritated A he loves only you and she is his doctor For what wrote out as an Expert they want to withdraw that he killed himself without remembering no one killed this intervention believes the evidence against him was stacked many Alyosha kestrel go please Find out from him what kind of secret this is. so that I know, study my damned I didn’t try to get the secret out of him I want to go and talk if he himself I will tell you what I promised you say but it seems to me that no here another here secret Bye Bye [music] Brother Alyoshka Alyosha saw this Rakitin. Why did he you got into the habit of wanting an article about mine in fact, write with a touch of socialism they say the darkness couldn’t help but kill, let’s stop by was Wednesday Alyosha, he explained everything to me that he explained And you imagine in our head in our brain there is such nerves Well, that’s how it is, brother tails Well, I’ll look at something with eyes and they tails tremble and I think because the tails And not because I have a magnificent soul science is that I am the image and likeness of God nonsense tails But still it’s rich It’s a pity, but that’s it good chemistry bro chemistry how do I ask without rich and without the future life would become Now everything allowed And you didn’t know answers laughs smart man everything is possible smart a man can crayfish catch brother come to your senses soon the trial I’m surprised you go to the place You’re talking business God knows what Alyoshka O What can we say about stinkers? Ugh I don’t want to the stinking god will kill him, you’ll see brother ash shut up you see I’ve wanted to tell you a lot here for a long time these shabby I brother in these last 2 months of a new person in yourself I felt a new resurrection in me man Alyoshka I’m all I thought why I dreamed about the Child then such I have this prophecy for a minute [music] I was going to have children because everyone is guilty for everyone else Child because there are small children and big children children all A child for everyone and I’ll go because someone needs it because of everyone go I didn’t kill father but I need go accept You have no idea Alexey How I Now what do we live for? I want it and it seems like there is so much of this in me forces Now that’s all I will fight for myself there is a torture I writhe in, but there is a pillar I sit in I see the sun but I don’t see the sun, so I know what is it? And Alyosha knows what is it? sun This is already my whole life Alexey Ay chert I can endure everything. I just can’t live without a pear. it can kill me the thought of her Why is she killing herself and why is she putting herself through such torment? she will accept it I know you upset me got jealous, let go, repented let’s get married who are married or not here question A and without it and not [music] Can Alyoshka I’ll tell you this whole secret. I’ll open it, go without you I still can’t decide I can and he can run offers how to escape to America pears if me I can’t sue, but what about her? they won’t let me in without a pear underground hammer give yourself head shattered on the other side conscience comes from suffering ran away was the path of purification from the faith crucifixion ran away Alyosha with you with one About This can be said You alone will understand this for others it’s stupidity b Ivan no he believes that he and Katya have a plan Everything is possible get settled and who was the first to come up with this Ivan it’s scary to insist, so the most important thing is – this is money there are 20,000 on America for 10 says we Great for America and I don’t like it ordered convey to you especially afraid that you as a conscience you will stand before me but Do you really have no hope at all? justify oneself Alyosha Tell me the whole truth as before By God, do you yourself believe that I killed or don’t believe tell the whole truth Don’t lie completely, tell the whole truth. the whole Don’t lie not for one minute did I believe that you are a killer Thank you I was afraid ask Now you have revived me Well go go god bless you Go and strengthen yourself love me Ivan forward call for me [music] [music] eh forward Hey man Hello schoolchildren you will take in schoolchildren schoolchildren And what about you they beat brother They probably whip you pretty badly, that’s why life is like that the beauty lied to us that we were being flogged you don’t understand you are a smurov in the idea of ​​a man a schoolboy should be spanked So what about me I’ll tell you that we don’t need to be separated from Naru speak skillfully Hello, translation Side Hello mister beauties I have been waiting for you for so long I waited Ilyusha was very attached to you before in this case the dog is not that dog Bug No I Karamazov M I will explain the case to the Supreme Court Beetle I then came Ilyushka somehow went with your late father’s footman with a peasant And he taught him a brutal joke to take stick a pin into a piece of bread and throw this bug Well, it swallowed it she screamed and let it run away and disappeared Yes and he keeps repeating that it’s because he killed the bug God punished and we all hoped for you what a rumor it was that she what’s alive is that you’re looking for her and I also really hoped that it was you this Bug bring him father even gave him a puppy to console hope his Well, I think it turned out worse But what Let’s go to him, just ring the bell will remain in ringing in the entryway forward evil will be lucky dragee ok Petka Petka Here’s a pof nusi go to the beauties Great, great, great, great Hello Hello hello, welcome guest Dear long-awaited guest, here you go now a well-mannered young man human and the fact that in other things it is ours guests are moving in one after another and this is how same mommy one on the other How is this and so they drive into the blue one will sit down another on the shoulders and a noble family and in Mommy Who is this? So this boy arrives on this today I arrived and here is that one mommy Mom, sit down, sit down with this you have a puppy and a black nose then he will have to grow up from evil put on a chain he will be huge with calf exactly from calf from real I found this calf on purpose angry and parents too huge this is this is a cat half will be And you and Alexey Fyodorovich deigned to arrive No I have a call back I have such dog now ringing and do you remember old man Your Beetle is missing, old man. Well, how is it? not to disappear after such a snack And for me but the ringing is shaggy like that bug I brought him to you I didn’t need to bring you at another time young man Why in another now Smurov open the door This is Beetle. Who did you think she was? then your piece she didn’t swallow it I just took out my tongue and pricked myself from that why did you come running and screaming and you didn’t I thought she was completely swallowed it beetle beetle sir beauties thank you how i found her he dragged it to his place, hid it under lock and key and that’s it taught the sciences that he brought you old man this is Bug here Bug here sit lie bug die Well done Beetle Well done Wow what a thing Great [applause] chka sit down Old man I brought you another cannon You once saw me and asked me to look here she is now yours can be shot if it doesn’t bother you I’ll give it to you mister Krasotkin Let me do it like with my ex military Please, it’s charged, yes. [laughter] What is this like, yes, this is great, huh? Give me Give me a better gun I’m mommy and she doesn’t care what Let it be yours with Ilyusha will general No, I don’t want that. general I want that I am not Ilyushina at all Mom Mom take yourself some beauties Can I It is absolutely possible to give it to her mother [music] [applause] Doctor from Ekaterina Ivanovna a doctor from St. Petersburg arrived, sorry Sorry Gentlemen old man I’m not leaving I’m on the street I’ll wait for Beetle to come forward Goodbye pass the test here here here come in, I’ve wanted to come with you for a long time meet karamazov I heard that you were in the monastery that you are a Mystic but this I was not stopped by what you call it Mystic Well, there is God and so on. But is it in God is unknown on the contrary I think it is needed for order but I am a socialist Roma I Incorrigible I am a socialist, of course I am not against it quite a humane person and alive in our time at some point he would certainly have joined who would play a prominent role among the revolutionaries What kind of fool did I tell you this? What kind of fool are you? I didn’t get involved with a fool at all. I often I’m talking to the gentleman why do you repeat this gross nonsense and in your deeds you me Raya I am in many ways mean Yes No, I didn’t come here I used to be very funny, but don’t think so. Almost all people with abilities know this are terribly afraid of being made fun of nobody laughs what to do I don’t God soon it’s Soon get ready for to everything Father, for your Excellency’s sake Christ Is there nothing left for him? it doesn’t depend on me to save you If only you could send your son to syracuse Ilyusha Syracuse Syracuse is in Sicily in Sicily your father Excellency what Sicily A family A Mommy, what can you do? [applause] Doctor Doctor you see What Sicily M [music] [music] [music] Father Father head butterfly No cry lyushka The doctor said it will be We will all be healthy happy daddy not cry when i die find yourself another boy Choose the best name his Ilyusha And love him instead of me Dad don’t forget about me never come to my grave in the evening and Take the bug with you bring Yes, I’ll be waiting for you there Old man, I’ll come tonight and get Zhuchka I’ll take it Sheka I I want I want another boy Oh my god [music] A [music] [applause] [music] [music] [music] become output two three one one one two ri [music] [music] stop [music] [music] forward move at a step [music] [music] it’s hot in your place Well, so take it off and we don’t care if we’re the first ones here will hear us no one knows anything from there Willie will hear canopy Listen my dear, what did you just blurt out then? when i left the hospital what did you say if I keep quiet about the fact that you are a master pretend to have an epilepsy, then you too investigator tell us everything about our talking to you gate what is it that’s all I meant then you know in advance about the murder of a parent your sacrifice then his left that’s what he promised then and Don’t announce to the authorities Are you in your right mind or not? no, absolutely not in its entirety mind Did I know about it then? murder say stinking It’s a shame, sir, for a weak person offend So you must have thought then that I want to kill my father together with Dmitry No to kill there is no way they could do that And they didn’t want it. But for someone else it was you who killed it I didn’t know your thoughts of those days, but that’s why I stopped you then, so that at this very point you will experience that experience that And this is what you want or you don’t want your parent to be killed quickly it’s you killed that it was not me who killed it you yourself you know and I thought that a smart person and talk more about it what did it become like for you, brother Dmitry that’s why intended not want yourself as the smartest man you are definitely Dmitry’s brother

    [музыка] [музыка] становись выводи раздватри раз раз раз два раз [музыка] [музыка] [музыка] стой вперёд шагом трогай [музыка] [музыка] [музыка] [аплодисменты] а вот я по [музыка] [музыка] [музыка] мо отец Мити Ивана и Алёши Фёдор палоч карамазов был женат два раза первая супруга была из богатого рода мисо которые не хотели отдавать её за Фёдор пал дело обошлось у возом что на время оболь аду ива Несмотря на то что наконец ада Ивана бросила дом и сбежала семинарист учителем оставив на руках Фёдор Палыча трёхлетнего сына Митю скорости бедняка оказалась в Петербурге Где умерла то ли от тифу то ли от голоду что несказанно обрадовало Фёдора Павловича [музыка] СМИ фдо па определил в дворовую избу к своему слуге григорию и как бы забыл но случилось так что из Парижа вернулся Брат покойной а Ивано услышав ВС про сестру и узнав что остался Митя он прямо объявил фдо па что хотел бы взять воспитание ребнка на себя па согласился был перевез одной из многочисленных т два его бра Иван и младший Аша Дмитрий Фёдорович рос в убеждении что он вс же имеет некоторое состояние и когда достигнет совершенных лет то будет Независимо Юность и молодость Мити прошли беспорядочно в гимназии он не доучился попал потом в одну военную школу потом очутился на Кавказе выслужил много кутил наделал Долгов дрался на дуэ и был Жан Выйди из полка Он явился к отцу чтобы объясниться насчёт имущества которое как он считал осталось ему в наследство после смерти Матери так мало того что вы легкомысленный Молодой человек вы же ещё и кутила вы же перебрали деньгами всю стоимость вашего имущества вот у вас ничего больше нет это обман подлая ложь Ну кого вон отсюда это бесчестно вон вторую свою жену Софью иванну Фёдор палоч взял у старухи генеральши где она находилась на воспитании родила она Фёдору павловичу двух сыновей и в скорости тоже умерла от какой-то нервной женской болезни после сме ма случилось точ вточ тоже самое что и с Мите они были совершенно забыты и заброшены отцом и попали ВС К тому же григорию в ту же избу где их и нашла генеральша воспитательница их [музыка] [музыка] матери без обиды шро тебе Бог заплатит довольно скоро старший из братьев Иван стал обнаруживать Блестящие способности к обучению за что и был отдан в Московскую гимназию Затем он учился в университете Где стал печатать весьма талантливые разборы книг Так что даже стал известен в литературных кружках Однажды он напечатал в одной газете странную статью к вопросу о церковном суде Главное было в Тоне и замечательной неожиданности заключения статья эта вызвала брожение умов и произвела чрезвычайные впечатления на четвёртого внебрачного сына Фёдора Палыча смерд уничтожьте в человечестве Веру в своё бессмертие в нём тоже иссякнет не только любовь но и всякая Живая сила мало того Тогда ничего уже не будет без нравственного всё будет дозволено всё будет дозволено поговаривали что матерью смердяков была городская юродивая известная по всему городу по прозвищу Лизавета смердящий Да нет это не у Барина в хлеву говорю кто-то где [музыка] ребёночек Господи ворота заперты как она через забор перелез перенесло её что Ду как это перенесло жа перенесло сюда к барину он же Отец он А ты дура наговоры не повторяй не от него это а от карпа свитом от беглого вора весь город говорит от Фёдора Палыча а у него же жена скоро молодая роди молчи дура Господь ему судья ребёночек [музыка] помирает что пойти барину сказать о Господи Господи ой Господи Господи прости что ты меня разбудил в сарае там в сарае сейчас туда туда ты всё-таки Ну чего ты меня Дин Ух ты Матерь Божия ставилось Царствие небесное ежели варим мы с вашего позволения с маркой младенце себя оставил А что очень даже неплохо будет а она же у нас была смердящий а он стал быть буден смердяков а ну с днём рождения смердяков [музыка] воспитал смерди кова Григорий но как сам он выражался мальчик рос безо всякой благодарности диким и смотря на свет из угла В детстве он очень любил вешать кошек и потом хоронить их с церемонией всё потихоньку и в тайне Григорий Однажды поймал его за этим упражнением и больно наказал розга Ты не человек ты из банной мокроты завёлся вот ты кто смердяков Как оказалось впоследствии никогда не мог простить ему этих слов Григорий выучил его грамоте и когда Ему исполнилось 12 лет стал учить Священной истории Но дело кончилось тот че же ничем и царствия его не будет конца Ты чего Ничего свет создал Господь Бог в первый день солнце Луну и звёзды на четвёртый день Откуда же свет-то сиял в первый день а во от что с тобой после того случая обяви падучая болезнь не покидая его потом всю жизнь [музыка] самый младший из братьев Алексей в гимназии свои курсы не кончил ему оставался Ещё целый год как он объявил что хочет поступать в монастырь послушника заранее сказать что Алёша был вовсе не фанатик и не Мистик если он ударился на монастырскую дорогу то потому только что был он ранний человеколюбия дорога в то время поразила его И представила ему так сказать идеалы схода рва вшийся из мрака Мирской злобы к свету Любви души его уничтожьте в человеке Веру в своё Бессмертие и в нём тот же не только любовь но и всякая Живая сила чтобы продолжать мировую жизнь исчезнет мало того Тогда ничего уже не будет без нравственного и всё будет позволено это письмо Дмитрия Прочтите пожалуйста м с чем-то обещайте сделать это для меня я вам обещаю выполняя обещания данные невесте своего брата Катерине Иване Иван Фёдорович довольно скоро приехал в город как позже выяснилось по делам Дмитрия Фёдоровича затеяв тяжбу с отцом изза принадлежавшей когда-то его матери деревни черш с этого рокового приезда Ивана Фёдоровича послужившего началом стольких последствий и начинается наша история [музыка] мама смотри ал Рома молчи ликий илите как я понимаю За что вас любит народ наш простодушный красный й об этом приехали со мной говорить и об этом и о многом другом но главное восторженная благодарность вы в четверг помолились над Лиз вы возложили на неё ваши руки и вы исцелили её как исцелил ведь она в кресле лежит да но ночные лихорадки совершенно исчезли и сегодня она целую минуту простояла безо всякой поддержки я призвала доктора герба он говорит дивлюсь недоумеваю Лис благодари же это я на него А вы зачем его шало дте А зачем он вс забыл он меня маленькую на руках носил читать учил А теперь вы на него ряску надели и он меня боится Я его съем что ли Да что это с тобой Простите Алексей фроч ВС волнения это того что у него к вам важное поручение от Катерины Ивано зашёл я к ней я её не знаю Мама он не пойдёт он же в монахи поступает он спасается он придёт я его пришлю а теперь Простите милые Меня ждут Ну так мы здесь уже а микито нет Вот так А ты знаешь Митька меня ненавидит А за что ему тебя любить Ты его в трёхлетнем возрасте вбк слугам жить выкинул когда я приехал забирать его на воспитание ты даже не помнил что у тебя есть маленький помнил Иван Я помню А тогда перед вами я представлялся что не помню ты же знаешь что я иногда люблю вдруг сыграть какую-нибудь неожиданную роль А сегодня ролей то не играе обещаю подайте Милон ради Бога о здравии раба Божия Федора о здравии Фёдора молись а что касается избы посуди сам не мог же я детей в то время при себе содержать в этом безобразие в Садо спроси неукого в этой белков где этот за Сима обитает А вы к старцу Да не угодно ли я провожу Позвольте рекомендовать Тульский помещик Максимов заду идёмте Вот в эти ворота старец Великолепный старец честь и Слава монастырю это такой старец он Шевалье парф кто Шевалье старец зама Святой сл Святой Вот я думаю может присутствие этого Как сказать Великолепного старца Митька усты и мы с ним договоримся как-нибудь по старец не будет решать ваши имущественные спот спорить чем ми долю свою давно уже перебрал и проку и легкомысленно и буйно и хватит об этом и вовсе даже не я ему а наоборот он мне должен всё всё Довольно хватит хватит я сказал ну что говорю равн Сенька полдень А сына моего Дмитрия всё ещё нет я хочу просить у вас за него прощения священный старец [музыка] вот он Катин жених этот ужасный метри трогай Простите великодушно что заставил Да слуга смердяков посланный ко мне батюшка и сказал мне что назначено в час Я понимаю что сознательно был введён заблуждение это ничего что Вы опоздали не беда чрезвычайно благодарен мене не мог ожидать от вашей доброты Митя мы тут говорили о статье вашего брата Ну это очень и очень Кстати я в недоумении вы заяв что такого природного закона любить человечество не существует в этом случае для каждого неверующего в Бога нравственный закон изменяется то есть без нравственного нет ничего стало быть любое злодейство может быть дозволено если оно будет разумным выходом Позвольте я не ослышался злодейство должно быть дозволена и признано самым умным выходом так точно так запомню Божественный старец Это мой сын Иван любимей плоть моя почтительный Сын так сказать Карл [музыка] мор А этот вот только что вошедший сын Дмитрий Фёдорович против которого у вас управы ищу это не почтительный Франц оба из разбойников автор шилер Говорите без юродства и Не начинайте оскорбления домашних ваши что я деньги доставшийся ему от его матери за сапог спрятал Ну так есть же суд Дмитрий Фёдорович и там вам всё по вашим же распискам всё сколько у вас было оп сколько вы истребили вот вот так сколько же остаётся и выходит митрий Федорович что вы мне сами должны Да ни сколько-нибудь а несколько тысяч недостойная комедия преподобный отец Я человек необразованный даже не знаю как вас именовать но тут вас обманули Дело совсем не в деньгах батюшке нужен лишь скандал Я знаю для чего священный отец не верьте ему весь город Н он гудит от этих его кутей а там где он прежде служил офицером он дочь командира своего храбрейший был подполковник он же скомпрометирован понимаете о чём я говорю и теперь она это невеста его Катерина Ивановна по имени Она же приехала сюда а он у неё на о Молчать не сметь марать благороднейшие девицу да одно то что вы осмеливается о ней заикнусь то что вы у неё на глазах к одной местной обольстительница ходите молчать ходите ходить молчать это он мне это он отцу с это мне а Ну как прокляну тогда что А да вы же от меня избавиться хотите потому что сами к ней приступаете со своей любовью слипы вы не мой сын Я бы немедленно вызвал вас сейчас же на дуэль мне всё рассказа как вы её учили через штаб капитана снегирёва меня соблазнить а потом по векселям и в тюрьму и как купить хотите её за 3.000 тоже рассказала На дуэль но только вы её не купите на дуэль через платок Простите меня но я не знал Идя сюда что отец ревнует сынак скверного поведения женщины и сам с этой же тварью пытается засадить в тюрьму что вы сказали Как вы е Да назвали [  ] [  ] Да это как вы её назвали [  ] она выше и чище всех в вашем этом плешивого роду Если уж на то пошло стыдно что Стыдно да это как он выразился [  ] святее всех вас спасающие иеромонах вы здесь капусту употребляете пескари ков они кушают И думают пескаря Бога купи А вот тьфу видишь вот тьфу нет простите простите всё о Боже пожила не пойму А почему он ему-то поклонился ядем домой выйдешь поехали как воо [музыка] Господи И я и я с вами Иван Иван Ну что ты ей я за Сумасшедший дом и за сумасшедших не отвечаю но зато избавлю себя пошёл от вашего общества копался поверьте что навсегда Пошёл Да пошёл давай же сам весь этот монастырь задел сам подстригал сам одобрял [музыка] Благословите здесь остаться Нет сынок Ты там нужнее как только сподоби Бог представится мне Уходи из монастыря и здесь твоё место и жениться ещё должен будешь и всё должен будешь перенести пока вновь возвратишься на послушание В миру Благословляю тебя Иди и возле братьев будь Да не около одного а около обоих Ступай ля помоему старец прозорлив уголов пронл какую уголов в вашем семействе теперь Когда что случится-то по все губернии разнесут астари зарание на пророчество убийца ноги поклон отбил какому убий Твой брат попа за публич денусь А ты не думал чем это кончится может нет не думал [музыка] Алё Алёш Давай сюда быстро идём давай сходи Чего смотришь опять пьянству не вей фантома мне две бутылки нужно чтобы отменять А я е чтото не выел заходи А теперь вникни по-настоящему повторяю по-настоящему Алёшка Я на всём свете люблю одного только тебя одного тебя и эту подлую в который влюбился до стемы пропал Обещай что исполнишь что погоди сперва гимн к радости Шиллера у груди лай природы ВС что дышит радость пьёт все создания Все народы за собой Она влет нам друзей дала в несчастье гроз сок венки Харит насекомым сладости ангел Богу предстоит насекомых которых Бог одарил сладострастие есть это насе и все мы Камазы такие же потому что сладострастие – это буря а Красота это страшная и ужасная вещь страшная потому что не Определи тут дьявол с Богом борется а Поле битвы сердца людей ят очень не образован Но об этом много думал то что уму представляется позором то для сердца сплош красотой нет широк человек Даже слишком широк Я бы сузил впрочем У кого что болит Кто там и говорит Слушай теперь про катерину Ивановна Я никогда никому не рассказывал тебе сейчас первому Расскажу конечно Ивана исключаю Иван знает ну Иван могила Иван могила я тогда в батальоне состоял прапорщиком Ну гулял ужасно и тут как раз приезжает из столицы младшая дочь моего начальника подполковника Да вот это самая Катерина Ивановна твоя невеста невеста потом А тогда она только из института вышла гордая сумом и образованием и ра красавица из красавиц Ну весь город вё тотчас расхват веселят царица балов и я таки молодец подхожу разговариваю она не глядит и губки Ну и была права бурбоны был ужаснейший она была права но я тогда обиделся страшно и решил отомщу тут я случайно узнаю что у её отца подполковника в кассе 4.500 руб не достаёт он казённые деньги с судил словом папаш Катерина Иванов на старости лет грозит Суджа Солдаты А тутто я решил как встречаю я как-то старшую доч полковника Ага Ивано напугали дмитри по Су ему ити лучше Пришлите ко мне в вашу институт я ей-то пожалуй отва да пусть сама одна придёт А я секрет сохраню обещаю под Ах Алёшка братец тот же день является к подпол вестовой с книгой сдать казенную сумму немедленно через 2 часа тот в книге расписался пошёл в спальню взял пистолет вкатился пулю и [музыка] [музыка] Ну всё это Алёшка я потом узнал А в тот вечер сидел я дома Сумерки зима мороз тилька Ты что ли с мне сестра сказала что вы дадите 4.500 руб если я приду за ними к вам сама я пришла [музыка] [музыка] это 4 тысячи Да я пошутил что это Вы слишком легко верно барышню со считали сотен две я пожалуй а 4000 на такое легкомыслие [музыка] об беспокоить себя напрасно изволили [музыка] [музыка] [музыка] [музыка] о [музыка] C [музыка] [музыка] [музыка] [музыка] становись выводи д т раз раз раз два раз раз [музыка] Mar [музыка] стой [музыка] [музыка] [музыка] вперёд шагом а трогай [музыка] мне сестра сказала что вы дадите 4.500 руб если я приду за ними к вам сама Я пришла [музыка] это 4 тысячи Да я пошутил что это Вы слишком ко верно барышню со считали сотен две я пожалуй а 4.000 на такое легкомыслие [музыка] кидать об беспокоить себя напрасно изволили [музыка] [музыка] о [музыка] [музыка] [музыка] H [музыка] а ушла а я вынул шпагу и хотел тут же себя заколоть должно быть от восторга а потом поцеловал клинок и вложил в нож на утро подполковник казню сумму вернул но слёг размягчение в мозгу и в 5 дней скончался Катерина Ивановна вернулась в Москву да ты слушаешь Дада Я получаю от неё по почте 4.500 руб а через 3 дня письмо предлагает себя мне невесты люблю дескать безумно хоть вы меня не любите всё равно Ну я написал ей и с Иваном в Москву отправил с Иваном Почему да потому Алёшка что Иван в Катю влюблён дадада она мне себя предлагает тут брат есть основная трагедия Она из благодарности ко мне судьбу свою изнасиловать хохочет То есть она вся в своём величии А я клоп не брат я на грушеньки этой женюсь А Катя выйдет за ива Ты мне скажи самое главное ты жених Катерина Ивановна жених формально она настояла и произошло всё в Москве когда я приехал Ну как же ты хочешь порвать А вот ты Алёш пойдёшь и скажешь что скажешь что я приказал кланяться вот так буквально и скажешь ей приказал кла ещ признание вручает Мне на днях ива деньги 3.000 чтобы я их в Москву её сестре почтой отправил А я как нарочно с грушенька тогда познакомился грянула гроза ударила чума и мы с грушенька в мокрое 25 вёрст отсюда цыган туда добыл шампанского всех мужиков шампанским перепалка [музыка] Катя Алёшка сказал что послал что расписку принесу и до сих пор не несу Вот это и есть моё [музыка] бесчестие но надо непременно сегодня уже Екатерине Ивановне отклонится поэтому я тебя к отцу ю к отцу у него 3000 спроси Митя он не даст не даст Это я От отчаяния Алёша теперь особенно не даст а ведь грушенька может быть не шутит и замуж за меня захочет прыгнуть а Алёшка Ну ведь у него уж дней пять как вынуты 3.000 руб большой пакет упакован а сверху розовой те смокой надс перевязана и написана ангелу моему грушеньки Коль захочет прийти А через 3 дня приписал и плёночку Ну ты видишь как подробно знаю вот он теперь ждёт и надеется что она придёт за Бакет Ну ты теперь понимаешь кого я здесь сторожу её её смердяков даст мне знать если она ко отцу придёт это он тебя про пакет рассказывал вон Алёшка Иди туда там как раз 3.000 ровно столько сколько Кате должен возьми их у отца и ей от меня отнеси что с тобой Ну что думаешь я помешался я чуду верю чу чу Ну давай а ты А я здесь буду ждать и часа буду ждать и и 5 и Но сегодня хотя бы даже в полночь ты явишься Катерине Ивановне с деньгами или без денег и скажешь вел вам если э грушенька вдруг отцу прит Руся помешаю убью кого отца её не убью брат что ты говоришь Ну я не знаю Алёшка что будет боюсь не удержусь Ну иди иди иди к отцу [аплодисменты] [музыка] Алёшка присоединяйся садись кофей кофе же постный постный монахам можно а на кофе да на кулебяки у меня смердяков артист Господи да Алёшенька садись голубчик ты мой садись Алёш Садись и Послушай у нас тут такое у нас пола ослица заговорила А ты знаешь как ловко как ловко р Тихо ну говори ослица я про то говорил что от Христа и от крещения отказаться никакого греха Нет слушай вот в чём это Григорий сегодня в газете вычитал про нашего русского солдата он в плен попал и они его там под страхом мучительной смерти в Ислам перейти принуждали а он не согласился это всё вот в газете описано он не согласился и больше того он с себя живого позволил кожу снять Христа славит Я говорю что солдат этого надо произвести в святые верно смердяков не соглашается подлец насчёт под лица Григорий Васильевич вы повременить Ну ты тоже не рассусоливать ты возьми и докажи и всё Докажи если этого похвального солдата подвиг какой и был то небольшой А я бы на его месте отказался И никакой это не был бы грех Ну как от Христа отказаться не грех Ну как это рассудите сами ведь едва Я только своим учителям скажу Нет я не християнин как четверти секунды не пройдёт как высшим божьим судом буду проклят Так ты теперь проклят после этого как же ты рассуждать смеешь бульончик А я желе проклят то Крещение моё с меня снимается так или не так видиш ты видишь Как поворачивать Я же тебе говорил ну-ка помолчи помолчи с мерком на время Иди ко мне иди Иван Я тебя люблю точно так же как ашку и никому никогда не верь что я тебя не люблю дай конику А давай заключа брат Давай заключа скорей так если я уже не християнин не может же Господь Бог спрашивать с меня как с християнина Ну так ты сам-то в себе всё жки отрёкся от Веры то своей иезуит ты мой прекрасный полагаю что Господь бог меня простит врёшь подлец не простит простит Григорий Васильевич простит червонца стоит твоё слово с лица А в остальном ты врёшь Слышь врёшь врёшь ты знай дурак Мы тут все из одного только легкомыслие не веруем Нам всё некогда покаяться ты вот там перед мучителя ты отрёкся а именно надо было тогда вето свою и доказать было поза так брат Я думаю составляет а составляет оно составляет но рассудите сами Григорий Васильевич Если бы я веровал как веровать надлежит то тогда было бы действительно грешно А так Для чего я безо всякой пользы дам кожу с себя содрать убирайтесь вы е зуи вон во СРВ пошёл червонец обещ Сегодня же приш пол ты здесь он всё время лет и чем ты-то ему так любопытен ничем уважать меня вздумал передовой мясо впрочем когда срок наступит что передовой сперва будут такие А за ними получше надоели все [музыка] [музыка] Вот это такая вот Лама ва с лица она думает она всё думает думай ты чёрте до чего додумается знали как я ненавижу вот эту Россию не вот эту О я пожалуй Лёшка Ну ты-то хоть веришь в то что я в жизни не всего только шу верю что не только Шут Вот и я верю что веришь и искренне говоришь ива Иванко Ну теперь серьёзно Алёш есть Бог есть Иван Нет на Без смерти Иван хоть кани малень не бессмертия никакого никакого что же выходит там абсолютне нуль или всё-таки неч а абсолютный ши нуль Алёш есть бессмертны Есть И бог и бессмертны и Бог и Бессмертный в Боге и бессмертны не Даки вот Алёшка вероятно что прав всё-таки вам Ой Господи сколько же человек отдал силы вот на эту вот веру и всё зря всё прах это ведь уже сколько тысяч лет Да эх-эх-эх кто же это так смеётся Тото над человеком Алёша А чёрт должно быть Чёрт а а чёрт-те есть нет и чёрта нет Жаль очень жаль Ты ведь Иван меня презираешь Да ты приехал в мой дом [музыка] крестом бом Проси Съезди в черешню Ну на день съе надва завтра поеду если так Наста не по не поедешь потому что тебе вот здесь надо за мно помари Что Что Что ты смотришь на меня лаза тво тель Ты у себя на уме приехал вон Алёшка вот он смотрит он смотрит но не презирает Алексей не люби Ивана слышит не люби его на бра Перестаньте его обижать Ну правильно ладно не сердись сы не сердись на меня неза что Не за что любить вам меня Слыш нула в черма черш поедешь я тебе там одну девчоночку покажу я её давно там на смотрел ено пугайся и не презирай это перлы давай не сердись [музыка] [музыка] [музыка] [музыка] где она она здесь я видел она к дому пробежала где она не пускай не пускайте меня к нему ОНТ меня боюсь я боюсь где она там подлец Алёшенька Алёша Алёша она пришла что ли вы же знаете что она не приходила е видел прил тогда может она мхо Т хоть заперто ключ у вас караул держите вора он у меня денежки Там в спальне [аплодисменты] Ура сумашедший Ты же убьёшь его да Так ему и надо подле а не убил так ещё приду убить не усте дмитри иди отсюда во про те одному у бё бы она здесь Е не была не была И никто её не ждал вовсе о деньгах Алёша не слова Катерине Ивановне иди немедленно сейчас и непременно кланяться велел непременно кланяться и раскланиться Опиши сцену А хорошо да не раскаиваюсь за кровь твою Берегись старик Береги мечту потому что и у меня мечта проклинаю тебя сам не отрекаюсь вовсе подлец ты подлец Ну вон же он Вон так Остановите его Вон пошёл к ней он же жениться на ней хочет она за него не пойдёт не поёт да не пойдёт правд денег у него нет совсем нет А у меня есть Мо нехорошо Мне плохо сердце ложитесь не пойдёт смердяков воды полотенце поворачивайся живо он меня дерзнул идите Дайте отдохнуть Мне идите ступайте Лёша Лёша Ты завтра ко мне зайди он на меня дерзнул да он не то что тебя он отца дерзнул я я его в корыте мыл а он [музыка] о и никому не говори Ивану не говори что сл завт Ах сердце Ой о Да если бы не мы он бы его убил поже сох чего Сохрани один гад съест другую гадину обои туда и дорога голова начала болять я выйду по двору походить заодно посторожу дмитри может вернуться с Катерина Ивановна Я Слава Богу наконец-то я потому так ждала вас что только от вас надеюсь услышать правду ни от кого больше вы меня звали и Митя послал меня Митя послал вас Я чувствовала это он велел вам кланяться кланица так и выразился Да кланица может быть в слове ошибся нет именно кланица он трижды это слово повторил Так это же хорошо если бы он велел клониться мельком Не настаивая на этом слове то это был бы ужас Это был бы конец А если он непременно настаивал на этом слове лани и даже трижды повторил его то значит он был вне себя он был в возбуждении значит он не уходит от меня твёрдым шагом А как бы полетел с горы значит это слово кланица не может означать ничего большего как только браваду Да тут много брова и мне так кажется а Коли так так ещё не всё потеряно значит он ещё не совсем погиб я могу его ещё спасти Присаживайтесь Алексей Фёдорович Теперь главное не передавал ли он Вам что-нибудь о деньгах о 3000 Да и это больше всего убивает его ну разве Вы знаете я спрашивала сестру телеграмы и знаю что денег он ей не отправил А ещё я знаю как он их [музыка] потратил перь он пошёл к той женщине Он только что из-за неё чуть отца не убил он не женится на ней потому что это страсть а не любовь Он может быть женится Нет она не выйдет за него Потому что Алексей Фёдорович это самое фантастическое из всех фантастических созданий Я знала что она обольститель но теперь я знаю как она добра и благородна аграфена Александровна Ангел мой покажитесь пожалуйста ему Я только и ждала что позовёте вы представляете Алексей Фёдорович Ведь я только захотела её узнать а она пришла по первому же зову не погнулись мной Да вы что такое говорите вами-то гнушаться обаятельная это же сердце веселится Глядя на этого ангела нете у меня милая барышне А может вовсе ласки вашей не стою Она то не стоит это вы что такое Говорите знаете Алексей Фёдорович мы своевольный но гордое сердечко и мы были несчастны был один польский офицер 5 лет назад и мы его полюбили и всё ему принесли а он нас бросил и женился на другой и только безногий старик купец Самсонов нас буквально от смерти спас А мы тогда даже утопиться хотели кто же нас теперь за него по прикл ой очень ж вы меня защищаете милая барышня очень поспешай во всём защищаю Да вы что такое говорите грушенька а ну-ка дайте мне вашу ручку Посмотрите на эту ручку США прелесть какая ручка она мне счастье сегодня принесла а вот я возьму сейчас её и [музыка] поцелую так вот так и в ладошку А вы меня не усты дете милая барышня Что ручку мою при алексе федоровиче целовали Да разве уж я вас остыть хотела вы меня совсем не так понимаете так вы меня тоже не так понимаете Я может гораздо дурнее чем вас наведу Я сердцем дурная своевольная я Дмитрия Фёдоровича вашего бедного из насмешки одной заполонила Ну Так вы теперь его и спасете вы расскажете что любите другого И что он приехал на вас жениться Вы же слово дали это всё дмитри ф рассказать Нет я вам такого слова не давала это вы сами мне всё говорили я вам не давала но вы же обещали я вам не обещала Ну Видите какая я вот как Захочется так и поступлю А вдруг он мне опять понравится мито м ну да вича вы говорили совсем не то Ну и Да вича ну я сердцем нежное глупое могу митью пожалеть ведь подумай только сколько она за меня перенёс я не ожидала ангел барышни какая же вы Какая Вы добрая благородная выходите А я дайте-ка мне вашу ручку знаете что ангел барышня я возьму вашу ручку И как вы мне Поцелую вы у меня три ра поцеловали Я вам 300 раз поцелую Красавица Вы невозможна а знаете что ангел барышня возьму и Да вашу ручку не поцелую да Что это с вами а так оставайтесь с тем на память что вот у меня ручку целовали А я у вас нет наглая и Митьки перескажи вот ж он смеяться-то будет Вон пошла мерзавка Вон пошла продажная [  ] Ну уж и продажная а сами-то девицы кавалерам за деньгами в сумерки не хаживал её она скоро уйдёт и уйду а ты Алёш Проводи меня я тебе хорошенькое хорошенькая словцо скажу Уйдите прошу [музыка] вас Дашечка Я ведь голубчик для тебя э цену [музыка] проделала ваш брат подлец Алексей Фёдорович уходите [музыка] немедленно вам забыли Передать письмецо от барышня локовые оно нас с обеда лежит и не поцеловала ручку и убежала понимаю я её царицу на власти Алёшка понимаю Вся она тут вся Она в этой ручке высказалась инфернал царица всех инфернал в своём роде Восторг Ну где она домой побежала тогда к ней к ней А Катерина Ивановна ну эту я всю насквозь вижу и как никогда Гордость и вызов судьбе всё мне подвластно захочу и грушенька околдую ты думаешь она на Рош на ручку первую поцеловала у груше Нет с расчётом она в за правду влюбилась в грушенька то есть не в грушенька А в свою мечту в свой бред Ну как ты мог рассказать те о том дне Когда Катерина Ивановна к тебе за деньгами Приходила А Алёш я был пьян в мокром был там цыганки пели Да я рыдал когда рассказывал да и грушенька всё понимала тогда и она тоже плакала вместе со мной Ну а вот теперь Бах кинжал в сердце О как уба а Алёшка голубчик Да как ты-то от них э таки спасся убежал подобрав подрясник конечно Я подлец всё равно что плакал подлец ты теперь запомни ты теперь свидетель что бы я раньше ни сделал ничто сравнится в подлости с тем позором который я ношу сейчас на груди моей бесчестие моё здесь ёшка и ты свидетель что я могу ещё остановиться И даже половину моей потерянной части воротить Я не остановлюсь Ты о чём дене тих деньги легалы мне даст Легал прозвище у него такое купец так вот этот Легавый год уже у отца в черш проще торгует Да за ценой расходится есть У меня к нему выгодное коммерческое предложение Ну прощай ты тепер своей дорого а я своей а там передай наименование подлец принимаю если это может утешить Прощай Алёша не молись обо мне не стою смрадный переволок инфер вот Райки гайки оближешь [музыка] мальчики за мочалку за [аплодисменты] мочалку Отпусти зачал отпусти панку отпустите пожалуйста ску ты офицер ты я офицер Найдите весь секундант и присылай тамм удовлетворение [музыка] сва [музыка] [музыка] [музыка] милый Алёша Я вас люблю люблю ещё с детства Когда вы были не такой как теперь и люблю на всю жизнь вот я написала вам любовное письмо Боже мой что я сделала теперь Тайны моей погибшей репутации в ваших руках до свидания до ужасного свидания до ужасного [музыка] [музыка] свидания теперь Тайны моей погибшей репутация в ваших руках до свидания до ужасного свидания теперь Тайна в ваших руках [музыка] а [музыка] [музыка] [музыка] становись выводи раз раз раз ДТ раз раз вперёд в [музыка] [музыка] стой [музыка] вперёд шагом а трогай [музыка] жду Мудрого совета как господину левому подступиться тут главный вопрос Если я сейчас перепишу на него эту рощу и всю незаконно оную отцом чеш даст ли мне господин знай Ну почему вы его легавым называете его имя горсткин он прозвищем Легавый жестоко обижается Да он же Пьян весь день пил что ж мне теперь делать-то дело-то у меня очень важное к нему спешу Сегодня же воротиться надо будить вам переждать придётся он видать не в состоянии Боже Нет надо сейчас разбудить если бы вы знали В каком я теперь отчаяние Сегодня он ни о чём разговаривать не сможет Ну останусь здесь тогда буду ждать ловить мгновение пробудится так и начну А за свечку Заплачу тебе за Постой тоже будешь помнить Дмитрия карамазова ну прощавайте желаю вам полное удовольствие Ой это же глупо весь честно нелепость вся судьба моя от него зависит Он храпит как строгая Планета А это Снегирёв лупи его лупи его Давай давай лупи кидаем Что вы делаете намо я один а ише я всех перебью один а зачем вы меня камни кидаете монах в гарнитуров штанах Хорошо я пойду я не хочу Вас дразнить я слышал как они вас дразнят Я не хочу Прощайте как вам не стыдно что вы делаете что я вам сде Почему на меня Скажите Извините уснул угар я поручик Дмитрий карамазов Вы вероятно слышали уже от лесника что я сын старика карамазова у которого вы изволите рощ торговать а это ты врёшь как это Уру Вы же Фёдора Павловича знаете не знаю никакого Фёдора Павловича проч вы моего отца торгуете рощу Я готов уступить вам права не только на рощу Но и на всю чермошное Это же не шутка ты красильщик да я Дмитрий карамазов и я к вам с предложением выгодным предложением именно по поводу этой за 3000 Нет ты красильщик ты у меня подряд брал и подлец вышел а Уверяю вас господин Легавый что какой те Легавый какой те Легавый горсткин я горн горн Я знаю что вы горкин гон Ой Господи что же я на делал-то А горски горски да я горски а ты красильщик подлез горски он же меня предупреждал горски горски гор это начали яко свечку [музыка] Боже мой Какое отчаяние Какая смерть круглая [музыка] по [музыка] [музыка] я [музыка] Алексей Фёдорович я вас жаждала У нас теперь Катерина Ивановна и ваш брат но не тот Ужасный А Иван Фёдорович и он с ней говорит Если бы вы только слышали Это надрыв Да ну главное Алексей Фёдорович А почему сли истерика она как услыхала что вы пришли с ней то с истерика это с вами сейчас истерика а не со мной я вовсе не знала что он приходит как так ты не знала Тебе же Юлия сказала что Алексей Фёдорович пришёл она же у тебя на сторожка стояла милый голубчик Мама это ужасно не остроумно сейчас с вашей стороны а если вы хотите поправиться и сказать что-нибудь очень умное то скажите милостивому государю вошедшему Алексею фёдоровичу что он одним тем самым доказал своё не остроумие что решился прийти к нам сегодня после вчерашнего И несмотря на то что над ним все смеются Лис я наконец прибег к мерам строгости Да Кто же над ним смеётся он здесь нужен он необходим Алексей Фёдорович я так несчастна это её болезнь её капризы и доктор Герцен чтобы ничего не может понять и трагедия Катерины Ивановны это всё вместе так ужасно Извините Дайте мне какую-нибудь тряпочку Я поранил руку и она у меня болит вот Боже Какая рана рана О Господи а что же вы молчали Мама он мог истечь кровью Юля воды воды и льда нужно промыть рану надо опустить руку в холодную воду чтобы боль перестала Это мама скорее воды плательную чашку надо послать за доктора а доктор опять скажет что не может ничего понять где это Юлия завязала с водой Юлия Ну скорее мама скорее ради Бога сходите сами Ну скорее же иначе я умру мама Принесите корпи этой мутной жидкости для порезов я не помню как её зовут у вас есть ваши спальни в склянке в шкафи направо сейчас принесу лист и Только не кричи Так посмотри как твёрдо Алексей Фёдорович переносит свои страдания Ну и где ты вызволили се Так пора Алексей ё Юля Принеси чистый платок а теперь быстро Отдайте мне моё письмо со мной нет письма не правда я так и знала что вы так ответите оно у вас в кармане Отдайте письмо Сейчас же оно там осталось тогда Принесите мне его сегодня же непременно Это была шутка слышите Я в этой глупой шутке раскаиваюсь всю ночь Вы очень надо Ной смеялись совсем нет почему потому что я совершенно поверил вашему письму вы меня оскорбляете нисколько я как только прочитал письмо сразу понял что всё так и будет старец приказал мне уйти из монастыря и жениться Я понял что лучше вас жены не найду Когда придёт законный срок мы обязательно поженимся Я Буду вас любить да ведь я [  ] меня на креслах возит я вас Буду возить но я уверен что к тому сроку Вы обязательно выздороветь Вы сумасшедший Вы из такой глупой шутки и вывели такой вздор Ах вот мамаш Мама ну можно ли так долго вы всегда зазывать Вот уже и Юли платок несёт Ах Лиз мня твоего крику Мам я вспомнил как эта жидкость называется это называется свинцовая примочка прекрасная свинцовая примочка ангел Мама вообразите он с мальчишками на улице подрался и Этот мальчишка укусил его за руку но можно ли ему после этого жениться потому что вообразите ангел Мама он хочет на мне жениться Ну не смех ли это Как жениться Да совсем Это тебе не [музыка] кстати Ведь этот мальчик может быть бешеный Ах мам Разве бывают бешеные мальчики будто не бывают Лис Ну точно я глупость сказала но ведь вашего мальчика укусила бешеная собака и он стал бешеный мальчик Вот и укусил Алексея Фёдоровича а не боитесь ли вы воды довольна ли Может быть я и в самом деле слишком поспешно про бешеного мальчика сказала а ты уж сейчас и вывела Алексей Фёдорович Катерина Иванна узнала что вы пришли и она вас ждёт мама Скажите ей что он сейчас не может он слишком страдает Я совсем не страдаю я могу пойти Ах так-то вы так-то вы мама это Монстр ли я потом к вам обязательно приду и мы с вами можем говорить сколько Мите его скорее уведите литы совсем с ума сошла Пойдёмте Алексей Фёдорович Я её боюсь я не хочу предварять но вы сейчас сами всё увидите там происходит самая Фантастическая комедия Катерина Ивановна любит вашего брата Ивана Фёдоровича но уверяет себя изо всех сил будто любит вашего брата Дмитрия Фёдоровича это ужасно А здравствуйте Здравствуйте Алексей Фёдорович Иван Фёдорович останьтесь пожалуйста ещё на одну минуту Я хочу услышать мнение Алексея Фёдоровича Алексей Фёдорович вы вчера были свидетелем этого ужаса поэтому я Вам доверяю так вот я не знаю теперь Люблю ли я Дмитрия Фёдоровича он мне стал жалок а это Это плохое свидетельство Нет конечно вы его не любите подождите подождите Мила Екатерина осиповна я ещё не сказала окончательного что решила в эту ночь решение моё таково Даже если он женится на той твари Я всё равно никогда Я никогда не оставлю его я буду всю жизнь всю жизнь ему верна Ну Несмотря на то что вчера перенесла и вот когда он станет с той тварью несчастен а это непременно будет Вот тогда он придёт ко мне и найдёт друга найдёт найдёт сестру любящую верную и всю жизнь ему пожертву уш я Я превращусь в средство для его счастья в инструмент Как же это сказать в машину для его счастья и это на всю жизнь таково моё решение и Иван Фёдорович высшей степени одобряет меня Да нет я только сказал мою мысль что ваша жизнь Катерина Ивановна будет проходить в страдальческом созерцании ваших собственных чувств и собственного подвига Но со временем страдание это смягчит и оставшееся чувство исполненного гордого замысла доставит Вам самое полное удовлетворение Боже мой как это всё не так скажите вы Алексей Фёдорович Ну что ж я к несчастью Завтра же может быть должен уехать в Москву И надолго оставить вас завтра в Москву но Ну Боже мой так счастливо Я рада Нет я рада не тому что вы нас покидаете о тому что вы сами лично в Москве передадите тётушке и агаша всё моё положение весь мой теперешний ужас Сами вы мне конечно же незаменимы я бегу Напишу письмо а Алёша та а Алексей Фёдорович чьё мнение вам непременно желала с услышать я не забыла об этом А почему вы так враждебны ко мне в эту минуту Катерина осиповна я слушаю вас Алексей Фёдорович Я никогда не думал я не мог О того представить чего он едет в Москву А вы вскрикнул что рады вы это нарочно сыграли как на театре в комедии сыграли Я знаю Что нехорошо сейчас всё это говорю но я вс-таки скажу Вы брата Дмитрия может быть совсем и не любите с самого начала и Дмитрий может быть совсем не любит вас а только чтит я даже не знаю права как я теперь смею но я должен сказать правду потому что здесь никто правду не хочет сказать какой правд А вот какую вы Пригласите сейчас сюда Дмитрия Пусть Он возьмёт вас за руку потом возьмёт за руку брата Ивана и соединит ваши руки вы мучаете Ивана только потому что любите его а дмитрие в неправду любите а только уверила себя в этом вы маленький юродивый Вот вы кто Ты ошибся Мой добрый Алёша ошибся никогда Катерина Ивановна не любила меня она знала всё время что я её люблю хотя я никогда не говорила ей Слово о моей любви знала но меня не любила она держала меня при себе для беспрерывного мщения она мстила мне за все оскорбления которое вносила от Дмитрия оскорбление с первой встречи [музыка] их Катерина Ивановна Вы действительно любите только его Именно таким его любите вас оскорбляющем его любите если бы он исправился его то бросили бы Вам он нужен для того чтобы Созерцать ваш подвиг Верности И упрекать его в неверности и всё это от вашей гордости мне не надо руки вашей слишком сознательно вы меня мучили для того чтобы я мог вам простить в эту минуту потом прощу а теперь не над руки награда не нужна мне госпожа вы ничего не наделали вы прелестно Как я виноват я начал Вы видели сами это надрыв Мама почему он действовал как ангел У меня к вам будет большая просьба Алексей Фёдорович ваш брат Дмитрий Он обидел человека в гневе в страстях но страшно обидел фамилия этого человека Снегирёв Я бы хотела просить вас сходить к нему и Деликатно Осторожно отдать вот 200 руб он наверняка примет вернее уговорить его принять прекрасная [музыка] добрая Это от меня это не от Дмитрия одним словом Найдите его Он живёт в озёрной улице в доме мещанки калмыковой вы сделаете это сделайте а теперь я устала до свидания слёзы это добрый знак Это превосходно Алексей Фёдорович спешите теперь по этому поручению возвращайтесь поскорее Лиза не задерживай Алексея Фёдоровича ни минуты ни за что теперь уже ни за что Говорите Так через дверь за что вы в Ангелы попали А за ужасную глупость [музыка] Лиза Прощайте [музыка] простите [музыка] [музыка] монах на монастырь просит знал кому прийти Нет Варвара Николаевна это не тос не угадали Я к Вам пришёл по тому самому делу какому делу Папа это он на меня жаловаться прил я ему палец укусил Так это он вам Да мне они на улице с мальчиками камнями перебрасывали в него шестеро кидают а он один я к нему а он в меня камень бросил я спросил что я ему сделал а он вдруг бросился и палец укусил Я не знаю за что высеку минутой вые я не жаловался Я просто рассказал Да он теперь вроде и боли Ой а вы что и вправду подумали что высеку что я возьму сейчас иллюзию да да и высеку для вашего полного удовлетворения нет ОТС прежде прежде чем его сечь я свои четыре пальца сейчас вот на ваших глазах Вот вот этим сам ном Отт для ление жажды мщения вам че-то пальцев довольно пятого Не потребуе а я теперь всё понял он бросился на меня как на брата вашего обидчика это я понимаю и мой брат раскаивается в своём поступке как только вы пожелаете он готов просить у вас прощения то есть вырвал бородёнки и попросил извинения он сделает всё что вам будет угодно а это как то есть если я попрошу его светлость на площади перед трактиров передо мной на колени стать Так он и станет Да а вот пронзили прослезились наконец папашу пояснить слыхали слыхали как она обо мне теперь прошу прошу Позвольте отре комен дова вполне папаша Перестаньте же кани дурак придёт вы смите видали видали вот какой у нас характер А теперь Позвольте вас представить супруге Арина Петровна Да вы вы Встаньте господин карамазов вас дами представляет надо встать маменька маменька это Это не тот не тот карамазов Это брат его Здравствуйте садитесь господин черномазов карамазов КАМАЗов маменька Извините мы из простых Папа да Садитесь же ну зачем же он вас поднял я-то вот без ног ноги-то есть распухли как вёдра мы когда раньше военными были у нас таких гостей много было я батюшка это дела Не приравнивают кого тот и люби того Александрович прекрасной души человек Анастасия говорит Петровна это Ича диада ну говорю это кто как кого обожает А ты это вот и мала куча да вонча А тебя говорит надо в повиновении держать Ах ты говорю ты чёрная ты шпага и кого это ты сюда учить пришла а я говорит воздух чистый впускают нечистый и так это мне с того времени в душе засе что вот сижу я на намедне как здесь теперича и вижу генерал вошёл который на святую сюда приезжал что говорю ему ваше превосходительство Можно ли благородной даме воздух свободный впускать да говорит Надо бы у Вас форточку Али дверь тут отворить потому как воздух у вас не свежий А я говорю воздуха вашего не порчу а шмаки закажу и уйду Не судите вы меня от судите ведь есть вед У меня только что ичка из класса прит и любит Николай ильч у не угодила ли я тебе Простите меня простите Вы меня совсем в одиноко Ну что ж вам мой Воздух противен стал Гошка па Не надо перед ним ну видели слышали тите вы уже ная свед изво из себя выходить рва николав я удовлетворю шапочку свою наденьте Алексей Фёдорович А я картус возьму Пойдём пойдём Пойдём пойдём Пойдёмте Пойдёмте надобно вам одно серьёзное словечко сказать вне этих стен покончить надобно покончить Пойдёмте Шут так вот тянет меня ваш братец за бородёнки из тратила и прямо на площадь А в то время школьники из школы выходит и Илюше вместе с ними как он увидел меня в таком виде бросился ко мне папа кричит папа схватил меня обнимает вытащить хочет И братцу то вашему кричит Это папа мой папа простите е Вот так и кричит Простите схватил его и руку-то его руку-то эту и целует помню я Какое у него личико тогда было не забыла не забуду не отсюда я брата вашего никогда не прощался Он оскорбил не только вас но ещё свою невесту благороднейшие должны быть врагами на свете друг друга у вас благородная душа Вы должны это понять руб Я 4 года таких денег-то не видал А вы говорите как сестры это вправду Клянусь правда вы даже понять не можете что для меня теперь эти 200 Люб могут знать я я ведь теперь Маньку и ночку ангела моего горкого почи тегу да конен постойте Екатерина Ивановна Вам ещё даст и меня можете взять как от друга сколько угодно потом отдадите А не хотите ли я вам сейчас с один фокуси покажу Какой фокуси фокуси фокус-покус такой вот Видели глядите Видели Видели вотже вот ваши деньги вот ваши деньги вот вот ваши деньги вот ваши деньги вот а что же бы я мальчику то моему сказал если бы деньги у вас за позор наш взял а [музыка] Ну что пожаловал узнать о вашем здоровье напрасно тревожился Впрочем я и знал что припрёмся ушёл он у Митьки невесту его отбивает из последних сил старается Вот для этого тут и живёт Он вам сам так сказал сам уж недели как три с лишним сказал ну не зарезать же меня тайно он сюда приехал правда что Чего это вы это так говорите а что я говорю-то для чего-нибудь он же сюда приехал Правда денег не просит это вот надо отдать должное а потом с другой стороны я ему вот ни Шиша не дам потому что сын мой любезный Алексей Фёдорович я ещё сам хочу на мужской линии то лет 20 состоять понимаете потому как Алёшка когда составишь понимаешь ни одна уже ко мне не придёт я знаю ни одна по доброй воли во и денежки Мне на это дело-то и понадобится Так что уж увольте для себя коплю потому как вот в сквер этой Я до самого конца хочу прожить Алёша оно мне в сквер не слаще все вон её ругают Ну ведь все же в ней-то и живут так все Тайна тайна фуфуфу А я открыта Нате Нате глядите А в рай твой Я не хочу Алёшка Даже если он где-то там и и есть не по-моему вот уснёшь и не проснёшься и нету ничего так что хотите поминайте меня а не хотите идите чёртовой матери вся моя философия А вот на грушки то я женюсь вот захочу Завра Ну как деньги милейший сын Алексей Фёдорович есть и стал быть будет всё вы раздражитель это вы со вчерашнего пошли бы вы до легли Ну вот вот ты говоришь Ну я же не сержусь на тебя нет А скажи Иван Не дай Бог я бы я бы расли это так слушай може Может конячку давай ты кофейку себе возьми ты вон кофейку холодненького а я тебе и прильнет Нет спасибо я рюмочки Давай давай вот этот хлебец с собой лучше возьму на бери а к ничку бы и вам не пить Вот прям под руку Ну правильно Что раздражает не даёт уже покоя никакого Ну я только рюмочку Ну что я с рюмки не околели А вот вы теперь добрее стали Ах Алёша сынок мой я тебя вон и бес конечка люблю а с под лицами Я подлец зло Я человек Алёша не зло исковеркать хотел чего спросить-то когда вчера чтоб ты пришёл тебя просил Слушай а если бы я Митьки щёнок другую вот прямо сейчас это считал ты как думаешь Может он уехал бы отсюда на совсем без грушки а я я думаю что если 3.000 не врёшь всё врёшь не надо ничего не спрашивать ничего не надо Всё я раздумал не надо ничего деньги мне самому мои нужны а Мику Я как таракана предав знаешь я как ночью чёрных тараканов вот так то и треснет Митька треснет Твой твой пото что ты его любишь вот вижу Всё иди отсюда Ступай Ступай нечего тебе здесь со мной бы А ты зачем так а мы же ещё увидимся с тобой а что ж думаешь совсем нет я Нечая Ну Ступай Ступай Я тоже так нечаянно [музыка] с [музыка] [музыка] [музыка] C [музыка] [музыка] [музыка] [музыка] [музыка] [музыка] становись выводи раз раздватри раз раз раз два три раз [музыка] [музыка] стой [музыка] вперёд шагом аш трогай [музыка] Так вы не отдали денег и дали ему убежать Так вы бы Побежали за ним Нет Лиза это лучше что я не побежал как лучше чем лучше потому Лиза что если бы он не растоптал а взял бы эти деньги то Придя домой через час он заплакал бы о своём унижении А завтра пришёл бы ко мне и может быть бросил бы кредитки растоптал бы как тогда а стало быть теперь нет ничего легче чем заставить его принять эти 200 руб поскольку честь свою он доказал ах это правда Ах я это ужасно вдруг поняла на равной ноге Несмотря на то что он деньги у нас берёт послушайте Алексей Фёдорович нет ли Тут во всём этом рассуждении нашем то есть вашим не Нет пусть уж будет нашим нет ли тут презрения к нему в том что мы его душу Разбираем точно свысока а нет Лиза презрения Нет потому что мы такие же не лучше Алексей Фёдорович вы удивительно Как хороши Вот вы иногда как будто педант А между тем смотришь вовсе не педант пойдите посмотрите у двери не подслушивает ли маменька Алексей Фёдорович Дайте мне Вашу руку я должна вам большое признание сделать вот так вчерашнее письмо я вам не в шутку написала а серьёзно Лиза Вот и прекрасно я был совершенно уверен что вы написали серьёзно уверен я ему руку поцеловала А он говорит ты прекрасно Я очень хочу вам понравиться Лиза просто не знаю как это сделать мил Алёша его холодно и дерст он был уже уверен что я написала серьёзно Каково Да разве это плохо что я был уверен Алёша ужасно как хорошо [музыка] Ну Простите я решила вышла глупой вы сказали что я холоден я взяла поцеловала вышло ужасно глупо [музыка] платье Алексей Фёдорович Садитесь [музыка] но я думаю что нам надо ещё всё-таки подождать с поцелуями потому что мы оба ещё это не умеем Скажите лучше за что вы хотите брать меня такую дуру такой умный такой заме Я вас не стою стойте Лиза я на днях выйду из монастыря Выйди в Свет я должен жениться Я это точно знаю мне за Сима так говорил и кого же я лучше вас возьму и токто кроме вас возьмёт меня Алексей Фёдорович Дайте мне Вашу руку Ну что вы её отнимается Слушайте а что вы наденете когда Выйдете из монастыря Какой костюм не смейтесь это очень-очень важно для меня я не думал Но какой хотите такое надену Я хочу чтобы у вас был серый пиджак Бархатный серый пикейный жилет и Серая мягкая шляпа Алексей Фёдорович а вы мне будете подчиняться это надо тоже заранее решить см но не в самом главном Потому что если в самом главном вы будете со мной не согласны я должен буду поступить как велит мне долг Угу Да вот вот так вот всё и нужно пойдите посмотрите у звере не послушает ли мамаша хорошо Я пойду только не лучше ли не смотреть Зачем подозревать в такой низости вашу мать как низости А какой низости это то что она подслушивает за дочерью так это её право Будьте уверены Алексей Фёдорович что когда я сама буду матерью и у меня будет такая дочь как я то я за ней буду обязательно подслушивать Лиза это нехорошо Ах Боже мой если какой-нибудь светский разговор я послушала то это низость а тут Родная дочь заперлась с молодым человеком знаете я и за вами буду подсматривать Алексей Фёдорович Нет я не буду за вами подсматривать никогда И никогда не прочитаю ни одного вашего письма потому что вы правы А я нет Алексей Фёдорович А почему такой грустно все эти дни я вижу что у вас есть какая-то особенная грусть может быть секретная А да есть и секретное я вижу что Вы любите меня раз угадали это я знаю что вас мучают ваши братья отец Да и братья я вашего брата Ивана Фёдоровича не люблю Алёша братья губят себя и отец тоже Губит тут земляная камазовская сила так отец паис выразился Я не знаю есть ли Дух Божий В верху сил это я не знаю Я знаю только что я карамазов я монах я монах Лиза Лиза я монах а это в Бога может быть и не Верую вы не верует Что с вами и теперь кроме всего мой друг уходит единственный в мире человек землю покидает Лиза вы представите себе не можете как я связан как я спая душевно с этим человеком и я остаюсь один я к вам приду впредь будем вместе да вместе всегда вместе на всю жизнь а теперь вступайте Христос с вами я сегодня буду молиться за него и за вас Поцелуйте меня [музыка] Алёша мы будем счастливы [музыка] будем кажется будем Алексей твич идите сюда это так ужасно Это ужасно Это всё детские пустяки и вздор Я надеюсь вы не вздумает глупости глупости и глупости и только ей не говорите этого потому что она будет взволнована это вредно Я слышу благоразумно слово благоразумного молодого человека понимат ли меня так что вы только потому с нею соглашались что не хотели противоречиям рассердить её нет совсем нет я совершенно серьёзно с неё говорил ну серьёзно здесь невозможно немыслимо во-первых я вас теперь совсем не приму ни разу А во-вторых я уеду и её увезу Да зачем же это так далеко ещё полтора года может быть ждать придётся Алексей Фёдорович это Конечно правда вы за полтора года ещё тысячу раз с неё рассорились и разойдётся Ну я так несчастна так несчастна Теперь второе самое главное что это за письмо которое она вам написала Покажите мне его сейчас сейчас нет не надо Алексей Фёдорович именем всего Великого и святого именем умирающего старца вашего Я прошу вас Покажите мне письмо если хотите держите его пальцами а я буду Вот так читать из ваших рук Нет Не покажу Катерина ось Хоть бы она позволила Я бы всё равно не показал Я приду завтра мы с вами поговорим если хоти А теперь Прощайте Марфа Да с давай удивляюсь Я на вас сударь а чего это вы в Чер Маш не поедете А зачем я туда поеду Так ведь Фёдор Павлович вас туда по делу съездить умоляет Почему бы не уехать Говори с ней чего тебе а то что ужасно моё положение Пётр Павлович каждую минуту пристаёт что грушенька не пришла Чего не пришла а с другой стороны Дмитрий Фёдорович и перед обоими я виноват а зачем ввязался зачем Дмитрию Фёдоровича стал переносить а я судр человек нежный больной меня сами изволите знать падучая и завтра полагаю со мной длинная падучая приключиться Какая длинная падучая Ну длиный припадок такой раз я когда с чердака упал 3 дня не мог в разум войти поду нельзя заранее преду знать как же ты говоришь что завтра будет так я на чердак каждый день лазаю Ну могу и завтра упасть Они то так в погреб попаду лете ты что-то Я тебя не [музыка] понимаю притвориться что ли Ты хочешь завтра на дня в поду опытному человеку притвориться нет никакого труда А зато когда я в болезни буду лежать Хоть бы грушенька и прила к павловичу не помет ш братец с больного человека Спросить зачем что Фёдор Павлович каждый вечер запирается и никому не отпирают А мне приказа Как аграфена Александровна придёт стучать ему в окошко эти самые секретные знаки и братцу ваш про эти знаки хорошо всё известно как же ты смел передать Ты же сам говорил что она никогда к отцу не прит зачем же дмитри Говори Я хочу мысли твои знать Да мои мысли тут ни при ЧМ а только у Фёдора Павловича для графена Александровны 3000 в конверте приготовлены и на конверте ангелу моему грушеньки А 3 дня спустя ещё приписали и плёночку и брау вашему про этот конверт хорошо известно от тебя [музыка] Ах какой же ты [музыка] негодяй только Дмитрий убивать отца не пойдёт он сейчас мог его убить в выступлении как дурак мог а сознание убивать и грабить не пойдёт а если ему деньги до последней надобности понадобятся ко всему тому жет тогда ни Дмитрию фёдоровичу ни вам с Алексеем фёдоровичем ничего После смерти родителей не достанется ни рубля а умри ваш родитель теперь пока ничего этого не произошло так каждому из вас по 4 сся верных достанется И это всё до подлинно Дмитрию фёдоровичу известно и кто его удержит если к примеру меня поду а Григорий ль помм после сего лечения как бревно Так зачем же я в чермошной Совершенно верно как уедете так и произойдёт я завтра в Москву уеду самое Это лучшее только разве то что из Москвы Вас могут по телеграфу беспокоить в каком-нибудь таком случае и из черш бы тоже вызвали в каком-нибудь таком случае тоже и из че машины не могут [музыка] городний господин город а Садитесь господин хоро пошла благороднейший человек вы меня спасли потому что мне сегодня же надо в город 3000 то подумать только из-за ничтожных 3.000 пропадает судьба человеческая Ну я достану потому что меня сейчас озарила вы госпожу хохлову вдову изволите знать Сха живая развязана несколько Нео образована но богата и не хочет чтобы я женился на моей невесте так чтобы ей отказать мне в 3.000 чтобы я мог угодить отсюда до веки Я сейчас к ней а Коль откажет конец скажите смердяков как мне Дмитрия Фёдоровича найти А почему мне про него должно быть известно он нам не сказывается Я думал вы знаете ведь он здесь о графену Александровну караулит А Вы обещали ему сказать когда она придёт ваш братец с Иваном фёдоровичем в трактире собираются обедать где Столичный город я к нему от Ивана Фёдоровича с поручением бегал дома не застал но хозяевам поручение передано что Иван Фёдорович его в трактире ожидает [аплодисменты] Алёша что здесь делаешь Я ищу Дмитрия он с тобой Ты можешь войти в таком платье в трактир Я в отдельном кабинете [музыка] Дмитрий так и не явился Ну ничего себе кажу тебе ухи от чего-нибудь ча Ты одним живёшь ухи Давай И чаю Я проголодался а варение вишнёвое ты маленький вишн Варе любит а ты по Давай варенье я и теперь люблю слышал Неси уху чай варенье всё Неси Будет сделано Я помню Ашка Я все помню Я помню тебя до 11 лет 15 и 11 Какая разница что между братьями в эти годы никогда не бывает понимания Я даже не знаю любил ли я тебя тогда А сечас живу здесь уже четвёртый месяц мы дру другу даже слова не сказали а ты кажется Почему ты любишь меня а Алёш люблю Иван брат Дмитрий говорит про тебя Иван могил А я говорю Иван загадка ты и теперь для меня загадка но кое-что я в тебе уже освоил что же это такое А ты Не рассердится ну а то что ты такой же молодой человек как и все молодые люди такой же молоденький свежий желторотый мальчик Ну что не очень Тебе обидно напротив поразился впадением Я ведь после того объяснения у Катерины Ивановны только и думаю что о моей желто рости А ты прямо с этого начинаешь ты прав Алёш Я желторотый мальчик нибо живу упреки всякой логики жить очень хочется того я живу у И пусть я не верю порядок вещей Алёша Пусть посетят меня все ужасы человеческого разочарования Пусть раз увер я в дорогой женщине Ну понимаешь ли дороги мне клейки распускающиеся весной листочки дорого голубое небо дорог иной человек которого встретишь не знаешь за что А вдруг полюбишь тут не ум логика тут натром люш Понимаешь ли ты что-нибудь в моей хи и нет Да ты кушай кушай давай уха Слав здесь хорошо Ну тро чре полюбить их это ты прекрасно [аплодисменты] сказал ждала ждала Дмитрий Фёдорович подивись моему инстинкту я ведь знала что вы ко мне при жда я при по чрезвычайно Я знаю что поважней ведь после того что произошло с катериной Ивановной Вы ведь не могли не прийти суда это реализм жизни я в отчаян нейм положении Если вы мне не поможете всё провалится но я погибаю Я в горячке сударыня Я в бреду Я знаю что вы в горячки Присаживайтесь Дмитрий Фёдорович Я знаю ВС ВС что вы скажете над знаю я СЖ зашей судь Я очень опытный душевный доктор суда если вы опытный доктор то я опытный больной предчувствую что Вы мне поможете только Извольте выслушать меня суда Я пришёл в последней степени отчаяния чтобы просить у вас 3000 взаймы на под залог под верней обеспечение вам нужны 3000 я вам дам больше безмерно больше суда раня Вы так добры вы спасаете человека от насильственной смерти от пистолета я спасу вас Дмитрий Фёдорович Но вы должны меня послушать и я вам дам бесконечно больше чем 3.000 мне столько и не надо необходимы только эти роковые 3.000 довольно Дмитрий Фёдорович А что вы думаете о золотых приисках а золотых приисках даты ничего никогда о них не думал Зато я думала передумала и я уже целый месяц слежу за вами с этой целью Я даже разучилась по походке по походке Дмитрий Фёдорович сударыня ну эти 3.000 эти 3.000 у вас всё равно что в кармане и не 3000 А 3 милна в самое короткое время я вам скажу вы отыщете прииски вы нажите миллионы вы вернётесь и станете деятелем и будете нас направлять двигая к добру сударыня сударыня Я последую этому совету весьма может быть умному вашему совету последую отправлюсь Может быть туда на эти прииски но 3.000 я умоляю вас прошу нужно сегодня сейчас Дмитрий Фёдорович довольно вопрос решились ли вы поедете Вы на прис или нет отвечайте математический С удара я пойду куда угодно но Умоляю вас подождите подождите Вот вот то что я искала Дмитрий Фёдорович это из Киева от мощей Варвары Великомученицы Позвольте мне самой надеть вам на шею и тем благословить вас на новую жизнь и на новые подвиги вот я даже не знаю как ль великодушны Позвольте я вам открою я изменил ка я был бесчестно существо существо может быть презирает рублей Ну у меня нет 3.000 руб Как же вы же выразились что они всё равно как у меня в кармане Нет вы меня не так поняли я говорила о приз Дмитрий Фёдорович Если вы думали деньги нет у меня теперь нет денег я как раз воюю с управляющим и сама заняла 500 руб у ми Усова и знаете Если бы у меня были деньги я бы вам не дала Да как же так Ну во-первых я не даю взаймы дать взаймы значит поссориться Но вам любя вас я бы особенно не дала вам чтобы спасти вас нужно только одно прииски прииски и прис Да что Чёрт тебе что делать надо найти грушу где она Ну пошло А тыт чего так беспокоишься Алёшка А на с тобой впереди ещё Бог знает сколько времени целая вечность если ты завтра уезжаешь Какая же вечность Ну о своём мы успеем переговорить о своём для чего мы сюда пришли Ну что ты смотришь на меня с таким удивлением мы Для чего сюда сошлись арша для того чтобы говорить о любви Катерине Ивановне о старике и дмитрии а заграницей о роковом положении России для этого нет не для этого сам понимаешь значит что не для этого ты для чего на меня 3 месяца в ожидании недел наверное чтоб просить о главном веруешь ты брату уван или вовсе не веруешь к этому сводились ваши трёхмесячные взгляды Алексей Фёдорович не так Ты надо мной смеёшься смеюсь Алёшка смеюсь Ну ты же сам говоришь Я такой же русский мальчик как и ты а как у нас орудуют русские мальчики русские мальчики идут в трактир садятся в угол и о мировых вопросах не иначе Есть ли бог Есть ли Бессмертие а те которые в Бога не веруют те о переделке человечества о социализме Только ведь это тот же самый вопрос только с другого конца разве не так Да так настоящим русским вопросы есть ли Бог есть ли Бессмертие или как ты говоришь вопросы с другого конца Это первый вопрос прежде всего так вот что я тебе скажу Алёшка ничего глупее того Чем занимаются русские мальчики и представить себе невозможно одного русского мальчика алёшку Я ужасно люблю как-то это славно подвёл Да ну давай начинай приказывай с чего начинать с Бога Существует ли бог что ли Да но ты же вчера у отца объявил что нет было я тебя наруш дразнил те Переговори перевоз по сди то что у меня нет друзей Я хочу попробовать Ну так Представь же себе что может быть и Я Бога принимаю для тебя это неожиданно да да Если только ты и теперь не шутишь шутишь шутишь Это Дави у Старцы сказали что я шучу Нет я решил Бога принять создал ли он человека или человек создал его этого мы никогда не узнаем я решил для себя больше об этом никогда не думать я решил Бога принять принять его цель совершенно нам неизвестную и вечную гармонию веровать в которой мы в финале все сольётся ну и прочее прочее прочее На этот счёт у нас много слов по надел Ну что я на хорошей дороге да да Ну погоди бы я не то хочу тебе сказать так Представь же себя что в окончательном результате я мира этого Божьего не принимаю Ты пойми я ни Бога не принимаю я мира им созданного не принимаю и оправдать прекрасным финалом то что сейчас творится с людьми я не могу Ну ты объясни Я объясню не секрет к тому и ВЛ только пойми бра Тишка Я не пытаюсь тебя с твоей Веры подвинуть Я может быть наоборот тобой исцелиться хочу ближних своих без надрыва любить можно только издали Но есть одно исключение Алёш дети детей можно любить их близ и даже грязных больных дурных лицом Потому что дети Они невинны они чисты душой и как бы изначально для любви созданы это так да Так почему же Бог допускает их страдания За какой грех ял про деток ВС из газет собираю например Тут пропели недавно про девчоночку маленькую пятилетнюю отец и мать образованные воспитанные Люди так и было написано в газете образованные и воспитанные от того что Девочка не просилась ночью возненавидели е били и запирали на ночь в отхожее место но всю ночь мороз Это только для того чтобы научить е проситься маленькое существо запертое в подлом месте не умеет осмыслить что с ней и плачет и просит боженьку её защитить а Боженька её не защищает Понимаешь ли ты это ахинею братец Ты мой послушник ты мой смиренный говорят что без зла не мог бы чело познать на Доро А для чего познавать это добро и зло Да весь этот чёртов мир познания не стоит этих слёз ребёнка боженьки Для чего они-то страдают ради будущей всемирной гармонии так вот я от такой высшей гармонии совершенно отказываюсь не стоит из ли Зинки одного замученной дорого Оценил Бог свою будущую гармонию не по карману наш платить лько за вход а потому я свой лет ему почтительный возвращаю Это бунт бунт бунт А ты сам в своей душе мог бы простить Тем кто с ребёнком такое делает родители этого ребёнка что Расстрелять для собственного нравственного очищения Расстрелять Ну говори Алёшка Расстрелять браво браво Ай да Схимник Если уж ты сказал значит вот какой бесёнок сидит у тебя внутри Алёшка карамазов Ну есть Христова Любовь есть он который может простить всех и всех он сам отдал неповинных и за всю ты забыл о нём Христова любовь Христова любовь Алёша есть Невозможное на земле чудо Христос был бог а мы-то не боги мы [музыка] люди онм я не забыл не забыл я о нём даже целую поэму сочинил Ты поэму о Христе написал не написал выдумал и запомнил вещ нелепая камазовская с надрывом был бы здесь Мить ему бы понравилось поя называется Великий Инквизитор действие у меня происходит в Испании в севилье в веке во времена инквизиции представ площадь перед собором пламя и Дым кардинал Великий Инквизитор смотрит в огонь костра на котором по его приказу должны сжечь еретиков 15 веков назад Христос дал обетование вернуться 15 веков молила человечество Господи явись нам и вот он возжелал явиться народу по безмерно милосердию своему он проходит ещё раз между людей в том самом образе человеческом в котором ходил три годы между людьми 15 веков назад Представь воздух пахнет лавром и лимоном и тут появляется он [музыка] [музыка] [музыка] взять [музыка] его а [музыка] K [аплодисменты] [музыка] Хри это ты Я вижу это ты [музыка] J [музыка] [музыка] [музыка] jus [музыка] C [музыка] [музыка] становись выводи 1 2 3 раз раз раз два раз [музыка] [музыка] C [музыка] стой [музыка] вперёд шагом трогай [музыка] [музыка] Представь себе площадь перед собором пламя и Дым кардинал Великий Инквизитор смотрит в огонь костра на котором по его приказу должны сжечь еретиков 15 веков назад Христос дал обетование вернуться 15 веков молила человечество Господи явись нам вотже он проходит ещ раз между людей в том самом образе человеческом в котором ходил 3 года между людьми 15 веков назад Представь воздух пахнет лавром и [музыка] лимоном и тут появляется он [музыка] [музыка] взять его [музыка] [музыка] [аплодисменты] Я не совсем понимаю узнав Христа они уводят его в тюрьму что это ошибка инквизитора ёшка тебя так разбал современный реализм что ты не можешь вынести ничего фантастического ты слушай слушай это ты Я вижу это ты Зачем ты пришёл а Христос он вс время у тебя молчит так ты не удостаивает ты говорил это людям поя лет назад а люди сами принесли нам свободу свою и покорно положили к нашим ногам Теперь они уверены что свободны вполне мы свободны вполне Какая же это свобода старик иронизирует сме над Христом мой Великий Инквизитор ставит себе в заслугу в том что он поборол свободу для того чтобы сделать людей счастливыми потому что людям нужна не Свобода А хлеб но в евангелии эти слова Христу говорит дьявол 15 веков назад дух пустыни указывал тебе путь которым можно было бы устроить людей счастливыми иго отте Лово в хлебы не превратил а они со словами Накорми тогда и спрашивая с нас добродетелей восстали и разрушили храм твой желая сделать их свободными ты поступил с ними как бы вовсе их Не любя и устав от этой Свободы Слабые и Порочные они пришли к нам и сказали Нам проводите нас но накормите нас и клонились перед нами ты этого не ожидал ты ждал свободной любви а этим жалким созданием нужно только перед кем-нибудь преклониться они ВС так же слабы и подл но иногда они вспоминают о своей свободе даже могут сбн това против власти и залить кровью землю но когда все непокорные истребят друг друга оставшиеся приу к ном нашим и с ибо есть на земле только три силы способные сделать людей счастливыми это чудо Тайна и авторитет это нелепость Не может быть такого фантастического лица Как твой Инквизитор вести людей именем Христа но путём дьявола и кто эти твои носители Тайны взявшие на себя Проклятие для счастья людей Дани и в богато не веруют это Рим Да и Рим не весь Это не правда это худшие из католичества инквизиторы А как же кончается твоя поэма или уж она кончена окончить её можно так Великий Инквизитор умолкает И ждёт что ответит ему пленник а тот молчит Скажи хоть слово даже самое страшное [музыка] Вступай и не приходи более [музыка] не приходи вовсе никогда Никакой тайны у твоего Великого инквизитора Нет он просто в Бога не верует Вот и вся Тайна довольно об этом а я как всякий сочинитель не выдерживаю критики но в этом ты прав мой Великий Инквизитор не верит в бога это ты в Бога не веруешь Алю что ты тако серьёз берёшь а ведь это же вздор бестолковая поэма бестолкового студента который в жизни никогда двух стихов не написал подм мне пора листочки о голубое небо о любимое женщины как с таким адом в голове любить есть такая это поть в разврате Да а Пожалуй это может быть до лет и сбег а там всё позволено это про вчерашнее сц кото так обиделся и подхватил Да пожалуй что и так всё позволено думал я на всм свете хоть тебя имею а теперь вижу что и в твоём сердце меня нет Но от Формулы всё позволено не отрекаюсь не отрекаюсь что отречься теперь от меня за это [музыка] да всё литературное воровство это из моей поэ украл акака Лёшка если когда-нибудь Хватит у меня сил наклейки листочки то вспоминать их Буду лишь тебя любя Если хочешь воспринимай это как признание в любви но а на эти темы больше со мной ни слово и о дмитрии больше не говори никогда всё уже переговорной не Нет я к себе не к вам [музыка] ём не сходится рохо [музыка] [музыка] дали [музыка] M а [музыка] [музыка] [музыка] [музыка] [музыка] прикажите утром за лошадьми послать совсем уезжаю в Москву ки ты какой всё-таки да Ну ладно что ж ладно слушай Иван Сделай всё-таки мне одолжение Ну заедь ты в черш Ну чего тебе там прямо налево сразу от станции 12 вёрст Вот она черш железной дороги 80 вёрст уезжать в 7 вечера только Чтобы успеть Ну послезавтра успеешь Ну тебе стоит в конце концов родителя успокоить у меня там Иван Аль приезжает купчи горсткин купить её хочет так 11.000 даёт А мне бы сейчас узнать Врёт стервец или может правду говорит А я тут ничего не сделаю у меня глаза нет Да я тебе я тебе все приметы ты сообщу Ваня садись Иди послушай тут видишь ли надо ему на бороду смотреть на бороду если бородка трясётся А сам сердится стал бы дело хочет делать и правду говорит так сидит и бороду левой рукой так огла да ухмыляется лжёт подлец понимаешь так вот мне бы сейчас узнать правду говорит или лжёт А если правду так я сам туда слетаю некогда мне избавьте без сердца вы все сами же вы меня в чермошной эту проклятую [музыка] толкае Здравствуй милый видел ли брата старшего которому я поклонился сегодня не видел найти утром Оставь всё и поспеши может ещё успеешь ужасное предупредить я тогда Великому будущему страданию его поклонился неясны слова ваши Какое страдание ожидает его был у него такой взгляд ужаснулся Я в сердце своём тому что готовит Этот человек для себя раз или два в жизни Я видел у некоторых людей подобное выражение лица как бы изображавшие всю судьбу их и потом вы сбылось может быть Братский Лик твой поможет ему всё от Господа Все судьбы наши я встану сейчас каждый отдаляется от другого И вместо полноты жизни получается лишь одиночество и так останется покуда каждый не поймёт что кроме своего греха он за всех и за вся виноват а скидываю свой грех на других людей кончишь тем что и на Бога возроди Бога вас жаждал любить но жизнь земная и подвигов нет в любви моей [музыка] [музыка] [музыка] мы веруем я и воскрес и Бог умерший от придет с ним ебо вам благом словом Господним яко мы живущие остав в пришествии Господне ивори уме см го во Глас арханге христ воскресну пер мы живущие остав ВНО с ним восхищены будем на облацех вре ненова от покойного Стар АНО не только Духу не было но точило благоухание вот ждали к посту не был строг сладости себе разрешал ре вишн с лю знать суд-то Божий не то что человеческий Куда поспеешь к службе Благовест Или ты с маловер [музыка] [музыка] Алексей Ты чего сердишься что ли на кого да О вот мы как это ты от того что стари ство провал Да неужели ты веришь что он чудеса отмачивать начнёт этоже тринадцатилетний школьник теперь не верит верю Верую Хочу веровать и буду веровать Ну чего тебе ещё глумиться над праведним из праведных за что кто судил это высшая Справедливость я не хочу чуда но справедливость Так ты на Бога своего взбунтовался Я против Бога своего не бунтуют мира его не принимаешь Что за белиберда елли ты сегодня тебе надо подкрепиться знаешь есть у меня в кармане колбаса так вял на всякий случай ты колбасы не станешь Давай колбасы Да ты вот как Ашка совсем уже барика этим дем нече пом ко мне я водо тя и вы Давай водки О как брат я вижу тут лихое дело Постой а знае куда мы лучше бы Теперь пошли всё равно куда хочешь такая минутка выдалась пойдём грушеньки а пойдёшь пойдём грушеньки Пойдём пойдём Ну вот прошу [музыка] Прошло уже 4 года как купец Самсонов привёз в этот дом из Губернского города восемнадцатилетним и грустную были слухи что была Она кем-то обманута каким-то будто бы офицером и затем точе же им брошено и осталась в позоре и [музыка] нищете фамили е была Светлова звали аграфена Александровна благодетеля своего купца Самсонова грушенька хоть и поразила Так что он жить без неё не мог но капитала большого он вс-таки ей не отделил но зато отделил капитал Малый и советами как орудовать этим капиталом помогал немало и надо сказать что грушенька оказалась с этой стороны с чрез СПО [музыка] она занималась скупкой векселей за бесценок а потом приобретала на этих векселях по рублю на гривенник Так что под конец многие прозвали её сущую жидов [музыка] кой Если уж выбирать между двумя Карамазовы отцом или сыном то выбирай отца но с тем чтобы подлец на тебе женился а предварительно капитал отписал с митько не ишай се пути не будет Кто там не он другие эти ничего хитка ты испугал Господи кого ты привёл что не угодил прикажи свечей принести фень Принеси ему свечку Ну нашёл время когда его привести Я думала это ми ломи я Лёш брат то его сегодня боюсь Почему митенки боишься кажется с ним не пугливо я тут заперлась вести одной жду золотой та весточки Так что Мити не надо Феня ты там всё кругом оглядела может он спрятался высматривает всё заперто всё закрыто Я и в лто гляжу поминутно сама в страхе трете разрядилась ты куда говорю тебе весточки одной жду Ане разговаривать с ракеткой когда тут такой гость стоит Алёш голубчик смотрю на тебя Я не верю как ты у меня появился не та минутка теперь А я тебе рада А вот ведь ракитин Какие вещи сегодня сбываются И чего я тебе так рада Лёш сама не знаю Ну и уж не знаешь чему рада сама же приставала ко мне Приведи Да Приведи имела же цель Прежде ты я другую цель имела теперь не та минутка алёше А что же так грусть боишься меня пустишь меня к себе на коленке посидеть вот так Развесели я тебя Мальчик ты мой богомольный сердишься Ладно хватит здоро болтать лучше шампанского подавай долго за тобой сама знаешь правда Алёшка я вам шампанского обещала Коль тебя приведёт Феня ня Феня Неси нам ту бутылку которую Мити оставил скорее беги с вами вы пошить хочется что за весточку ты ждёшь секрет не секрет Да и сам ты знаешь ракитин офицер едет офицер мой едет уже близко в мокром теперь оттуда лошадей пришлёт минь тепер онто знает чего знает если бы знал убил бы молчи ракит я об нём думать не хочу всё сердце он мне размол а вот об шеке могу думать Алёш голубчик А ну Смени хоть на меня ну на глупость мою Ну на радость мою сменился лас Как смотрит а я всё боялась что ты сердишься на меня за барышню за катерину Ивановну собака я была вот что нет оно хорошо что так произошло дурно оно было хорошо позвала меня победить хотела шоколадом своим обольстить Нет ну хорошо что так вышло да вот боюсь ты рассердился Она ведь тебя на самом деле боится э что люблю тебя Ах ты бесстыдница а это она в любви тебе объясняется А что ж люблю а офицер А Золотая Весточка из мокрого то одно а это другое А вот оно как по Бато выходит Не зли меня китка я Алёш по-другому люблю шампанская правда Алёш была у меня на тебя одна мысль подлая Да я ведь низкая я ведь ния возбуждена графи Александра и вне себя бокал выпьешь танцевать пойдёшь Эх Алёша бери бокал Покажи себя за что пить будем за райские двери за какие-то райские двери Нет не надо а хвалился Коль так и я не буду он против Бога своего взбунтовался колбасу собирался жрать а что так да старей Святой его сегодня помер и пропах Ну старей за Святой так умер старец за сим Господи я не знала этого госпо а ято у него на коленках сижу ракитин не дразни Ты меня что я против моего бога взбунтовался Я против тебя не имею и ты Будь добрее я потерял такое сокровище которое ты никогда не имел и ты теперь не имеешь права судить меня Посмотри лучше сюда на неё видел как она меня сейчас пощадил я шёл сюда подлый злой хотел злую душу найти а нашёл душу любящую она меня сейчас пощадила графена Александровна Я про тебя говорю ты мою душу сейчас восстановил так уж и спасла тебя Да она тебя проглотить хотела Знаешь ты это молчи китка молчите вы оба я всё скажу ты Алёш молчи потому что таких твоих слов меня стыд Берт потому что я злая а не добрая вот я какая а ты китка молчи Потому что ты жш была такая подлая мысль что хотела проглотить его но теперь вовсе не то теперь ты лжёшь и чтобы я больше вовсе тебя не слышала омом расслабились сейчас начнут Только вот что ракетка я хоть злая а луков я всё-таки подала какую луков видишь ачка это Я ракитки похвалила что луков подала тебе это с иной целью скажу а ты ракит сядь в угол и молчи как мой Лакей Слушай Алёш мою Басенко я от матрёны кухарки моей услышала Жила была Баба злющая призе и померла и не осталось после неё ни одного доброго дела схватили её черти и кинули в огненное озеро не потерплю и вот стоит её ангел-хранитель и думает Какое бы мне такое доброе дело её припомнить чтоб Богу сказать вспомнила говорит она говорит в огороде луков выдернула и нищенки подала отвечает ему Господь возьми что ты говорит эту самую луков протяни ей в озеро Пусть ухвати и тянется и если вытащишь бабу то пусть фра идёт оборвётся луковка то там оставаться ей протянул ангел бабе луков и стал её тянуть Да грешники прочие стали за неё хвататься а баба стала их ногами пихать меня тянут не вас моя луковка только она это выговорила и упала в Озеро не вытащила ангел бабу оборвалась луковка Вот моя басенка Алёш наизусть запомнила потому что я и есть это самая злющая баба ракитки похвалила что луков подала А тебе иначе скажу всего-то я луков подала всего-то на мне и есть добродетели и не хвали ты меня Я ракитки 25 руб обещала Коль тебя приведёт правда Это я тебя проглотить хотела на ратка принимай долг принимай небось не откажешься А ещё бы отказаться дураки и существуют Профит умному человеку а теперь молчи не любишь ты нас Вот и молчи любят за что-нибудь а вы мне что оба сделали за что мне вас любить-то а тебе этого не понять вон Он поймёт алёше Скажи ты мне теперь что мне делать офицера обидчика моего который меня соблазнил и бросил простить или нет Ты ведь уже простил и в прям простил якое подлое сердце за подлое сердце моё а разрядилась Ты зачем А может ещё и не простила не знаешь ты ракетка всего моего сердце вот войду к нему подсяду до больш Видал ты какая я теперь скажу Ну так вот оставайся при том милостивый государь или нож с собой туда возьму я ещ того не решила ну полилась река Миша будь милосердна вот адвокат появился Да ты влюбился в неё что ли аграфена Александровна так он влюбился в тебя победила молчи злая душа Барни голубушка таранда из мокрого за вами и письмо письмо кликнул свистнул ползи собачонка еду Прощайте Прощай Лёш решена судьба полетела грушка в Новую жизнь слоно [музыка] пьяна трогай пошла алёше поклонись ми переда что любила его грушенька оди часок времени только один часок времени и любила Пусть он этот часок всю жизнь жизнь помнит пошёл зарезал братца тинку Да ещё и приказывает всю жизнь свою помнить ка обратил блудниц на путь истины сем бесо изл ты теперь за эти 25 руб меня прие предал друга да ведь ты мне не Христос А я тебе не Иуда Я и забыл об этом сам сейчас напом ч ри всех и каждого И зачем Я чёрт с тобой ввязался знать я тебя больше не хочу Иди вон Твоя дорога [музыка] [музыка] Us [музыка] [музыка] становись выводи раз раз раздватри раз раз раздватри [музыка] а [музыка] [музыка] [музыка] стой вперёд шагом аш трогай с [музыка] ну хватит ну с Богом Иван с Богом приедешь Когда в жизнь Ты ещё приезжай Я всегда рад особо ты меня не брань давай с бох с бох СБО видишь в Москву еду значит Правильно говорят люди что с умным человеком и поговорить приятно [аплодисменты] какой же Я подлец [музыка] [музыка] [музыка] [музыка] Григорий Васильевич Григорий Васильевич упал Фёдоровича припадок Марфа игнатьевна фма фма [музыка] где она здесь Феня ради Господа Бога нашего Христа скажи где она батюшка голубчик Я не знаю она она домой не приходила ко отцу пошла нет врёшь там она по испугу твоему вижу что там О Господи он убить кого хочет а [музыка] о о ой соперник счастливый ипо [музыка] груша груша груша грушенька аграфена Девочка моя ты где ты а она тут вход пошла Сейчас открою Марфа кажется калитку забыл запереть нехорошо пойди закрой Марфа ослабела бабай дом без сторожев такое опасное время Господи Дмитрий стой й [музыка] старик [музыка] H [музыка] [аплодисменты] [музыка] [музыка] Александ вернулась а дома-то нет где она про бар баня уехала часа д тому в мокрое в мокрое Зачем этого знать не могу а а к офицеру какому-то Они они лошадей прислали а он часом не вернётся я дворнику наказала не впускать так дворника там нету ушёл дворник один Прохор стоит племянник [музыка] его Говори сейчас где она с кем она в мокром сечас скажу сейчас всё скажу ничего нер поел К какому офицеру к прежнему своему к прежнему 5 лет тому который о не был и бросил Феня Да как же я о нём то не подумал Она же о нём не говорила она же говорила что от него Письмо пришло А сегодня он приехал А вчера ещё в мокрое приехал Сейчас оставь ФТ было опять письмо и она поехала И крикнула ещё привет митенки и передать что любила его только часочек только один часок и любила А руки-то у вас какие дмитри Фёдорович всё все это в крови только часок любила Она же мне говорила как же я мог не думать Ну ничего ничего теперь перес Рень Что с вами это кровь Феня кровь человеческая Боже зачем она пролилась [музыка] Сеня тут один забор один высокий забор и страшный на вид но завтра на рассвете как взлетит солнце митенька через этот забор и пересчет не понимаешь Какой забор Ну ничего ничего всё равно завтра услышишь и всё поймёшь А теперь Прощай прощай [музыка] [музыка] [музыка] Григорий Васильевич Григорий Васильевич Где ж ты а Плохо ему [музыка] опять Григорий Васильевич Григорий Васильевич Григорий Васильевич Ты где ж а [музыка] О Господи [музыка] ва [музыка] р [музыка] рири это убил он отца убил Беги зови ой Гри зови [музыка] Гри Беги Холи Васильевич Помогите помогите Михой Васильевич умирает помогите Беда беда Давайте где Фёдор Павич беда Григорий Васильевич уме Фёдор Павлович беда Фёдор Павич Фёдор Павич у [музыка] бели Барина Бель Что случилось Барина убили Григорий Васильевич помирает весь в крови Я же слыхала отцу убивец кричали Григорий кричал А кто убил Да не знаю Господи так митри ёт убил Господи что делать-то что делать начальство надо доложить правника надо звать Да когда же докладывать мы же сами ничего не видели на самим глянуть Извините за вторжение заходите у вас закладе мои пистолеты А да отличные пистолеты арех с радостью Дмитрий Пётр ильч напротив я за ними пришёл и деньги принёс с благодарностью тороплюсь Пётр ильч нет времени пожалуйста поскорее А вы ве крови упали что ли пройдёмте ко мне к рукомойник Великолеп великолепно ру куда Да в карман карман Сунь Ай да вздор это Пётр ильч Давайте дело покончим с пистолетами то а вы мне их Верните очень нужно А я вам деньги вот ваши деньги очень нужно ни капли времени нет ни секунды Да у Сдачи не будет а мельче нет все такие все как одна а ид ш вы так разбогатели Дмитрий Фёдорович А вы знаете я сейчас пошлю свое мальчишку в лавку плотко пошлю сбегает они поздно закрывают и меняют Миша давай одна нога там другая тут понял Давай Великолеп дело Плотниково ми а ну скажи им что лани велел Дмитрий Фёдорович и сам сейчас будет Да здесь другая там Давай идёмте идёмте Давайте Пойдёмте помоемся Давайте дмитри снимите СРК Да положите вы деньги на стол не пропадут Давайте я вам помогу да у вас и рука в крови Да нет это не много вот рукава только не весь а вот ещё это карман платок через карман кровь просочилась Где же вас так угораздило подрались с кем А пройдём да да дада да Давайте за мной Прошу вас прошу Дмитрий Фёдорович ээ у вас ещё на лице кровь здесь вот тут на левой щеке Ага дадада дадада Дмитрий Фёдорович вы в этой рубашке и поедете смотрите у вас кровь на манжетах Ах да кровь кровь Ну так Смените бельё Да некогда А я вот вот так вот манжет заверну и не видно будет Ага Дмитрий Фёдорович где ж вас угораздило опять трактире подрались не опять ли с этим капитаном как тогда кого ещё прибили вздор это я это я старушонку одну сейчас раздавил старушонку раздавили старика чёрт возьми не убили ли Вы кого а Да нет при сцепились и примирись разошлись приятель вот нет ни времени ни секунды вы поймите поговорил бы с вами да Так а где деньги Да вон же лежат на столе Дмитрий фч для вас деньги что ссор или вода Да вот ключик вот ваши пистолеты вчера их заложили за 10 руб а теперь вас тысяч потеряете эк Дмитрий Федорович в самом деле куда вы собрались Вот она Пулька та если она в мой мозг войдёт интересно взглянуть Какова она А впрочем вздор Ах Пётр ильч знал бы ты до какой степени всё вздор А ну дай-ка мне бумажки кусочек гладкое для письма яй Бога сейчас пойду и кому-нибудь скажу чтобы вас никуда не пускали Дмитрий Фёдорович А всё-таки куда вы едете А в мокрое в мокрое Да зачем вам сейчас мокрое то ехать а а мокрое зачем Да женщина Пётр ильч послушайте Дмитрий Фёдорович вы хоть и дики но я всегда к вам хорошо относился вы мне как-то нравились Да Дмитрий Фёдорович Всё теперь можно ехать Я беспокоюсь о вас женщина Пётр илич и довольно и шабаш Миша а я и забыл про тебя Спасибо дорогое воз Пётр ильч едем не сметь не сметь не сметь пошл пошл отсюда в моём доме это не принято это дурное баловство спря ши Деги завтра жев при ру с Слушай а давай в мокрое вместе поедем А да Зачем мне с вами мокрой то ехать Слушай дмитрич ну хочешь я бутылку отку порю сейчас выпьем вместе я выпить хочу пуще всего с тобой Ну никогда же не пили вместе брат Ну давай к плотником в задней комнате выпьем Пётр илич Ну хочешь загадку тебе загадаю Ну загадай так а казню себя за всю жизнь всю жизнь себя наказываю вот сечас пойду и расскажу кому-нибудь а не успеешь голубчик аплот кого выпьем Да зачем тебе столько что за корзина что в ней тут на 400 руб а не изво сомневаться в этой корзине пока шампанского пол конфеты и не больше часа задержки и не более часа чтобы больше Гук Девки там это любят Гук что наче дюжины да Зачем те четыре дюжины шек одной довольно А ну-ка дайте мне счёт я проверю АХО те дери Дмитрий Фёдорович Бросай свои деньги Коли даром нажива сюда сюда давай шам с устриц первейший устриц самого последнего получения к чёрту устриц я их не ем некогда устриц Да и аппетита Нет ты не сердись на меня друг не любил я никогда всего это беспорядка Да кто же его любит-то беспорядок Дмитрий Фёдорович три джины шампанского на мужиком Да это хоть кого взорвёт Да я не про то не про то Слушай Дмитрий Фёдорович мне всё твои пистолетами мерещится пистолет здоро А ну давай пить пить и не фантазировать вот шампанская давай вот пожалуйста за жизнь голубчик за жизнь выпьем за жизнь предлагаю тост за жизнь и за одну царицу ицари выходите ну Ну за жизнь буде а пожалуй за твою царицу Ай чего тебе Миша Миша голубчик А ну давай давай ты выбей этот стакан Ну зачем ты ему ну Позволь Ну я хочу Ну дольше запомнить меня Ну что стоишь [смех] пей Хорошо молодец ай молодец женщину Я люблю женщина А что есть женщина царица земли грустно Мне Пётр Лич грустно помнишь гату мне так грустно так грустно рацию бедный Юрика Это я может быть бедный Юрик и есть именно теперь бедный Юрик а уж череп потом Дмитрий Фёдорович всё готово можно ехать Дмитрий Фёдорович Дмитрий Федорович голубчик не погубите барен и его не погубите замуж он берёт мне сес столе слеты я их по Доро в лужу выб не ри не погубит никого ВД никого уж не погубит глупый человек да я обидел тебя да прости ня и по А про тепер уже последня трогай Андрей улетаем быстро на пошла дурак хоть и хороший Малый Ну делает он там теперь делов Смотри чтоб не надули Да что я ему дядька Что лих у карамазова 3000 откуда него может быть 3000 он сказал что ему лакова дала здесь что-то неладно надо Фёдору пачу зайти не произошло ничего дмитри слух грозил убить его здесь все слышали именно х и говорил да всё это взор Скорее всего я что чиновник перхоти к нему в дом ломился чтобы узнать не убили ли его не я лучше эту служанку Фени как следует расспрошу бегу бегу Ну говори что знаешь что Дмитрий Фёдорович натворил откуда у него деньги Он от убил что ты это знаешь или так думаешь он за барн убил Он мне сам покаялся как покаялся что это кровь человеческая говорил что он человека убил он сам говорил он много что говорит Ты мне расскажи что Своими глазами видела Он песик железный из ступки взял Я воротился уже без песика а кровь с рук капает Капа капает Ну положим кровь у него с рук не капала просто Они были вымазано ею он за барань убил надо к исправник идти Ну к исправник так сходить Я могу Ну тут что-то не так не ведут себя так убийцы не ведут так он за барне поехал в мокрое барен убит Аль не знаю я батюшка не знаю к исправ бегите к исправ Григорий Васильевич справник говорить будем а если ещ жив Мы сперва сами глянем сейчас пойдём глянем [музыка] башка Дмитрий Фёдорович вас ли вновь обретаем стой Трифон борисо ж самое главное она здесь аграфена Александровна Да здесь она прибывает с кем гости прие один-то чиновник по разговору с поляком Ну гой с ним товарищ Аль кто разберёт по штатс одеты Кутя богачи Да какое Кутя Дмитрий Фёдорович небольшая величина небольшая сит поме Максимов нагое аж так при разных господа и ездит и только и всех только так теперь самое главное три Борисович как она весела смеётся Да Кажись не очень смеётся даже грустно сидит совсем Так теперь самое главное Давай за цыгана цыган нас вовсе не слышно Дмитрий Фёдорович согла начальство Зато вот житки здесь в рождественска есть так те на цимбалах играют на скрипках можно было бы за ними послать послать послать непременно послать и давай девок поднимай как тогда чтобы Марию особенно степани 200 руб даю за хор Да я тебе за такие деньги ВС село подниму так ну-ка быстро быстро только Зачем же Барин Ради такой подлости до гадости такую сумму определять а быстро а девки какие они есть се вшивые Да я тебе своих дочерей даром подниму А спать полегли так я их ногой в спину напи наю для тебя петь заставлю ряс я у тебя в тот раз не одну тысяч расли расли голубчик как же вас не вспомнить 3 поди у нас оста теперь с тем же приехал Ну видишь Ай Трифон Борисович Так теперь самое главное слушай и понимай через час вино привезут закуски конфеты пироги А ты сейчас пока эту корзину раскрывай и точе на стол Ага Давай давай девок девок девок адре вот 15 руб за тро 50 на водку за готовность твою любовь помни Андрей карамазова боюсь Барин 5 руб на чай пожалуйте больше не приму и Трифон Борисович свидетелем уж простите глупое слово моё боишься да и чёрт с тобой Коль боишься й Барин батюшка а пистолет это зачем а ну Проводи меня ой Они ведь в Голубой комнате как мы тогда в Голубой Ну стой а ты дай мне прежде всего глянуть на них а и главное чтобы они меня не видели чтобы не заметили А тихо давай Пожва Яла налички [музыка] се [музыка] Господа Вот я тоже приехал па мы здесь приватно имеются иные покои Здравствуйте господин карамазов Максимов и вы тут как же я ра что и Вы тут Ах вы Как вы мне руку пожали прин паль сломали руку пожал господа Пани Пани а выпи мировую Господа я привёз Вот это [смех] ежели позволит моя рулева рулева ролева что Королева что ли ой смешно мне как вы говорите садись Мить и не пугай больше Коли не будешь пугать я тебя рада мне ли вас пугать Я рада что ты приехал слышишь Я очень тебе рада Я хочу чтобы он здесь с нами сидел Коль он уйдёт так и я уйду что желает моя царица тот закон грош Пана до нашей компании [музыка] [музыка] Ну что Пани выпьем мне пить надо сегодня потому что Господи ть ты так больше не вский пить надо а привёз это славно я сама пить буду А их этой наливки терпеть не могу Ты кутить что ли приехал хорошо то с кучи ты деньги-то спрячь в карман откуда только достал а с [музыка] I [музыка] [аплодисменты] а [музыка] [музыка] [музыка] [музыка] [музыка] [музыка] становись выводи 2 раз раз раз два раз [музыка] [музыка] стой [музыка] [музыка] вперёд шагом трогай [музыка] [музыка] [музыка] [музыка] [музыка] иш [музыка] зашагал сквер на с вами Паня Я думала что веселее будет А давайте выпьем пано и с другим паном же Пани Эй Ясно вельмож А ну давай бери стакан пан в Рублевский теперь выпьем за Россию за Россию я хочу а я бы тоже за Россию старую бабусеньку все все эти Ну ура ура ура ура Ну вы чего за Россию до раздела Польши пара а не слабости до своего краю чтоб не было меня я вечно всех обижаю я виноват я не хотел вас обидеть надо чтобы весело было А где музыка где девки Почему девок нет давай шампанского ещё шампанская батюшка кончилась а тройка с припасами прибыть ещё не успела а девки где девки Да девки Вот они собираются Здравствуйте Бари Здравствуйте Мар Маря Так где и Марью Барин скоро доставим не Извольте беспокоиться и за жидка с цимбала послал и дочерей Я уже поднял сейчас все буду так давай гостинице девкам Из ящика доставай леденцов тгук и Андрей водки уехал он как же уехал уей обидел Я его я всех обижаю дч а ели в картишки играть Дайте М 5 руб Я бы тоже в бачок рискнул карты прекрасная мысль великолепна надо только чтобы опять было весело А вот держу 10 а проиграешь ещё приходи Господа пока музыки нет чем бы нам пока заняться чтобы весело было а может в банчо сыграть когда ве Ну конечно с Это же хорошо очень хорошо Яно согласны па но это что такое позно это значит Пани час позднем поздно нельзя сами скучны так и другим чтобы скучно было Мить это они так до тебя сидели молчали Н смутный он видит ваше нерасположение и поэтому печальный в карты гутов пане в карта не согласны тогда начнём только чтоб карты от хозяина Пани то наилей способ от хозяина это хорошо Я понимаю Пусть от хозяина это вы Пани хорошо кар а я им сегодня уже проиграл 50 руб Пан был несчастливый Пан может быть опять счастливый Сколько в банке может 100 Может 200 Спасибо три сколько будешь ставить я Пани много тебе хочу проиграть бери карты закладывая банк Что вам угодно я решился а беспокоить вас удар не в это неподходящее время по поводу общего знакомого нашего Дмитрия Фёдоровича карамазова знакомого всего 3 часа тому назад этот знакомый приходил сюда в эту самую гостиную чтобы меня убить убить так он вас тоже хотел убить тоже а он кого-то уже убил соблаговолите выслушать суда только полминуты я вам ВС разъясни сегодня вечером Дмитрий Фёдорович вошёл ко мне неся в руках пачку рублёвых бумажек примерно в две или даже в 3000 руб руки же у него и лицо были все окровавленные А сам он казался как бы по во что это вы судили ему сумму в 3000 чтобы ехать будто бы на золотые приз Боже мой никаких я ему денег не давала не давала это он отца своего убил Позвольте Позвольте сударыня Позвольте Вы точно помните что никаких денег ему не давали не Дава не давала я ему отказала а он на меня набросился я отскочила а он я вам могу теперь сказать как человеку от которого Мне нечего скрывать он в меня плюнул можете себе такое представить сударыня а а что же мы стоим пройдёмте Убил убил А как он Убил его как это было Садитесь Садитесь же Судя по всему Он заранее запасся медным пестиком на кухне своей любовницы и этим пестиком проломил несчастному голову а сейчас мчится мокрая с целью убить саму эту любовницу Но это пока только моё предположение я это чувствовала и то что теперь Он убил не меня а только одного отца своего это перст Божий он постыдились и вот он со броском на шее в меня плюнул и вон значит Куда поскакал Но теперь-то мы с вами что теперь Теперь я пойду прямо к исправник и всё ему расскажу а там уж он как сам знает Именно к нему Михаил Макарович прекрасный человек и знает что делать не поехать ли мне с вами Нет нет нет а вот если бы вы сейчас вашей ручкой написали всего три строки что денег Дмитрию фёдоровичу вы никаких не давали Вот это было бы не лишнее непременно Как вы находчивый Пётр Ильич Вы меня поражается вы меня просто потрясает что вы здесь служите вот никогда в жизни моей я не давала взаймы Дмитрию фёдоровичу карамазова 3.000 руб Клянусь в том Всем святым что есть в нашем мире Хохлова идите же и спасайте нас всех братец Ты бы луже быты засыпал бы Слушаюсь парень прошу вас я с докладом о возможном убийстве господину исправник об убийстве уже известно вс-таки убийство было совершено Дворовая убитого об этом сообщила так господина следователя ждём следователя уже оповестили до вечер господа Добрый вечер Добрый вечер неприятнее происшествие Господа Да добрый вечер господа Господа Ну вот и Николай парфенович и поскольку и полит кириш прокурор Вику и наш новый Земский врач тоже с нами Мы можем немедля отправиться к месту происшествия постараемся только не возбуждать лишне ажитация в год боюсь Михаил Макарович избежать всеобщей ажитация не удастся отце убийства слишком заметные события и тут поднимутся психологические и духовные вопросы настолько значительные что мы с вами окажемся в центре внимания не только города Но и всей России по всей видимости я более не нужен откланиваюсь Господа Моё почтение нус обсудим детали господа [музыка] 200 проиграл ещё ставишь 200 ещё 200 Пани напе Прекратите Дмитрий фроч довольно Ну почему Ну просто плюньте и Уйдите много проиграл жартуй па шучу я вовсе не шучу Он правду говорит Мить проиграешь ясн пова Роны не сметь кричать Пани Грина Ясно Вель мож на два слова что ш Пани прошу в ту комнату два словечка тебе скажу доволен будешь ж Пан врублевский со мной Телохранитель Пусть он идёт он даже непременно А ну марш куда твой душа моя в миг вернусь чем мог им служить хочешь 3000 деньги Вот бери и уезжай жи ржи поно Джи Слушай я вижу ты человек разумный бери 3000 убирайся отсюда ко всем чертям Ну только сейчас сю минуту и чтобы навеки А что у тебя там пальто шуба шапка есть Я вынесу всё сейчас же тройку заложен а поново доведение па а рубли а рубли поново вот как 500 руб сейчас в задаток а 2500 завтра в городе честью Клянусь будут Пани Ну и Земли чего 700 700 700 а не 500 прямо сейчас в руки Пани ты чего не веришь что ли в руки 700 Ну чего ты ну не дам же я тебе все три сейчас я дам А ты завтра опять воротишься к ней и что Да нет у меня 3000 Ну у меня дома там в городе где лежат Пан дома спрятаны ли жадны е Богу не поешь ещ чего грушеньки хочешь капнуть больше того плюш по-русски говори чтобы ни единого слова польского не было говорил же прежде по-русски неужели за 5 лет забыл па ае а негри по-русски говори или всё слушать не хочу Пани аграфена Я прибыл чтобы забыть старое и что было до пре сегодня простить но этот Пан Митя простить это меня-то ты приехал [музыка] простить я не малодушный я великодушный но я был им удивлён ших любовников Эй Пани Пани я не был её любовником как смешно меня пред ними защищать этот Пан Митя в тех покоях давал мне жи тынц чтобы я отбыл я плюнул пану в физи он тебе деньги давал Разве я продажная она чистая и сияет Мить Да не он с себя денег брал брал только он все 3000 хотел разом я ему 700 зада давал не бра Ну понятно Зачем ему 700 когда он прослыл что у меня больше есть затем и приехал венчаться Пани арепина я рыцарь я шляхтич а не Лайда ябл взять вас в супругу но вижу па Свон равную и Бесы что прежде Ну это что прежде А ты прежде такой был тот смеялся песнь мне пел тот был Сокол А это селезень Да это не он вовсе Это отец его какой-то я дура Проклятая ниска тебя 5 лет ждала всех мучила себя измучив вижу край родимой лесно было отдохнуть с подружкой [музыка] ми есть садом хозя прони ты глотку РВ Как говоришь скотина я скотина а в какие каты игра те задеть [музыка] Вот она моя колода запечатанная он её сюда сунул а своими подменил к [музыка] не А убира ты туда Откуда приехал в тебя прогнать и прогоняли шема курва [музыка] [аплодисменты] [музыка] доктори вызва ударом тяло скорее всего металлического предмета маврики маврики уже в мокрое уехали Отлично я послал станово в мокрое с тем чтобы до нашего прибытия держать преступника под наблюдением а то ещё и ВП застрелится А вот и этот предмет очевидно этим пестиком он проломил голову и своему отцу господа мы нашли на орудие убийства Короне бегала собачка руки толки хвостик хвостик за [музыка] короля Наро Нели [музыка] чка подарки Он и т он и носит дорогих подарки не [музыка] Ну что Ну яже ви ты не в себе Ну что Ну рассказывай как ты Как ты сюда приехал как Узнал от ты ко мне домой прибегал Да я там на кухне там Что что ну что ты хмуришься [музыка] тея оставил знать что выздоровит 10 лет жизни бы одно Да Бог с ним с больным Ты мне лучше скажи ты для меня на всё пойдёшь Да не сегодня завтра я тебе одно словечко скажу А ты сегодня хотел да [музыка] не точи ты бе кудрявый ты мою рассаду не точи ты бе куря ты мою рассаду яля тебя залила поливала яля тебя залила не поливала Дила ходила шло рушка рушка ила Иво своё но лево горо нане [музыка] Величка где больной когда начался припадок вчера батюшка вчера вчера вот как в погреб свалился так и началось прохладно господа записывайте конверт разорван надпись на конверте гостинчик 3.000 руб ангелу моему грушеньки Если захочет прийти успеваете и цыплёнок конверт разорван Хуст деньги похищены очевидно это те самые деньги на которые убийцы сейчас пьянству в мокром господа Да теперь у нас есть все основания произвести арест вы едете с нами или остаётесь здесь с раненым слугой я остаюсь с ним будет всё в порядке Но мне любопытно понаблюдать за другим слугой за эпилептиком понимаете такие длинные оед велика редкость приу всего он тут ра нето живёт А вот милостивые государи не государи попрошу смотреть Наш ведмедь пьяная колода медведя вода малину в малину залезает дево пугает мать его Дарья зовут его Марья медь у [музыка] ай он Мёртвый всё равно [музыка] лежит девки Давай целовать миловать А я начал оживать ди сходи печ чтоб никуда было [музыка] Пелет ко ля дено лет вот этому медведю а т пою й он ляже по клеть Ой он дома жи ко сотни лет [музыка] жи нам на не пойду [смех] масима [музыка] [музыка] [музыка] ты трин будь рядом чтобы не Приведи Господи да я Маврикий маврики с ним неотлучно а пистолет это я убрался Боже Живи поверну ведь делал ты чудеса Господи таких же грешников как и я Если старик жив я украденные деньги ворочу из под земли достану следов позора не останется кроме как мо всегда навеки сечас на эту ночь наве Мия даже минута любви сня с царицей Ты чего меня искал да Нет зачем мне вас разыскивать злишься гуляем поздно помилуйте Ради Бога это даже сколько угодно [музыка] спал ой Люде Люде на спал нас спас чуже ой Люде Люде поч полю люле своё жида туда-сюда о люле люле туда-сюда туда-сюда во все стороны о люле стороны йду Леле [музыка] мне ведь тогда 17 лет было сейчас ехала к нему и всю дорогу думала как встречу его что скажу как глядеть друг на друга будем вся душа замирала а он меня точно из Шаки помой окатил не узнала же его что ли Так испортила прежде таким же был Господи Прокляты Пусть тея ты сты ты какой [музыка] А слышишь Скажи мне кого я люблю я здесь одного человека люблю который Этот человек вот что Скажите мне вошёл давичи один сердце так шепнула дура вот ведь кого ты любишь вошёл всё светил Мить как это я дура Ну да подумаешь люблю другого после тебя прощаешь прощаешь меня Мити или нет Любишь любишь а Прости что мучила Я ведь со злобой всех мучила меть Сокол что ж ты не целуешь ты меня раз поцеловал и глядишь Слышишь ты что меня слушаешь та ты меня Целуй крепче вот так любить Ты ку любить Нет я так не хочу Вступай проще раба твоя буду раба на всю жизнь а сейчас вина Хочу напиться пьяное хочу ть пьяный плясать пойду [музыка] [аплодисменты] [музыка] люры не поду ты моя Почему я такая хорошая Я ведь очень хорошая вки [музыка] синие новые новые новые новые жее хола молода до нае рока хо дела молода до [музыка] нака заре навы навы Заре пускала зава из правого Рукава на пускала срала из правого Рукава на полки собони на кавала на полёт собони [музыка] не трогай сказала что твоя А ты не трогай пощади гнусно здесь послушен не мыслю благоговея Да гнусно здесь призрен надо чтобы это честно впредь будет честно и чтобы мы были честные добрые не звери а добрые увези меня слышишь не хочу здесь чтобы далеко-далеко увезу тебя всю жизнь за оди год отдам сейчас только бы не знать про эту кровь Какая кровь груша Вот ты хочешь чтобы честно я вор Я у Катьки деньги украл Позор позор Катьки э барышня А ты отдай у меня возьми от Дай Теперь всё моё твоё а её не люби больше её не люби тебя люблю тебя одну в Сибири любить буду начем Сибири что ж можно и в семир Если хочешь в себер [музыка] снег прекратить лю прекратить Дмитрий Фёдорович пожалуйте к нам сюда а а существует Настоятельно необходимость с вами объясниться старик старик его кровь понимаю господин отставной поручик карамазов я должен объявить вам что вы обвиняетесь в убийстве отца вашего Фёдора Павловича карамазова прошедшем в эту ночь [музыка] на [музыка] а [музыка] [музыка] [музыка] становись выводи раз раз раз два Т раз раз раз два [музыка] [музыка] стой [музыка] [музыка] вперёд шагом аш трогай [музыка] существует настоятельная необходимость вами объясниться господин отставной поручик карамазов я должен объявить вам что вы обвиняетесь в убийстве отца вашего ромаз Фёдору павловичу пришедшему в эту [музыка] ночь в этой крови я не повинен хотел убить но не повинен не я это я я винова это я его мучила и до того довела со злобы мое я и старика виновата я а ты виновата ты главная преступница ты разврат моё уж совсем беспорядок будет Михаил Макарович помешает следствию вместе судите нас казнить вместе с ним хоть на смертную казнь пойду примите меры меры примите груша жизнь моя святыня моя ой Господа Успокойтесь Дмитрий Фёдорович присядьте Да не верьте е не виновата она ни в чём а ну где что там ч разойдись Итак вы утверждаете что в смерти отца вашего вы не виновны виновен в крови Григория и оплакивают но не в крови отца нелепость невозможность вы напрасно Так беспокоитесь за слугу вашего Григория он несмотря на причинённый ему вами тяжкий побой жив жив жив и будет жить несомненно и врач в этом уверен жив Господи Благодарю тебя за Величайшее чудо я одну секунду это никак нельзя Господа Да я ж только на миг на мгновение сказать ей что смыта исчезла эта кровь что я не убийца Успокойтесь Господа вы воскресили меня это старик Григорий он мыл меня в корыте носил меня на руках когда меня трёхлетним ребёнком отец покинул вы считаете себя виновным или нет Ну погодите же Дайте вздохнуть не барабанный же [  ] человек ой Господа Немного пьян но я всё понимаю на мне лежит страшное подозрение ужас ужас я вам докажу Мы это в миг покончим тогда с вашего согласия мы запишем что возводимые на вас обвинение вы отклоняет виновен в нанесении тяжких побоев бедному старику виновен в глубине сердца винон это не написать эти глубины серд Каса Успокойтесь Ну в убийстве старика отца Ну это же дикая мысль Господа я вам докажу Да вы будете хохотать над вашим подозрением но вы же были в ссоре спокойным фёдором павловичем Вы же грозились его убить при свидетелях грозил и в Кили старца за Симы грозил и при свидетелях чуть не убил его подите если не то кто же кто же его убил то Господа я вас понимаю извиняю Ой да я и сам поражён А где он убит как убит мы нашли его лежащим на полу с проломленной головой [музыка] [музыка] что вызвало ваше чувство ненависти к нему чувство ревности ревность и не одна только ревность спор изза денег из-за денег спор кажется шл о 3 как будто не донных вам по наследству больше ше больше де Ну ято решился примириться на трх мне до зарез нужны были 3000 Господа вот эти вот 3000 у не под подушкой кото он приготовил для груше Я же Господа их считал шите на сво собственно Дем вы считали своею собственностью понимаю а я не боюсь улик сам на себя говорю Господа с вами говорит человек наделал ёз подлости норо митенька уда меры меры принять дмитри дмитри успокойтесь успокойтесь Зачем успокойте её Успокойтесь Дмитрий Петрович попрошу вас Успокойтесь [музыка] Прости фенн погорячился я виноват перед тобою башка Михал макач на пусти ты меня к не ну не Он убил отца изза меня страдать Дай мня словечко ему сказать прости христианская душа но нельзя тебе КМУ тый ты ему передай что был за меня спокоен и уден господа с вашего разрешения Дмитрий Фёдорович аграфина асановна послала меня сказать тебе чтобы ты был спокоен Михаил Макарович это против всех правил она у тебя умная добра Ты уж прости меня Михаил Макарович Что вы делаете и полит кич вы должны принять меры Так что передать ты ей будешь спокоен нет буду спокоен буду Ангельская вы душа Михаил Макарович вы передайте что я весел даже смеяться сейчас буду Вот только покончу освобожусь и сейчас к ней Пусть ждёт ждёт Пусть господа Я теперь вижу её с благородными людьми Да я вам всю душу сейчас открою Она же меня любит гордая и ни в чём не повинна я безобразная позорная [  ] она любит меня я теперь Уте Я теперь вполне ваш Господа Ваш Вы не представляете Дмитрий Фёдорович как нас ва эту готовностью ободряет а мы с нашей стороны употреби всё что от нас зависит Господа предоставьте мне самому тогда вам сейчас всё рассказать прекрасно и Рассказывайте Но сперва Подтвердите один фак нас весьма Любопытный а Верно ли что накануне этого убийства у Вас совсем не было денег и вы даже брали взаймы у Петра ильча хотина 10 руб заложил я ему пистолета за 10 руб в город воротился так и заложил А вы ездили за город Когда и куда именно я ездил здешнего купчине 3000 денег занима 3000 А почему именно 3000 так Господа погодите в 3000 долг отдать кому это я положительно отказываю сказать этот вопрос к делу не относится дол чести хотел отдать Позвольте записать что вы отвечать на этот вопрос отказываетесь сделайте одолжение у вас господа времени много а записывать милостивый государь Вы имеете полное право не отвечать на вопросы Но наше дело разъяснять вам вред который вы себе этим производите Ну Господа Прошу вас Дмитрий Фёдорович продолжать Итак вы пытались занять 3.000 купца гава вы от него их получили [музыка] ё [музыка] Итак столь необходимую вам сумму в 3.000 руб ни у купца галова ни у госпожи Хохловой вам занять не удалось Ох не удалось Я прошу это записать Вы подтверждаете что других денег Тогда при вас не было пишите пишите пишите пишите господа Это же самого Бога взт Ну это же не главное Я аж лаковой Выходя готов был скорее зарезать корону найти эти 3.000 добыть их из-под земли А вот эти слова зарезать хотел бы позволите записать знаком вам этот предмет вот Чёрт опять о не про то [музыка] э ж чем бежать к отцу и какую Вы имели цель вожа таким орудием какой це схватил побежал Однако не знаю собак темно на всякий случай А прежде Вы тоже брали Выходя ночью на улицу какое-нибудь оружие буквально невозможно гово пишите схватил пестик убил отца моего ударом по голове теперь довольны отвели душу Итак вы стояли с этим пестиком в руке у открытого окна вашего родителя И что же произошло Затем затем затем убил хватил ему в теме и раскроил ему чере Ведь так так по-вашему по-нашему Ну а по-вашему по-моему это было вот так груша груша грушенька аграфена Девочка моя ты где ты грушенька круша радость моя слава Богу аграфена альн Ах ты подлец Ах ты подлец слёзы личи мать ли моя бога умоли Я не знаю но Чёрт был побеждён я бросился от окна побежал к забору А ведь вы ни одному слову моему не верите Почему вы так заключаете потому что до главной дочки Я дошёл и убить хотел и пестик вынул и вдруг от окна убегаю Кто же это поверит поэма в стихах а не заметили ли вы отбегалась Какая дверь дверь дома была открыта А вы её нашли открытой Да а кто же её мог открыть А вот это Мы хотели бы у Вас узнать Дело в том дмит фч что убийство произошло не через окно а в комнате это несомненно Ясно из положение тела убийца в эту дверь вошёл и совершив убийство через неё же и вышел Да это невозможно я туда не входил а знаки были только мне и смерди кову без этих знаков старик никому бы в мире не отворил Какие знаки вот Какие знаки это чтобы отец Дверь открыл и смердяков мне их выдал А эти знаки были известны только вам и слуге смердяков ещё не бы и про небо Запишите Ну а если это так Дмитрий Фёдорович не смердяков ли заставил вашего отца открыть себя затем и совершил преступление смердяков болезненная курица Да и зачем ему убивать старика ведь он его Побочный сын вы это знаете да мы эту Легенду слышали но вы тоже его сы тем Мери убить подло ведь я же сам вам про это рассказал Ну не убил же спас меня ангел-хранитель мой что ж вы опять за своё то подло сам-то он что вам сказал смердяков могу я про это спросить мы нашли слугу смердяков без памяти в чрезвычайно сильном припадке падучей болезне Ну тогда старика убил Чёрт мы понимаем вы измучены Дмитрий Фёдорович и мы дадим вам отдохнуть Но сперва Расскажите нам про пистолеты зачем они вам вдруг понадобились чтобы здесь на рассвете пулю себе в башку всадить в кармане бумажку приготовил хотину написал читайте Когда вы господину хотину пришли за пистолетами у вас были вы не опасались подозрений А мне было ВС равно Господа я бы на рассвете застрелился вы бы ничего не успели сделать если бы отца не убили вы бы сюда не прибыли войдя господину хотину вы держали в окровавленный [музыка] Сай Но не скажу и очень се этим повредите знал Господа знал что тут ШИМ лбами но нельзя сказать и кончено но Можете ли вы по крайней мере объявить Какой величины была эта сумма довольно тода мым щиеся при вас деньги вот деньги читайте давай [музыка] [музыка] [музыка] [музыка] Митька тас Неси не видишь что ли лавки Плотников оставлено 300 руб хотину 10 его мальчику 10 ямщику 20 в карты проиграно 200 и максимову они 25 давали и максимову 25 всего вместе получается около полутора тысяч стало быть но вы говорили что вы привезли с собой 3.000 говорил А где остальные я должен теперь учинить подробный осмотр платья вашего Извольте карманы выверну необходимо будет снять одежду снять так так нельзя раздеваться прямо здесь хоть за занавеской Позвольте можете пройти за занавеску тоже рубашку снимать я вас во второй раз спрашиваю или нет снимать рубашку мы вас уведомим вы деньги ищете это ж прямо как с вором Ани как с офицером А это что у вас кровь кровь кровь Ипполит Кириллович взгляните тогда рубашку придётся у вас взять и носки потрудитесь снять шутите нам не до шуток Дайте принятым подписать акт осмотра мне тут голо что ли приказ те оставаться Вот другой сюртук это Ван Трифон Борисович жертвует не хочу одеваться в чужое Верните моё невозможно ваши вещи присоединили к собрание вещественных доказательств [музыка] [музыка] Ну что ж теперь пороть розгами меня начнёте больше уж ничего не осталось Дмитрий Фёдорович ваше нежелание разъяснить нам происхождение находившейся при вас суммы подталкивает нас к мысли что это из чего у вас перстень перстень Да вот этот на безымянном пальца С ломи какой это камень А это дымчатый топаз хотите посмотреть я сниму Неужели вы не понимаете если бы в самом деле я убил отца неужели бы я стал вилять лгать и прятаться Ну Дмитрий Фёдорович что вы меня муть тот кто Вол в дверь тот и уби [музыка] Я у нас есть свидетель который показывает что входили вы какой свидетель раненый вами Григорий он прежде чем заметить вас бегущего от дома к забору успела увидеть дверь открытую вздор Предъявите взгляните Дмитрий Фёдорович вам знаком этот предмет это тот конверт Да отцовский Ой это надпись вот цыплёнок вы видите 3.000 видите видим но денег мы в нём не нашли он лежал Разорванный на полу [аплодисменты] это смердяков Теперь ясно это он но вы же тоже про конверт знали я же не знал где он лежит но вы же говорили нам что конверт лежал у родителей покойного под подушки у нас это записано вздор я же на бум сказал что под подушкой Ну так говорят всегда деньги под подушкой А где конверт лежал знал Только он только смердяков Господа вы его арестуйте сре сре когда я отворил отец бы никому не отворил без знаков никому бы в жизни Дмитрий Фёдорович знаков никаких не надо было подавать дверь-то была уже отперта Ах дверь отперта Да это вздор Господа это Фантом Бог против меня Ну посудите сами дми с одной стороны это дверь а с другой стороны ваше ожесточённое умолчание насчёт происхождения денег Вот вы претендуете что мы холодные ценники и не верим в благородство души вашей но вникните в наше-то положение как мы можем Вам верить хорошо Господа Хорошо я Открою открою вам мой позор чтобы потом не винить ни вас ни себя вот и хорошо И поверьте Дмитрий Фёдорович что с ваше полное искреннее признание оно поможет об Господа эти деньги были мои подождите подождите Дмитрий Фёдорович но по вашему же собственному признанию денег у вас тогда не было вы же повсюду их пытались достать были мои были краденые мои и было их руб Да откуда вы их взяли ши и взял вот отсюда вот здесь они у меня висели зашитые в тряпку целый месяц краденые носил их здесь со стыдом и позором да кого же вы их Это присвоили у неё у Катерины Ивановны Верховцево у бывшей невесты мое украл да Я подлец что здесь сейчас о ней говорю но деньги от неё месяц назад она выдала мне 3.000 чтобы отослать её сестре Ну а я я в раковой час моей жизни полюбил другую здесь в мокром прокусил с нею половину этих проклятых 3.000 а вторую половину удержал удержал и носил здесь как свой позор А вчера распечатал помилуйте но месяц назад вы прогули здесь не пол а три а Кто считал что три так Вы же сами всем говорили что три Ну говорил ну прогул не три а полторы А другие полторы зашил в ладанку и носил Здесь вы кому-нибудь сообщили что оставили при себе половину суммы Да вы с ума сошли конечно никому но я не понимаю что побудило вас делать из этого такой секрет Как вы говорите позор всего лишь временное присвоение чужих денег а вовсе не кража поступок легкомысленный выше даже степени легкомысленной но не вовсе позорный вы не понимаете Почему позор Да нет Вы лучше Объясните нам Почему вы отделили эту сумму С какой целью Вы сохранили 15.500 ой Господа Я же вам не объяснил главного не объяснил это вы меня в миг поняли я ж подл груше думал что она мне нищеты моей не простит вон Отец ей в конверте 3000 приготовил А у меня два двугривенный и им Вдруг как устанет меня мучить скажет тебя люблю Ани его тогда что делать а Увози скажет меня на край света На какие деньги её увозить вот я отчитал половину эти и зашил иглой новта года с расчётом ещё до пьянства моего отчитал до пьянства Ну уж как зашил так и ну остальную половину пьянствовать подло поехал Дмитрий Фёдорович а помоему поступили вовсе не подло А даже благоразумны нравственно ну что удержались не всё проку ой Господа вы меня ужа сае Да вы поймите что со мной весь этот месяц творилось каждый день и каждый час я твердил себя Ты вор Ты вор от тогой свиреп от тогой дрался в трактире и отца избил от того что чувствовал что вор Скажите Однако дмит ч а велика ли была э как вы её называете Ланка на вашей шее бумажку 100 рублёвую в чате рас сложил вот он величину Зачем А куда вы её Дели спросил где именно Вы что смеётесь что ли надо мной Я не могу больше я не хочу я вижу что Вы не поверили мне ведь ни одному слову не поверили вы это будьте вы Прокляты они выпит ли нам чайку на душа моя ди [музыка] божи Дитё Боже [музыка] Дане неразумно Али знать грешно Ты душа [музыка] моя не покост да О О [музыка] весёлость как душам я Николай парфенович нев судебный следователь окружного суда до просив Дорина Дмитрия фдо в качестве обвиняемого внесени т [музыка] приведших к убийству Отца его дворянина карамазова Фёдора Павловича господа а с грушей то что она ведь ни в чём не виновата что вы с нею сделаете уте участи мы никаких мотивов пока не имеем благодарю Господа всё-таки вы честные и справедливые люди сам-то я пропал вижу пропал Но сейчас Вы сняли Бремя с души моей что теперь теперь что в тюрьму ты пусти давай давай давай потом потом Я пустил тебе душа продолжим так и нанесение тяжких телесных повреждений слуге Василию григорию и Принимая во внимание что обвиняемый не признавая себя виновным во возводимых на него преступлениях ничего в оправдание своё не представил а между тем свидетели обстоятельства его вполне [музыка] улича черо [музыка] [музыка] й не узду полой [музыка] тё [музыка] дитя сердце ди сердце го сердце чуе жы [музыка] S [музыка] [музыка] Чего плачет Дитё От чего оно [музыка] плачет от Чего плачет Дитё от чего она плачит чему [музыка] а [музыка] [музыка] [музыка] а [музыка] [музыка] [музыка] становись выводи 2 3 раз раз раз два три [музыка] M [музыка] стой вперёд шагом аш трогай [музыка] [музыка] вечер догора [музыка] [музыка] мойны модула на [музыка] нае и моё дитя сердце мои сердце мое сердце мое го [музыка] Чего плачет Дитё От чего оно [музыка] плачет от Чего плачет Дитё От чего оно плачет [музыка] [музыка] Дмитрий Фёдорович Дмитрий Фёдорович вам надо прочитать и подписать протокол я спал час более вам надо протокол прочитать Я не буду читать я так напишу Ага Готовьте я хороший сон видел Господа вот здесь я должен за вам постановление и Принимая во внимание что обвиняемый не признавая себя виновным во возводимых на него преступлениях ничего в оправдание своё не представил руководству статьями уложения о наказаниях постановил для пресечения карава зову дви фёдоровичу способов уклониться от следствия суда заключить его в тюремный замок о чём обвиняемому [музыка] объявить что ж господа вас не виню Господа я готов Маврикий маврики ВИЧ вас отвезёт да да пусть так будет принимаю муку обвинения всенародного позора моего пострадать хочу и страданиям очищу но са моего не повинен Господа вы добры гуманные Позвольте поститься в последний раз безусловно но уже нельзя ли в присутствии Прости меня груша за любовь мою сказала тебе что твоя и буду твоя пойду с тобой Навек куда бы тебя не решили [музыка] Прощайте божьи люди ну ни в какую не хочет ехать хоть ты Убей а а зачем нам вторая телега не бой не дозвольте тыкать я вам не ты Трифон Борисович Прощай Прощайте Дмитрий фич Прощайте прощай милый человек прощай жау [музыка] Какие же это люди какие же после этого могут быть люди [музыка] а [музыка] [музыка] е [музыка] с [музыка] [музыка] [музыка] Иван Фёдорович приступ подучи у смердяков ночь убийства несомненно вашим вопросом а он не притворялся нет припадок был и чрезвычайно Опасно Я даже боялся за его жизнь потом я принял меры он остался в живых но рассудок его отчасти расстроил так он что теперь сумасшедший что ли не в полном смысле но есть странность Благодарю вас можешь со мной говорить могу а ведь ты заранее знал что то что Той ночью случится Да кто же мог знать что ваш братец так себя поведёт я не про Дмитрия ты наперёд знал что в погреб попадёшь ты мне заранее предсказал что приступ случится когда ты в пог полезешь а вы в допросе это уже показали нет Ну покажу непременно А я суда всё уже господину следователь весь разговор ОЖ тогда же не передал А что ты ему передал Ну что я предчувствие заранее имел ты мне тогда предсказал именно день и час Так ведь я судо в погреб каждый день лазал и всякий раз как лазал я про вас думал что ты думал про меня что кроме вас я защиты от вашего брата ни от кого не имею А вы в тот день уехали а Дмитрий тебя обвиняет что ты убил и украл Да кто же поверить сударь после всех улик Да вы рассудите сударь сами Если бы я тогда в самом деле убийство задумал разве с говорил бы вам наперёд что в подучи представляюсь Заранее на себя самого такую улику сказать да ещё сыну родному Да вы суда этим показаниям меня только от обвинений напрасных защитите я не собираюсь тебя защищать дурак потому что вовсе не подозреваю тебя даже считаю такое подозрение смешным тебе не нужно ничего нет во всём благодарен Я скоро приду сударь Если вы следователь того разговора не сообщите то я не объявлю Что ты хочешь этим сказать что я твой сообщник [музыка] глупости глупости наконец-то прил Кофе хочешь Да я голод ф кофе и пирожков принеси меня с этими пирожками гм вышел что Опять с Да как не приду к нему так и поругаемся сегодня пиги на пол кинул растоптал Почему что случилось к поляку ревнует [музыка] супр тоже ревновала тебя кому горничным девушкам Да мол пирожки гла больше не дам те вре с этим вось то у меня дом какой бальный не стоя благодеяния ничтожен расточать тем кто нужнее меня А что поляк опять Денег просит теперь рубль просит сру [аплодисменты] потом до де опустился жалко стало отвезла ему там у них Алёш нищета бес кушине поляки сидят без дров теперь вот рубль просит только ревнует ты Мити нарочно как нарочно А ему всё равно что я к полякам хожу он [музыка] жен что о Только об этой Катьке мне говорит он же он же в глаза мне её хвалит доктора из Москвы для него Катька выписала адвокат самого первого чтобы его спасти Катька [музыка] позвала любит он её лш любит знает митинг что предо мной виноват Вот и ревность эту придумал дескать я с поляком так вот и он с Катькой нет Мить катерину Ивановну не [музыка] любит Ничего ты Алёшенька При всём уме своём не понимаешь любит он её Иван Фёдорович от неё к нему ходит как ходит мне мит рассказывал что Иван к нему ни разу не приходил проболталась Но разболталась скажу тайно он ходит втроём они что-то задумали Митя говорит что секрет Да да Какой уж там секрет бросит меня Митин замыслил вот Весь секрет А мне врёт что Иван в Катьку влюблён ну Говори мне говори по совести реш меня правда это Иванов Катю Нет грушенька Скоро суд ите раздражён А любит он только тебя А доктор она ему зачем выписала как Эксперт они хотят вывести что он убил себя не помн вмешательстве не убил этому никто не верит показаний против него сложилось множество Алёш кобчик сходи пожалуйста Выведи у него что это за секрет такой чтобы уж знала я учись мою проклятую я секрет у него выпытывать Не хочу я схожу поговорю если он сам расскажет я скажу что тебе обещался сказать но каже мне что не тут другой здесь секрет Пока Прощай [музыка] брат Алёшка Алёша видел этого ракитина Зачем он к тебе повадился о статью хочет о моём деле написать с оттенком социализма деска тьме нельзя было не убить заедем был средой Алёш он мне всё объяснил что он объяснил а ты вообрази у нас в голове в мозгу есть такие нервы Ну это такие брат хвостики Ну и вот я посмотрю на что-нибудь глазами и они хвостики задрожать и Я мыслю потому что хвостики А не потому что у меня душа Великолепная наука то что я образ и подобия Божие это глупости хвостики А всё-таки богато Жалко ну и то хорошо химия брат химия как же спрашиваю без богато и без будущей жизни стало бы Теперь всё позволено А ты и не знал отвечает смеётся умному человеку всё можно умный человек умеет раков ловить брат опомнись скоро суд Я удивляюсь ходишь ты место дела говоришь Бог знает о чём Алёшка О чём говорить-то о смердяков что ли Фу не хочу о смердящий его бог убьёт вот увидишь брат аш молчи видишь я давно хотел тебе многое здесь в этих облезлый я брат в эти последние 2 месяца в себе нового человека ощутил воскрес во мне новый человек Алёшка Я всё думал зачем мне тогда приснилось Дитё в такую минуту это пророчество у меня [музыка] была за детй пойду потому что все за всех виноваты за всех Дитё потому что есть малые дети большие дети все Дитё за всех и пойду потому что надобно же кому-нибудь из за всех пойти я не убил отца но мне надо пойти принимаю Ты не представляешь Алексей Как мне теперь жить-то хочется и кажется столько во мне этой силы Теперь что всё поборюсь себе я есть в пытке корчу но есть в столпе сижу солнце вижу а не вижу солнце так знаю что оно есть А знать Алёша что есть солнце Это уже вся жизнь Алексей Ай чёрт Я всё вытерплю Я только без груши не могу убивает меня мысль о ней убивает она-то за что на себя такую муку примет она была у меня я знаю огорчил ты е у приревновал отпускай раскаялся повенчаемся а которых венчают или нет вот вопрос А без неё и не [музыка] могу Алёшка Я тебе всю эту тайну открою иди без тебя всё равно решиться не смогу и он бежать предлагает как бежать в Америку груши если меня засудить не могу а ну как её там ко мне не пустят что я без грушу под землёй с молотком Дай голову себе раздроблена с другой стороны совесть от страдания ведь убежал был путь очищения от верг от распятия убежал Алёша с тобой с одним Об этом можно говорить Ты один это поймёшь для других это глупость б Иван не верит у них с Катькой план Всё может устроиться и кто первый это выдумал Иван страшно настаивать так самое главное – это деньги есть 20.000 на Америку на 10 говорит мы Великолепный по Америку стро и мне не велел передавать тебе особенно боится что ты как совесть передо мной станешь но Неужели ты совсем не надеешься оправдаться Алёша Скажи мне полную правду как перед Господом Богом сам-то ты веришь что я убил или не веришь говори полную правду Не лги полную что ты всю правду говори всю Не лги ни одной минуты не верил что ты убийца Спасибо тебе Я боялся спросить Теперь ты меня возродил Ну иди иди благослови тебя Бог Ступай укрепил ты меня люби Ивана вперёд перезвон за мной [музыка] [музыка] э перез вперёд Эй мужик Здорово в школьниках будешь в школьниках брать в школьниках А что о тебя подут секут братец секут поди больно не без того э жиз что же у красотки намы наврали что нас секут не понимаешь Ты смуров по идее мужика школьника должны пороть Ну и что же я вам скажу что нас не порю с Нару надо говорить умеючи Здравствуйте перево Сиде Здравствуйте господин красотки я вас так долго ждал Илюша был к вам очень привязан до этого случая соба это не та собака не Жучка Нет я карамазов м объясню ВС дело Жучка я затем пришёл Илюшка как-то сошл с лакеем покойного вашего отца со смерд Да и тот научил его зверской шутке взять кусок хлеба воткнуть в него булавку и этой жучки бросить Ну та проглотила завизжала и пустила сбежать и пропала Да и он всё время повторяет что это из-за того что он Жучку Убил его Бог наказал и мы все на вас надеялись с какой стать на меня был слух что она жива то что вы её отыскивает и я тоже очень надеялся что вы именно эту Жучку привезёте отец даже ему щенка подарил надежду тешить его Ну мне кажется вышло хуже Но что Пойдёмте к нему только перезвон останется в сенях перезвон вперёд злым будет вез драже хоро Петька Петька Вот поф нуси иди о красотки Здорово здорово здорово здорово Здравствуйте здравствуйте здравствуйте милости просим гость дорогой гость долгожданный Вот и видно сейчас хорошо воспитанного молодого человека а то что в прочее это Наши гости один на другом въезжают а это как же мамочка один-то на другом Как же это а так и въезжают в синя сядет один другому на плечи да благород семейство и вдет Мамочка Это кто же так приезжает так вот этот мальчик на этом сегодня приехал а вот тот на том мамочка мамо присядьте с присядьте с это у тебя на у щенок Да чёрный нос значит из злых подрастёт придётся посадить на цепь он огромным будет с телёнка точно с телёнка с настоящего телёнка я нарочно такого отыскал самого злющее и родители вот тоже огромные вот вот это кот полу будут А вы с Алексеем фёдоровичем изволили прибыть Нет я с перезвоном у меня такая собака теперь перезвон а помнишь старик Жучку пропала твоя Жучка старик Ну как не пропасть После такой закуски А у меня зато перезвон лохматый как та жучка вот я его к тебе нарожный привёл не надо вы бы в другое время молодой человек Зачем в другой сейчас смуров отвори дверь это же Жучка чка А ты думал кто она тогда твой кусок не проглотила она его вынула только язык себе уколола вот от чего заезжала бежала и визжала А ты не думал что она совсем проглотила это жука жука господин красотки благодарю я её как разыскал затащил к себе спрятал на замок и всем наукам обучил что уш привез тебе стари это Жучка сюда Жучка сюда сидеть лежать Жучка умри Молодец Жучка Молодец Ух ты какая это здорово [аплодисменты] чка сидеть Старик я тебе ещё пушечка принёс ты у меня как-то видел просил посмотреть вот теперь она твоя можно выстрелить если не беспокоит дам можно господин красоткин Позвольте мне как с бывшему военному Извольте она заряжена да [смех] Каково вот это да вот это здорово а Подарите мне Подарите пушечка лучше мне мамочка а она всё равно что твоя пусть она у вас с Илюшей будет будет общая Нет я не хочу чтобы общая Я хочу чтобы совсем я не Илюшина Мам Мама возьми себе красотки Можно мне её маме подарить совершенно возможно [музыка] [аплодисменты] доктор от Екатерина Ивановна приехал доктор из Петербурга простите простите Господа старик Я не ухожу я на улице подожду Жучка вперёд до свидания проходите сда перез сюда сюда сюда проходите я давно хотел с Вами познакомиться карамазов Я слышал что вы были в монастыре что вы Мистик но это меня не остановило что вы называете Мистик Ну там Бог и прочее А разве в Бога не ве напротив Я считаю что он нужен для порядка но я социалист Рома я Неисправимый социалист я конечно не против это была вполне гуманная личность и жив в наше время он непременно примкнул бы к революционерам играл бы видную роль кто же вам это наговорил с каким дураком вы связались вовсе не с дураком Я часто разговариваю с господином ра что повторяете этот грубый вздор и по делам вы меня Рае я во многом подли Да нет я подле что не приходил сюда Раньше я очень смешн да не думайте Вы про это почти все люди со способностями ужасно боятся быть смешными над вами никто не смеётся что делать Я не бог скоро это Скоро приготовьтесь ко всему батюшка ваше превосходительство ради Христа Неужели его ничего не спасёт не от меня зависит Если бы вы могли отправить вашего сына в сиракузы Илюше сиракузы сиракузы – это в Сицилии в Сицилии батюшка ваше превосходительство какая сицили А семья А маменька что поделаешь [аплодисменты] доктор доктор вы же видите Какая Сицилия M [музыка] [музыка] [музыка] батюшка батюшка башка бабочка Не плачь люшка Доктор сказал будет здоров Все мы будем счастливы папа не плачь Когда я умру Найди себе другого мальчика Выбери самого хорошего назови его Илюшей И люби его вместо меня папа о меня не забывай никогда ходи ко мне на могилку вечером и Жучку с собой приводи жа я вас там буду ждать Старик я вечером приду и Жучку возьму нь шека я хочу я хочу другого мальчика Господи я [музыка] а [музыка] [аплодисменты] [музыка] [музыка] [музыка] становись выводи два три Раз раз раз два ри [музыка] [музыка] стой [музыка] [музыка] вперёд шагом трогай [музыка] [музыка] жарко у тебя Ну так снимите а первы хони ли мы тут не услышит нас оттуда никто ничего не услышит Вили сени Послушай голубчик что это ты тогда сморозил такое когда я уходил у тебя из больницы что если я промолчу о том что ты мастер притворяться в падучей то и ты следователь всего расскажешь о нашем разговоре с тобой у ворот что это такое всего а то самое я тогда имел в виду что вы зная наперёд про убийство родителя вашего жертву тогда его оставили вот что тогда обещал и начальству не Объявлять Да ты в уме или нет совершенно в полном своём уме Да разве я знал тогда про убийство говори смердящий жер стыдно судар слабого человека обижать Так ты стал быть подумал тогда что я Заодно с Дмитрием хочу отца убить нет чтобы убить нет этого ни за что не могли Да и не хотели А вот чтобы кто другой убил это вы хотели мысле ваших тогдашних я не знал а потому и остановил вас тогда чтобы на этом самом пункте вас испытать что испытать что А вот это самое Хочется Вам или не хочется чтобы ваш родитель был поскорее убит это ты его убил что не я убил это Вы хорошо сами знаете и думал я что умному человеку и говорить об этом больше чего Стал быть по-твоему я брата Дмитрия тому и предназначался не захотите Сами как самый умный человек вы на брат Дмитрия непременно тогда рассчитывали да если бы я тогда Я рассчитывал на кого-нибудь так уж на тебя Да я тогда тоже подумал на минуточку одну что и на меня тоже рассчитываете подлец ты так понял А на что вам было тогда соглашаться если в Москву поехали без всякой причины по единому моему слову так стало быть чего-либо от меня ожидали если не избил тебя сейчас До смерти единственно потому что подозреваю тебя в этом Преступлении и прит к суду лучше молчите вам всё равно никто не поверит только если начнёте то и я всё расскажу думаешь Я теперь тебя боюсь Пускай моим словам что Вам теперь говорил в суде Не поверит Зато в публике поверит И вам стыдно станет Это опять-таки что с умным человеком и поговорить любопытно Да в самую точку вот умным и будь [музыка] Как хорошо что я вам отказала и не буду вашей женою вы не годитесь мужья я за вас выйду а потом дам вам вдруг записку чтобы снести тому которого полюблю после вас и вы непременно же отнесёте Ведь так Да я вас не уважаю и если бы уважала то не говорила бы вот так вот совсем вас не стыдясь Ведь так так А верите вы что я вас не стыжусь не верю Скажите зачем вы меня звали Сегодня я хочу вам объявить о своём желании Я хочу чтобы меня кто-нибудь дети лет 12 которые хотят что-то зажечь и зажигают Это вроде болезнь А я прочитала что [  ] на Пасху детей крадут и режут это правда не знаю А я прочитала что режет я прочитала что жит четырёхлетнему мальчику сначала все пальчики обрезал на ручках а потом распял его гвоздями к стенке а потом на суде сказал что он стоял любовался им и это хорошо хорошо хорошо Я когда читала Я думала что будто это я его распял он висит и стонет А я сижу против него и ананасный компот ем я люблю ананасный компот А вы Я когда эту ночью прочитала я с утра одному человеку послала письмо чтобы он пришёл и он пришёл и я ему рассказала И про мальчиков и про ананасный компот и про то что было хорошо а он засмеялся и сказал что ты и в правду хорошо а потом встал и ушёл он мне не поверил он меня презирал этот человек очень болен Лис он никому не верит а коль не верит то и презирает и меня и вас Ну и хорошо что презирает и мальчики с отрезанными пальцами тоже хорошо и в презрении жить хорошо Я не хочу жить потому что мне всё гадко всё гадко Алёша Почему вы меня не любите нет люблю И когда я погибну вы будете обо мне Жалеть буду будете Спасибо А другие Пусть меня растопчут ногами потому что я никого не люблю слышите никого Я всех ненавижу а теперь ступайте КК своему брату во срок ступайте [музыка] ступайте Да стойте же да да это ему Ивану фёдоровичу и передайте непременно Иначе я травлю я вас за этим и [музыка] звала подлая подлая подлая [музыка] [музыка] [музыка] убил Дмитрий но математического доказательства этому нет А если убил Не Дмитрий а смердяков то тогда Успокойся Что Тогда Тогда Тогда и я убийца Да что с тобой Иван ты не мог предвидеть что случится ты был сегодня у врача ты ни в чём не виноват если докажет что убил Лакей виноват смердяков не убивал тебе нужно математическое доказательство Вот оно что это это письмо который написал Дмитрий в тот самый день когда эта женщина оскорбила меня он писал пьяный Сидя в трактире видишь Она на трактирной счёте Роковая Катя завтра достану деньги и отдам тебе 3.000 и прощай любовь моя завтра буду доставать у всех людей а не достану то даю тебе Честное слово пойду к отцу и пролом ему голову и возьму у него под подушкой Прости меня ибо другую люблю отца убью и себя погублю чтобы гордости твоей не выносить Прощай вырву У него три и брошу тебе ноги твои целую раб и враг д карамазов ты это никому не показывала нет этого нельзя показывать Это это улика против него нуно это ведь то самое математическое доказательство которое ты так хотел получить Да как же ты ненавидишь его Да ненавижу ненавижу не за твои возвраты к нему гад нет я вижу его не вижу с каждым днём всё сильнее и сильней но не ты причина не ты а то что он убил отца Я всё равно не оставлю его Иван никогда слышишь Я никогда не оставлю его а это ты ты к ней не советую Иван Фёдорович воротись ещё на минуту я более одной минуты не останусь Алексей Фёдорович вы были у Дмитрия Да я был у него Что же он велел мне передать только одно чтобы вы не показывали На суде ничего что было между вами вначале а он хочет чтобы я пощадила а кого я должна пощадить себя или его и себя и Тото вы меня ещё совсем не знаете Алексей Фёдорович вы может быть после завтрашнего допроса меня ногами растоптать захотите вы покажете честно А Только этого и надо а женщины часто бывают бесчестно и потом я не знаю он ли убил Ты же всё знаешь Нет это ты меня убедил что он от ты убедил А я тебе поверила Ну довольно я пойду ступайте за ним немедленно он помешанный вы не знаете мне Доктор говорил он помешанный он в горячке не оставляйте его одного [музыка] Иван чего тебе она действительно права ты болен А ты знаешь Алексей Фёдорович как сходит с ума нет но полагаю что есть разные виды су Маша а над самим собой можно наблюдать что сходишь с ума Я думаю нет Вот тебе весьма а это 16 лет ещё нето уж предлагается как предлагается известно как как развратные женщины предлагается Иван Что ты делаешь Я не мог тебе не передать её письма но это же ребёнок ты обижаешь ребёнка если она ребёнок ей не Нянька и молчи Об этом я даже не думаю я о той думаю всё время думаю она же теперь всю ночь будет молить Божью Матерь чтобы указала ей как поступить завтра на суде губитель или спасительница теньки явиц она любит те брат может быть только я до неё не охотник Зачем же ты подавал ей надежду Да потому что ложь тут всё ложь на лжи если Я разорву с не теперь она из мщение ко мне погубит этого негодяя завтра на суде потому что она его ненавидит и знает что ненавидит А пока я с ней не разорвал она не станет этого изверга губить знаю как я хочу вытащить его из беды Чем же она может его погубить Вы что не документ есть собственноручной митинг доказывающие что он убил отца такого документа быть не может потому что убил отца не он а кто же ты сам знаешь кто это басня то об этом помешанность нерд кове что ли ты сам знаешь кто кто Я знаю только что отца убил не ты не ты что это такое не ты не ты убил сам знаешь что не я Ты бредишь ты сам говорил себе что убийца Ты когда я говорил когда я в Москве был когда я говорил ты говорил себе это много раз когда оставался один Ино убил не Ты слышишь меня не ты убил Брат ты моему слову поверишь я на всю жизнь тебе говорю что убил не ты это Бог послал мне наду чтобы я тебе сказал Алексей Фёдорович я Посланников божиих не терплю а пророков тем боле с этой минуты разрываюсь с вами всегда [музыка] павл Фёдорович очень на больный почти как не в свое уне буяни что ли напротив совсем тихие я к тебе с одним только вопросом была ли у тебя ронь Катерина Ивановна не уйду от тебя без ответа Ну да вы Кажись больны лица на вас Нет оставь моё здоровье говори о чём спрашивают была ли она здесь и спрашивала ли обо мне мучаетесь что ли очень вишь руки доходят чего у вас пальцы трясутся вступайте домой не Вы убили Я знаю что не я знаете Ты что хочешь сказать говори всё гадина говори а вот вы-то и убили Коли так опять опять про тот наш разговор не надоест жей человек с глазу на глаз сидим чего Вы кажется комедию играть или свалить на одного меня хотите Вы убили вы главный убийца е есть а я только слугой вашим верным был и делай это по слову вашему и совершил ты совершил Да разве ты убил испугались ты врёшь мня убил ты или сумасшедший или дразнишь меня вот смотрите сумашедший сумасшедший вот что это 3000 хоть и не считаете все здесь [музыка] примите Да Разве вы до сих пор не знали не знал не знал я на дмитрие всё думал а ты с ним с братом убил или один всего только с вами вместе с вами убил а Дмитрий Фёдорович ни при чём голова что-то болит что это я драж весь раньше смелые были всё дет сказать позволено говорили теперь вот как испугались говори говори как это было об том как это было сделано а самым естественным манерам с ваших Тех самых слов только Дмитрий ты убивать отца не пойдёт он сейчас мог его убить в вступлении как дурак мог а сознани убивать и грабить не пойдёт а если ему деньги до последней надобности понадобятся ко всему Тому если только графен Александровна захочет она не вашего брата а Фёдора палоч себе женит тогда ни Дмитрию фёдоровичу ни вам с Алексеем фёдоровичем ничего После смерти родителей не достанется ни рубля а умри ва Родите тепер Пока ничего этого каждому из вас по 40 сся верных достанется И это всё до подлинно Дмитрию фёдоровичу известно и кто его удержит если к примеру у меня падучая а Григорий Васильевич от поясницы бальзам ком лечится и спит после сего лечения как бревно зачем же я в чермашная Совершенно верно как уедете так и произойдёт видишь Москву ер значит Правильно говорят люди что с умным человеком и поговорить приятно какой же Я подлец вы уехали я в погреб упал притворился понятное дело притворился с лестницы сошёл в самый низ лёг и завопил [музыка] [музыка] и в больнице потом притворялся Нет На следующий же день на утро ударил настоящая такая сильная что уже много лет такое не бывало а в ту ночь что было ночью не спал стонал тихо и Дмитрия Фёдоровича ожидал как ожидал к себе Зачем к себе К папаше знаки То я сообщил я ожидал что он ёдо пал бью стой стой если бы он убил то он взял бы деньги что же тебе досталось бы так ведь деньги Он бы никогда не нашёл Это теперь все поверили что он их под подушкой хоронил а конверт этот Фёдор Павлович в угол за образа положил Я путаюсь Я путаюсь Значит ты только деньги взял а убил Дмитрий не Я бы мог вам сейчас сказать что он убийца Да не хочу м теперь в глаза доказать что доказать что главный убийца Здесь вы А я только самые не главный хоть это я убил Вы самый законный убийца и есть Почему почему я почему я о боже о боже Нет это потом потом Продолжай дальше продолжай про ту ночь дальше что же лежу я и слышу Григорий Васильевич поднялись и вышли и вдруг завопил а потом всё тихо мрак Я встал сердце колотится гляжу Григория Васильевича у избе нет и тут же я порешил всё это сейчас и покончить а [музыка] [музыка] где она грушка где так там она там она из кабинета ей [музыка] крикните Ну где она там во окно Да вон посмотрите как же на Ну ничего не вижу я испугалась Да вы крикните да вы крикните ру [музыка] Ну тут схватил я пресс по пье что на столе у них ну и в самой теме его и в другой раз и в третий вернулся на кровать и думаю если Григорий Васильевич не умрёт он будет свидетелем что Дмитрий Фёдорович приходил А что если умрёт Ну и начал стонать чтобы марф [музыка] разбудить а дверь если отец дверь тебе отворил то как же до этого мог григори видеть её отворю насчёт двери-то григорию Васильевичу почудилось это уж нам с вами счастье такое выпало что прове приду этой Дмитрия Фёдоровича его лечат Ну значит тебе сам Чёрт помогал но я не подбивать тебя вовсе не подбивает быть я имел Тайное желание чтобы отец умер но я тебя не подбивать я завтра на суде скажу Всё скажу сам Ну мы туда пойдём вместе с тобою ты должен во всём сознаться а не пойдёшь я один сознаюсь Да ничего этого не будет не пойдёте Вы слишком стыдно вам будет Да и нет у вас никакого доказательства А эти деньги а на судья скажет что вы свои деньги шкатулки взяли Да и принесли а что же ты мне их теперь отдаёшь если из-за них убил была такая мысль что Коль Бога нет И всё позволено Я с этими деньгами жизнь начну в Москве или за границей вот рассудил а теперь что в бога что ли уверовал коли мне их отдаёшь нет а вы-то сами что учили меня что дескать всё дозволено А теперь сами на себя показывать идти хотите только не пойдёте вы если я не убил тебя сейчас то единственно потому что ты мне нужен завтра на суде А что ж Убейте Убейте теперь Ну не посмеете ничего не посмеете прежний смелый человек примите деньги-то я их завтра на суд покажу Постойте Покажите мне их ещё раз Прощайте до завтра [музыка] [музыка] C а [музыка] стреляю свою жизнь собственной волей охота чтоб никого не винить а ah [музыка] [музыка] [музыка] а [музыка] [музыка] [музыка] [музыка] [музыка] становись выводи раз раз два 3 раз раз раз д [музыка] три пош а [музыка] [музыка] стой [музыка] вперёд шагом аш трогай [музыка] Иван Фёдорович А завтра Завтра не нужно до завтра галлюцинации в твоём состоянии очень возможны говорил же доктор Что необходимо начать лечение не теряя ни минуты не то будет плохо Послушай ты извини я только чтобы Напомнить Ты ведь к смердяков пошёл чтобы узнать про катерину Ивановну А ушёл ничего о ней не узнав Да я забыл Впрочем это я сам сейчас должен был вспомнить что ты выскочил Так я тебе и поверил что это ты мне подсказал не я сам вспомнил а не Вер Что за ве насилием Вере никакие доказательства не помогают особенно материальные тот цвет и материальные доказательства люли и наконец если доказан Чёрт то Ещё неизвестно доказан ли бог вот лишь лишь такое я иногда даже угадываю пото что это я же сам говорю я сам не ты мне только стыдно что-то Я хочу ходить по комнате вот я сечас обмо полотенце холодною водою вожу голове и ты Ишь Ой как мне нравится что мы с тобой стали наты дура Я тебе выну говорить что ли тебя нет Ты моя болезнь ты моя тень вальщик Я прива США Арман кто же я на земле как не приживалка Кстати а ты меня помаленьку в самом деле начинаешь за нечто принимать а не только за фантазию ми реальну правду Ты моя галлюцинация галлюцинации Ну ты на Алёшу Дави скинулся ты от него узнал как ты узнал что он ко мне ходит Это ведь ты про меня спрашивал стало быть на Одно маленькое мгновений ведь верил же верил что е действительно е да это была слабость смеёшься хороший знак Сегодня ты со мной гораздо любезнейший и принеси себя в жертву это благородно это прекрасно молчи дурак сейчас пинков тебе надаю отчасти буду рад коленки значит веришь в мой реализм Ты вчера к доктору ходил что доктор ты сказал дурак опять дурак Я как-никак поши ангел и людей люблю Ты любишь искренно люблю и мне нравится когда я к вам как сейчас переселяют там всё какие-то неопределённые уравнени А у вас тут вот ой формула геометрия всё очерчена Ой как я люблю ваш земной реализм Я здесь все ваши привычки принимаю я мо може себе представить в баню полюбил ходить с купцами и попами париться и ты знаешь моя мечта поплатиться Ну чтоп уж окончательно безвозвратно какую-нибудь я такую толстую семи подовую купчихи всему поверить чему Она верит чтобы войти в церковь и свечку поставить от чистого сердца Ей богу так вот тоже лечиться Вас полюбил оспу себе привил о ревматизм замучил Ах ревматизм чёрта я сатана сумт михиль хуману амы Алье нум путо как как я сатана ничто человеческое мне не чуждо раньше мне эти слова в голову не приходили Это не мои мысли твои твои Твои Твои тво тво твои Твои Твои Так о чём шь я да да да да ревматизм это Я простудился не у вас А у нас там где там в пространстве в эфире ведь это знаешь какой Мороз можешь себе представить 150° ниже нуля известна Забава деревенских девок на тиграном морозе предлагают новичку лизнуть топор язык мгновенно примерзает и Олы в кровь сдирает с него кожу так Ведь это только на 30° а на стато п палец Я думаю Приложи к топору его как не бывало если бы только там мог случиться топор А там может случиться топор топор Ну да что там Станется с топором что Станется в пространстве с топором примется Я думаю летать вокруг Земли сам не знае зачем в виде спутника ври по умнее а то ведь не поверю что ты есть нет нет не я не вру я не вру всё правда К сожалению правда почти всегда не остроумно не философствует осёл а это какая тут философия Ох ты когда ревматизм Опять ты сердишься Ты вечно сердишься Тебе бы всё только ума а я опять-таки повторю тебе что я отдал бы всю эту надзвукового душу семи пудовой купчихи и Богу свечку ставить Бог есть или нет голубчик мой ей богу не знаю Я мыслю Следовательно Я существую это я знаю наверное а всё остальное что вокруг все эти миры Бог даже сам сатана всё это не доказано Существует ли оно само по себе или только моя эманация последовательное развитие моего я всё всё прекращаю прекращаю прекращаю [музыка] [музыка] [музыка] почему же душа моя могла породить такого лакея как ты А друг мой Я знаю одного милейшего русского ту автор поэмы Великий Инквизитор молчи Молчи молчи я тебя сейчас убью сам считает меня за сон и сам же хочет убить Ой как я люблю мечты пылких трепещущий жаждой жизни мыслителей о человеке которому всё позволено там Новые люди решил Ты когда писал свою статейку они полагают разрушить всё и начать с антропофагия глупцы меня не спросили А по-моему И разрушать ничего не надо а надо всего только разрушить в человечестве идею о Боге с этого и надо начинать раз человечество поголовно отре от Бога то само собой пойдёт Всё прежнее мировоззрение А главное вся прежняя нравственность ой наступит всё новое и свободные люди возб лишь здешний мир и совокуп чтобы взять от жизни ВС человек возвеличивания наслаждения небесных мило вопрос толь ког ты лет мне наступит А вот и подумал юный мыслитель А что если мне уже сейчас стать человеком Богом пусть даже одному в целом мире и перескочить всю прежнюю нравственную преграду ведь для Бога не существует закона А всё дозволено и шабаш Вот это уже глупо Алёша и с самым неожиданным известием чего тебе я же велел не приходить смердяков [музыка] повесится Алексей [музыка] фетч хозяйка пришла самовар прибрать а он там висит настали записка истребляют жизнь собственную волю и охотою Чтобы никого не винить я к исправник сходил а потом к тебе сразу побежал Брат ты смотришь на меня как будто не понимаю что я тебе говорю Это хорошо что ты пришёл Я знал что он повесился От кого же не знаю от кого но я знал Знал ли я да знал а это он мне сказал кто он а Который час 1200в б ты в бреду он тебя испугался тебя чистого херувима тебя Дмитрий тоже чистым Херувим зовёт Да Про кого ты говоришь Кто здесь был Чёрт повалился ко мне Дрю такой Мелкий Чёрт он в бане ходит Алёш ты азп ты в снегу был да Хочешь чаю А А знаешь у меня теперь бывают сны такая не не сны а наву я хожу говорю вижу а сплю Давай мокрое полотенце к голове может быть поможет Давай я тут его давичи где-то бросил тут его нет я знаю где он вот он Постой Нет постой постой я же его час назад давичи оттуда взял а так яже Алёша Я завтра на суде за Катю боюсь больше всего за неё боюсь она меня завтра просит расту чить ногами она думает что я из ревности гу блю Дмитрия Да она так думает так вот нет же нет завтра крест но не веселится я жизни себя не лишу нет нет нет да почему я знал что смердяков повесился а так это же он мне сказал Да ты убеждён что он тут сидел да вот тут передо мной он исчез как ты появился Алёша он это я я сам всё моё самое низкое самое подлое и презренное Он смеялся надо мной о ты идёшь совершить подвиг добродетели Ты объяви завтра что убил отца что Лакей по твоему наущению убил отца брат удержи Это не ты убил это неправда Нет он знает он знает Ты идёшь совершить подвиг добродетели А в добродетель ты не веришь Луч что тебя злит и мучит это он мне про меня говорил это не он говорил это ты говорил будучи в болезни в бреду себя мучи Нет он знает что говорит он знает ты говорит идёшь из гордости для принципа Ну вот повесился смердяков умер Ну и кто ж тебе это судит теперь-то поверит [музыка] Для чего ж ты туда потащишь если жертву то ни к чему не [музыка] послужит но я бы много дал чтобы узнать самому Для чего я иду пойду не пойти не смею но Вот тебе загадка Угадай за Катю боюсь больше всего закати боюсь завтра закати боюсь [музыка] закать Бог применит [музыка] Встать суд [музыка] идёт прошу садиться рассмотрение окружного суда с участием присяжных заседателей подлежит дело об убийстве помещика Фёдора Павловича карамазова В чём обвиняется как предумышленное виновник господин карамазов в сели явились присяжный заседатели все присяжные на месте госпожа Хохлова не может быть вызвана по болезни и свидетель смердяков за внезапной смертью О чём есть свидетельство от полиции собаки собачья смерть подсудимый если повторится подобная этой выходкой я приму самые строгие меры Успокойтесь это не послужит в вашу пользу во мнении присяжных и публики я скажу я скажу Иван Иван подожди свидетель вы здесь под присягой при всей вашей почтительности к памяти Барина должны говорить полную правду Был ли покойный хорошим отцом и правда ли подсудимый в детстве был поселками в дворовой избе его малого мальчика без меня бывшие заели а он на меня посягнул грозил ли обиженный отцом подсудимый убить отца когда ворвался говорил что воротится и убьёт А в ночь убий Когда вы увидели в саду бегущего к забору подсудимого заметили ли вы открытую в доме дверь открыта была Дмитрий Фёдорович от неё к забору бежали а то что ударили меня так я не сердит и давно простил А мог ли по вашему мнению покойный Лаки смердяков украсть убитого деньги не мог не мог вопросов больше не имею из предварительного следствия Известно что в тот трагический вечер перед сном вы лечили свою страдающая сниц каким-то бальзамом или настойкой свидетель А могу я обратиться к вам с вопросом из чего состоял тот бальзам шалфей был положен только шалфей Подорожник тоже был и может быть перчик и перец пеку и всё это на водочке на спирту на спирту свидетель Скажите а вот нарев спину этим бальзамом оставшиеся содержимое бутылки вы выли не так ли Ну выпил А сколько не помните Ну рюмочку другую стакан будет за стакан Скажите а может полтора стаканчика а полтора стаканчика чистенько спирту ведь это ж очень недурно Как вы думаете можно даже райские двери увидеть не то что двери в сад свидетель Скажите а не Повали ли вы В ту минуту когда увидели отварную дверь в сад на ногах стоял доказательства могли вы ответить В ту минуту какой год у нас сейчас не знаю этого свидетель какой у нас год нашей эры от Рождества Христова свидетель сколько у вас пальцев на руке отвечайте поволи начальству угодно надо мной насмехаться то я снести должен защите следует задавать более подходящие вопросы Я свои расспросы окончил подсудимый имеете ли вы чего заметить по поводу данных показаний что в шее мне кроме двери всё правда ты нездоров тебя могут освободить я здоров я совершенно здоров брат [музыка] o p you Я видел у Пана в руках большие деньги А в какой момент Уважаемый Пан лович Вы видели у обвиняемого Деньги когда Пан Митя хотел купить мою честь Тони по шляхетский честь прекрасно Это очень возвышает вас В наших глазах но Раз уж речь зашла о честь Я позволю себе ещ один вопрос тут господин Максимов готов выступить с показаниями что во время карточной игры с господином Карамазовы вы подменили колоду это правда вопросов больше не имею Нет ну что же вы правда неудобно госпожа Верховцева Прошу вас в зал с моей точки зрения подсудимый как теперь так и прежде был совершенно нормален и Хотя перед арестом он находился в нервном и крайне возбуждённом состоянии то это было вызвано очевидными причинами гневом ревностью и беспрерывным своим ством Так что поведение подди никакого особенного аффекта Благодарю вас глав свидетель тю кович госпожа Верховцева Были ли вы половины невестой подсудимого до тех пор пока он сам меня не оставил А передавали ли вы ему для отсылки вашим родственникам 3000 руб Да но напрасно он так себя мучил из-за этого долго я передавала не прямо на поту я чувствовала тогда что ему оче нуж бы де Была уверена что он успеет переслать эти деньги эти 3.000 когда получит от отца Я всегда была уверена в его высокой честности в денежных делах Да и права Я не имела быть к нему требовательной потому как сама получила от него денежное одолжение большее чем в 3.000 это было в начале вашего знакомства Да мне тогда очень нужны были деньги чтобы спасти от бесчестия моего отца и я прибежала к Дмитрию фёдоровичу для того чтобы выпросить у него эти 4.500 готовая на всё и он отдал мне свои последние 5.000 Это всё что было у него в жизни и почтительно преклонил предо мной вопросов свидетельнице больше не имею госпожа Верховцева вы свободны господин карамазов Вы готовы дать показания вы нездоровы он выступит когда оправится Алеш тогда пожалуйте господин карамазов говорил ли вам брат ваш что намерен убить своего отца прямо не говорил а как говорил косвенно он говорил что в крайнюю Минуту Минуту омерзения он мог бы убить его и вы этому поверили поверил Но был убеждён что некоторые высшее чувства спасёт его в раковую минуту и оно его спасло он не убил Отца его убил смердяков почему же именно смердяков И как вы окончательно убедились в невиновности вашего брата Я по лицу его увидел что он мне не лжёт только по лицу и в этом все ваши доказательства более не имею доказательств вопросов больше не имею а не припомните ли вы Алексей Фёдорович Когда именно подсудимый говорил вам о ненависти к отцу Ведь вы это слышали от него при вашей последней встрече не так ли Да на последнем свидании а не помните как это было О чём ещё вы говорили с братом он говорил тогда что у него есть средство спасти честь свою вот тут на гди где он носит свой позор как быва на сердце но указывал не на сердце А куда он указывал вот сюда Я теперь вспоминаю что тогда мелькнула у меня мысль какая какая мысль мысль э показалась мне глупой что он указывает не на сердце а гораздо выше вот тут ниже шеи Я теперь подумал может быть он указывал тогда на эту ладанку в которой были зашиты именно ВС понимаю он тогда несколько раз выговорил слово половину по руб от 3 половину долга он мог бы отвести Катерине Ивановне но употребил их на увоз грушеньки слово позор означало что он может отдать половину долга но не отдаст вы ясно и твёрдо помните что он ударил себя именно в это место груди ясно и твёрдо Итак когда Дмитрий фдо примчался в мокрое него были эти и это были эти деньги а не деньги украденные у отца вопросов к свидетелю больше не имею попрошу вас ещё раз описать тот разговор с посу точно ли ударяя себя в грудь он на что-то указывал может быть просто бил себя мм указывал очень вот высоко вот сюда но как я мог это забыть до этой самой минуты что вы можете сказать по поводу данного показания так и было указывал на полтысячи бывший на груди моей и был это позорный шаг во всей моей жизни мог отдать но не отдал я остался в глазах её вором но не отдал прав Алёша Спасибо СБО Благодарю вас Алексей Фёдорович вызывается свидетельница Светлова как же я раньше не вспомнил как я мог забыть [музыка] [музыка] свидетельница слыхали ли вы от подсудимого о лежащем его отца конверте с трем сся рублей слыхала что есть у Фёдора Павловича для меня пакет только не от Мити от злодея Кого вы называете злодеем смердяков что Барин его убил А вчера повесился кае же ва основания Дмитрий фч мне сам говорил ему и верьте он не солжёт разлучница его погубила всему Одна она причина прошу объяснить на кого вы намекаете а на барышню на э катерину Ивановна она меня к себе зазывала шоколадом почивала льстить хотела стыда в ней нет Прошу вас умерить свои выражения свидетельница вы обвиняете в случившемся госпожу верховцеву но при аресте подсудимого вы кричали я во всём виноват вместе в каторгу пойдём я чувств моих тогдашних не помню то есть В ту минуту вы вери что он отц убийца Все кричали что он отца убил я и подумала что за меня убил А как сказал что не повинен я ему поверила всегда буду верить не таков он человек чтобы солгал вопросов больше нет господин карама готовы ли вы дать показания вы свидетель без присяги Вы можете показывать умолчать но всё показанное должно быть по совести Ну и что же ещё вы может быть ещё не так здоровы Не беспокойтесь ваше происходи я достаточно здоров и могу вам рассказать кое-что любопытное Вы имеете предъявить какое-нибудь особое сообщение нет не имею ничего особенного Иван Фёдорович господин карамазов Известно ли вам что-либо просчёты вашего отца с Дмитрием фёдоровичем мне Ничего неизвестно я не занимался этим А говорил ли вам брат ваш что намерен убить своего отца Я слышал это от него а слыхали ли вы от подсудимого Иван ч слыхали ли вы о конверте лежащем У вашего отца с 3000 рублей приготовленным для гражданки светлого в пакете слышал Дикова свидетель всё одно и тоже одно и тоже я не имею сообщить суду ничего особенного Я вижу его нездоровый и понимаю Ваши чувства больше исходите ство я покорнейше Прошу отпустить меня Я очень нездоров [музыка] Я ваше превосходительство получаюсь как та Крестьянская девка что ли которая говорит зацв с коцо за цо не с Кацо Что вы хотите этим сказать Ну это когда с сарафаном или понёва там что ли за ней бегают чтобы она вскочила и повязали её и венчать повезли а она говорит за хацу сцу за хацу не [музыка] сцу Вот вот те деньги которые были в конверте Вот деньги за которых убили отца [музыка] [музыка] на [музыка] [музыка] [музыка] [музыка] большое исходите сво я покорнейше Прошу отпустить меня Я очень нездоров Я ваше превосходительство получаюсь как та Крестьянская девка что ли которая говорит за хоц с коцо за хоц не в с коцо Что вы хотите этим сказать Ну это когда с сарафаном инво там чтоли за ней чтобы она вскочила и повязали её и венчать повезли а она говорит за хацу сцу за хацу не с концу Вот вот те деньги которые были в конверте Вот деньги за которых убили отца плать Каким образом могли эти деньги очутиться у вас если это те самые деньги получил от СПИД кова от убийцы вчера был у него перед тем как он повесился он убиваться брат не убивал Он убил а я а я научил А кто же не желает смерти отца А да вы в уме или нет даты и есть что в уме в подлом в таком же как и вы как все эти рожи сидят там кривляются друг перед другом если бы не был от убий они разошлись уже давно злые хлеба и зре Он болен не слушайте его он белый горячий Успокойтесь Господа Успокойтесь я не поме ну вы что я только убийца свидетель ваши слова непонятны и здесь невозможны чем вы можете подтвердить это признание а ну собака смердяков с того света не пришлёт мне показания в пакетике Нет у меня свидетелей А кроме разве что одного кто ваш свидетель Прошу прощения ше свидетельство не по форме будет свом Нет нет не волнуйтесь Не волнуйтесь не дьявол мелкий Чёрт набуде среди дост сти какие-то Давайте Берите меня ну что ну что вы стоите освобождайте изверга Давайте Берите меня Ну я же убил Ну Для чего же я сюда пришёл в чём дело уби же я ну берите же я убил Ну берите же почему так глупо всё [музыка] объявляется перерыв нет стойте я хочу сообщить ещё одно показание вот письмо Возьмите его и Прочтите немедленно Прочтите это письмо этого изверга вы сейчас увидите всю правду это он это он убил отца Здесь всё написано как он убьёт а тот тот другой он в горячке он больной и он не соображает что говорит я уже третий день вижу что он в горячке Вы можете говорить да Да да я вполне готова отвечать на ваши вопросы Прочтите это письмо вслух Роковая Катя завтра достану деньги и отдам тебе 3.000 и прощай любовь моя завтра буду доставать у всех людей а не достану то даю тебе Честное слово пойду к отцу и пролом ему голову и возьму у него под подушкой Прости меня ибо другую люблю отца ю и себя погублю Ноги твои целую раб и враг ты карамазов при каких обстоятельствах Вы получили это письмо я получила его накануне преступления ему тогда нужны были деньги чтобы чтобы соблазнить эту [  ] и увести её с собой я знала тогда что он уже что он уже мне изменил и собирается меня бросить но я сама протянула ему эти деньги а когда отдавала то я как бы спросила его так ли Ты бесчестие что возьмёшь И что же он он взял понял тогда что я всё знаю и всё-таки взял мои деньги и истратил с этой тварью правда Катя глаза смотрел понимал что бесчестие ь меня и всё-таки взял твои деньги презирай под лица все презирает подсудимый Ещё слово я велю вас вывести эти деньги его мучили Ох как мучили он же хотел мне их отдать правда хотел только ему деньги ещё нужны были и для этой твари вот он и убил отца А за день до того как убил написал мне это письмо пьяный был не пьяный бы не написал бы признаёте ли Вы что писали это письмо моё письмо моё не пьяное бы не написал за многое мы друг друга ненавидели Катя но Клянусь я тебя и ненавид любил а ты меня нет вопросов больше не имею Да что побудило вас утаить такой документ и показать его совершенно в другом духе и Тоне Да да я солгала всё лгала против чести чтобы его спасти а он меня презирал с той самой минуты когда я к нему за деньгами приходила и в ноги ему поклонилась Успокойтесь ради Бога Успокойтесь госпожа Верховцева мы понимаем как вам тяжело мы способны чувствовать но не могли бы в нам прояснить обвинения выдвигаемые против смердяков Да Иван Фёдорович болен Он мешается умом Я сама видела что он мешается умом А то что он обвинял смердяков так это он хотел спасти своего брата Я же показывала ему письмо и он убедился сам что убил Дмитрий но продолжал повторять что это он виновен в смерти отца его мучило совесть А третьего дня третьего дня его осматривал доктор по моей просьбе и он сказал что Иван Фёдорович близок к горячке А вчера он узнал что умер смердяков и это его так поразило что он окончательно сошёл с ума и всё это потому чтобы спасти своего брата этого изверга и убийцу Митя сгубила себя твоя змея вот она себя и показала сдержите аграфена Александровна Да действительно он приходил ко мне уже положительно не в здравом состоянии и ещё Он признался мне что в гости КМУ приходится там объявляется перерыв в заседании [музыка] Пусть он убил но о же был выступлении Я бы на месте защитника Так бы и сказала убил но не виновен оправдали же великим постом ту актрису которую же не любовника горло перерезала не доза же начала же резать [музыка] кто же совершил Это преступление господа присяжные зада в ночь преступления в доме убитого пребывала четыре человека Один из них убил слуга Григорий но его самого чуть не убили его жена служанка Марфа нуно её убийце Барина представить просто стыдно остаются стало быть два человека подсудимый и Лакей смердяков предположим что убил Лакей не имея мотивов какие были у подсудимого смердяков мог убить лишь из-за денег и что же замысливший пакет и главное эти знаки которыми к барину можно пройти Зачем сообщил если сам задумал убить и украсть мне скажут что от страху но как же так человек не смекнул неть такое бесстрашное и зверское дело и от страху нет Господа Уж если он задумал убить то ни за что бы не сказал подсудимому про деньги и как войти в дом повесивший он оставил записку Истре Сея своей волей и охотой Чтобы никого не винить нет чтоб прибавить убийца я а не карамазов он не прибавил он не признался в убийстве Господа Да потому что не убивал из четверых побывавших там в ту ночь убить несчастного старика мог только один его сын Дмитрий караманов в тот страшный вечер о котором сегодня так долго говорили Господа сын проник в дом отца и лицом к лицу столкнулся с его обидчиком и врагом не за деньгами Прибежал он сюда господа и не убить его ослепила ревность Он увидел отца ненавистник своего самого детства своего обидчика А теперь и чудовищного соперника и ненависть охватила его он не мог рассуждать Это был аффект аффект безумство аффект самой природы такое убийство не есть убийство господа и убийство такого отца не есть отце убийство Но если вы сочтёте его виновным то накажите его самым ужасным наказанием для русского сердца накажите вашим милосердием в ваших руках Господа судьба не только Моего клиента в них судьба всей Правды нашей русской вы отстоит её и докажете что её можно соблюсти и правда это в хороших [аплодисменты] руках господин карамазов не угодно ли вам воспользоваться правом последнего слова господа присяжные конец беспутному человеку слышу десницу Божью но в последний раз повторяю не я убил а докторам не верьте я в полном уме Коль пощадите лучшим стану помолюсь за вас те сам над головой свою шпагу сломаю и поцелую обломки Ну пощадите не лишите меня Бога моего тяжело души моя [музыка] пощадите присяжные удаляются для вынесения приговора [музыка] оправдают стыдно позорно будет не оправдать оправдают он Завтра весь трактир разнесёт праздновать будет [музыка] Встать суд идёт прошу [аплодисменты] Господа присяжные заседатели достигли ли вы решени Да ваше превосходительство виновен ли подсудимый в преднамеренном убийстве отца своего Фёдора павича Камаз Да [музыка] виновен как же [музыка] так Клянусь Богом страшною я [музыка] нено Катя прощаю тебя воды подайте воды воды воды суд удаляется для вынесения приговора 20 лет родничков не меньше [музыка] [музыка] да карамазов здесь ужасно Снегирёв не пьян но это ужасно я ре ночи не спал Я знаю про суд и прежде чем мы войдём Вы только скажите что ко ш брат виновен так и будет убил Лаки а брат невиновен Я тоже так думаю он погибнет невинной жертвой за правду Я готов ему завидовать Вот если бы и я мог принести себя в жертву за правду Ну не в таком же деле и не с таким же позар конечно но я желал бы умереть за всё человечество и вашего брата Я уважаю аюшка аюшка шка Дека Папочка Отдай мне цветочков он тот он беленький у него из ручки возьми и дай ничего не Да это его цветочки Они твои все его ни чтот его папа Дайте маме цветочек Я сказал не дам а а не дам она его не любила она тогда у него пушечка отнимал а он и подарил пора выносить не хочу не хочу не хочу градки хоронить я его Возле камешка похороню где мы с ним гуляли он так велел на дово оградки где крест по нему там молиться будут [музыка] да Ах ты Ах ты батюшка ты мой батюшка [музыка] у [музыка] [музыка] яко благи человека любит Бог Прости яко не человек же жив будет и не согреши ты бы Един кроме греха правда твоя правда Вове слово твое истина яко ты еси воскресение и живот и покой усопшего раба твоего новопреставленного Илии Христе Боже наш и тебе Славу восс со безначальный твоим отцем пре святым благим животворящий твоим духом ныне и присно и во веки веков Аминь а корочку корочку то забыли она у вас в кармане ичка велела чтобы воробушки прилетали я услышу говорил что они прилетели и мне будет весело что я не один здесь лежу Это очень хорошо Надо чаще носить каждый день буду носить каждый день Вот и прилетайте птички Вот и прилетайте воробушки Капитан полноте мужественный человек обязан переносить [музыка] ah [музыка] [аплодисменты] господа Это любимые рюшечки на место именно здесь на этом самом месте я вам хочу сказать одно слово я скоро покидаю город и мы с вами расстанемся согласимся же здесь на этом самом месте что никогда не забудем мальчика которого кидали камнями а потом полюбили и то что любовь это сделала нас намного сильнее чем мы есть на самом деле Если вы меня сейчас не совсем понимаете то ВС равно запомни Потому что одно такое Воспоминание в сердце возможно от великого зла нас удержит Я вас понимаю Рома это так и будет будем добрее и честнее и никогда не забудем друг о друге Илюшу никогда не забудем Кама А неужели вправ религи говорит все восстанем из им друг друга непременно восстанем и непременно увидим ура ромаз ура [музыка] Моё почтение Благодарю вас Алексей чу завтра я расскажу вам план побегов Иван Фёдорович уже обо всём договорился Дмитрий может бежать когда партию поведут в Сибирь на третьем этапе отсюда Иван ездил к начальнику этапа он говорил вам про побег Дмитрий Да Иван Нет ну конечно конечно он скрыл это от вас а мне рассказал 3 дня назад помните Вы застали нас в ссоре А вы знаете из-за чего Мы тогда поссорились из-за той твари опять из-за неё Иван Иван сообщил мне тогда план по которому в случае осуждения Дмитрий Фёдорович убежит за границу вместе с этой женщиной а я тогда обозлило на него Ну из-за того что она бежит за границу вместе с Дмитрием Он подумал что я ревную к ней А через 3 дня после этой ссоры он принёс мне запечатанный конверт с деньгами и с планом побега и сказал что если с ним что-то случится то дело о спасении он доверяет мне вам а кому же ещё он мог довериться вам вы бы сказали что это нечестно бежать или как это там не по-христиански что ли Вот он и выбрал меня а я а я дмитри суд предала Иван никогда не говорил что убийца Это Дмитрий это я это я сама убеждала его в этом во всём виноват мой ратер мой ужасный несчастный ратер И вот теперь после того как я митью передала он уже не согласится бежать онг Ну конечно ну конечно Как же он может эту [ __ ] оставить А в каргу ведь её не пустят вот он и вынужден бежать он согласится но вы должны к нему прийти он зовёт вас к себе куда он меня зовёт к нему в больницу он в арестантское палате сторож пропустит вас нет это невозможно Это возможно и должно вы нужны ему сечас именно сейчас нужны я знала Я знала что он меня позовёт к себе но я не пойду его руки чисты на них крови нет И ради будущего его страдания Вы должны посетить его появитесь на пороге и только вы должны это сделать должна да но я не могу Как же вы жить дальше будете если простить не решитесь Нет я не могу его оставить на минуту можете оставить я скажу Мите что вы принте Алексей Фёдорович слыхал мне тут сторож рассказал Трифон Борисович мокро к себе обратился весь постоял и двор разорил полови поднимает доски отдирать хва Ты по прокурор доказал что у меня всего три было Вот полторы Я где-то у него там спрятал [аплодисменты] ты грушу про побег сказал сказал Согласна и ты сказал кто Побег устраивает скривилась лицом но промолчала поверила Она наконец что Катя любит Ивана а не меня как он плохо очень плохо но Катя не сомневается что он выздоровит Митя ты должен бежать Убегу ра Мить как короно может не убежать Я никогда не [музыка] Чёрт дери уже теперь ненавижу пусть только игрушек будет со мной ну посмотри на неё на американка ли она что он я так я тебя слушаю Ашка заш прямо сеча придёт она или нет Говори что сказала как сказала сказала придёт Но сегодня ли трудно ведь ей [музыка] [музыка] простила не нужно тебе моё прощение а мне твоё не нужно Ты всё равно язвой в сердце моём останешься на всю жизнь а я в твоём на всю жизнь [музыка] Катя прошла любовь Митя а то что осталось то до боли дорого мне ты теперь другой любишь и я другого люблю а всё равно тебя вечно любить буду а ты меня будешь Знал ли ты это Любить люби меня Митя всю твою жизнь люби [музыка] меня знаешь Катю знаешь я тебя и На суде любил Когда ты кричал что я убил Катя ты веришь что я [музыка] убил теперь вижу что нет что не веришь А на суде верила что я убил никогда не верила ненавидела [музыка] тебя не могуш я ещё к тебе приду А сейчас не могу [музыка] тяжело прости меня злы Мы мать с тобой обе злы г уж нам простить ты Тебе да мне спасёшь его всю жизнь молиться на тебя буду будь покойно спасу его тебе и ты могла е не простить После того когда она сама тебе сказала прости ми не упрекай её права не имеешь Уста её говорили гордые а не сердца избавить тебя от каторги всё прощу стой [музыка] вперёд шагом аш трогай [музыка] [музыка] я буду большой я тоже буду большой [музыка] [музыка] истинно истинно говорю вам если пшеничное зерно падшее в землю не умрёт то останется одно а если умрёт то принесёт много плода от Иоанна глава дя стих два чет [музыка]

    By Amjad Izhar
    Contact: amjad.izhar@gmail.com
    https://amjadizhar.blog

  • Python App Development: Build Modern GUIs PyQt GUI Development: Building Interactive Applications

    Python App Development: Build Modern GUIs PyQt GUI Development: Building Interactive Applications

    The provided text offers a comprehensive guide to building graphical user interface (GUI) applications using the PyQt framework in Python. It begins by introducing fundamental PyQt concepts like widgets, layouts (rows, columns, grids), and the framework’s modular structure. The text then progresses through building several example applications, including a random word generator, a functional calculator, an interactive photo editor leveraging the PIL library, and an expense tracker integrating SQLite databases. Each project incrementally introduces new PyQt widgets, layout management techniques, event handling, and external Python libraries. Furthermore, the material covers styling applications using CSS and explores more advanced features like data visualization with Matplotlib and implementing a dark mode. The overarching goal is to equip learners with the skills to design and develop interactive desktop applications using Python and PyQt.

    Python GUI Application Development Study Guide

    Quiz

    1. What is PyQt and what problem does it solve? PyQt is a Python binding for the Qt framework, a comprehensive C++ framework. It allows Python developers to create graphical user interfaces (GUIs) and access other features of Qt, such as database management and networking, using Python’s syntax.
    2. Name three of the five interactive applications that the course aims to build. The course aims to build a starter app, a calculator app, an expense tracker, an image editor (PhotoQT), and an interest rate calculator.
    3. Why is project-based learning emphasized in this course? Project-based learning is emphasized because it allows learners to build their skills in a way that keeps them engaged and provides a tangible final product. It also challenges learners to apply their knowledge in practical scenarios.
    4. What are widgets in the context of PyQt applications? Give two examples. Widgets are pre-built GUI elements that users see and interact with on an application screen. Examples of widgets include buttons (QPushButtons), text input boxes (QLineEdit), and labels (QLabel).
    5. What is the purpose of layouts in PyQt, and name one type of layout discussed? Layouts in PyQt are used to manage the arrangement and sizing of widgets within an application’s window, ensuring a consistent and responsive design. One type of layout discussed is the QGridLayout, which arranges widgets in a grid of rows and columns.
    6. Briefly explain the role of SQL in one of the course projects. In the expense tracker project, SQL is introduced to create and manage a database for storing financial transactions. PyQt is used to build the interface that interacts with this SQL database, allowing users to add, view, and delete expenses.
    7. What is Matplotlib, and what is its primary use in the context of this course? Matplotlib is a Python library used for data visualization. In this course, it is used in the interest rate calculator project to generate charts and graphs, providing a visual representation of the calculated interest over time.
    8. What is the purpose of the eval() function in the calculator app, and what potential issue does the try-except block address when using it? The eval() function in the calculator app is used to evaluate the mathematical expressions entered by the user as strings. The try-except block addresses the potential issue of errors that might occur if the user enters an invalid expression (e.g., dividing by zero), preventing the application from crashing and displaying an “error” message instead.
    9. Explain the concept of “events” in PyQt and how they are typically handled. Events in PyQt are signals that are emitted when something happens within the application, such as a button click or a mouse movement. They are typically handled by connecting a specific signal (e.g., clicked) of a widget to a function (a “slot”) that will be executed when that event occurs.
    10. What is the purpose of CSS (Cascading Style Sheets) in the context of PyQt applications? CSS in PyQt is used to style the visual appearance of application widgets, allowing developers to control aspects such as fonts, colors, backgrounds, and spacing. PyQt provides the setStyleSheet() method to apply CSS rules to widgets.

    Essay Format Questions

    1. Discuss the advantages of using a framework like PyQt for developing desktop applications with Python compared to more basic GUI libraries. Consider factors such as functionality, cross-platform compatibility, and development workflow.
    2. Explain how the five different application projects in the course progressively build upon fundamental Python and PyQt concepts. Highlight specific technologies and skills introduced in each project and how they relate to the overall goal of building interactive desktop applications.
    3. Describe the role of data persistence in application development, and analyze how SQL is used in the expense tracker project to achieve this. Discuss the basic SQL operations demonstrated and their significance for managing application data.
    4. Evaluate the benefits of incorporating data visualization using Matplotlib in a desktop application. Using the interest rate calculator as an example, explain how visualizing data can enhance user understanding and interaction with the application.
    5. Compare and contrast the different methods of styling PyQt applications demonstrated in the course, including widget-specific methods, CSS stylesheets, and the potential for implementing features like dark mode. Discuss the flexibility and control offered by each approach.

    Glossary of Key Terms

    • GUI (Graphical User Interface): A type of user interface that allows users to interact with electronic devices through visual indicator representations (icons, menus) rather than text-based commands.
    • Framework: A reusable body of code that provides a skeletal structure for building applications. It often includes libraries, tools, and design patterns.
    • PyQt: A Python binding for the Qt framework, enabling Python developers to create cross-platform GUI applications.
    • Widget: A basic building block of a GUI, such as buttons, labels, text boxes, etc., that users interact with.
    • Layout: In GUI development, a mechanism to organize and manage the size and position of widgets within a window.
    • Signal and Slot: A mechanism in Qt (and PyQt) for inter-object communication. A signal is emitted by an object when a particular event occurs, and a slot is a function that can be connected to a signal to be executed when the signal is emitted.
    • SQL (Structured Query Language): A standard programming language used for managing and manipulating relational databases.
    • Database: An organized collection of structured information, or data, typically stored electronically in a computer system.
    • Matplotlib: A comprehensive library in Python for creating static, interactive, and animated visualizations in Python.
    • Data Visualization: The graphical representation of information and data. By using visual elements like charts, graphs, and maps, data visualization tools provide an accessible way to see and understand trends, outliers, and patterns in data.
    • CSS (Cascading Style Sheets): A stylesheet language used to describe the presentation of a document written in a markup language like HTML. In PyQt, it can be used to style the appearance of widgets.
    • Event: An action or occurrence recognized by software, often originating asynchronously from the external environment, that may be handled by the software. Examples include button clicks, mouse movements, and key presses.
    • IDE (Integrated Development Environment): A software application that provides comprehensive facilities to computer programmers for software development. VS Code (Visual Studio Code) is an example used in the course.
    • Library (in programming): A collection of pre-written code that users can incorporate into their programs to perform specific tasks, saving development time and effort.
    • Cross-Platform Compatibility: The ability of software to run on different operating systems (e.g., Windows, macOS, Linux) without requiring significant modifications.
    • Module (in Python): A file containing Python definitions and statements. Libraries are often composed of multiple modules.
    • pip (Package Installer for Python): A package management system used to install and manage software packages written in Python.
    • Object (in programming): An instance of a class, which can contain data (attributes or properties) and code (methods or functions).
    • Class (in programming): A blueprint for creating objects. It defines the attributes and methods that objects of that class will have.
    • Method (in programming): A function that is associated with an object and can operate on the object’s data.

    Briefing Document: Review of Python GUI Course Sources

    Date: October 26, 2023 Prepared For: Interested Learners Prepared By: Gemini AI Assistant Subject: Detailed Review of “Building Desktop Applications with Python” Course Materials

    This briefing document provides a detailed review of the main themes, important ideas, and facts presented in the provided excerpts from the “Building Desktop Applications with Python” course materials (referred to as “01.pdf”). The course aims to empower individuals with existing Python skills to develop interactive desktop applications using graphical user interfaces (GUIs).

    Main Themes:

    • Transitioning Python Skills to GUI Development: The core theme is to elevate existing Python knowledge by introducing the concepts and tools necessary for building desktop applications with user-friendly interfaces. The instructor emphasizes moving beyond command-line scripts to create interactive and visually appealing applications.
    • Project-Based Learning: The course adopts a hands-on, project-based approach. Learners will build five distinct interactive applications throughout the 7-hour duration, reinforcing theoretical concepts with practical implementation. This allows learners to see tangible results and continuously build upon their skills.
    • Introduction to Key Python GUI Technologies: The course focuses on core technologies within the Python ecosystem for GUI development. The primary framework highlighted is PyQt (specifically PyQt5), a powerful and widely used library that bridges the C++ Qt framework with Python. Additionally, the course introduces SQL for database management and Matplotlib for data visualization within the applications.
    • Step-by-Step Learning and Practical Application: The instructor emphasizes breaking down complex tasks into easily understandable topics, catering to programmers of all levels. The focus is on learning by doing, with learners actively coding and designing the applications. The course structure explicitly outlines the progression from basic PyQt concepts to more advanced features like database integration and data visualization.
    • Free and Accessible Learning: The course is hosted for free on the instructor’s platform, encouraging accessibility for a wider audience. The instructor emphasizes community engagement and provides additional free resources on their platform.

    Most Important Ideas and Facts:

    Course Overview and Structure:

    • The course is a “project-based course” designed to challenge learners and provide a final product.
    • “our initial overview is you can expect a project-based course as this allows you to build your skills in a way that keeps you going but also challenges you and you can see a final product”
    • It aims to build a “strong foundation in the fundamental concepts of building apps in Python with pqt” while leveraging existing Python skills.
    • The course will cover setting up PyQt projects, creating app widgets, designing GUIs, and adding functionality.
    • Key PyQt concepts to be covered include “pqt widgets how we can create custom widgets how we can style our widgets and using buttons and labels within our programs.”
    • The curriculum progresses from basic PyQt application creation and layout management to integrating “SQL to create databases in pqt” and finally “data visualization with a module called matap plot lip.”
    • Learners will work through five projects: a starter app, a calculator app, an expense tracker, an image editor (“photo QT”), and an interest rate calculator.
    • The course is designed for “programmers of all levels,” those looking to grow their Python portfolio, project-based learners, and visual learners.
    • Access to “all my slides live coding projects and more” will be provided.

    Software Setup and Libraries:

    • The course utilizes Visual Studio Code (VS Code) as the Integrated Development Environment (IDE).
    • The recommended Python extension for VS Code is simply “Python.”
    • The instructor uses the “synth wave 84” theme in VS Code, which learners can optionally adopt for visual consistency.
    • Three primary Python libraries will be used throughout the course:
    • PyQt5: For building the graphical user interfaces.
    • “we are going to be using pqt”
    • Pillow: Likely for image manipulation within the image editor application.
    • “we are going to be using pillow”
    • Matplotlib: For creating charts and graphs in the interest rate calculator.
    • “we are going to be using Matt plot lib”
    • Instructions are provided for installing these libraries using pip3 install <library_name> or python3 -m pip install <library_name>.

    Introduction to PyQt:

    • PyQt acts as a “module that Bridges it it connects a popular framework in C++ and python,” allowing developers to use the Qt framework in Python.
    • It enables the creation of “graphical user interfaces” (GUIs).
    • PyQt offers capabilities beyond just visual elements, including “creating data bases with SQL or adding in embedded web browsers.”
    • A “widget is what you see on the app screen,” representing individual GUI elements like buttons and text inputs.
    • “a widget is what you see on the app screen”
    • The course will focus on PyQt5, with the explanation that it is very similar to PyQt6, and knowledge of PyQt5 provides compatibility with a wider range of applications.
    • “there is no major difference between these two in this course we will specifically focus on pi qt5 as these two versions the framework are so similar”
    • Reasons for choosing PyQt include:
    • Cross-platform compatibility: Apps can run on Windows, macOS, and Linux.
    • “pqt allows for crossplatform compatibility so it allows our apps to be run on different operating systems”
    • Endless widgets: Provides a wide variety of pre-built GUI elements.
    • “it also provides endless widgets… pqt provides these ready-made or pre-built GUI elements”
    • Wide range of components: Beyond basic widgets, it includes support for databases, graphics, and networking.
    • QT Designer: A visual tool for building GUIs (although the course will focus on programmatic creation).
    • “QT designer makes it significantly easier to build a pi QT app it’s kind of like figma or canva for building with pqt we won’t be addressing that in this course because that’s not programming that’s not coding that’s not learning the logic”
    • Python-based: Leveraging Python’s easier syntax.
    • “pqt is based in Python py right we are bridging it and connecting it to python which makes it very straightforward to us as python is an easier language and has easier syntax to understand”

    Window Applications and Layouts:

    • PyQt is designed to create “window applications,” which are standalone programs with their own windows.
    • “pqt is made to create these window applications”
    • A window application consists of a “main window” that acts as a container for “app Widgets or objects.”
    • “we have a main window and inside this main window we have app Widgets or objects”
    • Widgets are GUI elements like “text input box a checkbox text push buttons a list.”
    • “Layouts” in PyQt are used to structure and organize the widgets within the application window.
    • “We use layouts in pi QT to build out our design”
    • Examples of layouts include rows and columns, and PyQt provides layout classes to implement these designs.
    • Widgets are added to layouts by specifying their row and column position in a grid-based system (starting from index 0).

    Calculator App Development (Initial Stages):

    • The initial design of the calculator app aims for a layout with a text input area (using QLineEdit) at the top and a grid of buttons below (using QPushButton).
    • PyQt widgets to be used include QApplication, QWidget, QLineEdit, QPushButton, QHBoxLayout, QVBoxLayout, and QGridLayout.
    • The basic template for a PyQt application involves creating a QApplication instance, a main window (QWidget), setting its title and initial size, showing the main window, and executing the application.
    • Repetitive button creation can be handled efficiently using loops in Python.
    • “Loops what are the two types of Loops you know in Python the while loop and the for Loop. The four Loop is used to iterate to go through something else. Let me propose that we actually Loop through to create our grid”
    • A list of button labels can be iterated through to create QPushButton objects and add them to the QGridLayout.
    • Counter variables can be used within loops to manage the row and column placement of buttons in the grid.

    Next Steps (Implied):

    The excerpts lay the groundwork for building interactive desktop applications with Python and PyQt. The subsequent parts of the course will likely delve into:

    • Implementing functionality for the calculator app (button clicks, calculations).
    • Developing the image editor (image loading, editing operations using Pillow).
    • Building the expense tracker (database creation with SQL, data entry, and display).
    • Creating the interest rate calculator (data visualization using Matplotlib).
    • Styling the applications using CSS within PyQt.

    This briefing document highlights the key information presented in the initial course materials, setting the stage for learners to embark on their journey of building desktop applications with Python GUIs.

    Python Desktop Apps: PyQt GUI Development

    Frequently Asked Questions about Building Desktop Applications with Python

    1. What will I learn in this Python GUI course? This course will guide you through building five interactive desktop applications using Python. You’ll learn to create graphical user interfaces (GUIs) using the PyQt framework, work with databases using SQL, and perform data visualization with Matplotlib. The course covers fundamental concepts of building Python apps with PyQt, including setting up projects, creating and designing widgets, implementing application functionality, styling with CSS, and more.

    2. Who is this course designed for? This course is designed for programmers of all levels who want to elevate their Python skills and learn how to build desktop applications with graphical user interfaces. It’s particularly beneficial for those looking to expand their Python portfolio, visual learners, and individuals who appreciate complex tasks broken down into easily understandable concepts. Basic Python understanding is recommended as PyQt is a class-based framework.

    3. What are the key technologies and libraries used in this course? The core technologies and libraries you will explore in this course include: * PyQt5: A powerful Python framework for creating graphical user interfaces. * SQL: For creating and interacting with databases within your applications. * Matplotlib: A Python library used for data visualization, allowing you to create charts and graphs. * Pillow (PIL): A library introduced for image manipulation in one of the projects.

    4. What kind of projects will I build in this course? Over the course, you will build five interactive applications: * A starter app to get familiar with the initial setup and design in PyQt. * A calculator app with added styling. * An image editing application (PhotoQT) that allows editing real photos in Python. * An expense tracker application that incorporates database creation using SQL. * An interest rate calculator with data visualization using Matplotlib.

    5. Why is PyQt chosen as the GUI framework for this course? PyQt is a popular choice for building Python GUIs due to several reasons: * Cross-platform compatibility: Apps built with PyQt can run on various operating systems (Windows, macOS, Linux). * Extensive widgets: PyQt provides a wide range of pre-built GUI elements (buttons, text inputs, menus, etc.). * Rich functionality: Beyond basic widgets, PyQt offers features for database integration, graphics, networking, and more. * Python-friendly: As a Python binding for the Qt C++ framework, it leverages Python’s straightforward syntax. * While PyQt offers a visual designer (Qt Designer), this course focuses on building UIs through code to enhance understanding of the underlying logic.

    6. How will databases be integrated into the applications? The course introduces SQL for creating and managing databases within your PyQt applications. You will learn the basics of SQL, such as creating tables and performing queries, without needing prior SQL experience. One of the capstone projects, the expense tracker, specifically focuses on using SQL to create a database for storing and managing financial transactions. You’ll learn how to connect to a SQLite database using PyQt’s QtSql module, execute SQL queries to create tables, insert data, retrieve data, and delete data based on user interaction.

    7. What will I learn about data visualization with Matplotlib? The course introduces Matplotlib for data analysis and visualization within Python applications. You will learn how to use Matplotlib to create charts and graphs to represent data. The interest rate calculator project culminates in using Matplotlib to visualize interest rate calculations over time. You’ll learn how to create figures, subplots, plot data, and customize your charts with titles and labels. The integration of Matplotlib with PyQt is facilitated using the FigureCanvasQt class from Matplotlib’s backends, allowing you to embed Matplotlib charts within your PyQt GUI.

    8. Will I learn about styling my Python desktop applications? Yes, the course covers styling Python desktop applications using a few different approaches. For the calculator app, you’ll learn to customize the appearance of widgets using PyQt’s functionalities, such as setting fonts. Later, the course introduces Cascading Style Sheets (CSS) for more comprehensive styling, similar to web development. You’ll learn how to use the setStyleSheet method in PyQt to apply CSS rules to your application’s widgets, allowing you to control colors, fonts, spacing, and other visual aspects. Finally, the course explores implementing a dark mode as an advanced styling feature, toggling between different stylesheets based on user preference.

    PyQt Widgets: Building Blocks of GUI Applications

    Based on the sources, QT widgets are fundamental building blocks for creating graphical user interfaces (GUIs) in Python using the PyQt framework.

    Here’s a comprehensive overview of QT widgets as discussed in the sources:

    • Definition: A widget is any element you see on an application’s screen. This includes buttons, text labels, input fields, menus, and more. The PyQt5.QtWidgets module provides a collection of these pre-built GUI elements or objects that can be added to your application.
    • Purpose: QT widgets enable you to create interactive and visually appealing desktop applications. They provide the user interface components that allow users to interact with your Python programs.
    • Key Concepts:
    • Framework Module: PyQt is a comprehensive framework, and QtWidgets is one of its modules containing various widget classes.
    • Class-Based: PyQt is a class-based framework, meaning you work with classes to create and manage widgets. Each widget you use is typically an instance of a specific widget class.
    • Objects: When you use a widget class, you create an object or an instance of that class, which you then manipulate and display in your application.
    • Essential Widgets:
    • QApplication: This is a crucial class that allows you to create and execute your PyQt application. Every PyQt application must have one instance of QApplication.
    • QWidget: This serves as the basic building block for all user interface objects. It provides the main window for your application where other widgets are placed. Your custom application windows often inherit from QWidget.
    • Commonly Used Widgets (with examples from the course projects):
    • QLabel: Used to display text or images on the screen. In the example app, QLabel is used for the title and random words. In the image editor and interest rate calculator, it’s used as a placeholder for the image/chart initially.
    • QPushButton: Represents a clickable button that can trigger actions when clicked. Used for actions like “submit” in the example app, number and operation buttons in the calculator, editing tools in the image editor, and “Add Expense,” “Delete,” “Calculate,” and “Clear” buttons in other applications.
    • QLineEdit: Provides a text input field where users can enter and edit single-line text. Used for entering expressions in the calculator, amount and description in the expense tracker, and interest rate, initial investment, and years in the interest rate calculator.
    • QVBoxLayout and QHBoxLayout: These are layout managers that help you organize and arrange widgets in your application either vertically (QVBoxLayout) or horizontally (QHBoxLayout). They automatically handle the sizing and positioning of the widgets they contain.
    • QGridLayout: Another layout manager that arranges widgets in a grid (rows and columns). Particularly useful for structured layouts like the calculator’s button pad.
    • QListWidget: Displays a list of items that the user can select. Used in the image editor to show the list of files in a selected folder.
    • QComboBox: Creates a drop-down list (combo box) from which users can select an option. Used in the image editor for applying filters and in the expense tracker for selecting categories.
    • QDateEdit: Provides a widget for selecting dates. Used in the expense tracker to input the date of the expense.
    • QTableWidget: Displays data in a table format with rows and columns. Used in the expense tracker to show the list of expenses. Methods like setColumnCount and setHorizontalHeaderLabels are used to configure the table.
    • QTreeView: Presents data in a hierarchical tree structure. Used in the interest rate calculator to display the year and total interest calculated. It uses a QStandardItemModel to manage the data displayed in the tree.
    • Widget Manipulation:
    • Creation: Widgets are created by instantiating their respective classes (e.g., QLabel(), QPushButton(“Click Me”)).
    • Adding to Layouts: Once created, widgets need to be added to layout managers using methods like addWidget(). Layouts then need to be set on the main window (or other container widgets) using the setLayout() method.
    • Styling: Widgets can be styled to customize their appearance. This can be done through methods like setStyleSheet(), which allows applying CSS-like styles. You can target specific widget types (e.g., QPushButton, QLabel) in your style sheets. Fonts can be customized using QFont and the setFont() method.
    • Functionality: Widgets can be made interactive by connecting their signals (like a button’s clicked signal) to functions (slots) that define the desired behavior.

    In summary, QT widgets are the visible and interactive elements that constitute the user interface of a PyQt application. The QtWidgets module offers a rich set of pre-built widgets that can be arranged using layout managers and styled to create various desktop applications, as demonstrated through the different projects outlined in the sources.

    Pillow: Python Image Manipulation Fundamentals

    Based on the sources, the Pillow module, also known as the Python Imaging Library (PIL), is a crucial component for building the interactive photo editing app in Python within this course.

    Here’s a comprehensive discussion of the Pillow module as described in the sources:

    • Purpose: The Pillow module is specifically used to work with images in Python, allowing you to open, edit, and save them. It provides the necessary tools to implement image manipulation functionalities in your applications.
    • Installation: The sources mention that Pillow needs to be installed using the Python package installer, pip. The commands provided are pip 3 install pillow or, if that doesn’t work, python 3 -m pip install pillow. This step is essential before you can use the Pillow library in your Python projects.
    • Key Submodules and Classes: The sources highlight several important parts of the Pillow library that are used in the image editing app:
    • Image Module/Class: This is fundamental for opening image files using Image.open(full_name), displaying images using image.show(), creating copies using image.copy(), and saving images using image.save(full_name). The Image class also provides methods for image transformations such as flipping using image.transpose(Image.FLIP_LEFT_RIGHT) and rotating using image.transpose(Image.ROTATE_90).
    • ImageFilter Module: This module allows you to apply various filters to images. Examples mentioned include ImageFilter.SHARPEN and ImageFilter.BLUR, which can be applied to an image object using the filter() method (e.g., self.image.filter(ImageFilter.SHARPEN)).
    • ImageEnhance Module: This module provides classes to adjust image characteristics like color, contrast, and sharpness. For instance, the ImageEnhance.Color(pick).enhance(1.2) class and its enhance() method can be used to increase the saturation of an image. Similarly, ImageEnhance.Contrast(self.image).enhance(1.5) can be used to increase the contrast.
    • Basic Image Operations:
    • Opening Images: Similar to opening text files with Python’s built-in open() function, you can use Image.open() from the Pillow library to load image files. You need to provide the path to the image file as an argument.
    • Saving Images: The save() method of an Image object allows you to save the modified image to a file, specifying the filename and format.
    • Image Manipulation Techniques Discussed:
    • Converting to Black and White: The convert(‘L’) method of an Image object can be used to transform a color image into a grayscale (black and white) image.
    • Applying Filters: The filter() method, along with filters from the ImageFilter module, can be used to enhance or modify the image.
    • Enhancing Image Properties: Classes from the ImageEnhance module allow for adjustments to color saturation, contrast, and potentially other properties.
    • Flipping and Rotating: The transpose() method with constants like Image.FLIP_LEFT_RIGHT and Image.ROTATE_90 can be used for geometric transformations.
    • Integration with PyQt: The Pillow module is used in conjunction with PyQt to build the image editing application. After loading and editing images using Pillow, the resulting image data needs to be displayed in the PyQt application’s GUI. The sources mention using QPixmap (from PyQt5.QtGui) to handle image display within PyQt.
    • Importance of Specific Imports: The sources emphasize the best practice of importing specific classes and modules from Pillow (e.g., from PIL import Image, ImageFilter, ImageEnhance) rather than using a wildcard import (from PIL import *), as Pillow is a large library.

    In summary, the Pillow module is essential for the image editing project, providing the functionality to load, manipulate through various filters and enhancements, and save image files within the Python application built with PyQt.

    PyQt and SQL for Desktop Applications

    Based on the sources, SQL databases are a key technology explored in this course for building interactive desktop applications with Python and PyQt, particularly within the expense tracker application.

    Here’s a breakdown of the discussion around SQL databases in the sources:

    • Purpose: SQL is used to create and manage relational databases within the PyQt applications. These databases allow for the storage and retrieval of structured data in tables. In the context of the expense tracker, SQL is used to store information about expenses, such as date, category, amount, and description.
    • Integration with PyQt: PyQt provides specific modules and classes to interact with SQL databases. The primary modules involved are:
    • PyQt5.QtSql.QSqlDatabase: This class is used to establish a connection to a SQL database. The course specifically focuses on SQLite databases due to their lightweight nature and ease of use within Python applications. The addDatabase() method is used to create a database connection, setDatabaseName() to specify the name of the database file (e.g., expense.db), and open() to open an existing database file, ensuring that previously stored data is loaded when the app starts. Error handling is implemented to check if the database can be opened, and if not, a critical error message is displayed, and the application may exit.
    • PyQt5.QtSql.QSqlQuery: This class is used to execute SQL queries on the connected database. Queries are essentially questions or commands sent to the database to perform actions like creating tables, inserting data, selecting data, and deleting data. The execute() method runs the SQL query. For safer data insertion, especially when dealing with user input, the prepare() method is used to prepare a SQL query with placeholders, and then addBindValue() is used to securely bind the actual data to these placeholders, preventing SQL injection vulnerabilities.
    • Database Schema and Table Creation: In the expense tracker, an initial query is executed to create a table named expenses if it doesn’t already exist. The CREATE TABLE IF NOT EXISTS SQL command is used for this purpose. The expenses table is defined with several columns, each with a specific data type:
    • ID: An integer that serves as the primary key for each expense entry and is set to auto-increment, meaning the database automatically assigns a unique ID to each new entry.
    • date: Stores the date of the expense as text.
    • category: Stores the category of the expense as text.
    • amount: Stores the monetary amount of the expense as a real number.
    • description: Stores a description of the expense as text.
    • Data Manipulation:
    • Inserting Data: When a user adds a new expense, the application retrieves the data from the input fields and uses an INSERT INTO SQL query to add a new row into the expenses table. Placeholders are used for the values (date, category, amount, description), and addBindValue() is used to associate the actual data with these placeholders before the query is executed.
    • Selecting Data: To display the existing expenses in the QTableWidget, a SELECT * FROM expenses SQL query is used to retrieve all data from the expenses table. The results are then iterated through, and each row from the database is inserted as a new row in the QTableWidget, with each column’s value from the database being placed into the corresponding cell of the table. The value() method of QSqlQuery is used to retrieve the data from each column of the current row in the database result.
    • Deleting Data: When a user wants to delete an expense, the application first identifies the ID of the selected row in the QTableWidget. A DELETE FROM expenses WHERE ID = :id SQL query is then prepared, where :id is a placeholder. The ID of the selected expense is bound to this placeholder using addBindValue(), and the query is executed to remove the corresponding row from the expenses table.
    • GUI Integration (Expense Tracker): The data from the SQL database is visually represented in the expense tracker application using a QTableWidget. The setColumnCount() and setHorizontalHeaderLabels() methods of QTableWidget are used to define the number of columns and their respective names, mirroring the structure of the expenses table in the database. The insertRow() method adds new rows to the table, and setItem() along with QTableWidgetItem is used to populate the cells of the table with the data retrieved from the database. When an expense is deleted, the corresponding row is removed from the database, and the loadTable() method is called to refresh the QTableWidget with the updated data.

    In essence, SQL databases provide a persistent storage mechanism for the PyQt applications, allowing them to save and retrieve data even after the application is closed and reopened. PyQt offers the necessary tools to seamlessly integrate with SQL databases, enabling the creation of data-driven desktop applications.

    PyQt Applications: Styling with CSS

    Based on the sources, CSS styling is a method used in this course to enhance the visual appearance of the PyQt desktop applications.

    Here’s a comprehensive discussion of CSS styling as described in the sources:

    • What is CSS? CSS, which stands for Cascading Styling Sheets, is a language primarily used to style websites, working in conjunction with HTML and JavaScript. However, the sources explicitly state that CSS can also be used with other languages, including Python and its GUI framework, PyQt.
    • How it Works in PyQt: In PyQt, CSS styling is applied to widgets using the setStyleSheet() method. This method accepts a string as an argument, and this string contains the CSS rules that you want to apply to the widget.
    • CSS Syntax in PyQt: The CSS syntax used within the setStyleSheet() method in PyQt is very similar to standard CSS used for web development. It involves targeting specific elements (widgets) and then defining style properties within curly braces {}.
    • Targeting Elements (Widgets): You can target different types of PyQt widgets by using their class names directly. Examples from the sources include:
    • QWidget: To style the entire application or main window.
    • QLabel: To style text labels.
    • QLineEdit: To style input fields.
    • QPushButton: To style buttons.
    • QTreeView: To style tree view widgets.
    • QTableWidget: To style table widgets.
    • QComboBox: To style combo (dropdown) boxes.
    • QDateEdit: To style date edit controls.
    • Style Properties: Within the curly braces, you define style properties using a key-value pair format, separated by a colon : and terminated by a semicolon ;. Examples of CSS properties used in the sources include:
    • background-color: To set the background color of a widget.
    • font-size: To set the size of the font.
    • font-family: To set the typeface of the font.
    • padding: To add spacing around the content of a widget.
    • border: To add a border around a widget.
    • color: To set the text color.
    • Applying Styles: The setStyleSheet() method is called on a specific widget instance to apply the defined styles to that widget. You can apply global styles by setting the style sheet on the main QWidget or more specific styles to individual widgets.
    • Targeting States (e.g., Hover): PyQt’s setStyleSheet() also allows you to target specific states of widgets using pseudo-classes, similar to CSS in web development. The source provides an example of the :hover state for QPushButton to change the button’s appearance when the mouse cursor is over it.
    • Organization of Styles: The sources demonstrate different ways to organize CSS styling:
    • Directly within the setStyleSheet() method call.
    • Using multi-line strings (with triple quotes “””) for better readability when defining multiple styles.
    • Creating a separate method (e.g., applyStyles()) within a class to encapsulate all the styling logic, which can then be called during initialization or in response to events (like toggling dark mode).
    • Dark Mode Implementation: The implementation of a dark mode in the interest rate calculator application heavily relies on CSS styling. By checking the state of a QCheckBox, different sets of CSS rules are applied using setStyleSheet() to switch between a light and a dark theme by altering background colors and text colors of various widgets.

    In summary, CSS styling in PyQt, applied via the setStyleSheet() method, offers a powerful and flexible way to customize the look and feel of your desktop applications by leveraging familiar CSS syntax to target widgets and define their visual properties.

    Python App Development: Build Modern GUIs in 7 Hours (Beginners Course)

    The Original Text

    are you ready to start building your own desktop applications you’ve landed on the Right video this is the course for you over the next 7 hours we are going to be building five interactive applications with python this course is designed for those wanting to take their python skills up a level and Learn Python guis or graphical user interfaces you’re going to be exploring core Technologies in Python like the powerful High QT framework and SQL and Matt plot lip just to name a few well without further Ado I don’t want to keep you guys waiting let’s start building apps it’s why you’re here are you ready cuz I’m ready let’s dive in welcome guys to another code with Josh special for super obvious reasons I’m Josh if you guys don’t want to hear me ramble on for the next few minutes it is going to be beneficial here’s the time stamp that just jumps into the course you can check that out okay but as I mentioned we’re going to be building five interactive apps a starter app a calculator app expense tracker an image editor as well as an interest rate calculator using matplot lib SQL guys this course is hosted absolutely free right show some love smash that like button and subscribe comment and engage as that does help my course reach more students around the world okay that is is your way you can show support and guys the first link in the description won use the links okay but I’m hosting this course on my own platform for you guys absolutely free over there’s the community all my other free resources all right so to show your support just use the links in the description all right um okay enough chitchat uh let’s just jump into the course I’m really excited I hope you are too [Music] hi there and Welcome to our course before we get started I like to kick off my courses by going over the course structure and what you can expect in this course let’s jump in and let’s take a look our initial overview is you can expect a project-based course as this allows you to build your skills in a way that keeps you going but also challenges you and you can see a final product you will be building a strong foundation in the fundamental concepts of building apps in Python with pqt and you will use your existing python skills now you should have a basic understanding as this course and pqt is a class-based framework the knowledge you gain from this course will be key in your programming journey and allow you to expand on what you already know we are going to talk about the setup for any pqt project we will look at ways to create our app widgets design our GUI and add some app functionality throughout this course we will talk about pqt widgets how we can create custom widgets how we can style our widgets and using buttons and labels within our programs to break down our course overall we will begin with giving you a good understanding of how we use pqt to create applications we then build on working with layouts in designs for our overall apps while introducing widgets and creating interactive guis once you’ve built this solid foundation of creating your layouts working with widgets we now have a basic understanding of pqt you will then be introduced to SQL and how we can use SQL to create databases in pqt now we’re only brushing the surface here and you don’t need to have any background in SQL you’ll learn everything you need to know here to hit the ground running and for our final project you will learn data visualization with a module called matap plot lip this will introduce you to data analysis and data visualization with python you’ll also see how we can use CSS to style our python applications throughout this course you will have five projects in total the first project isn’t here but it’s a project to get you warmed up with the initial setup and the design for pqt then we work with four projects that all build upon each other our first one is going to be a calculator app and we will add styling to this app we then move on to an image editing application or I’ve nicknamed my app photo QT this app allows you to edit real photos in Python we then will progress into our third Capstone project this is an expense tracker and here is where you’ll learn how to create a database using SQL our final project is going to be an interest rate calculator with our data visualization this is where we will talk about how we can use charts and graphs in our applications who is this course designed for well it’s designed for a lot of you it’s designed for programmers of all levels for those looking to grow their python portfolio those looking who want complex tasks broken down to a basic level of understanding that is what my courses in the zero to knowing series does breaks down complex tasks into easily understandable topics this this course is designed for project-based Learners as well as all you visual Learners out there don’t worry you’ll get access to all my slides live coding projects and more now that you have an overall understanding of what you can expect in this course and the overall structure let’s jump in and let’s start off with the installation of what we need to hit the ground running I’ll see you guys in the next video [Music] all right we’re just about there before we jump into the first lesson I want to get everything installed and set up here within vscode now you may have already used vs code or this might be new to you let’s go through just one extension that we’re going to be using and I’ll give you mine as well the first extension that you should have please look for Python and just go through and make sure that you do have python within VSS code you can install this here I am using a theme as you can see here we have a few different things going on now if you want to to follow along with my theme cuzz color coordination works for me it might work for you I use synth wave 84 as my theme currently for the duration of this course you are welcome to get it there too okay let’s get that out of the way we have looked at our two extensions now going forward we are going to be working with a few different libraries throughout this course I want to install them all right now so I have them we are going to be using pqt we are going to be using pillow and we are going to be using Matt plot lib let’s get these all installed to open your terminal on a Mac you can press command J or on a Windows control J down here I just want to install so using the python package installer I’m going to say pip 3 for yours you might say p pip but with most updated newer versions of python pip 3 seems to be the way to go I’m going to say pip 3 install Pi qt5 enter let it do its thing now as you can see it says requirement already satisfied for mine that’s because I already have it here for the pillow Library I’m going to say pip 3 install pillow get that there now if none of these are working for you okay you may need to try python 3-m pip install pillow you can try using instead of pip 3 saying Python 3 this brings us to our final one which is mat plot lib so pip three install Matt plot lib as you can see I also have that one already installed at this point you’re ready to go you have pqt framework installed which we will be using for our course and then we will also introduce how to use pill in the pillow Library as well as Matt plot lib at later stages I’m ready for the first lesson and at this point you are too I’ll see you guys in lesson one of our [Music] course hi and welcome to the zero to knowing building apps in Python course in this course we will be looking at how to create apps in Python using the pqt framework before building any apps let’s jump in and let’s talk about what is pqt so long story short pqt is a module that Bridges it it connects a popular framework in C++ and python so it allows us to use this popular C++ framework in the language we choose to use which is Python and it enables us to create graphical user interfaces now you’re going to hear this a lot throughout this course and what you’re going to hear me say is you’re going to hear me say GUI GUI is a reference for graphical user in interfaces pqt it allows us to do many different things such as creating data bases with SQL or adding in embedded web browsers and even using its own collection of widgets and a widget is what you see on the app screen and there’s so much more that we can do with pqt and these features make QT a comprehensive of framework and it allows us to make all types of apps in Python let’s talk about what is the difference between pi qt5 and Pi qt6 well there is no major difference between these two in this course we will specifically focus on pi qt5 as these two versions the framework are so similar anything you do in pi qt5 that are easy workarounds to any solutions that may occur with pi qt6 and by learning and understanding just the last version pyqt5 you’re going to be able to work with a wider range of applications you’ll be able to work with older pqt apps as well as the new apps using pqt 6 the final question you may be asking yourselves now is why do we use pqt why do developers choose this framework over others I’ve put together a few popular reasons why going through them pqt allows for crossplatform compatibility so it allows our apps to be run on different operating systems like I am on a Mac but you yourself may be on a Windows or a Linux pqt allows for this it also provides endless widgets you’re going to hear this a lot in our course what is a widget a widget is something you see on your app screen it could be buttons text menus anything like that and pqt provides these ready-made or pre-built GUI elements they also offer a wide range Beyond just these components like I’ve mentioned in the previous slides we could include databases Graphics like pictures networking and a few of these we will actually be building projects in this course using them pqt also has something called QT designer and QT designer makes it significantly easier to build a pi QT app it’s kind of like figma or canva for building with pqt we won’t be addressing that in this course because that’s not programming that’s not coding that’s not learning the logic in this course most developers aren’t going to use QT designer you’re expected to know how to build out an app and what things are doing within your app that’s what we focus on here finally pqt is based in Python py right we are bridging it and connecting it to python which makes it very straightforward to us as python is an easier language and has easier syntax to understand now that we understand what pqt is and why we use it let’s head over into our next video and talk about window applications I’ll see you guys in the next video [Music] here we are at the introduction to our first app before we start making our first app we need to understand what is a window application and pqt is made to create these window applications we are here to touch on the foundations we will use to construct and build your first app these are two current and popular examples of window applications I took these off my Mac and you see a calculator and we have the system preferences tab they pop out when we need them and we close them when we do not need them anymore more as we break this down further let’s examine and take a look at the system preferences app that you see here on the left we have a main window and inside this main window we have app Widgets or objects these work together to create the GUI of our app and if you think about the main window as like a jar right and then all of the widgets are the coins and the money inside the jar they all represent something different but they’re all inside the same jar this jar is like the parent it’s like the main window of our app within the app you also see many widgets which is a word that I also keep using in this app we see a text input box a checkbox text push buttons a list all of these are a type of widget or an object that we create and then we later add into the app remember this word later but these are widgets from a class called QT widgets if I asked you to design this app what comes to mind what type of layout would you use would you draw this out would you you put it in rows how could we design it that’s a great question and as we start looking further at apps it’s a question that you should be asking yourself how I would design this app is yes rows and columns exactly what can we store in a row and what can I store in a column can I store columns in a row let’s look at that this has two rows and two columns we use layouts in pi QT to build out our design okay widgets they are automatically aligned either vertically or horizontally so my two rows are horizontal and my two columns are vertical in row one I have 1 two three four buttons they’re in their own row at the top of my app in the second row I actually have two columns one column two column with some text and a button these columns are added into a row at the end interesting so start thinking about how can we break an app down to the design basics of rows and columns moving forward let’s take a look at what exactly the pqt framework is and how it all ties together pqt is a massive framework and within this framework we have modules so for example you may have used other popular python modules like the built-in ones time and random or maybe you’ve used other external modules Frameworks like pandis or plotly or others like that well pqt is like that it is one main framework and then within that there are many modules within each module there are many classes many functions all of that stuff here I’ve put just a few of the popular pqt modules will we use all of these in our course no will we use some of them absolutely are there going to be others also yes there will be others these these are just a few popular ones starting off I’m going to talk about QT widgets because we actually saw this earlier remember everything on the app screen is considered a widget and this really provides us with GUI elements or objects that we can add into our app screen another module that we will start off with using early on is a module called QT core QT core essentially holds the miscellaneous elements that we need within certain elements of our app as we grow in our fundamentals and understanding of app development you can expect to learn a little bit of sequel in this course in creating databases as well as learning some GUI and design elements something that I’ve created that I love to teach the order of in this pattern is the code Burger all right I’m going to put this at stages throughout this course if you take notes which not really if you should be taking notes and if you do you should write this down or screenshot the code Burger this is the order of steps we must take in order to design an app in pqt and get it to open and run accordingly number one we need to make sure all of our Imports are at the top of our burger at the top of the coat once we import everything we need I will then create my main app objects and all my app settings like the size of my app the title of my app things like that once we get everything set up I can then create all the widgets that I want to have in my app they can be stored at the top all the buttons all the text anything like that can be stored in this step once we create all these widgets we need to add them to our design we need to design our app or design our layout and add all those widgets to the main window our screen once we finalize that design it’s the good idea to set our final layout we want to set the final design to our main window ending with showing and executing our app pqt is a class-based language now at this point in your programming Journey you should understand the fundamental concepts of python and programming in general python has a core concept of objectoriented programming that is where we create objects in classes and the class can store fundamental information about those objects if we do a quick class flashback pause the video read through this code and understand what’s happening do you understand everything what things do you not quite understand and then answer the question for me what is a method and what is a property all right to touch on these very briefly we defined a class called app remember a class name is one of the only things in Python that is capitalized ized my class is called app I have three methods 1 2 3 a method is a function in a class I then create an object the value of an object is a class in this case is app I’m giving app three arguments one two 3 because my app has one two three parameters these parameters are used as the value to my properties what is a property a property is a variable in a class I can then use these throughout parts of my class when it comes time to use a method a method must be linked to your object so a method is a function in a class you must link it to an object of that class in order to use it all right that was a lot but don’t worry because I’ve color coordinated a part of it and I want you to take a look at that now making an object we’re giving the three arguments to our class now these arguments we are giving to init in it is what we call our Constructor method Constructor construction build we use in it to build our class now pqt is a framework that has modules each module has classes these classes we can import into our projects to allow us to use them in our apps each class has methods and properties of its own that we can use when we link it to an object of that class that’s a lot but this flashback it should get the gears turning it should bring back memories in The Core Concepts of how we use objectoriented programming in Python brilliant let’s talk about how we can connect 2 pi QT to set app up remember step number one of the code Burger we want to import everything we need now pqt you can see I am linking to one of the modules pqt is the framework QT core and QT widgets are a module from our framework QT is a class from my module QT core I am importing some something called QT you’ll find out more about this very soon then we import all of the QT widgets we need these widgets are the objects that we want to see within our app do you want to see buttons do you want to see an input field text what do you want to see in your app that’s what we import here the two most important classes that we must Import in order to get a working app our Q application and Q widget Q application it allows us to create and execute our app Q widget on the other hand allows us to actually create that main window the parent that all the other objects are dropped into great we need those two that’s why I always like to import them first next is anything you want to see in your app anytime you want to see text on the screen of your app text in pqt is called a q label anytime you want a submit style button that is called a q push button that’s like a click button or submit button and then the other one we’re going to take a look at here you visibly cannot see this but for the design of our app we need to use layouts now what we’re going to be looking at in this first app is a vertical layout V and we will also be looking at a horizontal layout these give our app alignment in the case of QV box layout this is going to be vertical alignment we have just introduced a few classes that come with QT core and QT widgets remember QT widgets provides us the GUI elements the widgets or the objects you want to see on the screen of your app in QT core it kind of contains some miscellaneous things that we can use throughout our programs mainly for us what we are going to be using is the QT tool for alignment like align left align right align Center to help us structure our app in a more visually appealing way we’re getting super close to starting to code but before we do I’ve just introduced some important classes that we will be importing but we need to talk about a few of those important methods you’re going to be using with these classes what is a method remember it is a function in a class what is a property a variable in a class how do we use them a method in property must be linked to an object in order to work let’s take a look at some popular ones we will start off with today in order to add an object to our screen we use the method add widget this allows us to add our object specifically to a layout so to a column or a row we can change or set the text of an existing object by using the set text method remember this for later change the text of something that’s where it’s really useful when we want to add two layouts together we cannot use add widget because a layout is not a widget in order to add a column to a row for example we can use add layout and this adds two layouts together once we have one final Master layout where everything is held we can take that Master layout and we can set that as the final layout to the main window here is the method we can use to set the final design to our main window our last two methods we will use throughout our course is show and hide and this allows you to show or hide an object when something happens let’s take a look at your first app that we’re about to put together this is our first application it’s rather basic but it does everything we want it to do to hit the ground running and and understand the fundamentals it allows us to add objects on the screen we will be creating functions as well as programming these buttons to do something so let’s get comfortable with the foundations of app design in pqt 5 what do we see here so I have a main window I have like a title text I have some text for some random words and then I have clickable buttons can you locate them here they are now I want you to think about I introduced important classes that we will import earlier what classes will we need to import in order to build this app I want you to think about that well in order to create our main window our main window uses the class Q widget any text on the screen is known as a q label one two three four I will have four Q label objects and then a submit style button is known as a q push button you may be noticing two things one everything starts with Q yes that’s true also everything is camel cased camel casing means it’s one word but every word the first letter is capitalized that is very important if you spell one of these wrong you’re going to get an error and it’s going to say undefined next up how will you design the app how can we solve this what design elements should we think about here you can pause try and use those Clues to help you it’s not completed yet what we could do is we could start with three rows that’s the most basic form of design design in this app these three rows are like the base layers and I’m going to stack them like cake in a column so my final design is a column and within that column I have Row one two and Row three bringing together the final application design how cool all right let’s tie everything together the real question we need to know to get started is what do we need in order to set up our main window screen to get our app started here we are if you memorize any code in this first part of the lesson memorize this because we will use this every time we start creating an app at the top of my code you can see all of our Imports I’m importing QT from QT core next I am importing all the widgets I need to build the app for from QT widgets our two most important Q application Q widget everything else is optional based on what you are trying to build after our Imports according to the code Burger we have our app settings and our app main objects these main objects are app in main window one of them should always be called app this is a generic name that’s used across the world by other Developers app is equal to Q application Q application is our class remember the parentheses and it also takes an empty list as an argument next I like to use the name main window you do not need to use that the value of main window is Q widget that allows us to create this window app once we have our main window object you can go forth and you can start to style or give your app the settings if you want to give your app a title you can do that with the set window title method that’s linked to our main window if you want to give your app a starting size what size will the app be when it first opens you can resize with a width 300 and a height of 200 you can choose any width and height you would like soon we will be creating all the objects that we’ll be adding to our app but the last two lines in order to get our app template all ready to go is we need to show our main window and we need to execute our app great let’s put together our starting app and head over to vs code I’ll see you guys in our next video [Music] alrighty here we are in vs code before we jump into start coding let’s take the code burger and let’s put it in here to VSS code to give us a starting template what was number one again well number one was we want to import our modules okay then we have our main app objects and all of our settings great once we have our main app objects what should we do we should create all app objects so anything we want to see in this app finally we can have all of our events and then we want to show slash run our app these would be the things inside now we do want to design where do we want to design in our app well we want to design right here okay so all of our design can be done after we create the main object so I’ll just say all design all righty to kick things off let’s go up and let’s work through and get a basic template going for the foundation of our app so importing our modules we can say from PI qt5 that’s our framework now I can attach the module I want to go QT core import class so I want QT class from the QT core module from the framework pi qt5 all righty now we can get our GUI going we can get all of the widgets we want on the screen so let’s import those I like to start with the two most important ones which are Q application and Q widget so right here Q application Q widget what else do we want to see in the app well I know that I want text so we can say Q Lael I know I want some buttons so let’s say Q push button finally what type of design are we going to be doing well we’re going to try to do some rows inside of a column which we’re going to actually check out here in our next lesson so before we do that let’s just say QV box that gives us one initial layout now that we have everything imported let’s work on our two main objects so I’m going to say app equals our Q application class and remember that this takes an empty list as our argument next up to kick things off let’s make a main window and we can say here Q widget you can name this anything you want my names are going to be to help you further your understanding so this is my main window I’m going to call it my main window now the other final settings we can do is we could set a title for our app right and we could say random word maker okay and then we could set the initial size what size do we want the app to open with I could say a width of 300 a height of 200 great all righty to close things off for our start all we need to do is is we need to take our main window and we want to show the main window while the main window is showing we can execute or run our app let’s run our code and observe what happens there we are our starting template you can see that the initial size is 300200 but you can make it smaller and you can make it bigger okay and then you can also see the app title is random word maker which we gave it here now this is great because every app we make will start with this this is the foundation it’s like you’re pouring the concrete to build the home so we can now build on top of this now remember there are many ways to do a certain task don’t be afraid to try your way I’m breaking this down so we understand the key fundamentals to build apps with pqt let’s head over to our next video and in that lesson we are going to address the design of our app and how we can do that I’ll see you guys in the next [Music] lesson [Music] Welcome to our next video now that we have our starting template ready to go it’s time to design our app how can we achieve this look right we have our three rows and these rows are held in one master column so the layout tools will be using are going to be our QV box layout V for vertical and our qh box layout or H for horizontal these will be used to build our rows and the columns how will our code look well now that we have our app ready to go we need to create all of the objects or widgets that we want to store in this app on my screen you see one 1 2 3 4 five six seven objects therefore we should be creating seven different objects they each have their own name but the value can still be from the same class they’re different objects from the same class my title text well that’s just text remember in pi QT anytime we want text we can say Q label when my app first starts all of these should actually be a question mark right until we start clicking the button so I can create those here to end with I will create three push buttons each button is a different object but they all say click me now that we have created all these objects you’re going to use in your app it’s now time to design the app you won’t be able to see any of the objects if you were to run your code now it’s because we can’t see these objects until we add them to our layout and we set that to our main window as I go through this course remember there are many ways to solve a problem in coding I am showing you one way and I’m breaking that down to a way that you guys can easily understand if you find a different way or you want to try it yourself I encourage you to do so here you can see each of those correspond to an element on the app screen and that’s held in our final QV box column now that we created those objects I need to get them on my screen here I have made my master layout which I know at the end everything will be added to but I also know that I’m going to have one two three rows so I can create three row layout objects right here next up it’s time to add things to the row so I can start with Row one because I know it’s going to be at the top what do I want to do I want to say Row one I want to add the title text to it it’s going to do just that if I want I can give alignment to the text and I can say I want it to align in the center enter you can see I’m using the QT class from QT core that we imported now that I know Row one is done check I can move on to row two and I can do the same thing row two I want to add the widget text one which corresponds to that and I can also give that alignment row two is done we can add the buttons to row three this is adding all of the objects you just made into each row now if you’re running your app no what do we need to do now what’s the next step in the code Burger now that we have our rows we need to add them to our Master column I can take that and I can say master layout I want to add Row one it’s important to add these rows in the order that you want to see them remember python reads top to bottom we need to code like that too once we have everything in one place or should I say in one master layout I can take my main window and I can set the final layout to be my master layout if I break that down one step further here is what that would look like we’re creating our Master layout that everything eventually will be added to I can create three rows because that is how I’m choosing to design my project then we just need to go through and we add each row once we’ve added the widgets to it we add each row to that Master layout finally you can use set layout to set the final design of your app to your main window screen this ties together perfectly the code Burger you guessed it you probably didn’t guess it but it does bring in the code bger I’ve just gone through each step individually and how they align and how they work together you have a designed app now but let’s just touch on the final elements what is this app going to be doing well it’s going to be generating a random word and displaying that on the screen every time you click a button how could we do that pause the video take a minute just think how could you do that that you heard the word random you should have thought the random module I want to import the function Choice from random now Choice takes a list as an argument and it randomly chooses one of the elements from that list so I have a list called my words and I’ve just put these random words in here I then have a function and when this function is called I have a word variable and this Choice function is going to choose one of these random words so word equals one of these I can then take my text one object which we already made in your app and I can now set the text to be that random were that is how I can use the set text method with our app to set the text of an existing object on our screen the final question that we are going to address is event handling how do we connect a button how do we activate a button to work in our code what event could we possibly use in pqt in pqt to kick things off we are going to be focusing on one event now you can see that I have my object button and that is a q push button that object is created here I then have a function and every time this function is called it’s just going to print this button is working that’s all the function is doing I take my button objects and I say when the button is clicked we want to run the test function clicked that’s the event type in pqt let me translate this now the event would literally translate to when this button is clicked I want to connect to this function and that is how we handle events in pqt in our first app we are just going to be looking at the clicked event but in other projects that we do in this course we will be learning about other events as well all right let’s head over to vs code and let’s finish off our app I’ll see you guys in the next video [Music] here we are in our next video in the lesson we introduced how we can create a layout and design our app the way we want it to we also addressed how to get the objects to appear on our screen because we now know that after we create an object we then need to add it to our design let’s start off by creating all the app objects that we need first up I’m going to create a title cuz I know I’m going to have a title that is going to be text on the screen and according to my app I can just put random keywords because that’s what I want the title to be I will then have three different text so as long as they all have a different name because they’re all different objects that’s fine and they can still all use the same class initially when the app starts I want my text to be a question mark when we click a button this is going to change to a random word great we have our text objects what other objects do we want the buttons so for each button you should create a q push button it’s a q push button that can say click me we need to give them different names great we now have our seven objects all of these we want to see on our screen now that we’ve created these objects it’s now time to move into our design we got to get these onto our our layouts onto our screen the first thing we can do for our design is let’s create all the layouts we want now I know that my final layout my master layout I want everything to be held in a column so I’m going to make that within this master layout column I know I’m going to stack some rows it’s going to be like cake so I want to have Row one row two Row three in order to get that I need my Q hbox layout therefore let’s go up and let’s just add that on to our Imports let’s say qh boox layout now that we have that I can go forth and I can say okay I am going to make a row one let’s make a row two and Row three these are the designs in the app great we can start to add our objects how do we add these widgets to our screen well do you remember the method we learned add widget what is that going to be linked to well let’s say hey python in row one I would like to add my title to the screen I would like my title to have the alignment of the center of the screen so I can pop that in just like so that’s what that translates to row one I I would like to add my title my title is a widget Q Lael and then my row is the layout great that’s Row one I can move on to row two in row two we’re going to have more I’m going to have text one text one is going to have its alignment again and I can say once again align Center but row two is also going to have our other two texts so I can say text two text three remembering that python reads like a book left to right top to bottom so the order we add these to our rows it’s going to go left to right text one text two text three that concludes with the final of adding our buttons to the screen our buttons do not need alignment so I can just take it and we can just add the button how it is button two button three awesome look at our design okay if any of that is confusing go back through some of our slides rewatch the last two minutes of this video right we create our layouts and we simply just go in order all right I’ve made my layout I’ll just start with Row one we do what we need to do row two and Row three now that we have all these rows I just want to drop them into my master layout here is US using the add layout method now remember that we use the add layout method because a row in this example is not a widget it’s a layout if we want to add rows or columns together we need to use add layout so how we could translate this is Master layout we want to add Row one at the top Master layout I would like to add row two under Row one and then Master layout we can add Row three under row two now that everything is stacked in our Master layout let’s just say okay I have my final design ready to go main window I want to set the final layout to be my master layout incredible let’s give our code a run there we are you can see our app I have the title which we’ve given it right here I have my three question marks ready to go for my random words and then we have all the buttons we added now if you try the buttons we have not connected any events yet that’s what’s yet to come in the next video we will implement ment our random words as well as the events for each button I’ll see you guys in the next [Music] video Al righty welcome back let’s get this app finished now we need to introduce random words and Link our buttons with our Events first things first let’s create some random words so when you hear the word random you should immediately be thinking of the Python random module if you’re not familiar with this do a little reading on the documentation it’s one of the built-in python modules like random or time or math python has these modules and choice is going to allow us to choose a random word from a list speaking of lists let’s go down here with all of our objects and let’s make one let’s just say my words equals a list I’ve already prepared some words you guys be creative you know choose a hobby that you’re passionate about and use those words here all righty so let’s see let me Mark these we’ve imported choice we have a list of words we’re now ready to make some functions I’m going to add one additional comment add functions I like to create my functions down here in the bottom okay after our design after the design elements of our app there are many ways to do this again and if you think of a different way go with your way try your way the way I’m about to do it is to make it more readable for you and easier to understand in the big picture of things it doesn’t matter if you do the same problem in three lines of code or 15 lines of code were you able to solve the problem if the answer is yes awesome that’s great and you should be proud of that let’s make a function now to be exact I’m actually going to make three functions they’re all going to be the same thing but they’re going to be linked to different events so random word when I call this function I would like to get a random word from my list of words so I’m going to use the choice function here and I’m going to insert my list so now word is going to be one of the random words from my list it could be Hello Goodbye test app any of those I can then take my object text one remember we created three of these one 2 3 currently text one is a question mark I want to update that value or change that value who remembers what method do we use to change the value of an existing object set text so I can link set text method because I want to change the value of text one and what do I want the text to be whatever random word was chosen that’s what we want great I’m going to use this now a few times so let’s just take this what do we need to change well uh random word two we now want to change text two and then random three would like to change text three great we have our three functions one two and three to close things off we need our pqt events and remember we have just learned our first event of clicked clicked is linked to a button object so let’s say button one when button one is clicked I want to connect with my random word one function when my button to is clicked I want to connect with my random word to and I’m just going to take that for the last one and we can say button three and random word three great run your apps play with your apps experiment and review our code what did we just do save this code somewhere as it’s going to help you build our future projects it is the code Burger structure it’s what we’re going to be using in this course I’m going to give my app a run there we are click ah look at that all different that’s great we have it working exactly how we wanted it to very well done we have put together our first app but fear not cuz what we’ve learned here we are going to use in the remaining projects of this course I’ll see you guys in the next lesson where we are going to introduce our next [Music] project welcome back to our next project in this project you’re going to be putting your knowledge of QT widgets to the test as we build an interactive calculator with pqt before we dive into this project let’s take a look at the famous code Burger one more time remember the structure of what we’re trying to do here we will use this structure within this project as well remembering all of our Imports our main app objects with the setting once we have those two feel free to create all the widgets you want to see in your app once you have those we can then design the app with our layouts and set that to our main window when everything is set it’s time to run and execute your app this is the code Burger so in the past we have been using QV box layout in qh box layout and remember that V is for vertical or a column and H is for horizontal and row you got some practice with these in the last project looking at this calculator app how would you design this do you see rows and columns does that make sense right what other options do we have well what I see is a grid what if there was a way to create a grid for us there is with pi QT we have a layout called Q grid layout and you can see that I have my object grid and the value is Q grid layout which I’m going to use instead of creating four columns and five rows that seems really repetitive I can create one grid and add things to my grid which becomes incredibly useful for us but how do we add things to this grid do we still use add widget yes we are adding an object to a layout we still will use add widget but now add widget actually takes two additional arguments we create our grid object then we say grid we want to add a button where we need to specify the row in the column right so if we translate this layout add this object to this Row in this column now for this to work right we do need to create some type of index or current position in this example I’ve said row equals 2 in column equals 1 that would actually give us the number five button if you’re thinking how that doesn’t make sense remember programming languages start on zero so I’m actually saying row 0 1 2 column 01 that gives us number five we are trying to take our knowledge from an idea all the way to a completed application currently we’re on the number one you know how to get to number two and after the last two slides you should have a rough idea on how we can achieve number three you do see a new object in our calculator this little guy is called a q line edit tool and this is where we will see all of our Expressions being entered and evaluated number four is like a final bonus redesign and it’s a way for us to add slightly more details to our app we can change the font change the color things like that that’s our goal for this app to go from design one all the way to design three if we can get here this is a completed product we can then worry about getting to number four looking at this calculator now this whole grid system it seems like it’s going to take a while because I I have I think at least 17 buttons maybe 18 buttons so it seems really repetitive how can we deal with repetitiveness in coding what do we have for this Loops what are the two types of Loops you know in Python the while loop and the for Loop the four Loop is used to iterate to go through something else let me propose that we actually Loop through to create our grid so let me break that down to plain English in general tasks before you see any code I’m making a for Loop and I’m going to go through this list this list will be all the string elements that I want my buttons to say what do I want to see on my buttons like the letter c the less than sign the number four all of those I could add to a list and I could Loop through and say for every button text in my list every time I Loop through one I want to create a new push button object with the current text I’m on two for that object object I will create an event only for that button great then I want to add this new button to my grid layout one two and three all work for one button number four before I make the next button I should change my row and or change my column so think about this how can you achieve this and how can you achieve this with using a for loop as well as counter variables if you’re up for a little challenge pause the video here give it a try and then come back to continue watching putting this into code on the outside of my for loop I have two counter variables responsible for keeping track of my row and column I’m going through my list of buttons and every time I’m creating a new button object a new event for that button and then I am adding I’m taking my button and we’re adding it to our button grid every button is being added at an index a position row column once we add one button I want to increase my column or change my column if I get to four columns then I want to reset my columns and I want to go down to the next row this remember we start on zero so it’s actually 0 1 2 3 increase row 0 1 2 3 and I’m repeating myself amazing very well done I would love it if you took the knowledge that we just learned in this lesson and you go on and you create your design and create the initial product for our app I’ll see you guys over in vs code where we’re going to put all of our knowledge to the [Music] test Welcome to our next video in this video we are going to put together our initial design here in vs code for our calculator app let’s get started so who remembers the code burger right let’s go through those steps what will we need in order to complete this project well we really just need some widgets okay so I’m going to say from pqt 5. QT widgets let’s import the two most important ones so Q application Q widget what else will we need to create this well we need our new tool our q line edit we will be using push buttons then our layouts we have our qh which we can use for row if we need it we have our QV box for columns and our new tool is our Q grid layout which I can import up top like so um looking good all righty now that we have those we can create our starting template so our app which is our Q application then we can say our main window amazing who remembers how to give the main window AR title let’s say main window. set window Title Here I can put calculator app then we can take our main window and we can resize so the initial resize let’s say the width can be 250 and the height can be 300 we can see how that plays out when we’ve run our app let’s put in the final two lines what do we need to show our starting template well heading down here our final two lines we can show our main window and we can execute our app great let’s give it a run all righty there we are our starting template what do we need on here we need to now design the layout using our Q grid box our q line edit and then our push buttons that we want for our clear and delete as a as a starting template so this is what we’re aiming for all right and I’ll bring this back up as we work through this project but this is the goal up top in a column we have a q line edit this is like where I enter something then we have our Q grid layout with all of our buttons and the last one could be a row here that I may put and that contains our final two Q push buttons so to get our row and our design well let’s create all of our objects first so even before my design let’s go back and let’s say something like uh all objects or widgets right CU that’s what they are what do we need here well I need a place for my input so let’s say like a text box cuz that’s that’s what it can be this is our q line edit now q line edit does not take anything I will make my grid which is a layout so Q grid layout now the way we looked at this in the lesson is we have a for Loop that can go through a list and every element in that list or every position it can append or put that into our grid layout so I need a list of buttons now what order do they need to go in and we need to think about that let me bring up our example of the app again I’m going to Loop through so either we want to do it in columns 7410 or I could do 789 SL 456 star let’s go with the rows so how about we start by making this I could I could probably keep this up as a template uh so let’s say 7 8 n slash right and then I’m coming down the row we have four five six let me enter the rest of these here there is our list of button text now this makes it really difficult to see so let me re Factor this and I’m just going to make it look more pretty so that it’s how it would appear on the calculator right so there’s the same list I’ve just put it in rows now and this is essentially what we want to see on our app screen right when the app fires up it appears and you can see how each row of this list is corresponding to the row in our calculator now I just made this look like the calculator will but one long list is the same this is easier to understand and interpret now the final two buttons we can make outside of our list and those can be our push buttons let me close the app let’s create a clear button and this will delete everything in the Box I’ll put C and then we’ll say delete and delete could be a push button like we could do that for delete we could also write clear and delete might be fine clear let’s keep the symbol for delete uh all righty so we have everything that we want to see on our screen at this point let’s go through and let’s map this out and get our design we have our objects we need our design to start flowing how could we get our design started here well let’s create our layouts so I’m going to say master layout I know in the end everything will be held in a column that makes sense at the top of my column I would like my text box right that input so I’m going to put that right there directly under this I would like to actually add my grid of buttons which I don’t I don’t quite have those yet so I’m thinking out loud here then at the bottom we want to have I actually want to have a row so let’s also say add layout and let’s say button row while I’m here let’s create that button row so I’ll say button row and within that button row I would like to add my widgets so from left to right let’s say the Clear button and then we have the delete button let’s focus on our grit we have everything going and so we can see that let me turn off the grid let’s set the master layout to the main window cuz that’s our final design I’m going to run my program this is what it looks like currently we have that box at the top we want we have clear and delete I want to get the buttons between those two now so here is where I’m about to implement that Loop and remember every time we Loop over we are creating a new object with a new event why while also increasing the row and the column as well I’m going to shut the app down trash the terminal we are going to go right here before our design this looks like a good place before our Design This is where our for Loop is going to take form now I’m going to create my two counters so row and column and this will keep track of how many buttons are in each row as well as each column I can say for every text in this list so I have my list of buttons and I want to say for every string for every text in here so let’s say for every text in my list of buttons I want to create an object for the current button I’m on so I’ll say button equals Q push button uh what do we want it to say well I want it to say whatever the current text is in the loop when this Loop first takes off text is going to be the number seven number seven will be the text value of the first push button we create for this button it has the object name button I can create my event and I’m going to say I want to connect it to some type of function which actually I don’t have yet okay so let’s keep that empty while we have our button created we have the event created which I could say none while it’s also none let’s turn it off we can now add this to our grid let’s take our grid let’s add the widget what widget do you want to add I want to add the current button at the current row at the current column looking great all righty before we go on any further I now need to increase the column I want to move to the next button on the right so column plus equal 1 if my column is greater than three I want to reset my column so column now equals zero and I can increase my row because it’s time for a new row this puts together exactly what we want to see in our calculator app the final step is let’s just turn this back on again we can add our grid to our Master layout design when we give the app a run we should see our basic template with all of our buttons looking great this is the basic form of the app now notice it doesn’t do anything yet but we have everything ready to go for adding our functionality I’ll see you guys in the next lesson where we are going to discuss how we can add functional ity to our [Music] app great now we have our design for our calculator app completed but what’s the problem it doesn’t do anything yet that’s fine because adding the functionality to our applications comes after we create our initial design so in this lesson we are going to learn how to create that functionality as well as learning how to evaluate our expressions for example 2 + 2 evaluate to 4 in order to do this we could do this a few ways now what are you thinking about right now in this moment how would you add functionality to our app you may be thinking a few things and that’s okay before watching this lesson you may want to try and Implement your own ideas in logic which I highly encourage you try I’m going to show you one of the many ways to solve this and the way I’m going to show you is actually done through one sole thing function I am creating one function called [Music] buttonclick this is the only function that’s actually required to run our app you could make a function for each button sure that’s just a lot of code but would that work absolutely it would work what we’re doing is going down we are checking if the text of the button is the equal sign if it is then we set the value of this variable to be the equal sign if I press the button that has the letter c on it I would like to clear my q line edit object if we press the less than button we would like to cut the last element off our current text do you know how to solve any of these currently well let’s take a look at some of them our first one let’s begin with this so when we click a button I want to get the text value off of that button object do you remember how we can do this well we can use the text method and this method is linked to an object and it gets the text value of that object which is pretty cool you can see here here that I’m getting the text value of the button I’m getting the text value of the input box the q line edit box and I’m doing that here here and here pretty cool all right now that we’ve collected the text from the button we need to evaluate the expression that we enter into the input field for example if you clicked 3 + 5 we need to now evaluate that we want to change that to 15 any thoughts on how we can do this in Python well in fact you may have seen this python function around before python has a function called eval this function is made to evaluate expressions so if the expression is true if the expression is allowed it’s going to run next if we press C we want to clear the input field how can we do that well thanks to Pi QT Pi QT has a method called clear we can link clear to any object that we want to Simply put clear great this brings us to our final one if we press the delete button we want to delete the last item that we entered any thoughts on how we can cut an element from a string you should know this from working with strings and string manipulation as well as working with lists in order to cut I have a variable called current text and that is the text value of whatever is in my input field so I’m going to take that text and I’m going to cut using our square brackets to index the last position of the string minus one this is a key fundamental of string manipulation that you should already feel relatively comfortable with this takes us to our last method now a current problem we actually have is all the buttons have the same event or the same Target of event and we need a way to tell them apart but don’t worry because Pi QT has actually got us covered for this as well we only need to do this if we are making one function for our entire application which in this lesson that’s what I’m doing we can use the sender method and I’m going to link sender with our app object the sender method was created specifically to tell the difference between multiple events in Pi QT so that’s the first thing we do I create a variable called button and I am tracking which button did I click which button sent the event to me amazing the last thing we can do here is I’m going to throw in a try statement because I could potentially get an error I would like to try to evaluate the expression if that’s not possible then I just want to set the text of the input to error why is this useful why would this happen well if you pull out your iPhone right now any phone you have and you pick any number and you say I don’t know 20 divided 5 you’re going to get four but if you say 20 / 0 you’re going to get error that is what could happen what if a user tries to divide by zero we want to anticipate what could the user do wrong and I’m going to catch that right here so as a final precaution I am going to add my try and accept statement to catch any potential errors amazing before heading back into vs code to implement our app functionality you are going to see the next few videos in the next video we will finalize our app then I have prepared two remaster challenges for you that we should be getting comfortable with here are your two challenges for this project once you have a working product your first challenge is to remaster your app into a class based application so I want you to try to build your own class and refactor all your code to get it in your own class all right if you’re able to do that why don’t you try to add some designs and styles to your app as a hint you can check out the Q font module from pqt this will allow you to play with your fonts and for all the styling check out the method set style sheet if you have ever worked with CSS you’re going to be ahead of the game because we can add CSS to our apps I’ll see you guys over in VSS code where we are about to finish our calculator [Music] app amazing now we’ve addressed the functionality that we will be adding to our application here is where we left off I’ve cleaned some things up a little bit as we’re getting ready to add in our function the question becomes where should this go so if I take away all of our spacing here based on our last app we put the function at the end but I am going to get an issue because right here we need to connect to some button in order to create this event so it has to go before our Point here because this needs to go before our layout our function can rest just up here right after we create all the elements we’ll use all those widgets I’m going to create my function and this function is going to be responsible for Anytime a button is clicked so remember we have all those buttons on the screen and each button really has the same function call so we need to check what is the face value of that button what text is currently on the button what we can do is I can create a variable and I’m going to listen to who sent the message who was clicked that’s what it’s listening for then I can take that button of who was clicked and I can take the text value of it right so those those two are working together right there first I’m listening to what button was clicked then based on that button I’m getting the text value from it we can then check if that text value is actually the equal sign if it is then we want to get the text that is within our object text box let’s get that we can then try to evaluate so remember that this is an expression and I’m going to have a result in this result we want to evaluate the equation so like 2 + 2 my result should equal four I can set my text box as the updated value of whatever my result was making sure that I convert that to a string what is every Tri statement need well every try statement we want to have an accept we want to catch that so how can I catch that for every exception I don’t just want to say accept I want to say exceptions overall and I can give them a nickname and I’m just going to refer to them as e e means every

    exception so I can just print off and I’m just going to say error let’s put two dots and I’m going to say e so that I can get that type of error as well if we press the equal sign we evaluate that expression let’s check if the original button text is actually clear right does the text value say clear if it does we can take our text box and we just want to clear the value that’s within it that’s where the pqt handy clear method comes in what is the last button that needs its own as well well our delete button right if we press delete we would like to be able to backspace so if the face value of our button is that sign that we set we can then try and do a few things we would like to get the current text within our text box whatever it is it could be 85 minus 2 I want to get 85 – 2 I want that value it could be 100 I want to get 100 from there so let’s say let’s just say current value it’s the current value within that box and that is equal to my text box the text within looking good in order to update this now every time I click I want to update the text box so I can say set text because I want to change the current value of that and I want it to be the current value but I want to take off the last position so I can do that by signaling this as the index great and to touch up I want one more but it’s going to trigger no matter what so if I put an else here now that we understand that each of these are a condition we also need to understand that I can only press one button at one time all of these are a part of one condition instead of saying if let’s say also if or El if our final else we can say the current value is going to be the textbox value and let’s just say our textbox set text our current Value Plus text now remember text is going to be a button value so if it’s not an equal sign if it’s not the clear button if it’s not the delete button then it’s going to be a number or an addition symbol a subtraction symbol we want those to appear in the text box that is what this else is doing this is adding numbers to the text box as we click them this is our overall function and the functionality to it we just need to connect our buttons to this function and we have a working app going down now let’s take away all this space we can turn back on this event and I’m going to put in here the name of our function which is button click at the bottom here right before we execute our app let’s take the clear button that we made let’s say when that’s clicked I want to connect also to button click and when the delete button is clicked that can also connect to our function button clicked looking great amazing all within 80 lines of code just about we have a working calculator app well let’s check that it’s working that was our final stage of the basic form of this app all right let’s go down here let’s say 55 * 62 equals wow there we go looking good minus 36 equals great clear that works choose we can delete amazing well done coming from the first warm-up app that we created you were introduced to these basic concepts of design and how we set up a template app in pqt this is your first real world application in your first project this calculator app very nicely done what we’ve learned here we’re going to continue to build on in the next video we are going to learn how to refactor this code as a class-based application I’ll see you you guys in the next [Music] lesson as we enter this lesson let’s address who we did in the last lesson we completed the basic functionality of our calculator app a fully working app in Python with pqt using this framework now in this video we are going to learn how to refactor our code into a class-based application why is this so important well pqt is already structured in classes as you can see here with QT widgets it’s everything we already have so you should feel confident and comfortable creating your own classes methods and properties the second point is as we go forward in our projects they are going to become more class based focused as this course is designed to take your basic programming skills of python in object orientated programming and grow on that idea that concept of o or objectoriented programming as I’ve introduced how this framework is class-based it’s now time to start making our projects in a class right here is where we left off in our last video our app still functions I haven’t added any more code it’s now time to refactor we looked at this very briefly in the introduction lessons of this course but if there’s anything that you’re hesitant about feel free to check out my other objectoriented programming course or just go back a few slides and review what we looked at in order to do this let’s create some space here so pretty much everything I want to have in a class and the last two things I’m actually going to remove our app and Main window because those will automatically run here at the end so I’m just going to store them down here for now going up to our top let’s try and keep everything so I’m going to create a class and I can call this Cal app it’s my calculator app everything below we pretty much want inside of this class all righty I am now storing all of our original code in a place called class app now we still need a main window and as you saw I just removed my main window so how can I pass in a main window that my class can use well the obvious one that we may be thinking is Josh why did you just remove that well what I can do is I don’t actually want to do this I can take first off let’s uppercase that I can take Q widget and I’m actually going to inherit Q widget why can I do this well remember in pi QT all of these are classes so a class can inherit a class I’m using this Q widget as a super class I can now take that away I’m inheriting that I’m left with all of our starting code and this code starts as soon as the app starts so what is that special Constructor method that automatically runs when an object is called in it we need our initializer function so let’s say in it I’m going to put self I’m going to activate my super class so with our super function we can initialize the super class now that we have that let’s take all of this we’re just going to put that right there inside main window is nothing but now that I’m working with a class these are not variables they are now properties self is referring to the Q widget remember that originally I had said main window equals Q widget I’m inheriting Q widget so instead of saying main window it’s kind of like saying self my S is a q widget I am a q widget so I can say self. set window title instead all righty all the widgets we originally made I’m just going to come down here and let’s turn those into properties so self self and self looking good all righty uh let’s continue down you can see that I’m given an error Here in My Method this has become a method it’s now a function a class everywhere it says text box I don’t have textbox anymore that has become a property correct so let’s just add our key keyword self just like so and then pass in self as a parameter looking great missed one self going down this where we create our buttons that should be done at the start right that’s done through the initialization process so I can refactor that by putting that just directly inside our Constructor in it there we go looking good I’m going to give self here so self button click my grid has become a property self grid and our button list is now self buttons already going down our design once again when the app fires up in order to start the app everything should be done at the beginning so all of our design now that we’re working with classes I can remove this and I can put this inside in it once again I’m going to drop down here and let’s just drop it right there all of these we can tab over remember that anywhere we have main window we don’t have that it’s now self uh all of these guys have become properties going away from the variable form so let’s add self looking great all right so our class has been restructured and refactored let me clean that up so now in it initialize start when the app starts everything is done all the design is done right because that should be happening we then have our method Now button click that’s only triggered when we click the buttons and the reason that I can put my design before now is because this is a class the word self unlocks everything in our class that we can use anywhere we want we can go to our Bottom now for this to work if we ran it well let’s run it and let’s watch what happens it’ll make for a better explanation I get this massive window blank screen that doesn’t look right okay let’s close out what we need is we can use the python condition that we like to say so if the name if you’re running the main file is what this translates too if that’s the case then I want my app to run or execute I want to create an object I want to show that object now I am using Q widget remember we don’t need Q widget anymore because we gave this as the super class to our calculator app so this really should be Cal app main window is fine I can use that outside here running our app it’s now brought back to life 78 – 35 equals there we are a refactored form of that app through classes heading over to our last video now if you’re up for the additional bonus challenge we will be learning a new class that I gave you the hint of using Q font as well as the method of set style sheet to design your app a little bit more I’ll see you guys in the next video [Music] all right let’s add some design fonts and color to our application in order to change the font of our line edit and other tools let’s import Q font so I can say from PI qt5 this is from the qtgui module I can import Q font and Q font I want to use that to set the font of the text box so I can use the method set font and inside here you can see it actually says Q font so let’s say let’s put our Q font class in there as the argument to our method set font and I can actually put the type of font I want so let’s say uh helvetica as my font and then I’m going to style it as let’s say a size of 32 all righty so that’s step one we’ve styled that let’s go down a little bit and style the buttons so here we create a button here we create a button button event before we add it to our layout let’s style it so let’s use the method set style sheet so this is going to allow us to essentially use like CSS in pqt which is quite cool and wherever you are in your programming Journey you have probably come across CSS and HTML before if not this will be a great time to just briefly read through some of the CSS guidelines So within this method set style sheet I’m going to specify a few things and I’m going to specify all this as a string this is going to be just like normal CSS So within any CSS file we would typically put the name of the element that we want to affect so I want to affect a q push button that would be followed by a set of brackets or curly braces the first thing that I want to affect is I’m going to say font and I want to give it a font and I’m going to say this font is going to have be 25 pixels or a font size of 25 and let’s be creative here and let’s say comic Sands as our font style and then I would like to give a padding as well of let’s say 10 pixels to each button so I can specify that like that great so each button is going to have this styling to it all right we haven’t added the color we’ve given it a font size a font family as well as padding going down to each button now let’s take our Master layout and let’s set our margins so this is going to be a small amount of spacing in between all of our buttons and let’s say I want there to be 25 the right left top and bottom that’s the margins that I’m giving each button and I can justify it just like that finally to end things off let’s go down to to our bottom right here I create my main window object before I show my main window let’s set some styling to this now the question becomes what do we want to style I want to style my entire app and our entire main window is our Q widget so I can set that like so in here let’s just say uh background color and let’s give it background color so let’s say like uh o I don’t know these let’s say 1 two three interesting color it’s like going to be a really darkish black blue let’s try it let’s run our code okay so unknown background color and that’s because I spelled background wrong you can see the comic SS taking place that’s really cool let’s go down uh background and I also noticed one more thing that we didn’t put in O okay so far too dark right I’m not I’m not a fan of that I’m going to change a few details let’s give it like a lighter color and I actually have a color right here and also my delete button and my clear button they did not have any styling to them I’m going to go up so I actually create them right here I have my self. CLE property and myself. delete and both of these are going to be our buttons for each each button let’s say self. CLE let’s say set style sheet I’m going to actually take this because I want the same properties as my other styling great we can copy this and for our last one let’s just set our delete button running our application there we are it looks amazing it looks much better than the last product we had congrat congratulation that is the completed calculator application for our course going into the next project let’s take what we’ve built here and build on top of that and create an app that’s going to add even more functionality that we can use in real world situations I will see you guys in the next lesson for our second project [Music] Welcome to our next project in this project you’re going to learn how to combine multiple modules to build an interactive photo editing app in Python with pqt and the pill module let’s dive in and let’s take a look at what this app is going to look like and what it’s going to be able to do Here’s the final product of what we want to get our app to look like what can this app do well we can select an image from a folder from the desktop we can apply filters to the image before we edit it we can edit all of our photos using the tools that we Implement and finally we want to be able to save the photo we edit to our desktop pretty cool now looking at the app what widgets do you see in this app what widgets do you think we’re going to import from pqt to build out our design here we go how many of these were you able to get right hopefully all of them if you happen to miss any it would most likely be the Q combo box and the Q list widget as we haven’t used these widgets yet our Q list widget allows us to have a list of things within our app and then the Q combo box is essentially a drop- down box and this box drops down and it allows you to select an item from that box all the other ones you’re familiar with and you may be thinking Josh this is a picture why did you say Q Lael well we’re going to look at that closely but in the initial design of the app it’s easiest if we just set this area to something that’s not the picture yet so I’m going to say Q Lael in the future we are going to change the value of this Q label to become a picture the final a point we need to think about now how would you like to design this app what’s going through your head right now well so far you’ve learned three layouts we have our QV box which is for vertical or columns we have our qh box horizontal row and then from the last project you were actually introduced to Q grid layout what do you see how would you design our app how I’ve put it together is I have a master row this master row everything will be added to but instead of adding it individually we can create one two columns we can add the items we need to these columns then we can append it or add it to our row pretty cool now before we get into this new module pill which is going to help us edit photos with python and before we Implement any functionality to our app we need to focus on the design of our app so far we have created two projects you were introduced to pqt with our warm-up random keyword app in the last project you created your own interactive calculator I want you to use use the two projects and everything you’ve learned in these last two to create our initial design for our app here let me go back here’s a refresh of what you need to add let’s head over to the next video but before you do I want you to at least spend the next 20 minutes and I want you to try to design what you see here in VSS code I’ll see you guys in the next video [Music] here we are in vs code in this lesson we are going to set up our initial project for our image editor app let’s jump in and let’s set up our initial design starting things off what do we need to import here well let’s start with our design so from PI qt5 what widgets do we want to import well our two most important we have are our Q application let’s say Q widget what else do we need for this app well based off what we discussed in our lesson we’ll need a label we will put in some Q push buttons we have a Q list widget this will allow us to add the items we select to a list we have something called a q combo box let’s start to think about our design for the design we know we’re going to have some rows and we’re going to have some columns great I think that’s a good starting point for our wiek widgets for our alignment tools who remembers the module for alignment we can say QT core specifically I would like QT and we can start with that for our setup great I’m going to begin by creating the two objects that we need to start things off here so app and let’s say main window that’s our widget great I would like to set my app title so set window title and let’s call this a photo QT my version of uh Photoshop let’s set our initial size and I can say 900 and 700 great I’m going to jump down and let’s get our template shown so main window Show app dox execute I’m going to give it a quick run to make sure everything checks out before we jump into our design there we go great so it is working this is the size of our app and my template is all ready to go we are ready for the next part of our code Burger speaking of the code Burger let’s label a few things out to prepare us all right now that I have things labeled I’m going to jump here and I’m going to create all the widgets we want to see in the app now this can be in any order you want as long as we have them all So based on the app we’re trying to create I’m going to work left to right at the top we have let’s keep it with good name so I have a button for my folder and this will allow me to click and access my desktop so that button will say folder under that we have our let’s call it our file list and this is is our qless widget that’s going to contain all the files within the folder that we select we are going to have all of our editing buttons so now comes the question of what editing tools would you like to add in your project you can read some of the documentation and be creative to what you would like to add I have selected the following so I’m going to create a rotate left button a rotate right button let’s have a mirror let’s have a sharpness let’s say gray is easier than black and white we have a saturation and we have a contrast I could say blur as well that gives our tools more ability for each of these there each going to be a q push button and each of those will have a string so let’s just go down and let’s add those great we have our objects ready to go what would you like your buttons to say so let’s initially say left WR uh we can keep all these variable names that we initially used we can just keep those that brings us to our next widget that we need to add I need a drop- down box essentially so I’m going to call this let’s say drop- down box and in order to get this into Pi QT when you’re working with this widget this is our combo box so let’s call this a filter box and I can say Q combo box now we need to add the items what do you want to see in the drop- down box ideally I want to see all of these in the Box to do that we can take our newly created object filter box and let’s use the method add item I want to add a sing single item to my drop- down box the first one will be my original so I need that because when I apply a filter I would like to have the ability to revert or go back to my original photo so let’s say original I am just going to go down through each button I created and I’m going to add that in here as well I now have my combo box with each of my buttons added in there which we will use to apply a filter with later very good my final item is I want to create an object for my picture and this is the actual area in the app that our picture is going to appear but initially we don’t have a photo so I just want to create an object that I can set as the initial placement in my app later changing to insert a photo initially let’s just say Q label and the label is going to say image will appear here we can just put that text like so awesome all of our objects have been created which leads us down to our app design the master layout for my app so I’m going to create a master layout and I want it to be a row so I will set it as a cube hbox layout within my master layout I know that I’m going to have two columns so I can create column one and column two let’s begin with our first column so what do we want to see in this column starting at the top I want to see the folder button and let me show you guys our app so this is what we’re aiming for in our design I want to see this button up top above my Q list widget my drop down box than all my buttons let’s add those to our column one the first thing we want is the button for folder next up we would like our file list this is the Q list widget I would like to see our filter box and directly under that I’m just going to go through and I’m going to add add each button that we’ve created up here to our screen all of our buttons are here and they’re added so column one is completed and column one contains most of our objects the only thing that we want to see in column 2 is currently it’s just going to be our Q label or the picture box because I want to give my picture as much space as we can so we have more editing space column one and column 2 is completed what is the next step of our code Burger well let’s take our Master layout which is a row and we can use add layout to add column 1 as well as column two to our Master row or the master layout the final piece of the puzzle let’s take our main window and let’s set the final layout to become our Master layout let’s give our app a run here’s the app when it’s loaded now it looks a bit strange and that’s because this left column is actually taking up the most room that only leaves a little bit for our image when in reality we want to flip this we want to have this the opposite way I want the First Column to take up the least amount of room possible and give our image the most space we can let’s close our app I’m going to kill my terminal in here I’m going to justify how wide do I want column 1 to be out of 100% let’s say column 1 is going to be 20% of the entire screen this argument is called stretch it allows us to justify how much of the screen we want that column to stretch when we run our app again we now have it exactly how we want it to all of our buttons are on the left our editing tools and our drop- down box has the options that we’ve added to it when we click one we will have this apply a special filter to our image to see if we like it before we go and we click the black and white button great our design is done and we’re ready to add the functionality to our app I’ll see you guys in our next lesson where we are going to discuss just how to do so [Music] now that we have our app all set up and ready to go it’s now time to introduce to you this new module that we are going to be working with this new module is is called the pill module or more specifically the python image library now before we Implement any of this code within our project I want to take some time to just play with the pill library in its own file we can break that down understand that then we can take what we learned and use that within our app let’s take a look at how this new module is broken down the python image Library allows us to work with real photos in Python so imagine the photos you take on your phone or your camera we can take those photos and we can edit them in Python and if you broke this down this is like a really basic version of Photoshop but the more we build on the more advanced we can make our apps and if you notice here I’ve actually put this how I structured the breakdown of the pqt framework and the pill library is actually quite similar pill is like a massive library or module and within pill we have other modules that we can import individually to achieve a certain task each of these modules contain functions and properties of their own this is very similar to how Pi QT is working we will be using three modules from the pill Library the first one is called image and this is a class that holds properties and methods specifically for working with pictures as files so you should start to think now okay how do we work with files in Python how do I I load a textt file or a Json file in Python think about that and get a head start the next class that we can look at is image filter and this is a group of constant variables that we can use to apply filters or rotate our images apply filters or rotate our images remember that and the last one is called image enhance we can use IM image enhance to enhance our images so if you’re used to photoshop or the editing tools on let’s say Instagram there are tools for saturation contrast and Vibrance we can use these with python and we can get those from the image enhance module now that we understand these three modules that we will use from the pill Library let’s take a look at a few code examples in what they they actually do behind the scenes here is some of the code that we’re going to be using and it’s not in any particular order except the first one and the last one because this is the overall structure we will use in the app going forward to kick things off we can import pill but remember pill is massive and just like Pi QT we don’t want to say import Star there’s too much happening so be more specific what do you want to import and what will you be using in your app I can say from the pillow Library import the image module class image filter and image enhance and this is the structure to import the classes we are going to be using in this app we have a method called convert convert takes an argument of an L don’t ask me why that’s what it is and what could convert does is it converts this image pick to a black and white image pretty handy pretty short and that can be done very quickly next up we could increase the sharpness of your picture now by changing the sharpness this is actually a filter we are applying to the original photo pick what do we want to filter well I want to apply the sharpen filter that is a part of my image filter module and it’s stored in a variable called sharp all right now we’ve seen the basic image module we’ve seen the image filter module now let’s look at the image enhance module if I want to make my picture more saturated or add color I can do so and how we do this is we create our variable and the value is we take our class image enhance and we apply a subclass color what do we want to add color to this pick this original picture and I can enhance that by 1.2 I say 1.2 because the picture begins at one so I’m increasing it by more or less 20% 1.2 if you want to mirror an image you can use your image class and you can use something called flip left right and finally to save a picture you can just use the pill save method we can link that to our new picture name and then our picture is actually saved within our desktop or within vs code now I asked earlier how do we open text files in Python and I wanted to get you to think about that because we can do the same thing with an image in Python we can use the python open function take a look at our code try and interpret what’s happening if you need to pause the video please do at the top we always import everything we are going to be needing in our code so because I’m using pill and images I’m going to import the pillow library then we can use the open function just like we do with text files with open the only difference we need to do is I need to specify what am I opening so with open I want to open a picture called selfie. JPEG and this picture I load I’m going to give it a nickname and reference it as pick so now anywhere I use this variable pick the value of pick is actually the picture we decide to open so I can show my picture I can then take my picture and I can enhance it I can add SE saturation to my pick it’s being passed down if we want to convert our pick to black and white the same thing I can take my new picture variable because I created that and I can convert that to black and white remember after we do something if you want to see it you need to show the new picture if you want to save it you need to save the new new picture but in this code did we save the pictures no we didn’t do you remember how we save a picture we need to use the save method I am saving this new picture black and white and I’m giving this new picture the name gray pick jpeg let’s head over to vs code in a new file outside side of our pqt app and let’s spend the next 10 minutes and let’s experiment with how this new library works and how we can use it to edit photos you are going to need a few photos you can use your own or you can head on to Google and find a few stock photos that we can use I’ll see you guys in our next video [Music] let’s take a step away from pqt you have just been introduced to a new module and this module is called the python image Library we use this to work with images in Python which allows us to open them and edit them so in this lesson we want to practice and introduce the steps we need to take in order to edit an image everything we learn in this lesson you will be implementing and using within your pqt image editor app all right let’s jump in and let’s import what we need so I’m going to say from the pillow Library I want to import image we need image to be able to open the image or do the basic edits to the image we are also going to be looking at a class called image filter this allows us to apply filters to the image as well as image enhance image enhance allows us to add contrast or saturation to a picture now that we have that I’m going to come down here and we want to open a picture so here I have the picture I’m trying to open I can delete this one right this is the figma logo I want to use this and I want to edit this in our main file I can put inside open my picture name whatever picture you want to use just drag it into VSS code so I want to open this picture and I want to give it a nickname and reference it as picture so every time I use this variable I just make picture it’s referring to the picture we’ve loaded in here but I can’t just open an image in Python I’m going to get an error open is meant for text files and Json files but because we’re working with the pill Library I need to say hey it’s actually image that I want to open and this image that I open I’m going to call it picture now that we’ve done that let’s just run a a quick test I can say picture. show and there we have it so it’s loaded up on our screen great I’m going to turn off picture Showdown let’s start with our editing techniques so a nice one to be introduced with is black and white let’s say that we want to convert our picture to black and white so I make a variable and the value of this variable is our original picture and I’m going to take that and I want to convert the original picture to black and white now that I’ve done that I can take this new image and I can save this image what name do I want to give this well I could just say gray.png save it when I run this I’m not showing the picture anymore I’m just saving the picture so it’s going to edit the photo and it should appear here great our code’s ran and it has appeared here I click that there we go our picture has been edited we’ve converted it to black and white it looks great let’s play with a few more going down what is another one we could look at well let’s say we want to rotate or mirror our image we looked at these during the lesson I won’t be doing all of them in this video so I encourage you to use what we just learned from the lesson and try the ones that I don’t talk about about here in our video Let’s make one for Mirror I’m going to say all right what do I want to mirror well I want to mirror my picture all right what do I want to do with this picture I want to transform it or transpose the picture great what do I want to do to it now that I can transpose it well I can take my image and I can say I want to do flip left right that’s going to mirror our image I can take this newly created image and I can save this image let’s just call it mirror.png running our code there we are with mirror and you can see the figma logo is actually flipped right if I go to the original it looks like an F for figma I go to mirror it’s a backwards F that’s awesome we just transposed and flipped our image with mirror we’re going to take a look at two more I want to use use one from each of the classes we’ve imported so I’ve used image and you can see how we use that with our open function as well as any type of rotation so if you want to mirror or you want to flip the image left flip right upside down we use the image class let’s say we want to apply a filter so a filter could be like blur or sharpen things like that let’s say we want to make the image blurry so I’m going to create a new variable called blur I’m going to take my picture and I’m going to apply a filter to that picture what filter do I want well I want blur and that it comes from the image filter class so I can say blur just like that we then take it we can save it give it a name of blur and we can run it now it’s quite tough it is blurred it’s just quite tough to see because this is an SVG image there we go that’s blurry all right looks great I’m going to do two more now and both of the next ones are actually going to be from the image enhanced class we’re going to talk about two ways we can do this I would like to begin with the contrast so I would like to add contrast to my image this is equal to our image enhance contrast what do you want to add contrast to my picture okay so I am telling python that I have a picture called picture and this is what I’m going to add contrast to it’s now called contrast I’m going to take that variable contrast and I’m going to say it’s now equal to the original contrast but I want to enhance it you photos start on one every photo is one a good starting point once we get into coding our app will be like 20% so 1.2 would be 20% contrast for this I’m going to go all out I’m going to say 2.5 that’s a lot so I’m adding a lot of contrast I can then take this new image let’s save this new image let’s run our code look at that that is a lot lot of contrast added to our image and it actually looks pretty cool we’ve turned all of our colors if I go to our original we came from that we went to that so you can see the power of this and the power of editing these photos I’m going to do one final one now what you see here is you see a lot of repeating actually there’s nothing wrong with this this is easier to understand especially when you’re first introduced to this module but we could do this a faster way as well now I’m going to create one for color I can say the value of this is image enhance this time color what do we want to add color to my picture instead of going to our next line I can just link my enhance method here it’s the same exact thing let’s say 2.5 again that’s a lot of color in our app right let’s just try 1.2 because we will be be able to continuously click the button to add more if we want to for here 2.5 we can take our color and we can save that new image as color PNG you can name your images anything but the extension they end with make sure it’s the same extension as the image you originally loaded I’m ending with PNG so I’m using PNG when I save the images let’s run this for the final time you can see how much brighter that got we added so much more color in there looks great we have just gone through and we’ve introduced and played a little bit with photos before you head into the next video I would like you to go find three photos these could be photos that you’ve taken off your phone that you want to try editing or photos online spend the next 10 or 20 minutes programming out a few more edits you can use what we talked about in the previous lesson or you can Google and do some research and read the pill documentation what can you find anything you’re able to add you’ll be able to add in your image editing app I’ll see you in our next lesson [Music] now that you understand how the pillow pill Library works it’s time to implement this to our photo app and in our last project the calculator app as a bonus part of the creation of that we did a refactor challenge where you refactored the app into a class-based application we are going to start from the get-go right now in creating our image editing app as a class-based application here I have two bullet points and each of these are actually two different methods that we need to create and I’ve worded these out before we look at the code to get our minds thinking about how this can be done and after I go through this in a file in vs code I want you to just type your ideas out spend 5 minutes what would you do what do you think is right to solve these we need to create a function now we want to create a function that’s going to filter through two two lists the first is a list of files and this will contain all of our photos and the second list is going to be a list of extensions so think about that what extensions do photos end with what we want to do is for every file in our file list we want to check to see if the file has one of the correct extensions now our photo extensions should have either jpeg PNG or SVG as there’re in image if they do indeed have one of those extensions we want to add them to a new list that we create within this function now as a hint I’ve given you a part of the code because this is a new pqt method we’ve never used before I can use this with a condition and I can say if the current file name I’m looking for ends with the current extension I’m looking for we can append it to a new list you’re going to start to see a lot of new methods actually I will do my best to explain them here in the lessons as you implement them into your code now that we have this first function done our filter function we want to create a function that gets the current working directory now if you aren’t familiar with the directory that’s okay let’s introduce you to that now you’ve probably seen this before in vs code when you run your code in your terminal it displays something like this right and this is basically where are you within your computer system users is like the main starting point at least I’m on a Mac the main start of a directory on a Mac is users then it’s the current user so what this would say is my path I’m on a Mac in the user Josh on the desktop in a folder named folder one in a file called main.py right that gets where I’m at and that’s called our directory in order to get my current working directory with pqt I can make a variable and the value is a q file dialogue and the method is get existing directory now Q file dialogue that’s a q do we import that what do you need to do for that think about that this function calls the filter function and we add the file names to our Q list widget on the app screen so this new function that you’re making is actually going to call the first function we made and it’s going to take those file names and it’s going to add it to our Q list widget as a hint here is the actual code we’re going to use this is the filter function we just made and it’s taking the current working directory with our extend iions this is our class in the last slide we introduced the two functions we need to create outside of our class which we are going to use to give a path or give a file to our class we Define four properties from the beginning because I know taking a look at some other important methods we need in our class we do need to create a method to save our image but don’t worry because we can still use the pqt or the pill save method but I want to create a method that is going to allow us to do so when we want to save an image we have to check right here I need to check if the path that I’m am trying to save my image as already exists so for example imagine you have a picture on your desktop called background then you try to save another picture as background we can’t do that you can’t have a picture that has the same name because they need their own unique path so first we want to check right here if the path already exists or the path is the current working directory if not then let’s make a new directory that’s what that says right there we can make a new directory and we can join that path with our picture then you can save that new picture awesome that brings us into actually loading our image so in the last slide we loaded a file but now we need to take that file and we want it to show as an image so how can we do that well let’s create a new method to show this image and this method will take one argument which is actually going to be a path where is this file we’re trying to show located remember in the original opening of the app we said the picture was going to be a q label so let’s hide that Q label it’s now time to show an image we can use the Q pixmap class from the QT GUI module and we’re going to give it the image we want to load which is our path once we have this image we want to give it a width and height which it’s just going to take the width and height of the CU Q label in our screen and then we can set the image and show our image set pix map and qpx map are coming from the module qtgui you must import qix map at the top of our code from this new module now that we pretty much have everything our class in the app generally are going to work but we cannot edit our photos remember if we click a button we want to have the ability to edit the photo based on the button we click we want to take what we learned just in the last lesson while you were experimenting with the pill library and bring that into our new application here is just one example of one of our methods so let’s let’s say we want to add saturation or add color to our image I create a property called self. image because remember my class has these properties we made at the beginning inside in it and it’s going to be given one photo in our class this photo no matter what it’s called we can call it and reference it as self. image the value of the image for this method is exactly what we saw before remember when we were introduced to the pill library and all the new code this is the same code the only difference is we are changing the name from pick to self. image all right after we edit the photo we can then call the save method that we just made we want to save our photo and then finally you want to show your new photo because this photo is new you need to generate a new image path remember let me go back actually I’m going to go back to the very beginning here we created a new folder called save folder this is the new path we need to use this now while we’re loading our new image I need to join together my current working directory my new save folder in my new save file all of these final three lines in every method you make are going to be the exact same you can copy and paste them because every time you edit a photo you want to do the same three things you want to save the image and you want to show it the only difference in the methods you are about to program you need to change what you want to do with that photo you can remember this and you can go back a few slides and look at what we did in the last video finally to tie everything together you need to link your buttons or your events do you remember from the first two projects how do we connect our events in pqt the object has the value of the class that we just made we can take the folder button and we can say hey python when this button is clicked I want to connect to the function we first made that allows us to choose the work directory then once we load all of the images we can take our file list and I want to access the image that I choose from the file list to do that we can make this new function and we can check if we select one of the items from the file list if we do we want to call the load image method we made inside our class editor this final function is responsible for loading the image we click from the Q list widget we have done a lot now before going into vs code you should go back through and review a little bit here and take some screenshots try and put all these pieces together in debug on your own I’m about to head over there and I’ll see you guys in the next video where we’re going to add the functionality to our image editing app I’ll see you guys there [Music] now that you’ve been introduced on how we’re going to add functionality to this app let’s Jump Right In and let’s do so to kick things off let’s focus on what we’re going to be doing and we want to be able to click a button and unlock your desktop or access your operating system and through this you’ll be able to select a folder from your desktop that we can open its contents and display within the app to open and unlock our operating system in pqt or python in general we are going to import the OS module OS stands for operating system we use this when we work with operating systems and finally in order to get an image into pyqt5 we are going to import something called Q pixmap qpx map comes from the qtgui module great we have imported OS and we have imported our Q pixel map looking great where are we going to add the functions and our class within our code well let’s go down to the very bottom all the functionality that we want to add will take place before the show in the execute methods so let’s jump in right here what do we want to do well I know that I want to filter the files and extensions we know that we want to choose or get the current uh work directory so where are we within our system those are going to be the first two that’s going to help us so let’s create a variable and let’s say working directory I don’t know what that’s going to be yet but I’m going to need that variable and then making a function for filter so filter is going to take a bunch of files and it’s going to take a bunch of extensions remember that these extensions are what our photo ends with so jpeg PNG SVG something like that I am going to create a list here CU I want to go through these files and extensions and I want to check that if they match if my file ends with the correct extension I can add this to my list let’s Loop through and let’s say for every file in all all my files I also want to Loop through every extension in all my extensions if the current file that I’m on ends with the current extension I’m on that’s a good thing I want to append that file to my new list once my Loops are done we can return my list okay so let me translate that I’m creating a list and I’m giving this function a bunch of files and a bunch of extensions I’m going to Loop through and I’m going to say for every file in the list of files it was given for every extension in all my extensions if the current file I’m on ends with one of the extensions I’m going to add that to this list and then finally return this list I want to use this function within another function I need to create a function that’s going to allow me to access my current working directory I’m going to say get work directory this is not going to take any arguments what I want to do here is I want to access this variable and because it’s on the outside and I want to change the value let’s make that a global variable in order to get my current working directory we are going to use a class from pqt called Q file dialogue let’s go up to the top of our code and let’s actually import it can be anywhere and I’ll say Q file dialogue just like so I can now use this in the function that we were just making get work directory so to access the current working directory I can take my Q file dialogue and say get existing directory just like so so now the variable working directory is holding my current working directory I’m going to create a list here called extensions and this is the list of all the possible extensions that my photos can have so I’m going to put these here for now and where these are going to go are they are going to be passed up to our filter function this is the list we’re giving and this is the list that we are going to Loop through because these are the accepted extension names every photo if you take it on your phone or if you take it on a camera it’s most likely going to end with one of these extension now that I have my current working directory and I have my extensions I’m going to create something called file names this is just a variable but its value is going to be whatever I return from this function so the value of this variable is going to be a list results that we get back what arguments do I need to give my function well we need to give it all of our files and all of our extensions where are we going to get all of our files well it’s going to be our current list directory or our current working directory so I can access my operating system and let’s use the list dur method function from the OS module and I can just give it my working directory that’s the first argument this argument is the same thing as my files the second argument I’m just going to give it my list that I’ve just created of extensions all right this looks good once we’ve done that I want to take my list where do we want these files to appear in our app well the correct answer is the Q list widget that Q list widget we have named file list right here I want them to appear here so I want to make sure that I have a clean slate or an empty list before I load in these new files going down let’s just say file list clear remember the clear method we learned this in the last project I’ve cleared my file list and I can now Loop through my new list file names remember that this is a list because the value is the list that we return so my list is called file names for every file name in my list of file names what do I want to do well I want to add every item that I come across to my file list just like so amazing all right we are so close here so we have our three starting functions we’re close to testing our app but we’re not done just yet all we need to do to run a quick test is let’s connect the button so let’s take our folder button and let’s run a quick test let’s use our clicked event so when the folder button is clicked I would like to connect to my get work directory function let’s run our app I’m going to click the folder button and try to load something from my desktop it’s working right so when we click the folder button we unlock our desktop you have the ability to go and select the desktop and choose a folder you want you just have to click the folder one time and click the open Button now everything within that folder I have loaded in my Q list widget these are all PNG photos you could have jpeg you could have anything that we specified right here as an extension awesome the app is looking great I want to have the ability to now click one of these and have it load over here how can we do that well let’s carry on and let’s solve that to do this we want to create our main class our class that’s going to store all the methods we make as well as be responsible for programming all of our buttons I’m going to close this I’m going to create a class and I’m going to call this editor editor we do need to have our Constructor and we need to ask ourself what pieces of information do we want to have inside our Constructor and not even inside the Constructor what information do we want to have access to within our class well I know that I’m going to have an image currently I don’t know what it is but it will have a value I will have one called Original and original is going to be responsible for holding the original image that we can go back to at any point in time I’m going to have a file name and lastly I’m going to have a save folder Where do I want these new photos to save this will be an extension of your current path so let’s just call it Edits edits is going to be the name of a new folder that we start to save things to let’s start with all the important methods we need a method to load images to save images and to show images let’s start with load an image this specifically will not actually load the picture in the app but it’s going to load the file name that we can take and then we can load that file name into our app as an image this method load image is going to take self as we need to remember self is like a key it unlocks our class and it will also take the file name that we want to load in our app let’s turn that file name into a property so I actually already have my property I am taking that same property and I’m changing the value To None to become whatever we give this function so my argument becomes the value to my property self. file name all right great next we need to create a name so the full name of where we’re trying to access and I can do this by connecting pieces of our working directory to do this we can access our OS module and we can say I want to join together I want to connect two paths or two directories together so OS path join I want to join together my working directory of where I’m currently at and my file name just like that after I have this new path called full name we want to open this so I’m going to take my property self. image that we’ve created up here currently its value is none who remembers how do we open an image I want to use the open function but I can’t just use open alone I need to use the pill python image Library so let’s go to the top of our code and let’s actually import pill I’m getting ready to use it from pill I want to import image what else will we need for this well I might as well import my other two classes now as well image filter and image enhance look at this we are creating this app and we have used three modules I’ve used OS I’ve used pqt and I’ve used pill they’re all working together to create a single application pretty cool now that we have image let’s return to our class I can say image. openen there we are what do we want to open well I want to open my full name right this is that path I want to open this image now as a file we have our image and before I edit the image or do anything I want to make a copy so I’m going to take my property original right here currently its value is none but I’m about to give it the value of my current image that I just loaded what do I want to do with this current image I want to copy this image now anything I do to the pictures through editing I always have a copy of that original image load image is done what is the next method that we want to do well let’s make one to save our images that’s what this is going to be responsible for every time I edit an image I want to have the ability to save this image within our new save folder how can we do this well let’s create a path and let’s say this path is equal to a join path and we can join together our working directory and at the end of the working directory I want to just link on the save folder so for example if my current directory is users SL job SL desktop now I’m going to link on my new folder edits right here that’s what we’ve just connected those two together we have our path I now need to check to make sure that this path does not exist so does this path exist or is this the current path so OS path is dur is the current directory okay if it’s not I am allowed to make a new directory with that name of my path I can create a full name again and just like before let’s say OS path join but now the question becomes what do we want to join together well I want want to connect this New Path I just made and at the end I want to connect my file name that property we can take our image and let’s call the save method what do we want to save I want to save my new path that we just made amazing all right we have our load image we have the save image before we do any type of editing we need one last method to get everything working this method is going to be responsible for showing our images so let’s call it show image this will actually allow an image to appear within our app screen this will take the path of the image that we are trying to load the first thing we need to do is the place we want to load the image is at actually a q label we don’t want to see that Q label anymore so our Q label is called picture box let’s hide the picture box taking that away from our screen next up let’s create an image and this is going to be an object of our Q pix map class that we just imported qix map allows us to load images into Pi Q UT it takes an argument what do we want to load well this path so I am giving a path to this class qix map and QX map is converting this path to a real image that we can show the next question becomes how big do we want this image well let’s actually load our app again I want the image to take up all of this space this space remember is 80% of the screen and we said that because when we created our layouts up here I Justified it as 80% of the screen so column 2 is 80% in column two it only holds our picture box in our show image let’s create two variables width and height let’s say the width is going to be the picture box width that’s literally the width of the whole column two and the height can be the picture box height and that’s going to take that what can we do with this now well I can take the image that I’ve created right here in line 119 and this image I want to scale it so I’m going to take the image and I’m going to scale it how big do I want to scale it well I now have a width and height that that I can scale it too an image that we load could become distorted and I don’t want that I want to prevent it from being distorted or weirdly deformed in any way to do this I can actually use the QT module and remember in the past we have used QT for our alignment well here I can use QT to keep my aspect ratios of the picture this will prevent the picture from being deformed in any way we now have an image that we are ready to load I’m going to take my picture box and I’m going to set pixmap what picture do I want to set to the picture box well my image my image is now set to the picture box but remember originally we hid the picture box let’s say picture box I now I want to show you again everything is done before you run the app this is all within a class so this isn’t going to work just yet we need to do a few more things on the outside let’s go on the outside and let’s create one final function this function is going to be responsible to display the image that we click from our file list so whatever image we click in this function we want to check to make sure that our file list actually has items in it and so I’m going to say file list the row has greater than or equal to zero there’s something in the file list if that’s the case I would like to get the value of an item that I click let’s create a variable called file name and we can say okay the file list. current item this will be the current item that I click on I would like to get the text value of that item and I want to use my load image method right here because I have a file name right I just made that I’m going to give this file name to my load image method how can we do that it’s a method well before moving on I’m going to create an object let’s say main I’ll say editor all right I have my object I can say main do load image now what do I want to load well my file name then I would like to show the image that I’ve loaded what do we want to show well I want to show my OS path I need to join together the working directory with something else with my main file name I need to connect those two this will allow our image to load great the final stage is we have an event for our button well now we want an event for our file list so I’m going to say file list when the current row is changed we want to connect with our display image function amazing let’s give our app a run the app is working I’m going to go through and select a folder now that I have the folder selected I can choose one of these images boom look at that I have loaded an image into my app I can select any of these images and they are loaded into our app this is great well done the functionality is coming together what do we have left well our buttons don’t edit these photos so let’s head over to the next video and let’s add the editing power to our app I’ll see you in our next [Music] lesson [Music] our app is coming to life in this stage of the creation of our app it’s now time to add the functionality for the editing so when we click our buttons I want to be able to add more color to a picture or convert a picture to black and white let’s program all of our buttons let’s scroll down to our class editor and in our editor class we have our load image method that’s great I load an image I can save an image we have show an image I’m going to go down here and I’m going to start to create all the editing tools we have so let’s just start with our first method and I will call this gray now this method we are going to program and it’s going to be very similar to the lesson we had that introduced you to the pill module if you go back a few lessons to the lesson that we spent time practicing and introducing the python image Library we want to use the same idea and the same Core Concepts in programming our methods so I’m going to take my image remember we made a property called self. image this currently holds the value of the image that we loaded into our app and I want to change that image I want to convert this image so I can use the convert method and give it the argument of L so I’m changing the image to Black and White Once I have this new image let’s say self and let’s call our save image method so I can save this new image into my edits folder that we created it next up I need to create myself a new image path because I want to show this new image and this new image it has A New Path because we generated a black and white image and we saved it into a new folder with a new name this new image path well I want to take my path and I want to join together what do we want to join together well my working directory with my save folder with my file name that’s a new path we can now take our show image method and we can

    show this new image path that’s it that’s our gray method we edit our photo we save the new photo we show the new photo that is what’s happening in this editing function now that we have that the only thing to do to test if this is working is we can go down and we need to create all of our events the final step is I need to take my black and white button when that’s clicked we want to connect to our gray method that’s inside our class we can now give this a quick test before we write any other methods I’m going to select a folder now that I’ve loaded everything in let’s choose one I’ll choose a colorful one here okay this is pink I’m going to click my black and white button ah voila it is working it has been converted to black and white that’s great all right let’s work on the other buttons I’m going to close my app let’s trash the terminal now all of the methods are actually the same thing except what we are doing to the image but the idea of saving the image creating A New Path and showing the image that’s the same for every button so for example if I just take this method and I’m going to paste that here let’s change this to say uh left and take our image now and let’s change what we want to do to it so do you remember how do I rotate an image left right well I can take my image and I I want to transpose that image as the argument I’m going to take my class and Link the property rotate 90 that’s it we have a new method it’s the same exact final three lines we just need to now connect our left button all right I want you guys to pause the video here and I want you to program the rest of your buttons use the knowledge you gained with the python image library and use the knowledge from these first two methods to complete this challenge pause the video now I’m going to go through and I’m going to program the rest of these I’ve just finished up programming the remaining methods and as you can see here we have our gray left right we have mirror sharpen blur color contrast they’re all doing the same thing in the end the only difference is what we’re doing with that photo specifically the final step is each method needs to be connected to its button at the bottom of our code remember take our button when it’s clicked we want to connect with one of the methods that we made for that button everything’s working let’s run our app and at this stage 80% of what we’re trying to accomplish is done here’s my app I’m going to load a new folder now that I’ve loaded the folder let’s start with python so I can click left o there we go let’s click right that’s working mirror it’s flipped it our buttons are working we’re editing real photos with our code let’s do color if I keep clicking it you can see that it’s getting brighter and more colors being added if I click contrast it’s contrasting and then finally blur will be oh it blurred well I thought that may be tough to see with the python image right if I take it I click blur again it’s become blurry black and white loses its color our app is coming together and this is the most advanced app that you’ve created yet the last thing we need to do is we need to program this filter box to apply a filter remember that we can apply a filter it’s not going to save that as a new photo we can apply a filter and see if we like it before before we edit the photo in order to do that we’re going to introduce a new and popular python topic which is slightly Advanced and that’s the topic of Lambda functions I’ll see you guys in the next video where I will introduce Anonymous [Music] functions [Music] as we approach the end of our project it leaves us with one final task of adding functionality we have not programmed our filters or the filter drop-down box and that’s what we’re going to look at here in this lesson but to do this we have so many filters I don’t want to create a method or a function for each filter cuz that’s repetitive and we sort of did that just in our class I want to create Anonymous functions that I create and I use them right when I create them those are called Lambda functions this special feature comes with python and it’s for creating Anonymous functions which are these special functions that don’t really have a name most of the time when we create functions we do Define a name so we can call on them later but with Lambda functions we create it right where we need it and we call upon it immediately to run so they don’t need a name this is called Anonymous functions or in our case with python Lambda and this is a slightly more advanced topic that we are getting to explore let’s check out two live Lambda code examples I’m going to explore the first code example up here I have a function called Cube and cube is an anonymous function cuz yeah in this case I have given it a name but when I call this it’s going to run instantly now I’m saying it’s an anonymous Lambda function and I’m giving it something here this something is used in our expression what could these be in Lambda Lambda is taking a single parameter in this example I am justifying a single parameter and then that parameter is used in the expression of the function or what we want to do so four is really saying 4 cubed let’s add some color coordination in the bottom example I’ve actually written out a scenario so imagine you have your math problem you’re trying to solve by multiplying two numbers instead of writing a function for this somewhere in your code I am writing the function in one line right when I need it and that’s going to solve this specific problem now because we’re multiplying two together I am giving my Anonymous Lambda function one two parameters if I have have my two parameters we’re giving it two arguments when we use it these are being used in here so if we ran our code what would be the output of both of these Anonymous functions well the first output would be 64 and our second output would be 15 so you kind of have a core understanding now of what is Lambda what it accepts and how we create a basic Lambda function but how can we use this our project well let’s break that down a bit more our mission with Lambda is to create an anonymous function for each filter that we have in our Q combo box so I’ve kind of given you a head start but how could we do this with a dictionary because it seems very repetitive and I’m going to have a lot of these filter options so instead of creating these in seven lines or however many we have why not store them in a dictionary now remember a dictionary key value and what this would translate to is dictionary key unlocks a value so we can use that to structure our dictionary hm that’s interesting what would this look like in our code here I create an instant Lambda function and when this is used it’s going to be executed and ran immediately this is a dictionary filter mapping and remember in a dictionary we have a key and every key has a value together these are called our key value pairs so the key is actually the text from our drop-down box and the value is this Anonymous function that’s going to take an image the image that it takes it’s going to convert that image to black and white that is really interesting that makes our code run a lot faster and it allows us to create these little functions that we want to call upon throughout our program and you can see for every item in the drop- down box I’m making a key value pair which represents the drop- down box name and a Lambda function here is the overall function so let’s say we create it and we name our function apply filter I am going to give one parameter of a filter name this is the name that we select from the drop-down box if I click black and white then black and white is going to be given to this method the first thing I want to do is I want to check if I chose original because if I did I want my image to actually be the copy that we first made when we loaded the image I want to revert to the original copy if we do not choose original it must mean we did something else so here is our dictionary of everything else that we have the ability to choose from our drop down box each of these Keys has an anonymous function that will be executed instantly and they all take the same parameter image which you can see are being used within the anonymous function now this dictionary nothing is happening if we get to else we are going down here and we’re checking right we want to get whatever the filter name was from our dictionary remember that this filter name is actually the parameter that we gave we can check to make sure that yes we do indeed have text from our dictionary and we can go about our day we can set our image to whatever image we chose from our dictionary we can save that image generate a path and show the image just like how we created our methods in our class inserting the dictionary taking the value of the filter function is whatever the Lambda function returns if Lambda returns something we want to show what lambdaa returned let’s jump back to our code and let’s implement this final apply filter function and get you guys reading your first Anonymous Lambda functions I’ll see you in the next lesson [Music] now that you’ve been introduced to Lambda in Anonymous functions let’s create a method that’s going to store many Anonymous functions and these functions will be responsible for applying our filter let’s scroll down to our class and in our class we can go pretty much towards the end actually let’s go all the way down before the final one so I can go right in here let’s create a method that I could call this apply filter needs our word self and then what do we want to give it well I’m going to give it a name more specifically whichever word that I choose from the drop- down box I want to take that text value and I want to use that within this method so I’m giving this method a text value from my drop down box let’s just call this filter name the first thing I want to do is I want to check if my filter name is equal to original because if it is I want to revert or change the image back to the initial starting image I can do this by saying okay cool self. image in that case is equal to self. original. copy so our image is equal to the copy that we generated earlier great that’s why made the copy to be able to go back to the original copy else if it’s not original then okay I have selected something that I want to actually apply a filter on now in our drop down box if I were to go check we have all of these so 2 4 6 I have eight different options and each option is going to be able to do something or have its own function so the best way to do this would be to create a dictionary where each of these would be my key and the value is going to be a function that’s triggered only one time that’s why we create a Lambda or Anonymous function I’m going to return to our method that we’re making and let’s create a dictionary let’s say mapping now I need a key in the first key let’s just start with black and white and let me make sure these the text value needs to match what we’re trying to do so black and White’s good make sure your spelling is consistent returning black and white and the value is now going to be a Lambda function so to create a Lambda function we’re going to use the word Lambda then I need to justify any parameters my function will use the parameter well it needs an image that it’s going to edit so this function doesn’t have a name because it’s only being called when I get to here so it’s a function it’s a Lambda it’s Anonymous it has no name but this Anonymous function it does have a parameter which means I’m going to give it an argument next up in the function it is going going to take what I give it and it’s going to convert that image to black and white that’s what it’s going to do one and done all right so next up let’s try one more together let’s say color color is going to be a Lambda function it takes a parameter of an image let’s take what we give it and let’s say image enhance do color what do we want to enhance the color of well the image we give it how much do we want to enhance it by let’s say 1.2 just like when we programmed our method above right here same thing I have now created two Anonymous functions I want you to try to program the rest of these Lambda functions on your own pause the video here I’m going to go through and I’m going to complete the rest of these Lambda functions what do we want to do to that photo the New Concept though is creating an anonymous function now remember that this Anonymous function is a special python function that doesn’t have a name and it can perform any task we assign it without needing a name as well so I am giving a parameter of image and we are taking whatever we give it and we’re going to apply and edit to it great so I’ve created this dictionary now and my dictionary is called mapping well I now want to map over this and I want to get one of these I want to get the one that is equal to my filter name let’s create a function let’s say filter function and the value of this is I’m going to take my dictionary and I want to get what do I want to get well I want to get whatever the filter name parameter of this method is that’s the value of filter function I now want to check to make sure that there is a value that we selected so to do that I can just say if filter function right that translates to if filter function equals true or if there is something in our filter function if there is what should we do well let’s take our image right our property self. image and we’re going to say hey I want to update this and I’m going to update this to the value that we gave our filter function self. image I can then save let’s call our save image method I can create an image path just like we did in our initial method so OS path join we want to join together many things working directory our save folder and then finally our file name what do we want to do last well then I can show this new image that we have kind of created or at least applied the filter to so image path uh finally if that fails let’s just say pass I want to skip over it so our apply filter function or I should say method is done we have a method and this method contains about eight other functions which is incredible now that most of the supply filter method is done we’re pretty much there outside of my else right so no matter what when this condition is done running I would like to save the image so let call our method we made save image let’s take our image path and let’s show our image so I’m going to take those and I’m going to put those just like that right there looking great we want to create a function on the outside to handle any of this so let’s say let’s create a function called handle your filter and the first thing we need to do is we need to make sure that indeed there are items that have been loaded into our Q list widget so just like we did in the other one let’s make sure that we have an item what do we want to do with that item well I want to get text so bear with me Whatever item I click from the drop down box I want to get that text in order to do that with a Q combo box or a q drop-down box we do not use the text method instead what we can say is let’s take our filter box and let’s use the method current text now that we have the current text value let’s call the apply filter method giving it the text that we just created or got our final stage is we need to create our event for our handle filter method we can take our filter box and we can say hey when current text is changed we want to connect to this new filter function now the current text the current text is initially original because it’s the original photo when we change that all right now we want to trigger this event amazing let’s run our app I can now load in a folder and let’s go through and choose one of our images so let’s choose a this will be perfect in my drop down box I can now choose how would this look as a black and white image oh that looks pretty good okay let’s go back to the original great now how would that look if we blurred it well I can’t really tell right so I’m gonna go back to the original again everything is working this is great well done you guys have a completely working image editing app that we’ve created we have accessed our desktop using the OS module you’ve used multiple modules from pqt and we’ve used a few classes from the pill module as well to achieve this well done I’m so proud of you guys if you’re interested head over into the next lesson where I’ve prepared a special challenge using Lambda to extend the functionality of our photo QT image editing app I’ll see you in the next [Music] lesson congratulations we have a working image editing app for fully completed with the editing capabilities that we wanted as well as Lambda functions now let’s refactor our code and I’ve prepared a challenge for you guys using Anonymous functions to make our image app more efficient let’s take a look currently we have a class and our class has all of our editing methods in right so every button we have we created a method for I want to see if you can take all these editing methods and convert them into this can you replace all the buttons and how can we use Lambda to do so I want you to try to create a new method which is going to replace all of these you can name this method transform image or if you have a better name use that name this method will hold a dictionary just like our previous method with all these functions we want to replace or I should say update if you’re up for a good challenge this is better going to improve your understanding of how to use anonymous functions as well as using dictionaries I’ll see you in the video where we refactor our app and add in this final method [Music] you must be up for the lamba challenge if you’re here and I’m glad you are we’re going to refactor this code and make it significantly more efficient and less all while keeping the same functionality let’s take a look right here we have all these buttons and we want to create a Lambda function for each button this is going to be very similar to how we created them for the filter let’s take a look at our class we have our editor within here we have in it we need that we have load image save image show image we need to keep all those because they each have an instrumental task that is called upon at some point in our program but all the other methods the ones where we create the actual editing techniques you can see here that I have 1 2 3 4 5 6 7 eight we have eight of those what if we could replace all of those with a single function well that’s what I’m going to do I’m going to take all the methods that we just programmed and I’m going to delete them from my code what you can do before you delete is maybe make a copy to keep this and you’re able to see how far you’ve come and we have a starting point which is this and now we’re progressing into more advanced concept so I’m going to delete those we have our apply filter method currently now I have if we go down to all of our events we have none of these anymore right main mirror mirror is not a method we just deleted that let’s go up here just above our apply filter method we are going to make a new method here and we can call this transform image transform image is going to take something so transformation what do we want to do to the image if I click the blur button blur is my transformation it is very similar to how I explained filter name in the apply filter method inside here we will make a dictionary this dictionary is going to be structured the same way as as we did here so I can actually take most of these out let’s just copy those paste those here what do we have 1 2 3 4 five six seven eight those are all of our buttons as well and just double check that these text these strings all match your button names at the top and if I do a quick check they do match going back down to this new transform image function we have a dictionary inside that each of these is a key value pair the key is what the button says and the value is an anonymous function our Anonymous function will take an image and it will do something with that image we have all of our functions ready to go in our Transformations dictionary let’s create a a transform function and let’s just say I’m going to say Transformations I want to get the transformation I give as the parameter this is my dictionary I want to get something from the dictionary and I want to get the original parameter we passed into our method just like our apply filter method I’m going to check to make sure this is true I indeed have something because if we don’t have anything well I can’t quite do anything with it if I do though I’m going to take my image and I want to update my image this is now my image after we apply our filter to it we can save this new image finally we can show this new image just like that I have replaced all eight of of our original methods with a single transform image method all that’s left to do is we need to connect our methods to our buttons and because we’re using Lambda this is going to be slightly different where do we keep all of our events well they’re at the bottom let’s head to the bottom starting with our first button gray now I’m going to change what we’re connecting to we are connecting to a method but that method is a Lambda Anonymous method or it’s an anonymous function in our method transform image Lambda is anonymous I can take my main object that’s my class remember and to our main class we can link our method we just made which is transform image I now need to select one of the keys in transform image so if I go up here for the gray the black and white this is my key I’m going to use this in here I can just say black and white if I go to our next one I would do the same thing I would take Lambda and I would say our object let’s transform our image and I think we just called that one left if I go up and check yep right there left I’m going to go forward and program the rest of these all right we have all of our new Lambda functions connected that means it’s time for us to run our app all right and just right here so I’m trying to show an image but if we remember show image takes a path which I’ve left out here so let’s come out here I’m going to do a few things outside I can do save image again then directly inside let’s create an image path again and we can say OS path I want to join what do we want to join well I want to join my working directory I want to join my save folder that we have created so save folder and then finally our file name and we can just do a check does this match this it does our app is running selecting a folder going down to our images left great it’s working right there we go I can mirror it I can add color to it there we are contrast all of our buttons are working they look great amazing we just refactored our project to more efficient code you have been introduced to so many new Concepts in this project one the introduction to a new module pill the pillow library for working with images two you have now been introduced to Anonymous function in Python which I’m sure you’ve seen before these little guys are called Lambda functions as well as taking your pqt skills to the next tier amazing job congratulations I’ll see you guys in the next lesson for the start of our next [Music] project [Music] congratulations as we enter our next project you guys have done an incredible job you have so far three fully working apps with one warm-up or introduction app for pqt you have a fully working calculator applic and after completing the last project you now have an image editing app as we enter this project you are about to make an expense tracking app but this app is going to do so much more than just track your expenses and use your knowledge of pqt not only are you going to use and build on all of your pqt knowledge you are also going to get an introduction to SQL and how we can incorporate SQL databases into our app to track and maintain live data more specifically live data that’s changing so in the last project you got an intro to Lambda in Anonymous functions add that to the CV in this project you’re going to get an intro to SQL and what that is and how we can use that with apps let’s take a look this is our overall app overview our app we have the ability to add expenses delete expenses and also save data in a database and I want you to think what widgets are you seeing on the screen you should know most of these right we have been using these in previous projects so what widgets do you know well let’s take a look all of these widgets we will be using in our app and you can see right from the get-go there are two that you may be unfamiliar with as we haven’t used them before we have our Q date edit in Q table widget now you can see that the date edit is collecting a date we even have a category that’s going to allow us to choose what category our expense came from we have the ability to enter the amount of the expense as well as a description of what we spent it on we create two buttons and at the bottom here we have our visual database so this is the front end of what we see once we add all of our data using SQL to our SQL database have you thought about your design yet because as you’re growing more and more of an expert with pqt you should be thinking about your design every step of the way how could we design this app well let’s take a look I have created one map Master column and you can see I’m using QV box layout I have three rows at the top with a few objects in each row my table does not need a row because it’s going to take up my whole screen everything else I want is actually above my table while you’re designing this app you know most of the methods and the ways that you will be able to implement your designs but C table widget this is new and you will need to import this along with your other QT widgets in order to get your table set up there is a method that comes with our Q table widget class we have set column count and this takes an integer as an argument and you can see that in this example we have five columns if I put the number five inside here we will see 1 2 2 3 4 and 5 that allows us to structure our database and get it ready to accept data the second method that we are going to use is called set horizontal header labels this method takes a list more importantly this list is going to have many elements each element will be a string and the string will be the name of your columns if you say you have have a column count of five then in your list you should also have five elements each element is representing the name of your headers the name of your rows let’s head over to vs code and let’s try and get our app designed and structured before we dive into SQL I’ll see you over in the next lesson [Music] now that we’re here in VSS code let’s get our expense tracker project all set up and designed you can see here on the screen this is what we’re aiming for and by the end of this video we will have an initial design something like this ready to go let’s move that away for now I have here my code burger and what do we need in order to design this app well a lot of things but in this video we are just going to focus on one module QT widgets because we need to design our app first and that’s what we can start things off with in the previous projects we have created an app then converted that or refactored it into a class-based application well to kick things off with this project we are going to start by creating our application as a class-based application let’s begin here with all of our Imports so from PI qt5 QT widgets we have that one down let’s import our Q application we can import our Q widget what else do we need in our app so if we take a look at it what do we see here right I see Q labels I see q line edits I see our Q combo box I see an area for our date and time we have a table a few new widgets we need to import all of these so let’s begin I know that I’m going to have a Q label we saw a q push button there we saw our q line edits we can bring in our Q combo box then our two new ones we had a date edit window and finally let’s just come down here I’m going to say Q table widget now I’m going to put that back on the line there we are Q table widget anything else that we’re missing is there anything else we need well don’t forget QV box and qbox even if you don’t know if you’re going to need both layouts it’s always good to import them because there’s a high likelihood that you will let’s create our class let’s create a class called expense app inside we can create our Constructor as this is going to run immediately every time we create our app so when our program runs it creates an instance from our object and this init Constructor will immediately run we need to ask ourself what do we need well our main settings we usually like to use resize but I don’t have any main window and in order to get that let’s inherit just like we’ve done before let’s inherit Q widget now that I have q widget I can refer to myself and we can say okay let’s resize and let’s give ourselves a window title because we always want to give our app a title we can call this expense tracker 2.0 the window size let’s give it a size of 550 for width and 500 for height that’s a good starting point now we need to create all the objects we see on the screen remember the input Fields the table the date box all of those items so let’s create one let’s say datebox and datebox will be one of our Properties or an object that we’re creating now for the app UI and a date box we can say Q dat edit just like so we also have a drop- down box so let’s just say drop down and this is our Q combo box we have our amount which is going to be a q line edit and then we have our description an area that you can enter what you spent that money on and that will also be a q line edit now we did have text within the app but that’s going to create too many objects and the text I won’t need to do anything with that value so I’ll actually create it here when I create my design speaking of of design we need to justify our Master layout I can create my object Master layout and I know that everything here will be held in a column so let’s say QV box we have that and within that column we are going to have let’s say Row one row two and Row three bringing those down just remember to change the name of your property all right what else do we need we have our all of our input Fields I know I’m going to have a few buttons on the screen so our buttons will be an add button to be able to add to our expense so we can say that would be a q push button add expense we will also have a delete button this delete button will once clicked we’ll remove from our table we have almost everything that we want to see this brings us to our final and our new object we are introducing SQL in this project so with SQL I want to be able to display all my data within a table we are going to use our Q table widget let’s create a property called table this can be our our Q table widget we can do a few things with this in the beginning when I’m creating this table let’s take our object I would like to set the number of columns this will help us with our SQL queries and adding data at a later stage let’s use the method of set column count in here I’m going to to have five rows of data which we will see here shortly but that’s going to look like an ID a date category amount and description that is why we have five columns once we have this then we can take our table I’m going to call the method set horizontal header labels because I want to give a title to each column that we create this will actually take a list we can do this two ways I can say header names making a list what do we want our header names to be let me code these out I now have a list of my header names you can see these are my column names just like before I created five columns in column one that’s my ID column column 2 is my date our method set horizontal header labels that takes a list so header names did I have to make this no I did not I could take this I could just put this inside here like this how I did it before was easier for readability we have a table now with five columns and the columns each have their own name we’re ready to go what do we need now I have all my objects next up in our code Burger I can actually structure this so there we are we can design our app with our lay layouts what layouts will we be using QV and qh box let’s create a master layout that can be my QV box then within my app I know that I’m going to have three rows so Row one qbox layout let’s create the other two we have our Master layout along with our three rows ready to go now that we have these let’s go through and Design Row one I want to start with you I want to add some widgets to row one in case we forgot what we’re aiming for in our app in row one I’m looking for these date text the date time box our category text and our Q combo box notice I didn’t actually make Q labels and that was to save us space in our code as we aren’t going to do anything with these values vales so I can immediately add these to my layout what do I mean by that well right in here I can just actually add the class Q label what is this going to say well it’s going to say date like that so I’ve added my widget next up in my Row one I would like to add what do we want well I would like to add my date box after these we can add category text followed by our Q combo box which is what we called drop down so Row one is completed going on to row two it’s the same idea I can take this as a starting template and instead of Row one change that to row two our Q label that we’re going to be putting on which actually right here this should also be our Q label instead of saying date here we can actually say amount what do we want add next to amount well let’s add the widget and let’s say self. amount that was our property that we created here of a q line edit the final two all right row two is completed Row three we just want to add our two push buttons to them great our three rows are designed and all ready to go what does that mean what do we need to do with our rows let’s add the rows to our Master layout so take your master layout use the method add layout you should have this under your belt by now adding in row one we can copy that as we need to do it three times one two get them all set the only thing we have to do is change the layout that we’re adding so self. Row 2 self. Row 3 let’s set our final design usually we would do something like this but where is my main window I don’t have a main window remember my main window is my super class so I’m going to refer to my S and I can say self. set layout I want to set the master layout as the main layout all righty our design is almost all the way there currently there’s no table on the screen we’ve added our three rows to the screen then we did set the final design but right in between here before I set my final Design This is where we want to see our newly created table let’s add that but the table is so big I don’t need it in a row it’s going to take up the whole row itself it’s just going to go at the bottom of our expense app all we need to do for this is take our Master layout we can add widget and we can add our table because we have created our class base application let’s go on the outside right here and we can say if name in main we can create our app Q application give it an empty list here you could create something just an object and what is our app class expense app main. show app. execute let’s run our app and see if it’s set up the way we want it to be all righty so right in here it’s telling me that I need to activate my super class which that’s actually true I buzzed right over that going up remember anything that we pass in so I’m inheriting the super class let’s use the handy python super function and say hey super I want to initialize you just like that give our app one more run there it’s all taken care of here is our app ready to go everything is where we want it to in our three rows with our new table at the bottom spend the next five minutes and tweak any details you may want to tweak if you want to change the words change the header names change your alignment that’s up to you I’ll see you guys over in our next lesson where we will introduce SQL in pqt [Music] now that your app is all set up and ready to go it’s time to introduce the top IC of SQL and how we are going to use SQL light with the module QT SQL to work with our app in pqt if you’ve worked with SQL before great you have a head start and if you’ve never used SQL before that’s okay because I’ve structured this lesson as a breakdown to what it is and how we can use it it’s going to ease you into working with SQL let’s jump in so SQL really means structure structured query language you might hear people say SQL or more commonly SQL now we’re going to look at three SQL keywords and this is basic Syntax for SQL these words these key operators are used in the SQL language select from where notice that all of those are capitalized that’s very important we use the select operator to select the column colum we want to look at we use the from operator to choose the table where the data lives that we’re trying to look at and we use where to justify a specific condition so when something is true that’s what we want to find with our data so picture this we have an example down here picture I have a table that has the name users I have two two columns in my table I have a username column and a password column then I have a condition that I want to look for the username Mario 123 I could write my query in two ways up here I’m writing a query I am saying select star which literally translated means select everything from my table remember my table is called users so this literally says I want to select everything from the table named users but that doesn’t do it right because I have a condition so I want to be more specific I’m looking for a username right well select the column named username from the table named users where my username is equal to Mario 123 that’s allowing me to access key components of my database and pull out the data that we are looking for we are using SQL and we use this to work with our relational databases or these are databases that store our structured data within tables let’s take a look at how we set up a SQL Connection in pqt before I move on remember these three key words from SQL select from and where and try and remember these two examples and how they relate to our example here let’s take a look at how we can set up a SQL Connection in pqt in order to create a connection to SQL light we are going to import something called Q SQL database we can import this from QT SQL module I am adding a database what type of database is this well it is a SQL light database which is a lightweight database for working with SQL in Python I am justifying that as the value to a variable or an object of database I can give my database a name giving it right here making sure my extension is DB these are the methods that we are going to see here I can use add database to create my connection I can use set database name to set the name and we are going to use the open function to open our pre-existing database so that every time we load our app it’s going to load all the data that we’ve previously stored in our database you can see I have a condition here now let’s just start with the very Basics I have a database so if my database is not open I want to print off error I’m going to talk more about this in the next slide but the key component here is I’m creating a condition just to make sure that indeed I do have a database and I can open it if I don’t have a database and I can’t open it I want to print off or alert the user to an error now you can see I’m using something called Q message box simply put in pi QT a q message box is just a popup box any of these popup boxes can look like the following you can see they’re all different but they’re all little windows that can pop up on the screen and each method we use with Q message box so for example I want to ask the user a question you can see that it kind of has a question mark warning warning critical critical there are different things that we’re triggering we can use to ask the user questions as well and based on the response of the user we can do something with those but let’s focus on the bottom two right now because it’s just a pop up and it’s just alerting the user to something remember that those methods are linked to what type of Q message box we are seeing now that we’ve created our connection to our database remember from the previous slide database was created and we open our sqlite database let’s create a query and we want to run our query to create a table named expenses but we want to check first to make sure it doesn’t exist so a query is basically a question that we are asking the database I’m preparing to query or ask the database for some type of information so I can create an object and I’m going to import qsqlquery this is used to execute any queries on our connected database then I can use my query and I can execute a question or I can execute a query to my database this structure inside is actually quite important okay all of this is a string and this is how we can use SQL light to perform queries in Python we are saying Hey I want you to create a new table if it doesn’t exist and I want you to name that table whatever you say here expenses we are giving an ID now these items here are the columns in our database so the First Column is going to be the ID of that item in our database the second column is going to be a date and this date is going to be the value type of text category it’s going to have a text value amount is going to have a real value a number value we use this execute method which you’ve seen before in pqt because it prevents us from needing additional boilerplate code specifically with SQL we can incorporate the code inside the execute method okay so take a look at what’s Happening Here We execute the SQL query specified in our quotation marks to make it a string and we create a table named expenses with the following columns ID date category amount and description each of those I’m also telling the database what type of data it’s going to have is it a text data or is it a number data let’s jump into our project and let’s create a database that we can begin to add things to where are we going to create our connection to the database and where will we create the query those are questions to ask yourself as we jump on into the code I will see you guys in the next [Music] lesson now that we have our database all set up it’s time to create our methods now these methods we’ll be building are specifically going to be built for our add and delete buttons when we click add we want to add our data to a database when we click delete we want to remove our data from our database let’s take a look at our first method before we even get to the ADD and delete methods we need a method for loading our table because every time we open the app we want to load our pre-existing data now in the previous projects I’ve put a lot of code examples on the screen but at this stage you should feel challenged or at least I want you to put in the challenge to problem solve and to logically solve these steps I have broken down step by step what we need to do to create the method to load the table and I am going to show you a part of the code in the next slide start to think about how we can do it using what we talk about now the first thing we need to do is we want to clear the current Table that’s because any old data I don’t want the old data to be there to do this we’re going to look at something called set row count I can then create a new query to select everything from our table using using our class Q SQL query you’ll create a loop and this Loop will run as long as there are more rows in the table right so if you have a database with 10 rows or 10 pieces of data your Loop is going to run 10 times until everything from your database is in your app once we do that Loop we can retrieve the values from each column we will use the Value method to do that the information we retrieve we want to insert the data from number four right that’s what we retrieved and we can use insert row to do that before increasing a row counter this method is responsible for displaying all of our database data in our app so we can visually see it how would the loop look I want to make a loop and that’s going to repeat and I want to use the next method with a loop that’s a bit odd well along with our query we do want to create a while loop so I can say while there is another row in my query that’s what that translates to right so while my database still has another row I want my code to run every time this Loop runs we are retrieving the values from each column column one column 2 column 3 column four column 5 if you have more columns make sure you retrieve those values we’re using the Value method that takes an integer once we’ve retrieved all the data from that current Row from every column we want to insert that data into our table so imagine you your table is called expense table you want to insert the current row that you’re on right so row needs to be an integer we need to insert the current row we can then go through and set the items of every row so I’m going to put my row number which would be the same for all of these and then I’m going to put the column in the row next is the information we want in that row now notice this is a new class but this is the item that we collected that we want to display in row one or more specifically in the First Column of our first row now we’re going to look at the added new expense method what do we want to do with this well we want to gather the info that we entered from the input boxes all the info the date the description the drop-down information the amount and we want to insert all that information into our database then we want the input fields to clear to prepare for the next input we can then load our database if I add or delete information I want to load that new database information so we can visually see it take a look at all these methods some of them we’ve worked with before others are new which ones look familiar to you do you remember why and how we use them in our code let’s take a look at what each of these will do for us I’m going to touch on a few of these I’m going to touch on all the new ones we haven’t addressed and if you need to pause the video screenshot that’s fine you can do that we have the prepare method we use use prepare when we’re working with SQL and this will check the provided query to make sure that it’s a valid question it’s a valid query so when we click a button I want to check to make sure that all my data is going to sit well in my database that is when prepare comes in hand we have the method add bind value add bind value will put the information in a column that’s in our database for us every piece of information we will need to use add bind value we can use the two string method and this will convert an object into a string we can use date and this will convert our input in our case which is a date into an actual date and let’s take a look at our last one here current date this will get the live current date in time like if I ask you hey what’s the date today that is what that that will return take a look at these remember these are all methods so think about the objects that these will be linked to how can we finish up our add function within our add new expense method the first thing I want to do when I click the add new expense button is we want to collect all the data from our input fields at the top of the app you can see that I’m collecting my date I am collecting the information from my drop-down box which is a category we are getting our amount and we’re getting the description using all this information that we just captured from the input fields we can create a query and we can prepare to execute our query now notice the seq syntax insert into so we can prepare to to insert into our table expenses what do we want to insert date category amount description date category amount description our information is going into our database every item we want to send off that info now so prepare it’s preparing to get the database ready to accept this new information now we want to send off our information to our database and we can do that using the add bind value and giving it an argument what do we want to send well I want to send my date off to my query and you can see in position one of my query is the first item that we prepared as well in position two of the query is the second item we prepared for our query all right let’s jum back to vs code and see if we can program out this add new expense method to make some SQL [Music] queries we have our app all set up and ready to go you’ve been introduced just on the surface to SQL and I’m excited to be able to implement that now into our application to create a real database that we can load in data delete and add data to begin let’s go to the bottom of our code here we have our class at the bottom that’s what’s running right this is where our app is running right here this is where we we can create our database before I can create the database we need to import that from our module going up here all we currently have is pi QT and the QT widgets module we want more than this we are going to say from PI qt5 the module we’re looking for is QT SQL we want to import to two classes or two modules from within I want the Q SQL database and we would also like the Q SQL query those two perfect outside while we’re creating our database here I can create a variable I’m going to call that variable database and I can say all right database is equal to Q SQL database dot I want to add a new database what kind of database is this this is going to be a q sqlite database we have this variable that is a sqlite database we can take it and let’s set the name the name I can call is expense. DB DB you guessed it stands for datab base we’ve created it I want to create and try and catch any error errors that might happen and the error that might happen is I’m not able to open my back end I’m not able to open this database for some reason if that happens my app needs to close it’s it’s not able to open without any data let’s say if not my database open so if I can’t open it I want a message to appear on the screen how did we do that before what did we use it starts with a q but we haven’t imported it yet Q message box let’s go and import Q message box at the top right there’s our Q message box returning now I can create this and let’s say critical because if this happens that is a critical error I can’t I can’t get past that my app can’t run without it our first argument can be none I’m going to say error within the app I can say could not open your database what do we want to happen I would like exit I want my app to just exit immediately exit is something that we need from another module this is the only time we’re really going to use it in our applications that module is called CIS or system we want it to exit after 1 second up at the top let’s pop in here import CIS now that we’ve created this database I can now create an initial query remember query is like a question or an initial setup so how do I want to set up my database what structure is this going to have I will create a object called query from the Q SQL query class I’m going to take this and I’m going to execute an initial query or run an initial query when this is Ram this is where we put all of our SQL syntax a lot of this is specific for SQL light here we’re going to put six double quotes drop down like that how do we want to set up this database well what I can say is I want to create a table if it doesn’t already exist this table is going to be called expenses or whatever you want to call that table that goes there okay so if I don’t have a table I’m going to create one and it’s going to be called expenses what structure will this table have if you don’t remember go up and let’s take a look here at set horizontal header labels this is the structure of our database let’s make sure everything is pretty much how we want it I can say ID everything’s capitalized the first thing that’s going to be in my database will be ID that will be in column one and so forth returning to our query let’s say the first one is our ID ID is going to take something called integer primary key autoincrement what this means is an ID I’m not giving it that information every new row of data it’s automatically generating a number so Row one row two Row three and it’s automatically adding in that number so that’s autoincrement this is known as the primary key the master key for that row let’s put a comma next up we have date what is date well date is is going to be text we don’t have to do anything mathematical with that value so it’s just text next up is category category is also text we have the amount amount is real real in SQL just means it’s a number we can do something with that value lastly we have our description and our description is text great we have our query all ready to go it’s set up in the order that it’s going to receive that data it’s going to receive it as an ID but it won’t receive that because that’s automatically being incremented the other four in order are being added into this newly created database every query is going to be structured in this order ID date category amount and description amazing we’ve created our first database in the app but currently we can’t do anything or we are not doing anything with it we want to be able to add and load from this let’s go up to our class we are going to create a few methods here the first method I want to create before I can add data or delete data I need to load my table into my app I need to load my database let’s create a method right here and let’s say load table it’s a method it’s in my class it’s after we initialize everything I can give ourselves a bunch of room right here to kick things off let’s take our table I’m going to take the table we’ve created and I’m going to set the row count we going to set it at zero this is one of the methods we introduced during our lesson during the previous slides we have our row count set I can create a new query a new question remember anytime I say query I’m saying question what do I want to ask it well I want to ask it to select everything from my table known as expenses please remember that these are special SQL syntax words expenses is lowercase because that’s the name of my table select is a word and from is a word from SQL let’s create a row because currently I haven’t loaded in any data but I want to start on row zero and begin after that so row zero Row one row two everything after that first row will be loaded in as well but we need to load in the first well we can say while my current query. next so while I have another row available still while there is another row in my table we want to get the values from each column in our row remember the order of our column let me bring back up our SQL query we have our ID date category amount description let’s go up now in order let’s get an expense ID let’s say the expense ID is just equal to our query value0 so it’s equal to whatever the first column in my database is because python starts on zero My First Column is actually zero in my database if you check the First Column is our ID so the value is whatever we get from our current row next up we can get a date we can say our date is query. value and I think you can guess so for each of these we want to get the value of that current column I’m going to go forward and I’m going to grab the values from each column I have our five columns and I’m getting the value out of each of those so every query runs we get the value from that column we’ve indexed now now that we have these values we want to put them into our Q table widget so I’m going to say add values to table we can’t see these values we can’t see what’s in a database I want to take it out of the database and put it into a table for us to be able to see let’s take our table property and we can say insert row what row do I want to insert well well I want to insert the first row which would be row zero the first time this while loop runs but I need to be able to increment that to go to row two Row three I’m just going to put my row variable remember we have our row variable here so I’m adding the first row I’m inserting the first row to my table at the end of this you guessed it we can increase the row so so every time our Loop runs we are increasing the row and adding in row two Row three Etc after we’ve inserted the row I want to take the values that we got back and I want to insert them into a column within my table to do this let’s take our table I now have my table object and I want to set an item in that table okay what row is this from I don’t know but it’s from the current row I’m on all right now it’s asking me for a column great the first one I know is column zero that’s the First Column then we need an item well to get an item here because we’re working with a Q table widget I’m going to go up and I’m going to import one more key class for us to do this at the top here let’s import a class called Q table widget item this is an item in a table you guessed it going down I can now use that new class I can say Q table widget item like so what is the first item in the First Column think about that for a moment what do I need to add inside here an ID well where’s my ID it’s right here it’s called expense ID let’s convert this to a string and let’s put in expense ID just like that so I’m taking my table and I’m going to set an item in that table it’s going to be in the First Column and it’s going to be my ID amazing I’m going to copy this how many items do we have we have five so one 2 3 4 five there are our five items let’s go down let’s change our column numbers and also the values here what do we need here well I need a date I need my category I need my amount and amount is a number so I’m going to leave it to convert to a string here our final one our description if you need to pause to understand what’s happening please do read through an interpret in your own way once we’re done here I’m going to read through again and translate what’s actually happening let’s bring our row up and we are ready to go through this method let’s break things up when this method is called we are setting our table row count I’m then creating a new query I’m getting ready to ask my database a question what’s my question going to be well well I don’t know yet but what I do know is I want to get the data to use for my query question I want to select everything from my table expenses I’m going to start with the first row and I’m going to repeat all of this while there is a next row in my database if there’s not another row in my database stop if there is a row keep repeating every time my Loop runs I’m taking the five values from the five columns in the current row I’m going to insert that row into my object table remember table is a q table widget and I’m going to insert the current row that I’m on I then go forward and I set every col column in my table to the items that I got earlier those values we end with increasing our row we’re pretty much done with our load method I’m going to go up here into our init I’m going to say here I want this to automatically call load table method every time we boot up because we will always want to load in the database so I can insert that right there self load table let’s run our app now we won’t see anything because currently we don’t have anything in our database great our app still works airfree which means we are ready to go to the next video in the next video I will walk us through how we can add expenses to our database I’ll see you in our next [Music] lesson [Music] we did a lot in our last video and I hope you took some time to read through your notes and review the previous lesson as we introduced a lot more advanced concepts as well as introducing SQL and our databases to our project in the last video you created a database as well as creating a method for loading in our existing database in this video we want to be able to add items to this newly created database wow I’m saying the word database quite a lot let’s go down to our load table method and right after it we can create our add expense method right here the first thing that’s going to happen in in ad expense is we want to retrieve all our input field data let me show you what I mean I’m going to put pass here for now let’s run our code here’s our app let’s say we have a date of today is the 8th 23 I have a category an amount so 25 description uh food category oh I don’t have a drop down box yet I have it but it’s not dropping down let’s address that too but all this information right here I want to capture it it’s like taking a picture I want to capture it and I want to store it in variables remember that let’s go and address this drop down box quickly going up our code where did we we can jump in right here actually so here we create the dropdown let’s jump in here here let’s say self. dropdown let’s say add items add items takes a list just like the horizontal header labels what do we want the items in the drop-down list to say well I want them to be our categories so pretend they are categories you could spend money on food Transportation uh rent shopping entertainment uh let’s say bills and finally other so all of these are options that you can select from the box all right that should take care of that issue let’s do a double check click oh yeah okay great so all this data here we want to capture this returning to our ad expense method now what we can do here is we can create four variables all the information we want to capture I know that I want to capture a date I have a category I have an amount and we have a description so these are all local variables I’m not making them properties they’re only inside this method date how do I capture the date well from what we looked at in the lesson when we introduced this topic we can capture the date by taking that date box so self. dat box I can convert the date and I want to turn that to a string what format do I want to format the date too that’s going to be done here in a string

    as well I can say 1 2 34 that’s year so if it’s 2023 it will be 2023 then I can do the month then I can do the day that’s how I want this format to look for my category let’s take our dropdown box so self. dropdown remember the method we used in our last project we can say current text to get the text value of a drop down box item amount self. amount we can say text q line edit we use the text method we saw this as well and we can get our self. description that is also a q line in it getting a text value so we have four variables each of these variables holds the value the face value of our items that we’re trying to collect the data from we now want to take this and I want to drop it or put it into my database we need to create a new question for the database a new query for the database let’s say Q SQL query I’m going to prepare to ask it a question this is a SQL statement so our six quotation marks what do we want to prepare to do that’s what this says well I’m I’m going to prepare to insert into my table known as expenses what do I want to insert well I’m going to insert the date I’m going to insert the category I’m going to insert the amount followed by my description each of these that I’m going to insert so these are like the names each of these are going to have corresponding values and these values will be represented by the information that we give it currently we don’t know it but the information we pass to it it’ll have those four values we are preparing to insert into our table this information that will have four values as well we’ve prepared the query let’s now push or send information to our database so I can take my query and I can say add bind value what value do I want want to go into the first slot of the database I want the date you guessed it we can take this now one 2 3 4 next up in the second slot I want the category the third slot amount fourth slot description we now have added these values to a specific column slot in our database I want my query to now execute it has the information it needs I want to send the information off to my database that is what we’re doing with our query once we’ve created that query we captured all this information from our box well I want to now clear those fields to prepare them for the next expense that you might enter right that’s a convenient thing to do for the user let’s clear everything how can we clear everything this is a method we’ve used before in our previous projects everything we do let’s start with our uh drop- down box let’s say dropdown we can reset it using this method Set current index back to zero we can take our amount field and because that’s a q line edit we can say clear we can take our description box and because that is also clear what am I missing well my date now my date originally was like 1 one 000000 let’s say when it clears let’s actually give the current date as the face value of our app that looks way better too so let’s take our date box and let’s set the date of the date box I want to set the date to the current date to do this we are going to import another module into our app this also comes from p qt5 and it comes from a module that you’re quite familiar with let’s say from PI qt5 QT core I want to import a class called Q date this will allow us to get the current date let’s return to where we were inside our set date method what do I want to set the date to well I’m going to take my Q date that’s a class but I’m not giving it any arguments I just want to link it I want to link it to something called current date just like that that is going to change the value of that date box to the date today and as of today it is July 8th amazing the last thing we want to do what do you think we want to do after we add an expense the last line of code well I have new information so I want to now look load this new database I’m going to call the method we first made load table as I have new information in our database great I’m excited let’s give our app a run at this point we have the ability to add information to this table before running the app break down and pause what is happening here let me go through and translate this when we click the add expense button so we need an event first but when we do click it we capture all the data from the input boxes at the top of our code we capture a date we capture the current text the amount and the description then I’m preparing to ask my database a question or preparing a query what am I preparing to do well I’m preparing to insert something into my table that we named expenses I’m going to insert in the format date category amount description each of these will have a value they have four values because I have four columns in our database then in my query in the order that we said we’re going to give it the information we are adding a binding value that’s going to bind with that current query once we add all the values we want to execute and send the query off to our database we’ve added something to this database it’s now time to prepare our app for the next input so we want to reset everything finally ending with loading our new database into our table in order to get this to work let’s link this to our ad button where did we create our ad button up top let’s go up top to where we made the ad button and right after here we could just say Okay self. add button. clicked when that’s clicked we want to connect to our new method add expense all right time to run the code let’s give it a run things are starting off let’s start things off with our date today so let’s say 8723 today food amount 10 description tacos add look at that we have added something into a database and taken that database and loaded it into our app let’s go for another one this time let’s say rent let’s say someone’s rent is 500 let’s say description landlord add ooh we have the ability to add things this is great we can say night out when did we do this night out let’s say one amazing we have almost full functionality of our app the last things we need to do is program our delete button and any designs we want to do well done I hope you’re starting to see the gears turn and how we can use SQL to enhance our applications it’s a way for us to store data within a database in pull it as we need it I’ll see you guys in our next lesson where we will introduce the delete expense [Music] method here you are in the final stages of your app and very well done because you’ve been introduced to a big new topic topic and you’ve only just scratched the surface what was that new topic that we’ve learned in this project well SQL the structured query language that we use while interacting with databases and you’ve gotten it down so far let’s finalize this app what’s left to do well our delete function our delete an expense what do we need to do to achieve this well in order we want to get the row that we clicked on from our table remember this method we’ve used this before so whatever row we click on I want to capture that and I do want to check I want to run a quick check and I want to check to make sure that I indeed chose a row within that database if I did I can create a variable using the ID of the row that I selected we can generate a question popup and we can ask the user if they want to delete yes or no remember the Q message box well we’re going to use that here along with the question method if I choose yes from my popup box I can prepare a query and I want to SQL syntax delete from table where the ID I collected is equal to the value we can then load in our new table using the load method that we previously made if we look at a little bit of the code from our delete method you can see in the first part I am creating a variable and the value of this variable is whatever row we click on I am capturing that from whatever row I click on I want to get the ID from that row so I’m saying my ID this new variable is equal to my expense table item the selected row column zero because I know that no matter what every Row in the First Column which is column zero that is actually holding the ID of that row so I am selecting so if I click on row five I want to go to row five and get the information that’s in the First Column and convert that to text that’s our ID based on that ID I’ll now create a new query and I’ll say hey prepare to execute this query all right I want to send my message and I want to execute the query so my expense ID is right here that’s our question it’s going to to remove that row and load in our new database right this prepare query where it’s preparing let’s translate that it literally says delete from my table named expenses but only where the ID matches the one I give you here that is how we could program out our delete method if you want to try and implement this yourself jump on over to vs code and I’m I’m about to head over there myself I’ll see you over in vs code let’s finish off our [Music] app you’re closing in on the final details of your project the last thing we should be doing is adding our delete expense method we have our functionality down we want to have the ability to remove something from our database from our app table let’s head down to our class and after our ad expense method this is where we focused our endeavors last lesson let’s create right here our closing method this will be our delete expense method let’s clean this up a bit so I’m going to give some space what do we want to happen how can we delete something well what I want to try to do is I’m going to click a row in my database and I want to capture whatever row I click I want to delete that row whatever row we click on after I click my delete button we have within our UI design so for whichever row I click on I want to capture the ID that’s linked to that row and I want to delete it from my app screen as well as my database let’s start with I want to capture the row that I click on let’s create a variable called like uh selected row this is equal to my table do you remember how do we get the value of the row we clicked on we’ve done this before actually and we did this in our last project I’m going to say current row so the value of this variable is one of the rows that I click on in my table first things first I need to make sure that my database is not empty because if I click into an empty table if there’s no database or there’s no rows I should not be able to delete anything so I need to anticipate that someone might try to do that let’s make sure that if the selected row is equal to -1 so that means you actually did not choose a row from the table you clicking the delete button but you did not click a row yet I want to alert the user to a problem an error what is the best practice for us to alert the user let’s give them a friendly message box and let’s just give them a nice warning and say hey something’s going on here and you might want to address that so that’s a part of myself and I’m going to say no expense chosen you are the chosen one you didn’t choose one so we can say that and I’m just going to say hey please choose an expense to delete that looks nice exclamation point we can simply then just return that that’s going back to the user nothing else is going to happen we now have checked and warned the user that they need to choose a row if they’ve chosen a row we want to capture the ID from that row so specifically the text value of that ID let’s create a local variable and previously we have one called expense ID I can use that here because this is within my method expense ID is going to be a number now the number is going to be something from my table and it will be one of the items in our table what item do I want from the table well I want to get it from the row that I’ve clicked on and I want it to be from column one which is column zero remember in our database the First Column is our ID that’s what I’m capturing I’m getting the ID from our database from the table specifically everything in the table is a text object so I’m just going to say text here this whole item is an ID text value but we’re converting it to an integer which is good I have an ID let’s double check and make sure that that user really wants to delete it CU if they don’t then okay let’s give them a second chance let’s create and let’s say something like confirm confirm is going to be also a friendly message but this is going to be more like a question because I want to make sure and I say okay are you sure that you want to delete this so we can say are you sure question what do we want to say then we can say delete then we need to give them two options and it’s telling me to give them two butt buttons now these are going to be our Q message buttons so we can say the options are going to be Q messagebox do it’s going to be yes or no I can say that like that so I’m going to confirm and this little question box which we’ve looked at before is going to pop up and it’s going to ask the user if they want to delete an expense the user will then be given two options from which they must choose choose yes or no if our answer so if what we get back from confirm is equal to no what do we want to do well I just want the program to end I don’t I don’t want to delete anything here’s a popup box if the confirmation is no just exit out of this method I’m done using it I don’t want to do anything I don’t want to delete that item but if this condition is not true it means we do want to delete an item and we clicked yes what do we need to do to remove an item from a database well it’s kind of the same question what do you need to do to create a database to add an item to delete an item we need to ask a question I’m going to prepare a query the query that I’m going to prepare is I’m going to take this query and I’m going to prepare something what SQL syntax do we want to use well I want to delete from my table called expenses everywhere where the ID is equal to the bind value I give it what’s the bind value well the bind value is going to be the expense ID this expense ID that we got from the row we clicked on is going to be where the ID matches that so delete from our table everywhere where the ID is equal to the row we clicked on that’s us using the ad bind value again finally let’s execute our query it’s time to run it now that we have new data let’s load our new table the updated version of our table into our application this pretty much wraps it up the final step that I’m going to put on here before a quick test going up to our buttons we just need to connect self. delete button doclick do connect we can link our delete expense method are you ready for this let’s see if our expense tracker is ready to go running our app let’s choose so you can see here my app’s loaded and it’s loaded in our saved database that’s the point of a database we can save information every time the app fires up it’s loading that in now let’s say I want to delete this rent that was an error so I’m going to click I could click anywhere in this row I’m capturing the current row delete expense do I want to delete it no okay so nothing happened entertainment delete yes look tacos that was a mistake yes you can see our database working look at that amazing well done to everyone I’m so happy with how far we’ve come and how many projects we’ve been working through you started off with not knowing what this new framework was but now you’ve come so far and you’ve learned how we can use this framework pqt to build out window applications in Python and we’re not done yet there’s more projects to come and more tools that you’re going to learn I will see you in our next [Music] video [Music] you’ve just finalized your expense tracking app we’re at a later stage in this course and you may be wondering okay how can I start to implement a bit more styling into my apps this could be changing colors or adding boxes anything like that in the next few minutes you’re going to learn how we can style our pqt apps with CSS what is CSS you may have seen this term before you may have actually used CSS as well let’s take a look now CSS is used to style websites specifically it’s used with HTML and JavaScript and it can be used with other languages and this also includes python how does CSS work well our casc G styling sheet that’s our abbreviation CSS we use it to Target specific elements in our code so for example if you have a website that has H1 elements these H1s are the big text the headers I want to Target all the H1 elements and I want to give them the font size of 32 and the font family Gothic so I can use these parent elements to Target specific objects on my page or in our app and apply filters or apply stylings to them in CSS we have our main elements which are like your H1 tags any of your header tags your paragraph tags anything like that you can also narrow it down so if you created a class in HTML you can Target the class by using the dot with your class name now keep in mind this only works for HTML this class structure as in Python we have something different and finally you could style it by ID and ID is very specific so I’ve actually put this in the order it takes precedence with our least important in between and the most important we can use our styling CSS by targeting our element followed by a set of curly braces inside the curly braces we put the font Styles we want to apply to that element what would this look like in pi QT well it’s actually going to look very similar we can style the same way in pqt we just need to use the set style sheet method inside here the only difference is all of our styling is actually a string and you can see I’ve specified that by using a multi-line comment or a multi-line string with three quotes in the beginning and at the end what elements are we trying to Target well remember with CSS we are targeting the parent elements originally these were our main elements and classes well we can Target that with pqt and python too you can see here I want to apply a background color to my entire app my finance class this will apply a solid background color to everything everything that is a q label a q line edit or a q push button they are going to have these Styles then my Q Tree View could have this style now we haven’t talked about Q Tre view but don’t worry I’m just including classes here as examples but we will see these at a later stage in our course let’s jump back into vs code and let’s finalize and style our app I’ll see you guys in the next video [Music] video it’s time to add some styling to our application our current application is looking like this let’s take a look at what we’re actually going to achieve in this video I want to take our application from this all the way to something that looks like this now you can use your own colors of course this is just going to be what I’m aiming for and we’re going to do a little bit more than just CSS I have some bonus surprises we haven’t talked about in order to tweak our app but don’t worry as we go through I will break it down and give you a good explanation all right let’s move these off and and jump into our code at the top of our code uh I’m going to go in here let’s just import QT the first thing I noticed was when our app started we don’t actually have the initial date set so let’s take our date box and let’s call Q date we’ve actually done this before and we can link our current date method to our class Q date now when the app starts it’s going to have today’s date on it okay next up I want to go down here to my table I want to design my table a little bit more there’s currently a few things I don’t like going on let’s bring our app back up in our app I don’t want to see this bar at the bottom I don’t want to move the table I want it to be hardcoded so how can I prevent that we are going to take a look at that and then another thing I want to do for example if I add this expense I want it to go in descending order so at the top I have my newest entry my newest expense and it goes down to my oldest expense let’s try to implement those two functionalities the first functionality here I’m going to take my table I’m going to say self. table and I’m going to take horizontal header I want to apply a method and I’m going to say set section resize mode this is going to allow our table to be hardcoded and take away that scrolling bar so it’s going to look nicer and more clean within here we need to stretch the header I need to stretch the table so to stretch the header I’m going to use something called Q header view we haven’t imported this yet but it does have a method called called stretch let’s go up I’m going to throw in here and I’m going to say Q header view as a q widget there we go so this is going to stretch our header across our entire table widget brilliant the last little tweak I want to do to my table is I want to sort them so everything is in descending order let’s take our table and thankfully pqt has an awesome method method called sort by column and inside sort by column it’s going to take the column we want to sort so if you remember in our app the First Column is actually our ID I want to sort the second column this is at position one so inside here I’m going to put one as I want to sort by column one and then my sort order I’m going to use QT and I’m going to say descending order now that we’ve styled that it’s now time to add in some of our CSS let’s clean this up I’m going to add in my CSS before we add everything to our design so let’s say self. set style sheet inside here remember we need our string 1 2 3 4 5 6 then we can add in our CSS what do we want to change well I want to change a few things in order to change my entire app we need to remember that our entire app is actually a q wiget so I want to affect that parent element of Q widget returning to set stylesheet let’s say okay so Q widget I would like to apply some styles to I’m going to give them a background color and the background color I want to be I have picked out is this great we have that color what else do we want to add in our Q widget well I have my Q widget let’s say we want to affect our Q label we could affect our q line edit if we want to affect more than one element with the same styling I can put a comma so in this line I’ll be affecting any q line edits we have any Q combo box Q date edit as well as any Q push buttons we can have our Q table widget Q push button and then the last one we are going to apply a state so for example with CSS I could apply a hover state or other types and to do this I can use a semicolon and I’m going to say okay when the Q push button buttons are hovered over with our Mouse then these Styles will be applied I’m going to go through and I’ve already created some styling that I’m going to add in here let’s see what we’re going to add my stylings look all ready to go let’s walk through and see what I’ve done here so I’ve taken my Q label and my Q labels are going to have a darker font to them and I’m setting their font size anything that’s text Q label all of my Q line edits combo boxes in the date edit box they are going to have a background color of this the text within those boxes will be this dark gray and I’m giving them all a border around the perimeter of that object with a little padding my table widget will be the same color as my overall background and it will have a border so we will be able to see the difference between the two in between each row and column I’m going to have white or like this grayish color I’m applying my Q push buttons will be green with white text no border then when we hover over the button the color is going to change ever so slightly so a little bit darker wow look at all the styling so we can do that within one method self. set style sheet this looks great let’s try running our app and seeing our end result is it what we’re aiming for amazing it is exactly what I was going for and you can see as I hover over these buttons they’re changing color all of our items match the background color and I’m hoping that you used some of your own colors too let’s add our expense everything is working how we want it to delete look at that even our Q message boxes are styled to what we set this looks amazing incredible job have a play around with CSS and do a little bit more research because in our next app you’re also going to use CSS to do some styling I’ll see you in the next video for an introduction into our next project [Music] are you guys ready for our next project cuz I certainly am we are about to dive in and create an interest rate calculator application in this application you will be using everything you’ve learned so far but in order to create this we need a way to visualize data in Python we will introduce a library used for data visualization in this project let’s break it down here is an initial overview of our app take a look at what we see going on and what this app can really do we have the ability to enter an interest rate the initial investment M or the amount of money that we want to put in and the number of years we want to invest for you can see up here here is the interest rate here is the initial investment and then here is the number of years we want to invest for you can also see that I have a little box here for dark mode which is a way that we can style our application even more we can create a chart we are going to display in a table or some type of view all of our interest rates calculated and then finally I want to have the ability to save so when we click this button I want to save our chart but then I also want to save our table as a CSV file what widgets do you see on the screen right here well we know all these except Q tree view this is going to be a new widget a new class which allows us to have it’s almost like a q list widget but we have two lists going on we have two columns we have a year and we have a total then we do need something for our chart but just for the initial setup and design for now let’s just use Q Lael very similar to what we did in our image editor app are you thinking about your layouts and how you’re going to design this app a lot of things are happening here what makes sense to you what is the easiest way we could design this are we going to have a master row or a master column and what will be inside our Master layout what I’ve come up with is I’ve said that I could have two rows because at the top of our app we have a lot going on up here so this could be held in its own row then I could structure in a second row and within the second row I can have two columns My First Column is going to hold my Q Tree View along with our buttons and my second column is just going to hold the area with the chart this for now can be our Q label our design will have two rows row two will have two columns and together Row one and row two these will be held in our Master layout that Master layout we can drop that into a column start thinking about this because you’re about to head off and design the app on your own So based on your experience with pi QT and everything you already know how can we set up this app to the best of our ability I’ll see you guys guys in the next video where together we will prepare the initial layout and design of our [Music] app all right here we are in the initial setup for our interest rate calculator app you know what to do here building on all the knowledge we have been learning how can we set up our initial project let’s kick things off with our Imports what do we need from PI qt5 we are going to do our QT widgets import everything we want so Q application Q widget what else are we going to be needing for our application well we need our Q labels we need our Q push buttons let’s get our layouts in there before I forget them so QV box layout Q hbox layout we will use Q Tree View that’s the new widget item we have our q line edits so I can say q line edit and finally here I’m going to talk about something briefly called Q main window let’s put that in as well and this will allow us to create a window very similar to what the Q widget does but it allows us to inherit it a little bit differently great I am then going to go and I’m going to import something else so I’m going to go to qtgui I would like to import Q standard item model this is what will allow us to to build out and add elements to our Q Tree View itself great we want to create a class-based application so I’m going to create one called finance app and instead of inheriting Q widget this time I’m going to inherit the main window itself so let’s say Q main window you’ve seen how we can inherit Q Widget the same thing’s going to be done here for main window and it’s it’s going to act very similarly let’s create our Constructor what do we want to run when the app first starts well everything actually up top here I can inherit and so let’s say our super function I want to inherit everything from our finance app and I’m just going to say in it just like that so I’m inheriting I’m initializing this as a super class as well as activating the main M Window what this translates to is I am activating my super class Q main window and I’m giving my super class my class that we just designed this is how we set up the inheritance for Cain window what do we want to create well I can set my window title now we know that what do you want to call it interest interest me 2.0 I don’t know that’s kind of cool okay let’s give it a resize what would the width and height of the app like to be let’s say to kick things off 800600 all righty because I’m inheriting Q main window I don’t have a Q widget yet so we can actually make that locally inside our Constructor method so let’s say our main window and let’s say that’s equal to our Q widget like so I don’t need self because it’s not going to need that it’s you used and constructed right here let’s create all the objects we want to see on the screen I’m looking if I run my class what objects do we want well if I run this app I want three text labels at the top and three q line edits that’s going to be in the first row I want my treeview two push buttons and then for now A Q label let’s start off just in the first row so interest rate initial investment let’s say rates text I have that I’m going to say rates input that’s the input let’s create one for uh initial text we’ll create one for initial input we can create one for years so years text and we can say years input now that I have those all sorted I can just go through and I know these are going to be Q label so I’ll say Q label take that two times we have two more and then our next one we know is going to be a q line edit so let’s get this all prepared for us all righty in the first Q Lael rate text we can just say like interest rate this is going to be in a percentage looking good so our first one is interest rate then we have our initial investment our final one is going to be years to invest so our row I have all those objects this is going to now bring me into let’s say creation of our tree view so how do we use Tree View and how do we get items to it what I need to do is I’m going to create something like a model and this model is ultimately going to hold my tree View and it’s going to allow me to add items to this model self. model is an object from this Nifty class that we’ve imported from our qtgui I can then create my treeview let’s say treeview is equal to Q treeview it doesn’t take any arguments right now I can take my treeview so self. treeview and I would like to set the model to become my my model great look at that all come together we have our starting row I have created my Q Tree View and I’m preparing it to accept items within the tree View and we are setting our model then our last three things are I want a few buttons so I’m going to start off by creating my buttons and say let’s say I have a cal button and let’s also say I have a clear button our C button can say calculate and our clear button can say clear then I’m going to create a figure now in the end ultimately this is going to hold my chart but I haven’t introduced data visualization yet or our new module that we will use for this so for now I’m just going to say Q Lael and I can just say uh chart will be here soon that’s just like placeholder text next up we have all the objects what should we be going into we should be going into our design right we can take our design for our app so let’s create that I’m going to create my master layout I’m inside in it so I can use self like that I know that I want it to be in a column I know that I’m going to have Row one and that is our c and we also know that we also have row two that can be our Q as well now within row2 there will also be two columns if I created those now I can just say column one that’s my QV and column two is also our QV box let’s start off with Row one so I can take my Row one and let’s add all of our widgets to them so I’m going to actually copy this I know I’ll be needing it the first element we want is going to be our rate text our rate input let me get the other four added we have everything added to the first row I can carry on now to row two now within row two I have columns so let’s let’s begin with those columns actually I’m going to take column one we want a lot of things in here initially at the top I I want my treeview so I can add in my treeview itself directly under treeview we would like our calculate button bringing us to directly under our calculate button we can just insert that clear button let’s take a look at what we want the app to look like as well one more time I have put everything in the column I now just need to add my Q label to my second column before we can add it into our row taking column two adding the widget what widget do we want to add here well I want my figure to be here eventually which will be a chart great we have our two columns let’s take row two and I would like to add layout Row one and row two I can take my master layout now we can add layout to that and at top we want to say Row one and row two I can see a little mistake here I threw off right here I’m adding to my row row one and two this should actually be column one in column two set we can take our main window we can set that layout and we can say selfmaster layout a great everything’s set up and it’s ready for running but let’s come outside of our class real quick cuz we don’t have anything so if name is equal to main then let’s create our app object and say Q application we can create an object and say well let’s say my app is equal to our finance app let’s say mya. show and then let’s take our app and let’s execute our app before we run our app we’ve set layout now I’m inheriting Q main window and we’ve seen this before with our Q widget because we’re inheriting it I want to set like a central window so I can say set Central widget what do I want the main widget to be well my main window that’s my main widget so I’m going to set that here in line 62 that’s the last and final part of using our design with Q main window when we run the application we see everything come to life now this looks almost ready to go and ready for the next stage but this tree view is huge ideally I want these to be swapped so chart will be here soon this should take up the most space how can we do that we’ve done this before remember I need to set the width and the percentage of my columns Let Me Close Our application let’s find right right here let’s give this a try so I’m going to say column 1 is going to occupy 20% column two is going to occupy 80% of the screen looking much better this is how I want the app to look we are ready to go in the next lesson we are going to convert your data and get it into our tree View and calculate our interest rate starting to visualize our data before we take the data we’ve created and generate a chart or a plot with that I’ll see you guys in our next [Music] lesson [Music] great we have our app set up in the initial design ready to go now we need to talk about how we are going to calculate our interest and how we can use what we calculate to put into our tree View and into our chart what are the step steps we need to do in order to calculate our interest well if we take a look here I want to add the interest calculation to the Q Tre so we are going to create a method and this method is going to do all of the following it’s going to convert all our input fields to numbers so all these guys will be converted to numbers and we do want to try to catch any error so think about that what error could occur in this program if we try to convert these fields to numbers what if the user enters something that’s not a number we want to catch that and alert the user to this so think about Q message box once we’ve converted all of our input fields to numbers we want to then create a list for every year I want to multiply the total investment by the interest rate our calculation is right here I can create a treeview and each item in here is going to be something called a qard item we can import this into our project this is going to take a single item that we want to add to a treeview we can add our item year and item total to our treeview as a list so think about how can we do that as a list finally once we have data in our box I want a save button to appear on my screen initially when the app starts we should not have a save button because you can’t save if we don’t have any information so pause the video read through each of these steps what would you need to do in order to achieve or to solve each of these steps here I am using to calculate the interest the value that we enter into those fields so this interest rate I could store that in a variable and use that and then this initial investment that’s like my total I could store that in some variable as well this calculation is the equivalent to the output of our interest rate the input that we entered in number of years you can see that that’s displayed in the First Column versus the second column let’s take a look at converting all of our input fields to numbers and how we could catch any errors with that we have our try and accept statements what do we want to try to do we are creating these local variables in the function and we’re trying to convert all of our initial properties to a number number now remember a q line edit we can get the text value of a q line edit by using the text method and linking it to our qine edit object now that I have the text value I want to try to convert that to a decimal a float number we try to take our values we entered and we convert them as we need them I’m going to try and catch any errors specifically the errors that I want to look out for are value errors so if the user enters something that is not a number I want to catch that as a value a and to alert the user we can use our Nifty Q message box and just give the user a warning and say hey um you need to enter a number please try again we’ve now converted all of our input fields to numbers or we’ve caught the errors to do so what comes next well we need to calculate our interest we had a local variable called initial investment but I don’t want to change that variable that value um I do want to create that so I can change it so I’m making a variable total and whatever our initial investment was that is now the value to this variable total try and break down what’s happening here as I go through where do these correspond to what you see in your app for every year in the number of years I entered which is essentially this I’m going to take my initial investment my total every year I want to add the previous total and I want to times it by the interest rate so so every time this runs this is going to start with the first initial investment multiplied by the interest rate but then the second year comes and you can actually see here in my treeview that the numbers changing because I’m earning interest off my initial interest and investment so as the years go on it’s actually updating that’s what’s happening here I can create an object item year and item total and remember to add these to our Q Tree View I’m going to use that new class Q standard item so I’m adding a year and I’m adding a total I can then append a row this method I’m using with Q Tre view specifically to append a row which means a row is going to have more than just one item in there remember that we said we need to add a list my item year is column one my item total is column two now this is kind of strange what’s going on here well a string format specifier this allows us to format all of our floating points with two decimal places this specific syntax is telling us the number that should be formatted or how many digits afterwards I want two digit digits after the number and you can see here 76 cents or 42 cents that’s what we are formatting where is everything coming from in the app well let’s keep with our color coordination our goal now is to head back into vs code I want to be able to program a calculate interest method that when we call this method it’s going to insert all of our data in into this Q Tree View as an added bonus try to create a reset method when I click the reset button I want all the contents in my treeview my interest rate investment in years I want those to be reset how can you do that using the clear method I’ll see you guys over in our next lesson [Music] it’s now time to calculate our interest rate and display that in our tree view let’s go down and let’s create a new method after our Constructor right here I’m going to make a method and I can call this calc interest giving itself and in the beginning I’m going to create a variable called initial investment I know that it’s going to have a value but currently it’s none we want to try to do a few things I want to take all of our inputs from the top of our app so our initial investment the interest rate and a number of years and I want to convert those to numbers so we need to check and try to do that let’s create a try statement and let’s say okay uh interest rate we have that I am going to get my initial investment and then we’re going to have the number of years for interest rate let’s convert a float and we want to get our uh input something of input text uh rate input we created that initially that’s our q line edit and we can get the text value of a q line edit by using the text method we can do the same thing for our initial investment this is called initial input get the text for number of years well calculating the interest of number of years is usually done in int so whole numbers and so let’s just convert that to an INT get the text awesome if this doesn’t work let’s throw an exception so a value error so you must enter a number you can’t enter a space a letter anything like that or it’s not going to work if this occurs let’s give the user a nice warning so I can do that by using our Q message box warning is it parent is myself we can say Okay error and let’s just say invalid input enter a number like so looks great if that’s the case you can return that we now at this point have three number values that we want to use to calculate our interest do you remember the equation we’re looking for let’s try this calculation I’m going to create a new variable because I don’t want to edit the actual value of my initial investment but I am going to use that as a starting point what I can say here is I can say for every year in the range of one because if I have an investment the minimum is one year and my variable number of years plus one so for every year if I have my investment for 10 years this Loop is going to repeat 10 times every time it repeats I’m going to take my total which the first time this runs that is the initial investment and I would like to add the total but I’m going to multiply that by my interest rate divided by 100 great we have this I can take my item year now in my item year I would like to add an item to my treeview in order to do this at the top I imported a class called Q standard item this allows us to add an item to our treeview which if we go up a little bit we have right here standard item model I’m going to add a standard item to this model model going back what do we want to add as the item year Well I want to add my current index so the year that’s like for I for every year I want to add that current Year to my treeview then I want to have the total how much did I earn that year essentially inside here we want to put and format our code so I can do something a little bit strange here let’s give ourselves some curly braces and let’s go to the end of our total and I want to cut off the last two decimals so I can say to F I can then format my total which we initially collected right here that’s being formatted to only secure two decimal points what we want to do is I want to take my model that we created really our model is that treeview the fancy method append row allows me to append a list in this list in the First Column I want it to be item year and then I want it to be item total just like that this pretty much works as a bonus I asked you to actually Implement a reset method so very quickly I’m going to do that let’s call a method reset and say self for this we didn’t really have to do too much what do you want to reset well we’re going to reset our rate input we’re going to reset our initial input and then finally we’re going to reset our years input we can just use clear because each of those is a q line edit what is left to do well let’s go up here now we just need to go at the bottom of our init and we need to take our buttons so I have a cal button and we have a clear button and we want to say when the clear button is clicked we want to connect to our reset method when the Cal button is clicked we can connect to well you guessed it we want to connect to the Cal interest method all right let’s run it let’s see if we can take our data calculate the interest and display that into our Q3 view let’s say we have an interest rate of 8% the initial investment can be 10,000 and years to invest 15 years calculate look at that we did that I’m going to make this a bit wider okay but this treeview is working great if I click clear you can see see that we’ve cleared all of our inputs let’s just end this on a high note and add the final two touches let’s make the tree view a little bit wider and then also let’s clear the tree view going up here let’s just change this to a 30% width and a 70% width going down to our reset let’s take our model let’s say self do model clear try it one more time again 8% let’s say say 10,000 let’s say 15 years calculate look at that clear everything is cleared we are looking great we are about to head over into our next lesson and we are going to introduce the new topic of data visualization in Python this can become incredibly useful in your python journey and your career as a data analyst or a python developer I’ll see you in our next lesson for the introduction of math plot [Music] lip it’s time to get our hands dirty and jump into how can we take all of our data in the tree View and how can we use that to generate or create a chart to do this we are going to use a powerful python Library called matplot lib let’s jump in and explore how this new module works and how we can use this to our advantage in order to import map plot lib I’m going to do two things number one I can import map plot lib and I’m going to give it a nickname I’m going to reference it as PLT and this is an extremely popular naming convention that you will see in other code that uses this module I’m giving it a nickname PLT which is like plot that I can use at later stages in my code now Matt plot lib and pqt actually use different backends so we need a way for them to communicate and talk to to each other because we are using M plot lib with pqt we are going to import one additional class for our use I’m going to import from the backend modules of map plot lip I’m going to import a class called Figure canvas QT and this is a really long name so it’s popular to see also renaming that class to figure canvas so I’m importing this class and I’m renaming that as figure canvas this acts as a bridge and it allows us to create charts or canvas objects and that’s acts as a container so it allows us to wrap our chart in a canvas and this allows us then to take this wrapped canvas and put it into an app like pqt this is why we use this class figure canvas take a look pause have a read through I’m using the back end of matplot lib to wrap my chart to use in pqt let’s take a look at some popular methods that we will use for data visualization anytime we’re working with this module map plot lib this is one of our most powerful Tools in Python when it comes to data visualization you will most likely see two popular librar while working with python one being matplot lib and for its Simplicity in used in scientific studies but two another popular module that you could use is called plotly in this course we are just going to jump in here and use matplot lib as it’s easier to start and easier to understand you can hit the ground running with your data visualiz Iz ation we can use this to create simple plots line graphs scatter graphs anything like that what we are focusing on in this specific project is going to be a line graft for us to see how much interest we’re earning screenshot or write this down take notes anytime you see a table with me explaining these new methods it means you’re going to be using them more than just once it’s a good idea to write them down to understand this new library as a whole the first method we have is called subplots this can generate one or more plots in a single figure so imagine for example here is one plot what if I want four plots well that’s one figure now I break it into four plots I can use this method to do that we have the plot method and this will try to plot the data that we give this method so this method does take an argument it takes the data you want to see and it’s going to try to plot that you’ve seen this method with pqt it’s also a part of Matt plot lip once we have this plot we want to show this plot for readability for anyone using your app it’s good to give your app names and more specifically your chart your x axis your y axis in the overall title of this chart the xaxis it could be the length of time years and your y AIS could be how much money you’re earning the title of your chart could be something like interest rate we have a method called Figure and we use this to generate a new figure or if we already have a figure I can get a reference from that but for this app and to start off we are specifically focused on creating a new figure and finally we are going to see the draw method and this is used to redraw a figure and update its contents think about that let’s take a look at how we can now set up a plot if you remember when you initially designed your app you initially designed your app in the chart portion of it as a q label we said in our code self. figure equals Q Lael well now it’s time to change that we are going to change it from Q Lael to say plot remember we imported map plot lib and we’re going to call the figure method creating a new figure now that I have a figure I’m going to be working with this figure in pi QT so I need to give it to the class that we imported this figure canvas class allows us to work with Matt plot lib and Pi QT together we are giving it the plot that we created then we are just adding it to our row so you can do this entirely on your own it’s just updating and tweaking a few parts of your design your initial layout returning to our method now we have one method for calculating interest in our application our code for generating this plot is going to go within that method now these steps are not in any order at all can you reorganize them and put them in the order that they should be in based on the way our code is running if I take them let’s reorganize them okay you can see all the methods that I previously introduced I’m using here to generate my plot my chart we are creating a new plot and I’m making a list of years based on the input that was collected from our q line edit all right I’m using a list it’s going to range a certain amount of times we’re obviously going to start with at least one year and then we want to go for however many years we entered into our q line edit I’m adding one because python starts on zero remember that we are creating a list of Interest over the years and what you see here is called list comprehension this is a slightly more advanced python Topic in your python Journey you may have used list comprehensions before or seen them around but don’t worry in the next few slides I will break down this specific example for you the final three points we have are we want to try to plot the data and then that data we plot it’s going to make a chart I want to give all the titles to my xaxis my y AIS and just the chart in general our chart is 100% set up I now want to update my chart so we can see it on the screen another thing you see here is ax you could call this anything but you will see as a popular naming convention the variable ax is used when working with matplot lip what is list comprehension now when I break that down what are we trying to achieve in this list example well let’s break it down what I want to do is I have a list and this list is called totals and I want to add a certain number of elements to this list if I’m going to invest money for 10 years I want there to be 10 different elements in my list so in my example I have said I’m going to invest for 15 years so I’m going to repeat something 15 times every single time I repeat this Loop I’m taking my list and I’m appending something to it I’m taking my initial investment and I’m multiplying it by the interest rate in the current year this is like how much money you would earn after a year for example if I Chang these numbers and I said 10,000 10% interest rate I would be appending the number 11,000 to my list the first time that ran the next time this ran what do you think we would be having well it’s not going to be 11,000 anymore can we use our input values instead instead of hardcoding these numbers we can remember that we collected the value of everything we entered into the inputs and we converted those to numbers so we already have those as variables let’s now use them initial investment interest rate that’s what we did we went from this we changed it down to this now I’m not hardcoding anymore I’m using the value of of my variables which could be changing it’s whatever the user enters into the app let’s take this one step further we now have this how can I combine these three lines of code into one this is list comprehension now that you understand what we’re trying to achieve in this list let’s combine them in our code you can see that I’m defining a new list called totals you can see my square brackets then the calculation for each element in the list and this just takes our initial investment in the interest rate and it’s squaring it based on the year so all in all this is just one number this is like 11,000 from my previous example then the comprehension is I’m putting a for Loop in my list and I want to repeat the number number of years that we entered in our input remember we stored that in a list years that we created previously let me return now to what we initially saw this was the setup for our code can you implement this let’s try it I want to start to see some charts on our screen let’s head over to VSS code and I will see you guys in the next lesson it’s time to implement map plot lib [Music] you now have a basic introduction to how we can take data and create visual visualizations using this data we have that Library called matplot lib or matplot Library let’s get that into our code at the top we need to get the standard pip plot library or module from matplot lib let’s import matplot lib but the ply plot as PLT that’s the popular naming convention then remember that map PL lib in pi QT have two different backends so there’s a special import we can use when working with matplot lib in pqt we can say here from matplot li. backends backend qt5 a what I want to say here is I want to import specifically figure canvas QT and I can nickname that now as figure canvas so PLT and figure canvas are already popular naming conventions you may see in other code when working with map plot lib with pqt okay I’m going to Mark those we now have this new module imported for our data visualization I want to go down remember that our app has this Q label so I have a property called self. figure but initially I set this to a q Lael we now want to redo that the value of Q Lael is going to be a figure of some sort now this figure I need to create and convert to a canvas remember that a canvas is like a giant container that’s going to hold my figure in pi QT so this canvas is going to be an object actually and we’re going to use that class we imported this is like a wrapper and it’s going to wrap my figure in my canvas we can then just go down and we have actually added in here already I have taken my column I’ve added my figure let’s just change where it says figure let’s now add our canvas marking that off we’ve created this new mat plot lib figure wrapped it in a canvas for pi QT and then set the canvas to our column two okay the design part is done we now need to take that data and convert that and display this in our chart going down here we’re going to do this inside our calc interest method the first part of what we did here was we got our data we converted it and calculated the interest to display inside our Q Tree View what I want to do here is I want to like update my chart with our data this can be done so the first thing I want to do is I want to take my figure and I want to clear it off from any old data we don’t want that then by popular name I’m going to say ax this is like our axis I’m going to create a plot and I’m I’m going to say figure. subplots method this will allow us to generate a chart and if we wanted to I could create one figure or I could have four figures within one so I’ve generated a chart that’s now called ax for all intents and purposes let’s create a list of years so this is potentially going to be the x axis on my chart because as the years go on my interest goes up so my years is going to be a list how many elements do I want in this new list well remember if I enter that I will invest for 10 years I should have 10 elements in this list 1 through 10 So within this list let’s say it’s going to have a range of one all the way to the number of years plus one just like we did up here for our for Loop we have our years I now want to calculate my initial investment for this we are going to do some list comprehension now remember I talked about this in the slides in the lesson this kind of gave you an intro to what list comprehension is and how we can nest in a list to repeat a very similar task so I have a list of totals I’m going to start with calculating the first element so the first element I want to take my initial investment and we’re going to multiply it by our interest rate so that’s going to be 1 plus our interest rate divided by 100 what we want to do is I want to take this and raise it by the year that’s just one element okay all this is working together as one now I want to repeat this for a number of times so I can say here for year in years remember that years is a list we just created so it’s going to Loop for however many years we have in this list every time it’s calculating the interest for the current year and adding it to this list called totals that saves us a lot of code and this is more advanced python that we will see as we progress through our journey next up I have my data that I want to plot so I’m going to take my figure and I’m going to try to plot what do I want to plot well I want to plot the years and I want to plot the totals now that we’ve given some space there let’s take it and let’s give a title so I can use the set title method I can uh use the set X Lael method and we can use the set y label method let’s give a name to everything I’ve now given the names to the Chart the last thing I’m going to do here is I am going to take my canvas and I want to draw on that canvas using that method let’s also go go down here and I’m going to add in two more clears so when we click the reset button I want my figure to also clear I would like the wrapper my canvas to also clear our app is pretty much ready to run let’s go through we cleared any old charts we created a subplot then we generated data so my years is a list my total is all my interest calculated then we set that data to our plot giving it a title an X label a y oh our y label and then we drew on our canvas we can run the app let’s say an interest rate of 10% with a $115,000 investment over 20 years calculate look at that we took our data it’s not only displayed in treeview it’s also displayed in an image a picture this looks incredible our app is almost ready to go I want to have the ability to save this data as a CSV file and this chart as a picture let’s head into the next lesson and let’s talk about how we can save all the data we’ve just generated I’ll see you guys there [Music] we’ve come so far we have implemented not only a new tree view which is like a table but we’ve also implemented a chart using map plot lib our app has come to life it’s now time to add the saving functionality I want us to be able to save all of our table data as well as our chart let’s take a look at how we can achieve this does this look familiar well it should this is our method from our image app that we built in that image app we made a save method and the job of this method was when it was called it was going to save our newly edited photo within a new folder so remember we use the OS module to achieve this OS is our operating system we used our path to join or more specifically to link our directories together we’re going to use that now again we can also use the function make dur which allows us to make a new directory or specifically make make a new folder so start to think how could you create this how could you create a save method for this new app we’re making using the OS module let’s take a look at how we can do this here’s my code written now so in this method I want to be able to create a save folder and it’s going to save my Q tree view data as a CSV file okay then it’s going to take our chart and it’s going to save the chart as a PNG or as a picture so I need to do a few things here we need to get our existing directory remember we have used this before we use this and our image app our Q file dialogue and our get existing directory if we have our path then I want to make a new folder called saved in this folder this is where all of our charts and our CSV files will be saved within our app then what we could do is I can create a new file path and it just links just like the image app remember we created a new edited folder and we took this new folder and we linked it onto the end of our directory the same thing is happening here I create a new saved folder and I link that to the end of my directory now

    that I have this new directory I’m taking this new directory and I am adding my CSV file that I’ve just created using my data to it now that we have that we can open this new file and I I want to write inside of this the name in my CSV file is going to be year and total it’s like two columns then for every Row in my tree view remember our treeview is called self. Model let me repeat that for every Row in my tree view I am going to get two things a year and a total and I’m taking this from the index the position of the First Column zero in my triw the second column is at position one that contains my total I can use the data method to do that once we have this new data for my row then I want to write in my CSV file I’m going to write two things with a comma in between they are going to be formatted to year year will be in the first one total will be in the second one that is what we see Happening Here pause the video read through break it down in our own words we’re going through every row into our Q Tree View and what we’re trying to do is we are going to get the data from the row and save that into our CSV file the code you see here this only applies to our CSV in order to save our chart it’s actually much easier thankfully matplot lib has a method for us called save fig this method works just like the save method we’ve used previously in our apps I can use Save fig and I’m going to give it the full folder name so previously the folder was saved here you could call it results and I’m giving the name to this picture as a friendly reminder at the end what you could do is you could include a q message box or a popup and just tell the user or give them some reassurance that hey yes your data has been saved you can use your Q message box with the information method and the warning method and we can link a few things and say hey congratulations your save was successful or no you actually didn’t select where you want to save to Let’s jump back into vs code and let’s begin to wrap things up the first thing we need to do to wrap up is to add our save functionality I’ll see you guys in our next lesson [Music] it’s time to add our saving functionality remember when we added the save method within our image editing app we needed something called Q file dialogue I’m going to import that right now we can next go down to the bottom of our class after our calc interest I’m going to go right here before reset I’m going to create a method called save data giving itself inside here I want to create a path or my directory path so let’s say directory path is equal to our qfile dialogue do get existing directory we’ve used this before you’ve seen it it’s going to allow us to choose that directory that we want inside here we want to give it self and I’m going to give it a caption so like select directory let’s make sure I spelled self correctly I’m then going to check if this is true so if I did indeed capture a directory we need to make sure that we selected something if we did I want to create a new folder so like a folder path now to do this remember I need OS we don’t have OS yet go up and let’s import OS right down here I’m just going to say import OS all right back down OS path I want to join together what do I want to join well I want to join the directory path that I’ve just made and then I want to join like a new folder so let’s call it like a saved right this is our saved folder it’s going to contain a CSV file as well as an image of our chart I’m then going to access my OS and let’s say OS make dur inside here we can say our folder path that’s the path to make we’re good we’re ready to go now that I have this new folder called save what I can try to do now is I want to save this CSV file and join that to my new path so let’s create a file path and say OS path I would like to join together what do I want to join together well I now have this new path called folder path and it’s going to add results which is going to be a CSV file we can now open this new file path I’ve just created which technically is a CV file we can give it the nickname file anytime that we use this word file now it’s like a nickname and it refers to this file this file is our working directory with our saved folder with our new CSV file so I want to open this CSV file giving it the nickname file inside the headers of this CSV file I’m going to write some stuff inside I’m going to write year and I’m going to write total before putting all the new information on a new line then for every Row in the range of my tree view so I want this Loop to repeat for however many items we have in our model which which is our treeview to do this I can just take our model and I’m going to say okay whatever that row count is of the model that’s how many times this Loop is going to repeat every time this Loop repeats I’m getting a year and I’m getting a total that I’m going to add into the CSV file my year how can I capture the year well let’s take our model let’s index let’s get the position I of the model the row is going to be whatever the current row we’re on that’s just the index of our for Loop what column is the year going to be in well the columns in year one which is at position zero next up let’s just get the data from that the total is going to be the same thing I can take my model I can index the current Row the column is one let’s get that data looks great inside our file I can take my file let’s write these new contents in our file so every row it’s capturing the year and the total and it’s going to write in the CSV line after line after line what do we want to write in every row well let’s just say I’m going to have data here it’s going to have a comma and then I’m going to have more data here I can then format that data how I want it to look and I want it to look like year and then total so let’s format it like that great we’ve saved the data from treeview as a CSV file what we can do now is I can take my map plot lib library and I’m going to say save fig I want to save my chart as a picture and I want to save it in my saved folder right finally at the end here let’s just give a nice little message to the user and say hey um either it’s saved or it didn’t save so just be like save results maybe that sounds nice what would you like to tell the user like uh results were saved to your folder then else I’m making this a part part of the initial condition so else I was not able to find a path to use then I’m going to give the user a warning and I need to alert them to this problem and say save results I can put no directory selected this looks great I’m actually done right here but there’s one thing we’re missing I have a save data method I should have a save button going up we don’t have a save button so I’m going to jump in here and I’m going to make one I’m going to call this save button let’s say save button is once again A Q push button going down let’s just add it right here in column one let’s say column one add widget let’s say save button okay then down with our events we can take our save button let’s give our have a final test all right let’s enter 12% let’s say 25,000 let’s say 20 years calculate let’s click save this is good it asks us where we want to save I’ll say open I’m given an error let’s take a look at how we saved this okay let’s do a few things here so I’m going to trash this the first thing I’m missing is I’m actually I need a command am I reading this file a pending or writing well I’m writing in this file the next thing let’s change this from makor let’s say makers instead make directories and if the directory already exists is that okay let’s just say yeah that’s that’s okay I can save multiple things to that file running my code again let’s say 12% 20,000 20 years calculate save where do we want to save it here is fine Open results we save to your folder okay I got that let me move my app or Shrink it let’s take a look now if you check your side folder you’re going to see results here’s my CSV okay and then you’re going to see the chart we saved as well it’s working our save functionality if I return to our app make it bigger we can press clear and we need to address our clear let’s just change clear to say draw because I want to draw a blank canvas and that’ll fix our issue okay this looks great guys I am so incredibly proud of how far you’ve come let’s jump in now we we going to add some final Advanced design cuz you’ve earned it I’ll see you guys in the next lesson where we’re going to talk about how we can add some styling to our application I’ll see you in the next [Music] video [Music] you can see that every app you’ve built you’ve added a little more styling every app we started with our warmup that random word app and The Styling you learned was the layout and the design you’ve gone to the calculator app we introduced Q font and how you can import a font to our app in the expense app we then introduced CSS and how you can use CSS and style your apps in pqt now for our final app let’s add in some more styling but this is going to be slightly more advanced now that we have a working app you can worry about that dark mode this is not something that you should worry about until you have a working product but it is a fun feature to add and it’s actually easier to implement than you may think in our interest rate calculator how can we add a dark mode Let’s jump in and find out how the last thing we want to wrap up with our app is we’re going to do a bonus dark mode we’re going to tweak any fonts we have add any colors and any styling when we first launch our app this is the template we see but then if we select our dark mode box it’s going to apply that filter to our app you also see that my chart has actually changed I’m going to show you how you can do that as well using map plot lib in order to get our dark mode implemented we will use our CSS styling do you remember how do we use CSS in pqt well you should remember our method set style sheet and we’re going to use that here as well I’m going to create a method and in this method I’m going to check if my checkbox is checked is checked is a method that checks the state of our Q combo box so it checks if you have clicked that now this doesn’t only work for Q combo box if you use a widget called Q radio button for radio buttons you can also use this method to check the state of that we have the method set stylesheet which is going to allow us for our stylesheet when our dark mode is checked I want my background to be a dark color of the whole app my Q labels q line edit Q push button they are going to take a lighter color then my Q Tree View is also going to be a lighter color text with a darker background let’s go back what does the app look like this is what it’s going to look like you can see that my font is now light my input boxes and my buttons Tree View is like this lightish dark gray the main app component is a very dark gray that’s what we’re actually applying here with our styling so remember in CSS we want to Target an element so for example H1 we want to affect anything with H1 and it’s going to take on the color of the text of white the font size the font family well it works the same in pi QT just remember that everything is a string I want to affect my entire app so finance app background color I only want to affect tree view all right so I Target Tree View here now that I created that dark mode I created that apply Styles method this method I am linking to an additional method specifically for toggling or turning on our dark mode we have our object that we made that’s a q checkbox now I want to use a new event this event is called State changed and this event triggers when we change the state of an object or to translate that and break it down this changes when we click a q combo box right I’m changing the state I’m clicking it I’m marking it that is what we want to connect to I want to connect to my toggle dark mode method in return I’m actually checking if my Q combo box is checked if it is it’s going to apply that style let’s wrap things up and let’s head back over into VSS code and wrap up our final application I’ll see you in that [Music] video we are now ready to implement some dark mode and add additional styling to make our app even more unique first thing I’m going to go up top and I want to import Q checkbox this is what we’re going to be using for our dark mode and then going down let’s just create one of an objects here let’s say let’s call this object dark mode and let’s say that is our Q checkbox this Q checkbox is going to say dark mode now that I have that we can add that into our layout so right here I’m going to say self. Row one let’s add in that new object we’ve made at the bottom of in it we have all of our events let’s take that dark mode and let’s say when the state is changed I want to connect to something now we need to make this something so I’m going to mark that right now after in it let’s create a bunch of space here I’m going to create a new method and I’m going to call this let’s call this apply Styles giving itself so first things first let’s set our style sheet remember this is how we do our styling in pqt so I’m going to create this property I’m calling this method set Style sheet and I’m going to give my app some qualities some background colors let me add those in so I’ve created the initial styles for my app when my app boots up it’s going to have these styles with it the initial Styles I can check if my dark mode so I can say if uh self. dark mode is checked we’re using this new method it’s going to check the state to see if it’s clicked so if it is I want to do something and I’m going to change these values so I can take this let’s put it inside and let me tweak these values so you can see now that when my dark mode is checked my background color is changing it was white now it’s this dark color my backgrounds for my other buttons my labels they’re changing as well as my tree view all of these are taking effect when my dark mode is checked great let’s apply these initial Styles remember when the app starts it’s going to have these Styles so I need to automatically apply these up inside in it let’s just go down here and in it and let’s say self. apply Styles and call that method great now carrying on we are going to create a final method and I’m going to call this toggle mode when this method is called the only thing that it’s doing is it’s going to apply Styles it’s going to call the method we made above here what happens is it’s going to hit this condition if it’s checked it’s going to change the styling up in our events right here I can now connect what do I want to connect to well I want to connect to this new method that I just made so let’s say self do toggle mode looking nice I think my app is ready for a quick run Let’s test it okay here’s our app you can see that the styling of everything looks a little different I’m going to click dark mode okay it is working this looks great I can turn that on turn that off turn that off okay let’s style a few more things I’m going to close the app I’m going to return to my Cal interest method right in here let’s go here I’m going to tweak a few things I’m going to say okay uh let’s make sure that every model is cleared before we calculate a new one and let’s take our model and let’s use this we have used this before we’ve said set horizontal header labels inside here here I want my chart to say year and I want my chart to say total okay then the last little tweak I’m going to do is I want my chart to actually have a style so I can take my map plot lib module and I’m going to say PLT cuz that’s referencing it I want to access style and I want to use now you can look up a few of the other styles they have cuz this has changed and it will continue to change but the style I’m I’m going to use and one of the more popular ones is called Seaborn so I’m going to add that in right there let’s run our app and do a final quick run through let’s say 8% interest with 50,000 for 15 years I’m going to click calculate it’s working I’m going to click clear okay we have everything working let’s say 8% let’s say 5,000 let’s say 15 years dark mode working calculate you can see my chart that was working the first time as well looks great I have my total label my year all right let’s click save where do we want to save it open we’re working this is incredible this is absolutely amazing we have shot for exactly what we want in our application you should feel so proud of yourself you have been introduced to so much in this course many new Advanced topics that don’t just include pqt I will see you guys in our next video congratulations and spend some time reviewing your code and seeing how everything came together there for us in the end I’ll see you in our next video [Music] congratulations you have just completed the building apps in Python with pqt course I am so proud of how far you’ve come throughout these last modules you have been introduced to a powerful framework that’s used to create apps in Python this framework is a bridge between C++ and Python and it’s a class-based framework which means you’ve used everything you’ve previously learned in the fundamentals of python and you’ve brought in that knowledge here to create class-based applications you now have four fledged Capstone projects you were introduced to pqt with our calculator app this taught you the layout and the design structure for building apps we let into our image editor app or photo QT here is where you learn that you can use multiple modules to create a single application you then were introduced to SQL in databases through our expense tracking app and for our final project we brought everything together with with our interest rate calculator and data visualization which is a powerful tool in Python I hope that you’ve had as much fun as I’ve had in this course and I look forward to seeing you in other courses that I may have in the zero to KN program congratulations and well done before jumping on to any other courses please spend the next week to hone in the skills you’ve learned and try creating your own project using everything that was taught in this course from data visualization to implementing CSS or adding a database into our applications I’ll see you guys around nicely done

    By Amjad Izhar
    Contact: amjad.izhar@gmail.com
    https://amjadizhar.blog

  • Python Object-Oriented Programming: Classes, Objects, and Methods

    Python Object-Oriented Programming: Classes, Objects, and Methods

    The provided text introduces object-oriented programming (OOP) concepts using analogies and practical Python examples. It begins by explaining the fundamentals of classes and objects, illustrating these ideas with real-world examples like birds and vehicles. The text then transitions to working with objects in Python, utilizing the Turtle module to visually demonstrate object properties and methods. Subsequent sections cover defining custom classes, including constructors (__init__) and the use of self, followed by explanations and challenges focusing on class inheritance, including single and multiple inheritance. The final part explores special methods (dunder methods) in Python, showcasing their utility in defining object behavior for operators and built-in functions.

    Object-Oriented Programming in Python: A Study Guide

    Quiz

    Answer the following questions in 2-3 sentences each.

    1. What are the fundamental prerequisites for students taking this OOP course, assuming prior Python knowledge?
    2. Describe the core purpose of object-oriented programming (OOP) as highlighted in the introductory lesson.
    3. Explain the concept of “encapsulation” within the context of object-oriented programming.
    4. In OOP, what is the significance of “inheritance,” and how does it relate to classes and objects?
    5. Define the term “object” (or “instance”) in OOP, and provide an analogy used in the source material to illustrate this concept.
    6. Explain the relationship between a “class” and an “object” as described using the “birds” analogy in the lesson.
    7. What are “methods” and “properties” in the context of OOP, and how do they relate to functions and variables?
    8. Why was the “turtle” module chosen as a tool for teaching object-oriented programming concepts in the course?
    9. What is the primary role of the __init__ method within a Python class?
    10. Explain the concept of “multiple class inheritance” and provide a brief example from the source material.

    Quiz Answer Key

    1. Students joining this OOP course should already possess a basic understanding of Python fundamentals. This includes knowledge of conditional statements (like if/else), loops (for/while), functions (defining and using them), and common data structures (such as lists, dictionaries, and tuples).
    2. The core purpose of OOP is to provide a way to organize our code, making it easier to understand, manage, and reuse. It achieves this by treating “objects” as self-contained blocks of code that have their own data and functionality.
    3. Encapsulation in OOP refers to the practice of hiding the internal details and implementation of a specific object from the outside. By concealing these internal workings, it becomes simpler to manage and comprehend the codebase, as interactions with the object occur through a defined interface.
    4. Inheritance is a fundamental concept in OOP that allows for the creation of new classes (derived or child classes) based on existing classes (base or parent classes). This enables the derived classes to inherit properties and methods from the base class, promoting code reuse and the creation of hierarchical relationships between classes.
    5. In OOP, an “object” (often referred to as an “instance”) is a specific realization or example of a class. The source material uses the analogy of building blocks or Legos, where objects are like individual blocks that can be combined to create more complex structures or solve more complex problems.
    6. A “class” is like a blueprint or a family, serving as a template for creating multiple objects with shared characteristics and behaviors. Using the “birds” analogy, the class “Birds” represents the general category, while individual birds like an owl, hummingbird, or canary are distinct “objects” belonging to that class.
    7. In OOP, “methods” are essentially functions that are defined within a class and are associated with the objects of that class, defining the actions an object can perform. “Properties” are variables that are defined within a class and hold the data or attributes of an object.
    8. The “turtle” module was chosen for teaching OOP because, despite seeming like a tool for simple graphics, it’s a valuable resource for strengthening the fundamental understanding of objects. It allows students to visually see how different turtle objects can have their own properties (like color and speed) and perform different actions (methods).
    9. The primary role of the __init__ method (often called the constructor) within a Python class is to initialize the object’s attributes or properties when an instance of the class is created. It is automatically called when you create a new object from a class and sets up the initial state of that object using provided arguments (parameters).
    10. Multiple class inheritance is a feature in OOP where a class can inherit attributes and methods from more than one parent class. In the hybrid car example, the Hybrid class inherited characteristics from the Vehicle, ElectricCar, and GasCar classes, allowing it to possess properties and functionalities from all three.

    Essay Format Questions

    1. Discuss the three core principles of object-oriented programming (encapsulation, inheritance, and polymorphism) as introduced or implied in the provided source material. Provide examples of how these principles contribute to better code organization and reusability.
    2. Analyze the pedagogical approach used in the “zero to knowing object-oriented programming” course based on the provided excerpts. How does the course structure, the use of examples (like the turtle module and the bird analogy), and the inclusion of challenges contribute to student learning and understanding of OOP concepts?
    3. Compare and contrast the concepts of classes and objects, emphasizing their relationship and roles within an object-oriented paradigm. Use examples from the source material, such as the vehicle/car hierarchy or the bird class with its specific bird objects, to illustrate your points.
    4. Evaluate the benefits and potential drawbacks of using inheritance, including single and multiple inheritance, in object-oriented design. Use examples from the course material, such as the superhero classes or the hybrid car example, to support your arguments.
    5. Explain the significance and usage of special methods (dunder methods) in Python classes, particularly focusing on __init__ and __str__ as highlighted in the source material. Discuss how these methods enhance the functionality and representation of objects.

    Glossary of Key Terms

    • Object (Instance): A specific realization or example of a class, possessing the attributes and behaviors defined by its class.
    • Class: A blueprint or template for creating objects, defining the common attributes (properties) and behaviors (methods) that its objects will share.
    • Encapsulation: The bundling of data (attributes) and methods that operate on the data within a single unit (an object), and the hiding of internal implementation details from the outside.
    • Inheritance: A mechanism in OOP where a new class (derived or child class) can inherit properties and methods from an existing class (base or parent class), promoting code reuse and establishing hierarchical relationships.
    • Polymorphism (Implied): The ability of objects of different classes to respond to the same method call in their own specific way. While not explicitly defined, the different behaviors of various turtle objects or bird objects hint at this concept.
    • Method: A function that is associated with an object and defines the actions or behaviors that an object of that class can perform.
    • Property (Attribute): A variable that is associated with an object and holds data or characteristics of that object.
    • Constructor (__init__): A special method in a class that is automatically called when an object of that class is created. It is used to initialize the object’s attributes.
    • Instance Variable: A property that is unique to each individual object (instance) of a class.
    • Module: A file containing Python definitions and statements that can be imported and used in other Python programs.
    • IDE (Integrated Development Environment): A software application that provides comprehensive facilities to computer programmers for software development, such as a code editor, debugger, and compiler/interpreter.
    • Parameter: A variable listed inside the parentheses in a function or method definition. It is a placeholder for a value that will be passed to the function or method when it is called.
    • Argument: The actual value that is passed to a function or method when it is called, corresponding to the parameters in the function/method definition.
    • Data Structure: A way of organizing and storing data, such as lists, dictionaries, and tuples in Python.
    • Conditional Statement: A programming construct (e.g., if, elif, else in Python) that allows different blocks of code to be executed based on whether a certain condition is true or false.
    • Loop: A programming construct (e.g., for, while in Python) that allows a block of code to be executed repeatedly until a certain condition is met.
    • Multiple Inheritance: A type of inheritance where a class can inherit from more than one base class, inheriting their attributes and methods.
    • Dunder Method (Special Method): Methods in Python that have double underscores at the beginning and end of their names (e.g., __init__, __str__). They define special behaviors or operations for objects of a class.

    Briefing Document: Object-Oriented Programming in Python Course

    This document provides a detailed review of the main themes, important ideas, and facts presented in the provided excerpts from an introductory course on object-oriented programming (OOP) using Python. The course aims to move beyond basic Python syntax and delve into the core concepts of OOP, focusing on understanding, management, and reusability of code.

    Main Themes:

    • Fundamentals of OOP: The central theme revolves around understanding the principles and logic behind object-oriented programming. The course emphasizes key OOP concepts and problem-solving using these principles.
    • Practical Application through Challenges: Unlike project-based courses, this is a “challenge-based” course, designed to solidify understanding through practical exercises and coding challenges.
    • Visual and Challenge-Based Learning: The course caters to visual learners with slides and reinforces learning through hands-on challenges.
    • Importance of Foundational Python Knowledge: Students are expected to have a basic understanding of Python fundamentals, including conditional statements, loops, functions, and data structures, before starting the course.
    • Hands-on Coding with the Turtle Module: The course utilizes the turtle module as a practical tool to visualize and understand OOP concepts through drawing and creating art.
    • Defining and Working with Classes and Objects: A significant portion of the course focuses on defining classes as blueprints and creating objects (instances) from these classes, along with understanding their properties (attributes) and methods (functions within a class).
    • Encapsulation, Inheritance, and Polymorphism (Implicit): While not explicitly detailed initially, the course introduces encapsulation (hiding internal details), inheritance (creating classes based on existing ones), and implicitly sets the stage for polymorphism through shared methods with different behaviors across objects.
    • Special Methods (Dunder Methods): The course introduces the concept of special methods (also known as Dunder methods due to the double underscores), highlighting their role in operator overloading and extending the functionality of objects (e.g., __init__, __str__, __del__, __eq__, __add__).
    • Multiple Class Inheritance: The course explores the concept of a class inheriting attributes and methods from multiple parent classes.
    • Dictionaries for Data Management: The course demonstrates the use of dictionaries as a data structure for organizing and managing object information.
    • Customer Loyalty Systems and Bank Accounts as Case Studies: Practical challenges involve building systems like customer loyalty programs and bank accounts to illustrate OOP principles in real-world scenarios.

    Most Important Ideas and Facts:

    • Course Prerequisites: Students should already possess a “basic python understanding such as what are conditional statements Loops functions and the data structures we use in Python.”
    • Course Structure: The course includes “slides for our new topics live coding exercises as well as quizzes.”
    • Importance of IDE: The course guides students through installing Python and an Integrated Development Environment (IDE) like VS Code.
    • “I highly recommend that you get a shortcut and you save this to your desktop or your icon bar at the bottom of your window as we’re going to be using vs code a lot it’ll be handy to have a shortcut.”
    • Definition of OOP: OOP is “a way to organize our code this makes it easier to understand manage and reuse.”
    • Objects: Objects are like “blocks of code” or “building blocks or like Legos” with their own “properties attributes” and “functions methods.” An “instance is an object…an example from a class.”
    • Classes: A class is like a “blueprint” or a “family,” a “group of similar objects Under One Roof.” It’s a template for creating multiple objects with shared properties and methods.
    • Encapsulation: This involves “hiding all the internal details of one specific object from the outside” to improve manageability and understanding.
    • Inheritance: This “allows for the creation of classes…used to create multiple objects with shared properties and methods.”
    • Methods vs. Properties:“A method is a function…specifically it is a function in a class.”
    • “A property is a variable…specifically a variable in a class.”
    • The turtle Module: This module is used for drawing and creating art and is a “Hidden Gem for learning oop” by strengthening the fundamentals of objects.
    • Constructor Method (__init__): This is a special method that is “automatically ran when an object is created.” It’s used to “build our class.”
    • “This method is called __init__…it has two underscores in the beginning and after init that’s very important…we must use this as our Constructor…always the first method in our class…init just means to initialize just means to start.”
    • The self Keyword: “We use the word self in a class now self it’s basically a key and it unlocks the class so we can use all the properties and all the methods within that specific object.”
    • Operator Overloading and Special Methods: Dunder methods extend the meaning of operators.
    • “__str__ Returns the object representation in a string format…commonly used to define human readable strings.”
    • “__del__ called when an object is about to be destroyed…used to perform any final actions before the object is removed from the program’s memory.”
    • “__eq__ allows us to compare the values of two objects using the equal sign operator.”
    • “__add__ allows objects of a class to be added together.”
    • Multiple Inheritance: A class can inherit from multiple parent classes by listing them within the parentheses in the class definition.
    • Dictionaries: Used as a data structure with “key pairs” where a “dictionary key unlocks a value.”

    Quotes:

    • “this is not a project-based course but rather a challenge-based course to really hone in your understanding of o key Concepts in the overall logic we need to solve these problems”
    • “it’s designed for those of you who want programing broken down to a different level of understanding it’s designed for the visual Learners as well as challenge based Learners”
    • “objects are like building blocks or like Legos and they can be used to create more complex problems or if you’re building with Legos more complex designs”
    • “inheritance allows for the creation of classes…this can be used to create multiple objects with shared properties and methods this is going to be a powerful tool as we go forward”
    • “a method is a function in a class A Proper is a variable in a class”
    • “Turtle module is a Hidden Gem for learning oop throughout my years of teaching I have seen Turtle strengthen the fundamentals of objects in my students”
    • “if you remember from lesson one I said to think of a class as a blueprint this still applies now a especially going forward a class is a blueprint”
    • “a class is always capitalized it is one of the very few things in Python you capitalize a class is followed by a set of parentheses capitalized parentheses”
    • “self it’s basically a key and it unlocks the class so we can use all the properties and all the methods within that specific object”
    • “__init__ has two underscores in the beginning and after init that’s very important we must use this as our Constructor this is always the first method in our class in just means to initialize initialize just means to start”
    • “__str__ This method creates a string representation of our object it’s called by the builtin string function”
    • “__del__ this method is called when an object is about to be destroyed destroyed it’s used to perform any final actions before the object is removed from the program’s memory”
    • “dictionary key unlocks a value dictionary key unlocks a value anytime you want the value of a dictionary you need to insert the dictionary key the key unlocks a door the same thing for a dictionary”

    This briefing document highlights the key aspects of the OOP in Python course based on the provided excerpts, emphasizing the learning approach, fundamental concepts, and practical applications covered.

    Object-Oriented Python: A Challenge-Based Course

    1. What fundamental Python knowledge is expected for this course on object-oriented programming (OOP)?

    Students joining this OOP course should already have a basic understanding of Python, including conditional statements (like if, else, elif), loops (for, while), functions (defining and using them, understanding parameters and arguments), and fundamental data structures (like lists, dictionaries, and tuples).

    2. What is the primary learning approach of this OOP course?

    This course is not project-based but rather challenge-based. It aims to deepen students’ understanding of key OOP concepts and the logic required to solve programming problems. It is designed for visual learners and those who learn best through overcoming challenges.

    3. How is the course structured in terms of learning materials and activities?

    The course includes slides for introducing new topics, live coding exercises where concepts are demonstrated and applied in real-time, and quizzes to assess understanding.

    4. What is object-oriented programming (OOP) and what are its core principles as introduced in this course?

    Object-oriented programming (OOP) is a way to organize code to make it easier to understand, manage, and reuse. It treats “objects” as fundamental building blocks of code, where each object has its own properties (attributes) and functions (methods). Key principles introduced include: – Encapsulation: Hiding the internal details of an object from the outside to improve manageability and understanding. – Inheritance: Allowing the creation of new “classes” (blueprints) that inherit properties and methods from existing classes, promoting code reuse and the creation of specialized objects.

    5. How are the concepts of “class” and “object” explained in the context of OOP?

    A class is described as a blueprint or template for creating objects. It defines the general characteristics (properties) and behaviors (methods) that objects of that class will have. An object (or instance) is a specific realization of a class. Think of a “Bird” as a class; an “owl,” “hummingbird,” and “canary” are individual objects (instances) of that Bird class, sharing common traits but also having unique ones.

    6. Why does the course utilize the Python “turtle” module?

    Despite seemingly being for beginners or for creating art, the turtle module is used in this OOP course as a valuable tool to strengthen the fundamental understanding of objects. It visually demonstrates how objects have properties (like color and speed) and can perform actions (methods like moving forward or turning), making abstract OOP concepts more concrete.

    7. What is the relationship between “methods” and “properties” in OOP?

    In the context of a class: – A method is a function defined within a class. It represents an action that an object of that class can perform. – A property is a variable defined within a class. It represents a characteristic or attribute of an object of that class. Both methods and properties are linked to specific objects to work or be accessed.

    8. What is “class inheritance” and how is it demonstrated in the course?

    Class inheritance is a mechanism in OOP where a new class (the derived or child class) can inherit properties and methods from an existing class (the base or parent class). This allows for code reuse and the creation of a hierarchy of classes where more specific classes build upon the foundation of more general classes. The course demonstrates this through examples like a Superhero class being inherited by a Flying subclass, where the flying superhero inherits basic superhero traits and adds specific flying-related attributes and behaviors. Multiple inheritance, where a class inherits from more than one parent class, is also introduced.

    Python Object-Oriented Programming Fundamentals

    Object-Oriented Programming (OOP) is described as a way to organize code, making it easier to understand, manage, and reuse. It’s a crucial and advanced concept in Python and programming as a whole. This course aims to take your Python skills to a higher level by focusing on key OOP concepts.

    Here are some fundamental ideas behind OOP as presented in the sources:

    • Objects: In OOP, code is organized around “objects”. You can think of objects as blocks of code, where each object has its own properties (attributes) and its own functions (methods). An object is also referred to as an instance of a class. Objects can be likened to building blocks or Legos that can be used to create more complex problems or designs.
    • Classes: A class is like a blueprint or a template for creating many objects with shared properties and methods. It’s like a family or a group of similar objects under one roof. A class is always capitalized in Python.
    • Encapsulation: This is a key concept in OOP and involves hiding all the internal details of one specific object from the outside. By hiding these details, it becomes easier to manage and understand the code.
    • Inheritance: Another core concept, inheritance allows for the creation of new classes (child classes or derived classes) that inherit properties and methods from existing classes (parent classes or superclasses). This promotes code reusability. The course will cover class inheritance as well as multiple class inheritance.
    • Methods and Properties: A method is essentially a function within a class, while a property is a variable within a class. Both methods and properties must be linked to an object in order to work.
    • Constructor (__init__): This is a special method within a class that is automatically run when an object is created. Its purpose is to build or initialize the object, often by defining the initial values of its properties. It is always the first method in a class and has double underscores before and after init. The __init__ method takes self as its first parameter, which acts as a key to unlock the class so you can use its properties and methods.
    • The super() function: When a child class inherits from a parent class and needs to initialize properties of the parent class or call its methods, the super() function is used. It allows a child class to inherit properties and methods from its superclass and is particularly important when a child class also introduces its own new properties, requiring a new constructor.

    The course mentioned in the source material, “zero to knowing object orientated programming and python course,” aims to provide a strong foundation in these fundamental OOP concepts. It is designed for beginners to intermediate students who already have a basic understanding of Python fundamentals such as conditional statements, loops, functions, and data structures. The course uses a challenge-based approach to hone understanding of key OOP concepts. The Turtle module is specifically used in the course as a tool to strengthen the understanding of how objects work.

    Furthermore, Python has special methods (also known as dunder methods because of their double underscore prefix and suffix, e.g., __init__) that provide extended meaning beyond their predefined operational meaning. These methods make operator overloading possible. Examples include __str__ (for string representation of an object), __del__ (for actions before an object is deleted), __len__ (to return the length of an object), __eq__ (to compare object values), __add__ (to add objects), and others.

    In summary, OOP is a programming paradigm centered around objects and classes, emphasizing concepts like encapsulation and inheritance to create modular, maintainable, and reusable code.

    Classes and Objects: An Introduction

    Let’s delve deeper into classes and objects, which are fundamental to Object-Oriented Programming (OOP) as discussed in the sources and our previous conversation.

    Classes

    • A class is best understood as a blueprint or a template for creating objects. It defines the structure and behavior that a group of similar objects will share. Think of it as a general overview or a sketch containing the necessary information to create an actual entity.
    • In Python, a class is defined using the class keyword followed by a unique name, which by convention, is capitalized.
    • The code within a class can include methods (functions within the class) and properties (variables within the class). These define what an object of that class can do and what characteristics it possesses.
    • A class can serve as a “family” or a group of similar objects under one roof. For example, “Birds” could be a class, encompassing various types of birds as objects. Similarly, “Vehicles” could be a class with objects like “car,” “truck,” and “van”.
    • Classes can have special methods, the most crucial being the constructor method, __init__. This method is automatically executed when an object of the class is created. Its primary purpose is to initialize the object’s properties. The __init__ method always takes self as its first parameter, which acts as a reference to the instance being created.
    • Classes can also have other special methods (dunder methods) like __str__, __del__, __len__, __eq__, __add__, etc., which define how objects of the class behave with built-in Python operations.

    Objects

    • An object is an instance of a class. It is a concrete entity created based on the blueprint provided by the class.
    • Each object has its own set of attributes (properties), which are like variables that hold data specific to that object. For instance, if “Car” is a class, individual car objects might have different values for properties like “color,” “model,” and “number of wheels”.
    • Objects can also perform actions through their methods, which are like functions that operate on the object’s data.
    • When you create an object, you are essentially calling the class like a function, which in turn invokes the __init__ method to set up the initial state of the object. For example, T1 = Turtle() creates an object named T1 which is an instance of the Turtle class. Here, Turtle is the class, and T1 is the object.
    • The value of an object is its class.
    • Methods must be linked to an object to be executed. You call a method on an object using dot notation (e.g., car.drive()). Similarly, you access an object’s properties using dot notation (e.g., car.color).

    Relationship between Classes and Objects

    • A class is a definition, while an object is a realization of that definition. You can create multiple objects from a single class, and each object will have the attributes and behaviors defined by the class, but with potentially different values for its attributes.
    • Think of a cookie cutter (class) and the cookies it produces (objects). The cookie cutter defines the shape, but each cookie is a separate instance with its own characteristics (e.g., amount of frosting).

    In summary, classes serve as the templates for creating objects, which are the actual entities that you work with in your program. Classes define the characteristics (properties) and capabilities (methods) that their objects will possess. The process of creating an object from a class is called instantiation. Understanding classes and objects is fundamental to grasping the principles of Object-Oriented Programming and writing well-structured and reusable code.

    Object-Oriented Programming: Class Inheritance Explained

    Let’s discuss class inheritance, a core concept in Object-Oriented Programming (OOP) that we’ve touched upon in our previous discussions. Class inheritance allows for the creation of new classes, known as child classes or derived classes, that inherit properties and methods from existing classes, called parent classes or superclasses. This concept mirrors real-world inheritance, where a child inherits traits and characteristics from their parents.

    Here’s a breakdown of class inheritance based on the sources:

    • Purpose and Analogy: Inheritance is a mechanism for code reusability. Instead of writing the same code multiple times in different classes, you can define common attributes and behaviors in a superclass, and then have subclasses inherit them. The source uses the analogy of family relationships, where a child class inherits characteristics from a parent class. For example, if you have a Car class, you could create a Vintage class that inherits the basic properties of a Car but also has its own specific properties, like price.
    • Superclass and Derived Class:
    • The superclass (or parent class) is the class whose properties and methods are being inherited. It’s the more general class. The source also refers to the superclass as the “main class”.
    • The derived class (or child class) is the new class that inherits from the superclass. It can have its own unique properties and methods in addition to those it inherits.
    • Syntax: In Python, you specify inheritance when defining a new class by putting the name of the superclass in parentheses after the name of the child class. For example, class Vintage(Car): indicates that the Vintage class inherits from the Car class.
    • Two Routes to Inheritance: The sources describe two main approaches to inheritance:
    • Route One: Inheriting only new methods. In this scenario, the child class only needs to add new functionalities (methods) and does not introduce any new properties. Because no new properties are being added, the child class does not need its own __init__ (constructor) method. It will automatically use the __init__ method of the superclass.
    • Route Two: Inheriting new properties as well as new methods. When a child class needs to have its own unique properties in addition to those inherited, it needs to define its own __init__ method. Within this child class’s __init__ method, you must also activate the superclass’s __init__ method to ensure that the inherited properties are properly initialized. This is achieved using the super() function. The syntax would look like super().__init__(…), where … includes the parameters required by the superclass’s __init__ method. After calling super().__init__(), you can then define and initialize the new properties specific to the child class.
    • Method Overriding: When a subclass defines a method with the same name as a method in its superclass, it overrides the superclass’s method. When the method is called on an object of the subclass, the subclass’s implementation is executed.
    • Accessing Superclass Methods: Even when a subclass overrides a method, it can still call the superclass’s version of that method using the super() function (e.g., super().some_method()).
    • Multiple Inheritance: Python also supports multiple inheritance, where a class can inherit from more than one superclass by listing them within the parentheses in the class definition, separated by commas (e.g., class Hybrid(Vehicle, ElectricCar, GasCar):). In such cases, the child class inherits attributes and methods from all the listed superclasses.
    • Examples from the Sources:
    • Vintage inheriting from Car, adding a price property.
    • Clinic inheriting from Animal, adding methods to search for animals by region without needing new properties.
    • Flying inheriting from Superhero, adding a speed property and methods related to flying.
    • Hybrid inheriting from Vehicle, ElectricCar, and GasCar, combining attributes of different vehicle types.
    • FictionBook and NonFictionBook inheriting from BookLogic, each adding a specific property (genre and topic respectively).
    • DevelopedCountry and DevelopingCountry inheriting from Country, each adding specific economic indicators (GDP and HDI).
    • Bird inheriting from Animal and CanFly (an example of multiple inheritance).
    • Customer and Seller inheriting from User.
    • Manager and Staff inheriting from Employee.
    • Football and Basketball inheriting from Sport, each having a team property and specific behaviors.
    • Book and DVD inheriting from Item, and LibraryItem inheriting from both Book and DVD.
    • Bitcoin and Ethereum inheriting from Crypto.

    In summary, class inheritance is a powerful mechanism in OOP that promotes code organization and reusability by allowing you to create specialized classes based on more general ones. By understanding the concepts of superclasses, derived classes, and the use of the super() function, you can effectively leverage inheritance to build more efficient and maintainable Python programs.

    Python Special (Dunder) Methods Explained

    Let’s discuss special methods, often referred to as dunder methods (due to their double underscore prefix and suffix, e.g., __init__), in Python. These methods are crucial for defining how objects of your classes interact with built-in Python operations, functions, and syntax. They enable operator overloading, allowing you to define custom behavior for operators like +, -, ==, and functions like len(), str(), etc., when used with instances of your classes.

    Here’s a breakdown of special methods based on the sources:

    • Definition and Purpose: Dunder methods are special methods in Python that have double underscores at the beginning and end of their names. They provide a way to give extended meaning beyond their predefined operational meaning to your classes and objects. Essentially, they allow you to customize the behavior of your objects in response to various Python operations.
    • Naming Convention: The double underscore naming convention (__method_name__) is a standard in Python to indicate these special methods that have predefined meanings.
    • Automatic Invocation: Python often calls these methods implicitly when you use certain operators or built-in functions on objects of your class. For example, when you use the + operator between two objects, Python will look for the __add__ method in their classes.
    • The __init__ Method (Constructor): This is perhaps the most common special method. __init__ is the constructor for a class. It is automatically called when an object of the class is created. Its primary purpose is to initialize the object’s attributes (properties). The __init__ method always takes self as its first parameter, which refers to the instance being created, followed by any other parameters needed to initialize the object’s state.
    • Examples of Other Special Methods (from Source 09.pdf and 13):
    • __del__(self) (Delete): This method is called when an object is about to be destroyed (deleted from memory). It can be used to perform any final cleanup actions before the object is removed. However, the source notes that it is not very commonly used.
    • __str__(self) (String Representation): This method is called by the built-in str() function and when you use the print() function on an object. It should return a human-readable string representation of the object. This is useful for debugging and displaying object information in a user-friendly format. If an object doesn’t have a __str__ method, Python will use a default representation, which is less informative.
    • __len__(self) (Length): This method is called by the built-in len() function and should return the length of the object (if it has a concept of length).
    • __eq__(self, other) (Equal): This method is called when you use the equality operator == to compare two objects. It should return True if the objects are considered equal based on your defined criteria, and False otherwise. The other parameter refers to the object being compared to self.
    • __add__(self, other) (Addition): This method is called when you use the addition operator + between two objects. It should define how the objects are “added” together and typically returns a new object representing the result. The other parameter represents the object being added to self. You can implement type checking within this method to ensure that addition is only performed with compatible objects.
    • __sub__(self, other) (Subtraction): Similar to __add__, this method is called when you use the subtraction operator – and defines how objects are subtracted. It also typically returns a new object.
    • Relevance to Object-Oriented Programming: Special methods are a fundamental part of making your classes behave like native Python objects. By implementing these methods, you can:
    • Make your objects printable in a meaningful way using __str__.
    • Define how equality is determined for your objects using __eq__.
    • Enable the use of arithmetic operators (+, -, etc.) with your objects in a way that makes sense for their domain.
    • Integrate your objects with built-in Python functions like len().
    • Further Exploration: The sources mention that there are endless special methods beyond these examples. As you continue your programming journey, you will encounter and may need to use other dunder methods to customize the behavior of your classes for various purposes.

    In essence, special methods (dunder methods) are a powerful feature in Python that allow you to imbue your classes with rich behavior by defining how their instances interact with the core language constructs. They are a key aspect of writing Pythonic and object-oriented code.

    Python Fundamentals: A Concise Overview

    Let’s discuss some of the fundamental concepts of Python that are essential for programming, particularly as a foundation for Object-Oriented Programming (OOP), as highlighted in the sources.

    According to the sources, before diving into OOP in Python, a solid understanding of the following fundamental concepts is expected:

    • Variables: These are used to store data values. The sources demonstrate the assignment of values to variables within and outside of classes.
    • Functions: These are blocks of reusable code that perform specific tasks. You should understand how to define a function using the def keyword and how to call a function. The concepts of parameters (defined in the function signature) and arguments (the values passed when calling a function) are also crucial. The sources provide numerous examples of defining and using functions and methods (which are functions within a class).
    • Loops: These control structures allow you to execute a block of code repeatedly.
    • for loops are used to iterate over a sequence (like a list) or a range of numbers. The sources show for loops being used for drawing shapes with the turtle module and for iterating through lists of objects.
    • while loops continue to execute as long as a certain condition remains true. One source demonstrates using a while loop with user input.
    • Conditional Statements: These allow your program to make decisions based on certain conditions.
    • if, elif (else if), and else statements are used to create these decision-making structures. The sources illustrate conditional statements for login validation and checking object types.
    • Understanding logical operators (like and, or, not, ==, >, <) is essential for constructing complex conditions.
    • Data Structures: These are ways to organize and store collections of data. The sources mention several key data structures:
    • Lists: Ordered, mutable sequences of items, enclosed in square brackets []. Lists are used to store colors, objects, and grades in the examples. Methods like append() and remove() are also used.
    • Dictionaries: Unordered collections of key-value pairs, enclosed in curly braces {}. Dictionaries are used to store country information and crypto portfolio details. The syntax for accessing values using keys is highlighted.
    • Tuples: Ordered, immutable sequences of items, enclosed in parentheses (). While not extensively used in the provided code snippets, they are a fundamental data structure in Python.
    • Sets: Unordered collections of unique elements, enclosed in curly braces {}. Sets are used to manage unique team names in the sports challenge.
    • Modules: These are files containing Python definitions and statements. The import statement is used to bring modules into your current program. The turtle module for graphics and the random module for generating random numbers are used in the examples. The syntax from module import * imports everything from a module.
    • Basic Python Lingo: This refers to understanding common terms and syntax used in Python programming.
    • Input and Output: The input() function is used to get user input, and the print() function is used to display output.
    • String Formatting: Techniques like f-strings (formatted string literals, using f’…’) are used to embed expressions inside string literals for more readable output.
    • File Input/Output: The open() function is introduced for working with files, specifically writing to text files using the ‘w’ mode and the write() method. The with open(…) as file: construct ensures proper file handling.
    • Built-in Functions: Functions like sum() to calculate the sum of elements in a list and len() to get the length of a sequence are used.
    • Operators: Understanding various operators, including arithmetic operators (+, -, *, /), comparison operators (==, !=, >, <, >=, <=), and the in operator for checking membership in a sequence.
    • isinstance() Function: This built-in function is used to check if an object is an instance of a particular class.

    The sources emphasize that a good grasp of these Python fundamentals is crucial because OOP in Python builds upon these concepts. For instance, methods within classes are essentially functions, and they often utilize loops, conditional statements, and data structures to implement their logic. Understanding how to work with modules allows you to extend the functionality of your programs by using pre-built libraries like turtle and random. Even special methods (dunder methods) operate within the framework of these fundamental concepts.

    Therefore, mastering these Python fundamentals will significantly enhance your ability to understand and effectively utilize object-oriented programming principles as taught in the provided course.

    Object-Oriented Programming with Python in 2024 | 7-Hour FREE Course for Beginners

    The Original Text

    if you’re ready to take your python skills up a level this is the video for you over the next 7 hours I’m going to take you on an objectoriented Journey with oop program taking you through these Advanced crucial Concepts in Python and we’re really going to focus on two key Concepts encapsulation and inheritance this course Builds on your core foundational skills so far in programming and it’s an extension of my python for absolute beginners course that I released at the beginning of the month right it’s still absolutely free that’s the best part 7 hours of more premium content coming at you for free if you guys enjoy this stuff do me a favor for this course like And subscribe to this I know right but liking helps this course reach more students people who could really use this course and comment your thoughts below if you’ve been feeling overwhelmed by this topic o right let me break it down for for you I’ve got you covered by the end of this course you’re going to have mastered a crucial concept not only in Python but in programming Concepts as a whole with over 7 years in the education space I’ve created interactive lessons in materials as well as live coding exercises that’s right all these challenges to further your understanding l p if you’re ready I’ve been ready let’s Dive In [Music] welcome to a code with Josh special don’t skip this part guys all right the next few minutes are the most important few minutes of this course because I’m going to break down who this is for is it even for you all right and who this is going to work best for how to go through this course all right so just give me a few minutes here right this is my extension to really break down a key crucial Concept in programming right o or objectoriented program all right now this is a topic that I did Cover in my course python for absolute beginners I’ll put that here all right that was still free for you right but it’s a rather crucial and advanced concept this course is dedicated to furthering your understanding in this crucial concept of oop through encapsulation and inheritance all right now if you’re new to programming this is not the course for you okay you should understand python as a whole already right control structures functions modules all right you should maybe have worked with classes before if you haven’t that’s okay right because I’m not going to teach program the basics of that I’ve done that in my previous course all right now here is going into o we’re going to further that and I want to emphasize too this is not a Project based course all right I do have projects in this but I want you to think of these projects as more like challenges or scenarios as we work through and introduce you to more advanced oop Concepts now guys also this is still 100% free right I’m not getting paid anything for this but I’m hosting this course as well as my other course for you guys on my own platform Zer towing.com I’m going to put that as the first link in the description all right head on over there and you get a boatload of free resources for you right my handcrafted python guide you get an Interactive Learning Community to chat with others and learn that’s key all right if you’re going to hold yourself responsible and you want to progress and learn don’t sit here and watch a YouTube video it’s not going to happen all right by learning engaging asking questions answering questions that is how we learn right so check out the platform it’s absolutely free it’s the link in the description all right um and that’s just going to bring you guys a smoother viewing experience right it’s still free and uh so use it all right now this course guys I have timestamps use the timestamps if there are topics you know Skip ahead to that topic indulge in it comment ask questions all right and code along the way all right I’m really excited for this right any questions let me know all the resources I have for you guys are in the description all right I think I think that’s it over to the course [Music] enjoy hi and welcome to the zero to knowing object orientated programming and python course my name is Josh with over five years in the education field for which two of the last have been specifically with python I’ve taught teens all the way to young adults I’ve taught hundreds of students and I’m here to share my knowledge with you let’s jump into a general course overview of what you can expect throughout this class throughout this class you are going to build a strong foundation in the fundamental concept of objectoriented programming you’re going to use your existing python skills as we grasp New Concepts and you learn new ways to implement your logic the knowledge you gain in this course is going to be instrumental in your programming Journey from here on out and as we go through our lessons we are going to build on each previous lesson and this is going to give you a good understanding of O and the general concepts that come with it I’ve seen many students struggle with this topic or try to speed past this topic topic of objectoriented programming this course is designed to give you a strong foundation in those important fundamentals that we will use in any o language many online courses have too much and some of the fundamental concepts get brushed over because of too much material all-in-one courses don’t spend enough time strengthening your foundation skills I’ve broken this course down to a level that’s easy for you to understand this course is structured in the best possible way so as you progress through it’s gradually going to get harder building on the skills that you’re learning from the previous lessons throughout this course you will get an overall idea of what is objectoriented programming you will spend time working with different objects spend time defining your own classes and objects we together will grasp the concept of class inheritance as well as the concept of multiple class inheritance and finally to end this course you are going to learn about Dunder methods or the special methods that come with objectoriented programming in Python who is this course designed for this course was created for beginners to intermediate students in mind and will not teach you the fundamentals of python but rather the fundamentals of oop students who join this class should already have a basic python understanding such as what are conditional statements Loops functions and the data structures we use in Python this is not a project-based course but rather a challenge-based course to really hone in your understanding of o key Concepts in the overall logic we need to solve these problems it’s designed for those of you who want programing broken down to a different level of understanding it’s designed for the visual Learners as well as challenge based Learners throughout this course you will have slides for our new topics live coding exercises as well as quizzes I can’t wait for us to get started and to take a closer look at object or orientated programming I’ll see you guys in [Music] class before we get started with our course this video is for those of you who do not have python installed on your computer and do not have an IDE like vs code if you have both of those you can skip this video and head into the first lesson if you don’t this is the right video to help you get set up first up let’s get Python and install that on your local environment your system on Google I would like you to just Google Python and it should be the first list link or it’s going to be the first unsponsored link I’m going to click welcome to python it takes you to the python page now here is where you can find any documentation or anything to help you with python what I’m interested in is I want to scroll down and we see all these subtitles I have get started download docs today we’re interested in download and I’m going to click the latest version python Pyon 3.11 now do not worry by the time you watch this video this version of python may have changed and that’s okay because currently what I’m on is python 3.10 as you can see this is 3.11 so it’s it’s fine at the very bottom you are going to see these files now it’s very important here if you are in a Mac you are going to click the Mac universal installer if you’re on a Windows you can click the windows installer 64bit I’m going to click Mac CU I’m on a Mac and then in the top it is going to download python once python is done downloading you need to go through the steps for installation so open it run it and go through those steps I’m not going to do so only because I already have this on my system great over on Google we need to get a an IDE now you have plenty of options for this you could use Sublime atom or what I personally use is VSS code so I’m going to go into Google and I’m going to search for VSS code there it is it is the first link visual studio.com visual studio is great and it’s wildly popular amongst developers around the world if we go in here you can just click the first link it takes you to the homepage you’re GNA see a big blue button here now depending on your operating system this will change I am on a Mac so it tells me to download Mac universal if you’re in a Windows it’s going to tell you to download the windows Universal you can click here and then just like python it’s going to download in the top right once VSS code is done downloading you can open it and go through the steps for installation I I highly recommend that you get a shortcut and you save this to your desktop or your icon bar at the bottom of your window as we’re going to be using vs code a lot it’ll be handy to have a shortcut I’ll see you guys in the next setup [Music] video [Music] hi and welcome to the zero to knowing object orientated programming course this is lesson one before we jump in and start coding or anything like that we need to start at the very beginning and we need to discuss what is is object orientated programming or simply put O Let’s jump in to further discuss and break down what exactly oop is I have made a list of bullet points it’s a way to organize our code this makes it easier to understand manage and reuse all objects that they are like blocks of code and they each have their own properties attributes in their own functions methods simply put if I could explain it like this is objects are like building blocks or like Legos and they can be used to create more complex problems or if you’re building with Legos more complex designs in O there’s a big word and it’s called encapsulation and this is hiding all the internal details of one specific object from the outside by hiding this it makes it easier for us to manage and for us to understand the code then the Holy Grail of oop we have inheritance this makes programming with objects amazing inheritance allows for the creation of classes now going forward I want you to think of a class as a blueprint and this can be used to create multiple objects with shared properties and methods this is going to be a powerful tool as we go forward let’s take a look at what an object really is so on the screen each object right so I have object one object two object three they each have their own attributes so in this example an attribute could be considered color they each look different they have their own color and they have their own unique actions but at the end of the day all of these are objects or all of these are squares per se all right so just remember an object has its own properties its own attributes as well as its own actions what can this object do here’s a fun example I’ve put together and going forward in the coming lessons I’m going to use examples like this here is an example of objects now they are all birds we can see that they’re all birds and they share some of the same properties but then they all have unique properties of their own so some common characteristics of all of these objects they all have two legs and they all can fly those are shared properties some unique properties for example is I have a type of bird hummingbird this hummingbird is only found in the Americas these are unique properties that only this bird has so you can see we have four different objects and an object I want you to remember this word instance I prefer to use the word object but in other programming documentation you will probably see this word instance more than once an instance is an object it’s an example from a class so this object is from this class now a class is like a family it’s a group of similar objects Under One Roof all of these are unique Birds but at the end of the day they are all birds if I asked you what animal is that you would tell me it’s a bird if I asked you to be very specific what type of bird is that well that bird is a parrot and that bird is an object this is how object orientated programming is broken down let’s move on a little more I’m going to give you guys a brainstorm Challenge and I want you to take the next five minutes I would like you to think of three different classes remember family and for each class I would like you to think of three objects as an example if I go back I have one family Birds then three objects would be owl hummingbird Canary that’s one example I would like you guys to think of three more classes each class with three objects pause the video here write down down what you come up with pause the video here and write down what you come up with before moving on great some examples that I’ve come up with I have put in the source code for this lesson and I’ve also put it here these could be three examples that I came up with I have a class A family of vehicles right each of these are different object at the end of the day they’re all vehicles but when you get specific one object is a car one is a truck one is a van and one is a luxury vehicle they’re all different types I have a class for furniture but Furniture is very broad what are some objects that come from this class chair sofa table bed finally I had a class of countries and then we have us Thailand Vietnam and France they’re all different countries at the end of the day they are all a country they come from a class countries great I would love to hear what you guys came up with so be sure to put it in the Q&A of this lesson before moving on to working with objects in lesson two at this point in your python Journey you should all already have a decent understanding of the following variables functions Loops conditions as well as some basic python lingo you can see on the screen I’ve made some categories in the first one I have functions now when it comes to functions you should understand both of these how to define a function and if I use the word parameter or argument you should understand what that is too with loops you should know how to set up W loops and for loops and why we use both of these you should understand our conditions and conditional statements which means creating your own and all the logical operators that come with that you should know some basic data structures this could be your dictionaries as well as lists and tles all of these were acquired over the fundamentals of python which you should have learned going forward with object orientated programming this is more of an intermediate to an advanced topic I will be using function Loops conditions and data structures throughout this program if you’re unfamiliar with any of these please look some of them up before moving on I will see you guys in lesson two working with [Music] objects welcome back to lesson two in the last lesson we introduced what exactly is objectoriented programming in this lesson we are going to begin working with objects in Python this will strengthen your understanding of what an object is and how we use this to work with objects I am going to introduce a special python module to work with object objects I am going to introduce a special python module this module is called turtle and turtle is a module in Python which allows us to draw and create art but you’re probably asking Josh I signed up for a course on object-orientated programming why are we doing this module although this seems like something for kids Turtle module is a Hidden Gem for learning oop throughout my years of teaching I have seen Turtle strengthen the fundamentals of objects in my students that is why I’m using it in this course and this module is going to give you a strong understanding of how objects work in programming and how we can use them throughout our code in the picture on the left we have nine objects all of which are turtles each turtle though has its own properties so its own color and it very well may have its own speed and they all have different actions that can do different tasks now two new key words that I introduced in the last lesson what are methods and properties let’s dive in and let’s take a look a method is a function all right so simply put if we boil everything down a method is a function do not forget that specifically it is a function in a class a property is a variable specifically a variable in a class if you have to say that a few times that’s okay a method is a function in a class A Proper is a variable in a class I want you to think about how do you use variables how do you define variables good got it how do you make a function how do you use a function you should know those and you should start to think about those on the left I have three different properties I have a color a speed and a width if we think of these like a variable which you should I have my variable and then the value to the variable is here so our color its value is maroon parrot speed its value is five Canary width its value is two now a property and a method must be linked to an object in order to work so color is linked to the object owl speed is linked to the object parrot and width is linked to the object Canary if you guys remember from the last lesson I showed us an illustration we had a class or a family which I called birds in the bird family we had four objects we had an owl hummingbird Canary and parrot and those are the objects that I am linking to my properties very good on the right I have an example of three methods it looks the same as a normal function it has a unique function name and it’s followed by a set of parentheses just like a property a method must be linked to an object in order to run or work just what I had mention right as you can see all my properties and all my methods are linked to a specific object so let’s take a look at how to set up our code we are going to be heading over to VSS code or an IDE of your choosing very shortly now the code on the left here is is actually outputting the image that you see here on the right you should have a basic understanding of how modules work at the top we are importing this module Turtle I am then creating two objects okay so an object is just like a variable but the value of the object is a class so so T1 is an object turtle one the value of T1 is a class my class is Turtle it’s capitalized and it’s followed by a set of parentheses once I’ve created my objects I can then set the properties of each object so T1 is going to have the color of orange T2 has the color purple I am then linking two methods to each object I am giving them actions I’m giving them instructions of what to do next when I run this code we can see the output on the right but let me break that down even further here we have step by step of what’s happening and this is how I like to use turtle and create object we’re importing everything at at the top of our code once we have our Imports I can then create any objects I will use I could create one I could create five as well we are then assigning the color property to each of our objects and then I am linking our two methods to the object in order to get them to move the final function you see here on the screen is done this is a special function that comes with Turtle it allows the drawing to stay on the screen once it is completed great I’ve shown you some basic Turtle code I’m actually going to show you some of the functions the methods and the variables or the properties we will use in this lesson let’s check them out all righty so on the left I have my column of some properties and methods you will use and what they do along the way okay please note that all of these must be linked to an object because they are properties and methods we have the color property and this assigns a color to the object now it’s important to note the color inside is a string the second method is width and this is the width of the line you’re drawing automatically the width of the line is one if you would like to increase that you can put an integer inside which will change your width the turtle is just the name for the object and we can actually change the shape of all the objects you see on the screen you can change it to Circle Arrow Square Turtle as well as a triangle you can use the speed property which speeds up the drawing itself the maximum speed you can do is 10 in order to give your turtle motion or action we have the forward method you can use the word forward or you can use FD inside we put the number of pixels you want to move in that direction and finally on this page we have our directions we have left and right both of these methods take a degree how many degrees do you want to turn left 90° would make you a square if you did that four times very good take a moment if you need to pause the video here take a screenshot I’m going to move on to a few more properties and methods here are a few more so we have a method called up now if you imagine that your object your turtle is just like this pen I have on my screen I’m drawing right now if I want to move to a different location I need to up I need to pick my pen up and move it to a different location I can use the up method to do that I can use go to to justify which coordinates I would like my object to move to now this does take an X and Y position once we’ve moved to a new location I can then put my pen back down and start drawing again great the steps in order to move your object up go to a new position put it back down you can then draw again in one of the challenges I’m going to ask that you make a circle now if you’re up for a good challenge you can try drawing a circle with just your two methods forward and left if you want to make it easier Turtle has a circle method inside you put the radius how big do you want the circle if I said T1 Circle T1 is going to draw me a circle with the radius of 10 n good the final few methods there’s so many that’s why I encourage you to go back through these slides read the documentation online and see what you can do with your objects if you want to fill in your drawing which I’m going to show you shortly but you want to have for example your Square to be a solid color once you’re done drawing you need to use the begin fill method we use this before you start drawing and once you finish drawing you can use the end fill method these two working together will fill in your object with a solid color the very last line of code you should be using is done this allows your drawing to stay on the screen once it’s completed very nice that’s a lot of methods I’ve gone through 12 actually all right so using turtle with the basics of python in lesson one at the end of that lesson I said that you should already have a good understanding of how to make functions Loops conditional statements all of that basic knowledge you can use right here in Turtle to hone in your skills while now we are working with objects so take a look at my code right on the left we see normally I am importing Turtle I then create one object T1 remember an object has the value of a class I assign my object to properties color and width great I am now ready to start doing something with my orange object I want to fill in the shape I draw then I’m using a for Loop you should know how to use a for Loop I’m saying for I in range five that means my Loop is going to repeat five times every time two things are happening my object is moving forward 150 pixels before it turns left 144° once it’s completed it’s going to fill in my illustration which produces an output like this an orange star you can actually see my object here on the left of the screen that is what your turtle will look like if you do not give it a starting shape very good let’s take a look at that example a bit more right so just by using that Loop that 4 I in range five that’s producing the orange star you see on the screen if you did not use a loop it would be very repetitive because you would have to write this four more times I saving you eight lines of Code by using a for Loop right so experiment use the the programming knowledge you already have and tie that together with working with objects in Turtle great taking a look at a more complex example don’t worry I will break this down for you even a bit more at the top we start with importing Turtle okay I’m going to work left to right you always start with your Imports at the top that shouldn’t be anything new then I have defined two functions of my own I made the star function and the circle function for this purpose I am just going to work with the star function my star function takes four parameters it takes an object I’m going to give it a width I’m going to give it a size and a color then just like outside of a function t1. color right I’m taking my object T and I’m assigning it a property what is the color going to be well the color is going to be whatever I give to my parameters the same thing applies to width I’m giving my object a width that is going to be done when I create or call my function this code is the same exact code as you saw in the previous slide if I go back right here you see all of this except in this example I Define the object as T1 specifically in the following example I have defined one object T but T could be anything over in our code then right you can see that I have made T So T equals Turtle I’m going to give this object to my function our program runs we begin with asking for an input this is where I can enter a shape so if my input is equal to Star I’m going to collect a width I’m going to collect a color and I’m going to collect the size this will be my ARG Arguments for my star function I’ll break it down a little bit more but I encourage you to pause the video here and really just read through the code you should understand 80 to 90% of this all right so you can see I’ve colorcoded that those three green variables width call and size they are being used used as the arguments to my star function those arguments are being passed up to the star function and being used as the values within my function the same thing is happening with circle if I enter circle in my input then I am asked for a radius and a color which I am using as the arguments to my circle function they’re passed and they’re used to create a circle pause here give it a good look right I’m about to give you guys your first challenges in vs code here we are I’ve put together five challenges for you guys number one I want you to draw a hollow Pentagon each side of a a pentagon has a different color number two draw four solid squares right so these squares should be filled in with a solid color all different colors but all in different locations how do we change a location you might need to go back a few slides number three I want you to create three functions each function will draw something different when it’s called this is very similar to the previous example in the last slide go back and take a look but come up with your own shapes don’t use a star make something else number four I want you to draw 10 circles each at a random location with a random radius so this might be new to some of you but if you hear the word random in Python you should be thinking about the random module now this one’s a good challenge because it’s going to require you to import the random module and use the randant function if you don’t know how to do this do a little Googling and finally your last challenge I would like you to create three different objects these objects will draw three triangles in a column each triangle is a different color okay now as help you can use the slides to help you please do I encourage you to do that but at this point in your programming Journey you should also be comfortable doing your own research or learning how you can check out the turtle Graphics module documentation just Google that it’s going to be one of the first links you can also use these slides to help you now I’m going to head over into vs code and we are going to code this out I encourage you to try these challenges on your own I’ll see you guys over in vs [Music] code [Music] great welcome guys to VSS code in this lesson we’ve introduced working with objects in python as we’re now in vs code we are going to put some of that to use and get on coding now before I start coding reminder there are so many way ways to solve one specific problem any way you’re able to do it well done amazing you should not have to do it the way I do it if you do it like I do great if you find a different way that’s you being creative that’s fine too all righty you had a chance to read through the tasks of this challenge before watching this video I highly encourage you to try these challenges on your own go back through the slides of this lesson read the documentation for turtle do your best to overcome these challenges if you get stuck watch the video or if you want a guide to follow along with watch the video too I’m going to jump in with our first challenge in the first exercise I asked you to create a hexagon with six sides each side with a different color there are many ways to do this I’m going to try and do this the more efficient way there is a longer way there are other ways choose your path first thing we want to do is we want to import remember all the Imports are at the top of our code so from Turtle I would like to import everything that’s what the star means from the turtle module import absolutely everything I am then going to make an object so for the purpose of this let’s pretend you’re drawing on a piece of paper so I’ll say pencil what is pencil well an object is always equal to a class my class is Turtle great I’ve made an object now I know that each side of this hexagon needs to be different so you could do this a few ways I’m going to make a list list how many sides are in a hexagon well there’s six if you didn’t know so I’m just going to make some colors here uh I’ll say red uh purple orange what other colors do we have I think lime Green’s a color in Turtle I’m going to put that in there uh I’ll say light blue I believe that’s a color what am I at 1 two 34 uh okay cool let’s just say green dark green and then yellow all right we have 1 two three four five oh is that seven I have seven colors let’s take away green okay sweet six colors now I want to repeat a task remembering the basics of python how can we repeat something a loop I can say 4 I in range I want to repeat this well six times right that is how many sides are on a hexagon so six times I’m going to take my object my pencil and I want to change the color of my pencil I want it to be one of the colors in my list specifically I want it to start with red then it’ll go to purple and work its way through the list so to do this I’m going to take my list colors and I need to give it an index a position I’m going to say I so I is the first index the first time this Loop runs right the next time this Loop runs I will be the second element change my color uh let’s just take this let’s say the width of our pencil let’s just put that at five my pencil can now move forward how far are let’s say 100 pixels and then our pencil can move right 90° remember the last line of code I’m going to put here is done this will ensure that the drawing stays on the screen at the end great let’s run our code I’m going to head up there run the code terminal appears I should see a window there we go the window is quite big right so I’m seeing an issue right that’s drawing a square I don’t want that who caught on why is it drawing a square let’s go back to my code because I put 90 de that’s for a square I should be putting 60° 60 * 6 that is equal to 360 that’s the total number of degrees in a circle let’s try that again boom there we go go there’s our hexagon you can see that my turtle Graphics screen in vs code is quite large that’s okay you’re able to see what I’m drawing yours is going to be large too so we have a hexagon different color sides with a width of five one object pretty cool all righty I’m going to trash my terminal I’m going to turn all of this off except my import because I want to continue to used that for my other challenges in our next challenge we wanted to draw four solid colored squares each with different colors each in a different location this is weird this is really weird so in order to get this going we need to think about the word random all right now if you haven’t used it before which you should have with the basics of python playing with modules there is a module in pyth python called random I want that uh I’m going to say from random import let’s say random because that’s all I want I want the randant function I already have Turtle so I can create my object let’s say pencil again pencil is my object what do I want to do well I’m going to have four squares and they’re all going to have to generate a different color a color can be RGB colors so red green blue with the maximum of 255 let’s create a random color for each one red green in blue so I can say for I in range how many squares will we have four I’m going to have red green not Global green and blue let’s start with red R equals random I can say 0 to 255 that way it’s going to choose a random number between 0 to 255 each of those is going to do that because this is going to generate us a color now that I have a color I can just insert in here and I can take my red I’m going to divide that by two 255 we can take our green and our blue that’s going to get us a nice unique color that I can use here in Turtle remember there are other ways to do this not just one now that I have a color we want to Define and create some location our locations are always going to be X and Y so a random location the left of my screen is going to be -200 the right can be positive 200 you should already have a good idea of how coordinates work and this should not be a new topic right but that’s generally going to keep it on my screen I can go left 200 or right 200 with 0 0 being the exact middle every time I draw a square remember how do we move the pencil around well I need to take my pencil and I need to lift it up once the pencil’s up I can take my pencil and I can go to a new position where do we want to go I want to go to my random X and Y that we just created here once I’ve gone to that new position I want to put my pencil back down on the paper great pencil’s in a new position we are ready to draw the square so to draw our Square pencil let’s change the color to the color that we just made our color argument right here is this one that’s a random color we can then begin fill remember if we want to have a solid shape we use begin fill at the start and we will use end fill at the end great now that I’m in my Loop we can go forward 100 this time I can go write RT right you can also spell right and I’m going to say 90 much better once we’ve drawn that shape I would like to end my fill the last thing we’re going to do is say done right let’s run that code we have one object this object oh there we go okay so I have been given an error it’s really coming from line 35 and all of this is being triggered so what I’m going to do let’s color one equals color equals cool let me give that Oro see what I’m working with here there we go boom one square okay two three all decent locations it looks pretty cool I have a lightish blue one a mint green raspberry color and a gray Square that’s the job that’s what we were trying to do random squares in a different location with different colors if you really wanted to take this challenge up a notch you could have done random sizes for the squares too think about that how could you implement that in your code try and find out all right I’m going to close this trash my terminal and I’m going to turn off this code here all of it okay let’s go down here we are now going to move on to the next challenge of working with objects you should start to begin to feel comfortable with what an object is how do we use it remember pencil is the object object the value of an object is a class and the class has all these special functions and properties that come with it pretty cool number three we wanted to create three functions that each will draw a different shape when they’re called functions you should know how to make a function in Python that was the fundamentals of python if not this will be a quick refresh now remember I already have uh I’m just going to comment it out from Turtle import Star I already have that at the top of my code so I’m going to skip that part I’m going to come right back down and we can create our object pencil now I’m going to make some functions so what shapes do we want to draw why don’t I draw a square a circle and a pentagon those are all good shapes so I’ll make a function called square square is going to take really three parameters it’s going to take an object that can be my turtle my pencil it’s going to take a size of the square and it’s going to take a color now that I’m in my function I can do exactly what I have been doing so I’m going to take my object and I’m going to set the color of this object so my object is t t color the color that I want it to be is whatever my color parameter is let me change this I’m going to say P for pencil that it’s going to make it easier to understand so I now have the color that this square is going to be and I’m going to call begin fill on my object as well I can now go through the normal steps for I in range of four remember I’m drawing a square and I want my pencil to go forward how far 100 well you could say that but we have our parameter size whatever I enter as an argument for my function that is going to be the size of my square if I enter 50 cool my square is going to have a size of 50 all right then I’m going to say WR I’m going to start to use these other words now as I don’t want to get too shorthand for you that’s going to get confusing so object pencil is going forward the size amount the object is going to go right for a square 90° great um at the end what’s the last thing we need to do here well I began the fill I now want to end my fill cool um just to kind of show you guys what’s happening I’ll put that in here uh I’m going to run the code real quick I’m not done by any means but let’s just watch what happens I call my function I give it my object pencil I give it a size and I give give it a color let’s run it on my screen we are going to see that red square appear right there and it’s filled now you noticed it cut out real quick cuz we should have done as the last function here let me run it again cool great I know it’s working that was a quick test let’s close that trashing our terminal I’m going to turn off that function I called I’m going to make my circle function so circle is also going to take an object it’ll take a not even a size it’s not going to take that it’ll take a radius and it’ll take our color so I can say color is our color right very good keeping that the same convention I’m going to call the turtle Circle function and I will give it my radius now even before that that’s just going to draw a plain Circle so let’s say begin fill here and we can end with our Nill cool that is our Circle while I’m here I’m just going to make our Pentagon as well Pentagon objects size and the color the same things as the other two functions I can start with my color I’m going to go to my begin fill then because it’s a pentagon I’m going to make a for Loop what’s the range five it’s G to be five inside that there we go okay so every time my object is going to go forward 100 my object can go left you can say right right cuz up here I said right left right up to you um let’s say left for that is actually going to be 72 great a part of the challenge I want a way that I can call these functions more uniquely than this so I’m going to make like a loop and my Loop I’m going to be able to enter as an input what shape I want to draw pretty cool so let’s say start is going to be an input and in here I can say a few things I can say say Square I can say uh Circle or I can say Pentagon and I’m going to make sure that they’re all lowercase linking do lower while my input is not equal to oh I don’t know let’s say stop while input is not equal to stop if my input is equal to square so if I’ve entered Square I want to collect some information here I want to collect a size and I want to collect a color so I’m going to say size is equal to an integer enter a size color because colors in Turtle are a string I can just say enter a color as a string there then we will call our function I’m going to give it an object what is my object pencil what is my size well I’m going to use my input size and my color can be color nice one done I’m going to add an also if Circle in there um if circle is called I don’t need a size I need a radius so I can say radius is our input right uh I will just say enter radius I’m going to copy color cuz that’s not really going to change we need a color for Circle then we will call our Circle function let’s give it our object let’s give it our radius and let’s give it our color nice one okay that brings us to our last shape so let’s make one more elith and say also if our Pentagon was called what I can do is cuz I’m going to use a size and color I’m going to take what we said here from our Square the only difference is I’m going to call the Pentagon function give it a size give it a color too no good conditions completed without an else so I haven’t put any warnings in here I don’t have any exceptions so let’s just say else anything else I’m just going to say uh error shape not found good do you guys remember what’s the last thing we need at the end of a loop well a loop needs a way to break to escape a while loop can go on forever we don’t want that that’s a problem so you need to be thinking about ways to break that Loop the one way to break it is I can just take my input copy that and I’m going to put that at the end of my Loop that way every time my Loop runs it’s going to ask this question again and it will check to see my input at the start of my Loop nice we’ve done a lot go back read through the code most of it should be familiar if there’s something that’s not familiar with you really break that down if you need to watch that part of this video again do so run your code experiment with it and let’s see what happens I’m going to run this code I’m going to make my terminal a bit smaller I don’t really need that cool so as you can see here I need to put this over here Turtle still on the screen at the bottom of here I’m seeing Square Circle Pentagon so I’m actually GNA enter and I’m gonna say Circle enter radius let’s say 25 color blue enter I’m going to go back here there we go I have a blue circle on my screen nice one okay let’s go back I’m going to do Pentagon Pentagon enter size 150 color orange going back oh there we go ah all right so I did not begin and N Fill with the Pentagon it’s not doing anything with that H let me fix that but let’s do the square first Square enter 100 uh purple oh what did I do wrong shape not found Square okay H spelled Square wrong so I fix that before I move on let’s just go to Pentagon let’s just say p. Nill trash my terminal reopen our code to get it working there we go uh let’s go into our code let’s do Pentagon this time Pentagon 200 purple there we go great now it’s filled right so I can now type whatever I want and whatever I type is going to be drawn onto our screen oh matched perfectly that’s cool I’m going to type stop that is going to break my Loop right so then our code is done now very very nice I’m going to turn off all this new code right so what I’m doing here is I’m touching on all the topics that were introduced in the fundamentals of python now you might not be a master at these topics but by going through them now you’re learning two things one how we work with objects and two how we can use our fundamentals of python to build while working with objects great guys I’m going to head over to the next video we are not done with these challenges I just want to give you guys a chance to review what we’ve learned in the next next video I’ll be back here in vs code and we will finish up those final two object challenges I’ll see you guys in the next [Music] video great here we are in the last video for working with objects where I’m going to finish up the final two challenges that I’ve given you guys in the next challenge we need to draw 10 different circles all at a random position and a random size I love random all right so I have Turtle let’s just go up here from random anytime you hear that word random think the random module I’m going to import everything great let’s make our pencil so our pencil that is our object the value is our class what I’m going to do here is I only want it to go when um I enter something into input that way it’s just not going to it’s going to wait for me to start so let’s say like start you don’t have to do this part you can just do a for Loop so I’ll start with that and then I’ll go back to what I wanted to do how many times will we repeat this 10 the challenge is to draw 10 circles every Circle needs something it needs a radius if you want to do a random color that would be a really good challenge I’m not going to put that in here though so so radius is random literally pick anything I could say five to One n to 100 let’s say 5 to 100 I have a random radius I need a random X we will keep with the statistics of2 200 and 200 uh and I need a y like so okay we have everything we need to start drawing what I’m going to do is I am going going to take my objects so pencil pen up or up right either of those two work I’m going to keep with up I want to pick my pencil up I want my pencil to go to a new position using the X and Y that I’ve created here right this is a random value this random value is being used for my X position our pencil can then go back down to begin drawing all we need to do to draw a circle quite handy quite useful we saw this in the previous exercise take our pencil call the circle method and I am just going to call Radius radius that is the input that we collected up top here it’s going to be a random radius awesome let’s run it that’s all we needed to do to get this working when Turtle loads it is slowly going to go through and you can see they’re not being filled in I didn’t ask you to fill them in I did ask you to put them as a random size all in random positions and by saying -200 and positive 200 it’s keeping them all in that general area nice really cool guys I’m going to say done so I used one object from a class and I used that object to draw 10 different things or do 10 different things that’s great okay uh if you wanted to right I could say like start and I could say input and we could say while start is not equal to off then all of this is going to go and we could take our input put that at the end the only difference this is going to do right is it’s going to do that I need to enter something anything right so I could say apple it’s going to go back it’s going to start drawing by using that while loop with input it’s just waiting for the user to tell python to do something before starting additional things from the fundamentals we can use with objects all right that brings us to our last challenge our last challenge I love this one we want to create four different objects each object is going to draw a triangle but these four triangles need to be in a column each triangle is a different color ooh what can we do here for this one so first thing I want to do is I want to create four different objects so far we’ve just been working with one but I can create multiple objects from the same class and that’s what I want to do here so instead of saying pencil I’m going to go shorter I’m going to say T1 I’m working with Turtle so turtle one Turtle class Turtle 2 Turtle I’ll fix that and uh T4 equals Turtle nice so this is going to parallel going into our next lesson I have four different objects remember each object has its own data and can do its own thing what I’m going to do in order to do this now you could have made one object right um the thing is they won’t all go at the same time you will need to wait for one object to draw and then go to a new position I know I’m going to draw a triangle so let’s create a function for triangle my triangle is going to take one of those objects one of those Turtles as an argument it will also take a color right so what I can do here is I’m going to take my object that I’m going to call color give it a color right I can say begin fill because these triangles are going to be a solid color and then we will do our for Loop triangle has three sides our range is three every time our turtle is going to go forward let’s say 100 and let’s say uh left ooh what is our left it’s not 90 be 120 three sides in a triangle 360 / 3 is 120 T and fill very nice our function is done which is great I want a way now that I can iterate through and I can draw these triangles at the same time you could be thinking of different things and you may have already solved this problem what I like to do is I love loops and I love to iterate through things so I’m actually going to make a list called T right and I’m going to put all my objects in this list and for the purpose of this let’s call this Turtles can I do that Turtle that’s better let’s say for every turtle in my list Turtle I want to do something with the turtle I’m on SO the current Turtle That’s T I want T I want that Turtle to go up I want that Turtle to go to a new position now I want them to be in a column so the X X that’s not going to change but the Y is going to change I need a way to change my y hm how can I do that well we could create a counter variable right let’s say y initially is 100 that means the first turtle is going to go to x0 Y 100 100 my turtle can go back down on the paper and then it would do something right but now the next Turtle needs to go to a different position let’s change the value of that y variable and let’s say y – 100 so every object T1 T2 T3 T4 is going to go to to a slightly different y position are you with me pause it read through see what’s happening now the final things we need to do I really just need to call my triangle function and I’m going to say T1 let’s say blue as the first color I’m going to say triangle let’s say T2 let’s say red let’s say triangle let’s say t three give me a color let’s do purple again uh and then triangle T4 excuse me and we will say uh blue did I do blue I’ve already done blue green there we go who remembers the very last line of code done wow you’ve done it let’s run it let’s see what’s happening now boom you see four different objects on the screen too that’s amazing they’re all in a perfect column nicely done if you got any of these challenges on your own you’re off to a good start and you’re going to do well in this course if you found some of them quite challenging that’s okay just know that this course might be a bit harder than you initially expected try to spend some time reviewing the fundamentals as you go through this course such as functions loops and conditions I’ll see you guys over in the next lesson in the next lesson we are going to start to Define your very own classes and objects I’ll see you guys there [Music] hi and welcome back to lesson three of the zero to knowing course in the last lesson I introduced the topic of objects and how to work with objects in Python in this lesson we are finally ready to Define our own classes and objects if you remember from lesson one I said to think of a class as a blueprint this still applies now a especially going forward a class is a blueprint let’s jump in to this lesson if I were to break it down so as I mentioned a class is like a blueprint or it’s a template for creating many objects so on the left I have a sketch or a picture of a house and this sketch is our class it contains a general overview of this type of object or it contains the general information you need in order to make an object on the right we have a completed object and this is what we created from the class using a description an object of a class now I want you to kind of remember from the last lesson do you remember this T1 equals Turtle I want you to say that 10 times if you need to get really annoyed by it T1 equals Turtle T1 equals Turtle T1 is an object the value of an object object is a class turtle is a class so here I have my instance or my object the value of an instance is my class now remember a class is always capitalized it is one of the very few things in Python you capitalize a class is followed by a set of parentheses capitalized parentheses let’s take a look at a few more objects so here we go you remember from the first lesson I introduced a class of birds well let’s take a look at a few more examples as you can see below these are all objects or they’re all animals right at the end of the day it it doesn’t matter in English all of these are animals that is our class they all have additional Properties or actions of their own right so the owl is the outcast object it is an object it’s an animal it has its own name has its own abilities has its own properties okay next up we have three land animals let’s call them and they share two of the same properties each of these objects have four legs and a tail but they each have their own properties such as the type of animal and location as well how many objects do we have four how many classes do we have one our class is animals our objects are owls raccoon lion and giraffe let’s take a look at another so here they are all phones sharing some of the same properties they all have some of the same properties and actions of their own but then they all have their own unique as well creating a class before we create any objects like a raccoon a lion we need to create a family we need to create a class in this class this is where we Define all the unique properties and all the unique methods that our objects will have but first we need to look at an important function this function is called a Constructor function but really it’s called our Constructor method right what is a method a method is a function in a class and this special method is automatically ran when an object is created it creates an instance it creates an object of a specific class this word Constructor what does it look like Constructor looks like construction what is construction build we use the Constructor method to build something to to build our class this method is called in it okay now you can already see and it looks weird you’ve never seen this before it has two underscores in the beginning and after in it that’s very important okay we must use this as our Constructor this is always the first method in our class in just means to initialize initialize just means to start right so every time we start our class or we create an object we automatically use the init method creating our class we’re finally here right we’re starting to see some actual code come together I’m going to break this down for us if you need to rewatch any of this please do because this is a very important topic object orientated programming so on the left we have all of our code and you can see that I’m starting at the top with my class to define a class we use the class keyword and then we give it a unique name just like a function but the first letter is capitalized then all the code inside is just like code outside you would make a function the same way but this is a method why is it a method because it’s a function in a class our first method is our Constructor in it in it is taking one two parameters just like a function takes parameters these parameters are the value to my properties at the end of our class I make an object car the value of an object is a class my class in this example right remember T1 equals Turtle well my T1 is car my turtle is my class I am giving my class two arguments because in it has two parameters that’s very important I can then use my drive method and I can link it to my car object if you’re a little confused don’t worry I’m going to break this down even more but before I do you see a new word on the screen what’s that new word boom we see the word self this is very important we use the word self in a class now self it’s basically a key okay and it unlocks the class so we can use all

    the properties and the methods anywhere we want throughout the class self is a key you must have it as the first parameter in any method okay but it’s important to note that you never use the word self outside of a class all right let’s do some color coordination now okay here we are pause the video okay if you need to just use the color coordination to help you all right so at the top of the screen the first thing I do is we Define we create a basic class I named it my class okay up next the first method in our class is our Constructor method this is where you will Define all the variables all the properties you will use throughout your class okay each parameter is the value to one of the properties next up we Define a method named drive this method this function uses the values from our two properties and gets the sum right so I have a variable X and the value of x are our two properties added together I can use my properties because I am using the word self remember self unlocks our variables and functions to use them throughout the class finally at the end of our code I create an object named car and then I give my two arguments to my class 50 and 60 50 is parameter 1 60 is parameter 2 I then link my drive method to my object and this is how we call a method because a method must be linked to an object right here we go so when I call my drive method the output in our terminal it would say the speed is 110 kilm per hour okay as you can see I added on a little extra there right but because my two arguments are being passed up here they are the value to my parameters I can then use my properties which which I’m adding together here and then I’m converting that integer to a string which is being printed out inside our terminal pretty cool huh everything’s starting to link together this is good all right let’s take a look at another class okay so I want you guys to pause the video read through the class okay I have two questions on the screen at the bottom try to answer those before I do all right I have a class called app you can see that’s created at the top of my screen here is here’s app the first method is our Constructor I am creating three parameters users storage and username for each parameter I am creating a property and remembering the value of my property is my parameter that’s all in it is doing it is a place to keep create and store our variables we will use in the class I then have two methods my first method is login this is just a normal condition if username if my property self. username is equal to owner and self. users is greater than one then I I can print off welcome username your storage is the amount of storage right so right here what is it going to print off think about that then I have a method called increase capacity increase capacity is its own method in my class it takes one of its own parameters I can use my property self. storage and I can add that parameter to it before I return self. storage so were you able to answer my questions what is the name of my class and my objects well let’s take a look okay our class is app our objects we have two product one product two remember the value of an object is a class go find that now my next question for you guys at the bottom of the screen what are the value of my properties pause it answer it there we go the value of my properties are my parameters users storage and username self. storage is equal to storage next question bottom of the screen where are the arguments that will be given to my class right there these are the arguments remember in order right it’s very structured users storage username users storage username right in that order these are being given to my class wonderful okay so here’s a breakdown I took that same class right and all we’re doing is we’re going top to bottom because that’s how we design our blueprint remember our class is like a blueprint we design the blueprint before we create an object before we create the finished product we create a class called app our method login has a condition which checks the properties against a set value that set value is owner and the integer of one we create a method called increase capacity and all this does is increases the current value of our property self. storage then finally once we’ve made our blueprint our class we can create an object called Product one or product two and we can call the methods we want okay so here’s even a bit more right I’ve kept a few of the hints from the last slide but I’ve added a bit more in the new ones I’ve added we set up our Constructor with the properties we will use throughout this class we have a method that increases the value right and then we have our product to what is this going to Output well let’s take a look if you haven’t guessed it yet which your mine should be ticking your wheels should be spinning what will this be outputting well let’s start with our first object our first object was product one right and product one is taking the arguments 35 256 an owner when I call the login method method those are the first two lines it’s going to say welcome owner owner and it’s going to say your storage is 256 then I also called the increase capacity method and I gave it the argument of 50 which is being used as my parameter it’s going to take my original storage which was 256 and it’s going to add a number to it that updates our storage to 306 if I take my second object and I call the login method it’s going to show login denied why well my username is Josh if username is equal to owner do this otherwise login denied so my name was not owner login was denied great a lot of things happening right so go back through these read over these see what’s really happening once we get to vs code it is going to start easy but I’m going to give you a few challenges and it’s going to get harder rather quickly it’s meant to challenge you and it’s meant to help build you that strong object orientated foundation in Python before vs code let’s take a quick flashback to what you were learning before objects here we are a class is a big group of methods and each method contains various elements that you’ve already learned in Python like conditions Loops lists diction Aries and more right so everything you see on my screen you should feel fairly confident with if you don’t I think you should stop now you can go back to Turtle because going back to Turtle you will reinforce your understanding of objects but you can also reinforce and practice your understanding of the basic Python Programming Concepts like conditions loops and functions a quick recap a condition is really just if something is true do this otherwise do something else that’s what a condition is if this is true print hello also if name is Josh Print it’s me Josh anything else print goodbye that’s how a condition is set up a while loop literally translates to while something is true keep repeating if it’s not true stop right so in my Loop while count while input is not equal to zero keep repeating every time I repeat I’m going to ask for a new input and I’m going to check if my input is zero it’s going to keep repeating right our for Loop if I literally translated a for Loop which I do do that for every item inside something I want to do something with that current item right so I have a list ages one two 3 four five six if I take my Loop for every age in my list ages if that current age is less than or equal to 17 I’m going to remove it all right so my Loop is going to go 33 and it’s going to take 33 if 33 is less than 17 nope my Loop is going to keep going and it’s going to check every number oh it gets to 15 if 15 is less than 17 that’s true it’s going to do something right you should feel very comfortable with these all right let’s jump in and check out some challenges do not go back okay this is our first challenge in VSS code where we are building classes this is a point where we should try to avoid going back from and I want you guys to try to recreate the code from the previous slides and use it as an example to build your own first class in vs code now remember that this class has one base class and I called it app inside app we had three methods in it login and increase capacity login checked if the username was equal to owner if it was it printed off welcome as well as the value of your storage increased capacity allows us to add a number to the current storage finally create two objects and both of these objects call both methods head over to vs code give this challenge a try and I will see you guys there for the next few challenges I’ll see you in vs code [Music] all right great guys here we are in vs code in this lesson we have introduced the topic of defin your own classes and your own objects and that’s what we’re about to do here in VSS code is to strengthen those foundations and build on what we have been learning in this first challenge I asked you not to go back and I wanted you to try to create the app class from the lesson here in VSS code in this video that’s exactly what we’re going to do so coming up top here we can use the class keyword to define a new class I’m going to call this class app now remember our class is capitalized everything after is inside the class what’s the first method we need to make who remembers what’s that special Constructor method well it’s in it remember in it means initialize or start and the first parameter inside any method is the word self self acts as a key and it unlocks everything for us to use around our class what were the other three parameters we had users we had storage if I can spell correctly and then we had username for each of these I am going to make a property so self. users equals users self. storage equals storage and self. username equals username like so very good our init is defined the first official method we had was login so I can make login remember give it the key so we can unlock it later this condition check to see if the username was owner and to make sure we had at least one user in the system so I can make a condition and I will say if username but if self. username right because a property it’s just like a variable it’s the same thing but because we’re inside our class in order to pass this variable around we need to use the word self so our variable is called self. username if self username is equal to owner and our self. users is greater than or equal to one we would like to print off a few things the first thing we can print off is is welcome then we want to print off the username so I can say welcome username then I would also like to print off how much storage they have available your storage is let’s just say and we can say self. storage like so very nice a condition doesn’t need to have an else but most of the time I like to put one what would you like to happen otherwise and we can say you are not a user nice that method’s done now remember a method is not the same as a function if I call a function like this and I run my code I’m going to get an error because this function is a method it’s a function in a class it tells me login is not defined it can’t find login anywhere I want you to think about why as I finish out this class great our next method was to increase our storage capacity so capacity there we go first word is self but then we’re going to give it an additional number that I can do stuff with I want to increase my existing capacity so I’ll say Self Storage plus equals that new number great I can then just print something like uh updated storage and we can just now do self. storage that’s our new number very nice before I create that bonus method I’m going to just create our objects so let’s say product one is equal to app um let’s say their users they have 35 users 256 GB of storage and their name can be just like the video let’s say owner we can then call our methods so the reason Logan didn’t work before is because a method must be linked to an object in order to work work so product One login and I’m going to say product two increase capacity let’s say uh 5044 that should give me an even 300 right um I’ll make one more now I’m going to print off an empty space first then we can do product two is equal to app as well uh product two can have 12 users uh they can have 128 GB of storage and their name can be my name Josh for each of these I’m going to say product two do login what’s going to happen there and I can say Product 2 dot I don’t want to upgrade it let’s just leave it for that let’s run the code great we’re going to see a few things happen here so awesome the first part so one two three that’s really being printed right here right welcome owner my name is owner so if username owner and users is greater than one it’s printing off these two then updated storage remember I’m increasing my capacity it so I’ve changed my storage from 256 to 300 very nice in our last one it just tells me I am not a user because I do not meet these two conditions nice one let’s jump into that bonus real quick I asked you to have a bonus right that would check your upgrade so I’m going to call this check upgrade and check upgrade does not take any parameters it does take self right if our users so let’s say if users is greater than or equal to our storage then I need to upgrade my storage so I’ll say upgrade amount so I can collect an input of how much do I want to upgrade it at I’m running out of space for the amount of users I have so let’s just say here upgrade amount like so all I want to do then is I can say self. storage plus equals upgrade amount like so cool very nice that will upgrade it and then um what I want to do then is else so if I do not need to upgrade my storage if I still have enough space I want to print how much storage do I have remaining how can you solve that how much storage I have remaining well let’s print off and let’s I’m going to say something like you still have then let’s do here I need to do a math problem right so I need to do self. storage minus my users but I want to make sure that this is a string so I’m going to convert that to a string then just close off your string and say I don’t know spaces open like so nice one I’m going to come down here for product two and let’s say product 2. check check upgrade I want to see if it’s time to upgrade run our code nice so it says you still have 116 spaces open why is that well 128 minus 12 is 116 that’s exactly what we did here 128 minus 12 incredible guys I hope you have followed along this far let’s head over into the next video and start with challenge two I’ll see you guys [Music] there here we are in challenge 2 now I’m not going to read all this as I’m hoping you guys already have and you’ve broken it down to what we need to do but I am going to read the overall description of what we are going to be building out in this class the code we make it’s going to represent an online course management system we are doing an online course this will help us keep track of online courses students and their grades and it allows us to do things like add new students see the course details and it’s going to allow us to calculate the average grades from our students this is a lot okay so I want you guys to try to work through this one by one don’t do everything at once do small tasks to work into this big problem what’s the first thing we need to do create a class what’s the first method make your Constructor method right step by step all right heading into task two I’m going to start out with us coding this I will build a class called let’s call it online course that’s what it is we will build our Constructor method giving it our key of self what information do we need here here well initially all we need is I need a course like the name of a course and then I need like who is teaching it so an instructor so in this course it’ be me in the course name it would be Zer to knowing object orientated programming these two parameters I am going to create our property for remember every parameter we have we would like to to create a property for okay instructor close enough nice in the last one I’m not going to give my init this method but remember that init is a place we keep all the variables the properties we will use in this class so I can make a variable here too I’m going to say self. students now this is going to be a list that I can use throughout my program that’s all it is right now great your first method that we needed to make was a method to add students to so the first method we needed to make was a method to enroll students let’s just call it enroll students now it’s going to need who who do we want to enroll well that’s going to take a name right it’s going to take a student’s name and what I want to do is any student who is enrolled I want to add them to my list right remember the list we just made here self students append who do we want to append the student name very nice once we have enrolled a student I want to print off their information so to do this I’m going to use in Python you might know this you might not you might have seen this in other languages in Python it’s called an F string I’m going to use an F string here because I just want to keep everything nice and easy and keep it all together so I don’t have to use commas and pluses to add different types of data together this just makes it more convenient I want to print off the name of the student so Bobby has been enrolled in the what course self. course Bobby has been enrolled in the science course right the name of the course would be printed there nice that’s all we’re doing for enroll we add a student to the list and we just print off and say hey this student is now a part of this course all right right our next method is let’s say we want course details I want the information about a course so it’s not going to accept anything it’s literally just going to print off detailed information about our course so here we can print I’m going to use f strings for all of these so the course name and then our course we can just say self doour we are going to print off here and in this print we can just print off the instructor name let’s say instructor name and we can tap into our property self. instructor and then in the last one what I’m going to try to do is I want to print off all the enrolled students in the course now you could just print off the list honestly um I could just literally go here and just say self. students and that’s going to work there’s nothing wrong with that right um if you wanted to get a bit more creative I could do that and let’s let’s add in here and let’s say I’m going to put like a comma right because each name is going to be separated by a comma and then I want to connect I want to join right and we haven’t quite Ted touched on this yet right I’m going to use the join method what do I want to join together I want to join together my students like so all right so I’m given an error uh okay let’s do this let’s change the double quotes let’s put single quotes as our outside ones are already double quotes there we go okay so now it’s going to join together in one line now there are going to be new things that I drop in this course here and there that I didn’t talk about in the lesson but that’s okay because as you’re now in this part of your programming Journey you should understand that certain things you might need to Google or research or find somewhere else and if you’re able to do that that makes you a stronger developer I’ve made a method for course details well let’s call that done okay nice um I’m going to make a method for completion or just call it completed course so like who completed the course when I say who it’s going to need a name again right so if the name I’m checking for I want to see if it’s in my list because if it is I want to remove that student from my list they are not part of my course anymore so if that name is in my list I can use a condition with my in operator then I want to remove that student from my list very nice um I can just print off and you could say something like uh course completed if they completed the course let’s say name has completed the course that’s cool okay else uh let’s just print off and we kind of need to like warn the user and we basically need to say that the name you’re looking for is not even a part of the course is not enrolled in this course nice all right we’ve made three methods right we’re building on everything we’ve been learning that brings us to our last method guys let’s do one for uh average grade I’m it’s going to take self this needs to take multiple grades what could that be well that’s going to be a list I’ve actually given you a list too and you should know how to find the average of something as well right you don’t need to be amazing at math for programming honestly you don’t right the computer can do that for you but you should have some basic understanding of math and this could be just algebra in general so how we find the average of something so to find this average I’m going to create a variable called total and I just want to add together my list so I can use Python’s built-in sum function to do that and I’m just adding everything together now that I have the total we want to create an average and the average is going to be the total divided by the length of our list the total divided by the length of our list okay now that we have our average we can just go through you can print off anything you want to say the average grade is let’s just say that let’s just put here and I’m going to say average awesome uh in the beginning let’s do a few things here let’s make this more unique let’s say course input let’s say name and let’s say student right because this is how a real program would run unless we’re coming from like a database so let’s say input let’s say enter a course uh I’m going to make sure everything’s lowercase okay that’s just good practice uh let’s say enter uh teacher or instructor right instructor that’s what we want there lower and then the last one you can say enter a name because the last one is for our student so we can just say enter a name lower nice one okay we’ve been done with our class class these three inputs will be used as the arguments for our class so I can come down here um I can say create an object called course and this is equal to our class our class needs three well actually our class just needs two arguments it needs our course name which is course input and it will need our instructor which is name the grades I’ve already given you and this is going to be a list so 90 85 92 78 and 80 it’s our list of grades we can use this now we can go through and I want you guys to call all four methods that we’ve just made so take our object course I’m going to link that to average grade and I’m going to give that my list grades I’m going to take my object and I want to enroll a student who do I want to enroll well I can enroll this into here is going to be enrolled in my course I can take my object and I can get my course information the details right let’s just run this for now actually enter our course python instructor Josh name of a student Billy nice one the average grade is 85 that’s the average from the list cool Billy has been enrolled in the python course oh nice all right that’s going up top here uh course python instructor name Josh students Billy it’s printing off the basic course details nice uh I’m going to call the last method here I’m just going to use my name actually so I’m going to say course uh complete completed course uh I need need to give it a name so I’m actually going to say name hardcode this because I don’t have this in the system I’m going to say just Josh for completed course so we’ll say python uh Bob instructor Billy there we go so I’m using my name hardcoded and it says Josh is not enrolled in this course right because well I’m not enrolled in the course if name if Josh in list remove else R I’m not removed nicely done guys that was your first challenge without anything from the lesson that we tried to implement on our own very nicely done I will see you guys in the next video for our next [Music] challenge [Music] all right wonderful welcome back to our next challenge if you haven’t noticed this is actually the code from the previous challenge which in the text file for this one I included as a hint to bring in that code as we’re going to use it what we want to do in this task is we want to redo an extend parts of this class I want to be able to have multiple students and each student is going to have three grades in order for us to calculate them now we can go to the bottom of our class for now because until we continue I don’t want to add anything else you can see that I’ve saved my inputs and my object course from the last Challenge and from here is where I want to extend onward when my program runs after I’m asked for course input and my name I want to be asked for let’s say numb students I would like to see how many students are going to be enrolled in this class so enter number of students very nice I’m then going to create a loop and I’m just going to say for this uh for I no I don’t even need to say I for in range I’m not going to use the index for anything I just want a loop that’s going to repeat for however many students we collected through our input right there every time this Loop runs we’re doing two things we’re asking for a name so who is the next student we are adding to the class roster enter a student name uh for good practice let’s make sure that’s lowercase then we’re going to ask for grades but before I ask for them I want to create where will these grades be stored currently it’s going to go into a list now that I know that we can Loop through how many grades do you want I initially said three you can change this for this purpose I’m going to keep three so in range of three every time this Loops we are asking for a grade which is going to be an integer so in input we can say enter a grade like so then we can take our grade and we can append it add it to our list list of grades great so imagine the loop runs one time the First Time The Loop runs it’s collecting all this information as a matter of fact every time our Loop runs it’s collecting this information a name of the student and for that current student it is going to collect three grades and add those to a list that’s linked to that student nice okay where do I want to keep this information I have two items but for a list I can only add one element at a time and that’s a problem if I have 10 students each with a name and a set of grades I need to keep them together somehow in order to add them to our list to do this we will create a class to store this information I will say class student now this class is nothing except like a database it’s going to hold a name of my student and it’s going to hold a list of their grades for each of those I just need to create a property for where they are going to be held like so I have my one student why don’t I take the information I collected and create an object called student the value of my object is my class and I’m going to give my input student name as the name and my list of grades as the grades nice I can now use this student object and I can use it as an argument in the methods from our initial online course class I am just going to say here I’m going to call course that’s our initial object right so I’m back up to here and for course let’s enroll students who do I want to enroll I’m just going to say student right that’s my object right there uh I can call my course object and why don’t we say average grade I can say that and we’ll give it a student again then at the end let’s get uh our course details so all the info about the course great you can see in those two methods here at the bottom that I’ve passed in the student object which we created here as the argument nice before I run my code I’m going to need to go up and make some adjustments to the methods that we have built how do I use a method well let’s it’s a serious question a method must be linked to an object in order to work we know this from the lesson here is my method it’s linked to my object course how do I use a property well a properties the same way I need to have the property linked to an object which I need to do I have an object student student has two properties name in grades when I want to access these I need to link them to my object student so let’s go up to enroll students and I’m going to start right here so let’s change my argument to my object all right so I’m going to be giving it an object student that object student is what I’m going to now append to my list it’s the same thing as before when I print off who has been enrolled name it needs to find name who remember that name is a property in my student class so I’m going to say student object. name that’s going to unlock the name all right nice let’s come down here to course details right here it’s joining together every name in my list but we’ve changed our list from names to objects so I’m going to I’m going to refactor this I’m going to change this I’m going to say print enrolled students then let’s make a loop and let’s say for every student in my list self. students I want to print the current student their property name that’ll print every student we have enrolled good okay uh coming down completed course let’s go in here and do some things so our completed course we give it a name let’s Loop through our list and let’s say for every student in our list of objects students all right I’m going to do a few things here if my name so if the current Student’s name is equal to the name that we gave as a parameter then I want to remove that current student right so I give this method a name Josh for example for every student in my list if the current student in my list has the name Josh then remove that student from the list that’s what’s happening there I can then print off my name good and I don’t actually need this else anymore I’m just going to bring this print right there so it’s going to print as soon as the loop ends if no students in that list that prints nice all right then refactoring our last method our average grade we are going to do a few things here so all we really need to do is we need to access these grades remember that that’s a property found in our class right here um our average total same thing student. grades and then our average that’s it that’s done good so we’ve used what we built in the last challenge we brought it in here and this was really useful as it taught us a few things it taught us how we can use another class as like a database it taught us how we can access these properties from another class or outside of this class and it also showed us how you can refactor your code to either extend it add more functionality or just refactoring in general really nicely done let’s run this I’ll go through this briefly uh course we can continue with python Josh number of students two students let’s say Bobby has a grade of five five and a three cool so it has Bobby has been enrolled in the python course average grade asks me for another student let’s say cool asks me for another student let’s say Emily Emily has a grade of uh 551 there we go gave me her information and then at the end it printed off the enrolled students Bobby and Emily the one thing I don’t like is all these decimal numbers so in our average grade function our method let’s put in the python built round function and let’s just round it down to one decimal great nicely done I will see you in our next chat [Music] chenge Welcome to our next class challenge before I get started encoding I’m just going to go through and I’m going to read our description I’m assuming at this point you have already read The Challenge and gone through it and you’re ready to jump in and get started for this challenge we are going to be provided code that represents travel planning in a cost calculation system it allows you to input the country you want to travel to the month of travel the type of travel so is it Leisure or business the system provides information about the trip and calculates the total cost based on flight expenses and any additional costs you may have great you know me I love travel and I love making code around travel so I’m going to head over into our code here we are so let’s get started the first thing I want to do is I want to make my class so using our class keyword I can say travel and inside here our class travel must have our Constructor method in it what properties do we need well I need a country we are going to have a month and then we’re going to have like a type of trip right so what type of trip Leisure business right for these three let’s create a property for each of these okay so country we have month and month is actually going to be an integer right uh the type so let’s I can call it type this equal to type that’s fine there we go and the last one I’m going to make a variable here or I should say property for a price initially the price is zero but once we start adding flights and other details that’s going to change very nice our Constructor is all set set up I’m going to create a quick method for all the info relating to my trip so what info should we know for this well a few things I’m just going to check and determine when the user is going if they’re going on a holiday during the winter months I want to alert them and say hey they’re going on a trip to this country in the winter months so how could we do that well well if our month is greater than October equal to October and our month is let’s say less than or equal to March which is three that’s why I converted my property to an integer if that’s the case let’s do a few things so I’ll put an F string I’ll say you are going to Country in the winter this is a style trip so inside here you are going to self. Country and then inside here we can say self. type like so cool okay also if let’s say month is greater than March and our month is oh let’s say less than October cuz that’s where we’re at I can just copy my print statement I’m going to put it here and instead of winter let’s just say summer just in case there’s an issue I’ll say an else and I will say oh I don’t know I don’t know let’s say invalid input there we go invalid input that method is done it’s just providing us the information about our trip you should have gotten that one if you did did nicely done let’s form a new method and this method is going to be responsible for calculating the cost of our trip we do need something though so I’m going to give it a cost as well all right and this cost will be added on to our current price property right so if I give it 10 I’m going to add 10 to our price property and our costs all of them will be held in a list we want this method to repeat as long as cost is not zero as long as you are entering a number it should be repeating and it should be increasing our property self. price right so every cost we’re adding it on to that every cost I am going to also keep track of in my list so I can add it to my list and when the loop finishes we should be collecting a new input right to test against our expression again so I will say enter another cost like so cool right that’s all that one is doing currently all right very nice now before we can complete that method we should be doing a few things here when the loop breaks okay I am going to call another method which I’m going to get to later so I’m going to put a comment here and I’m going to say uh call let’s just say call next method for now right um and then I’m going to want to call O check method I’m going to make a method to like check in order to do that I will need to return two things let’s just say two things for now let’s call that method done okay I’ll come back to that I’m going to create a method called advice now based on how much money I have is going to recommend me the type of trip if I have less than 500 I should probably print off and do something like uh let’s just say low budget cool uh let’s say if the number that I give this okay if that’s over 500 and that is less than let’s say 1,500 then I’m going to print off here and we could say for this that’s a median budget trip right so take a flight to anywhere dot dot dot great and then anything else which means you’re over 1500 essentially uh let’s just say luxury trip nice um I have advice that’s going to give me my advice now my last method is interesting so I can’t exactly budget how much I need for the trip right because anytime you go on a trip you know the overall cost right flight accommodation but the one thing you don’t exactly know is how much you’re going to be spending per day on food you could go to one place and get coffee for € you could go somewhere else and get dinner for eight right and it changes depending on where you go my next method I want to basically kind of create a way to like average and get a good estimate of how much I’m going to be spending on this trip so I want to inspect my list that I made up here okay so I’m going to give this method that list and really let’s say less than 10 any number that’s in my list that’s less than 10 um I’m going to do something with that so to begin I’m just going to say for I in costs for every cost in costs if I if the current cost is greater than or equal to 10 then I’m going to take my counter and I’m going to increase it by one great um anything else right so once that Loop runs basically okay if a cost is less than 10 I’m adding one to this right and every time you go out to eat right coffee $2 uh a burger $8 a drink $3 all of those are less than 10 that’s three items I want to add those three to this counter variable less than 10 my Loop breaks I can now say if that counter variable is less than or equal to 10 okay I’m just going to take my price and I’m just going to add 100 to it right that’s giving me 100 for my food budget uh and I’m just going to go in here I’ll put an F string and I can just say updated price and let’s just print off our new price right it’s better to have extra money than not enough money on a trip um all righty these two new methods we just created I want to use them inside CC cost right CU these two are going to be called based on how much money I have for this trip so let’s do a few things I’m going to create a variable called advice this is going to basically call my advice method remember to access a method you can do so just use self. method name because we’re inside of a class um great advice is going to take a price so it’s going to recommend you advice based on the price of your trip nice um let’s say inspect and let’s do the same thing let’s do list inspect method and here I can give it my list costs brilliant the last thing you need to do is you need to return advice and inspect so we can see those results all right wow nice work our class is done that’s it okay pretty cool outside of our class now we need a location where are you traveling to so enter a country cool uh I actually want to capitalize this let’s get it looking all nice let’s say capitalized okay uh let’s say trip type I can also enter an input here and we can say uh leion if I can spell leisure correctly or business we can also capitalize to make it look nicer all right so I have location that what am I missing month so remember that we don’t need to do int input because month is going to be converted inside our init function enter a month I have month now all we need to do is we need to Jet Set so I need to create an object I need to go travel right um so let’s just say uh test okay that’s my object and that’s going to be our travel class what are we giving to our class as our arguments location trip type that should actually be month right so I can say month just like so great as a test let’s take our object and let’s call our trip info method let’s call that and see what happens I have two commas here enter a country Vietnam uh business month five ooh nice there we go you were going to Vietnam in the summer this is this is a business trip all right looking good let’s now do some flight cost calculation so a flight cost is going to be let’s say an integer input you could do float right so enter flight cost nice one and then we’re going to take our object and we are going to So Cal cost change text to say test there we go and inside here we can put our flight costs all right let’s run it one final time to our country I will do that again I will say Vietnam for a business month the same I know a flight cost uh return ticket to the US for me is probably about 24 million so ,000 enter another cost okay I have now entered My Method that’s collecting the costs right so I have a flight cost th000 now I can enter all my other costs so for example let’s say accommodation 500 eating uh five 4 3 1 2 8 10 done zero there we go so it’s triggered two things advice it tells me luxury trip right and then for our list inspect it gives me an updated price right and it adds an extra 100 onto our initial price right so we basically just created a mini system to help us plan a trip and organize the cost great guys feel free to move on to the next lesson if you’re feeling confident we have just completed working with classes in this lesson with four challenges but if you’re up for it I’ve prepared a bonus challenge for you head over to the next video if you want to check that out I’ll see you guys [Music] there [Music] welcome to the bonus challenge if you’re here you must be ready for a good challenge I hope you are as we are going to touch on a few new things and this one is going to be the most challenging of the prior four now I’m going to read our description here and then we are going to jump into our code this code we’re trying trying to create it’s going to be a guest management system with a loyalty program so I want you to think about hotels or Airlines it allows you to input information about guests like their names their ranks and their ages their rank is like how high are they in the Loyalty program are they a gold member a diamond a platinum something like that the system provides various function fun alties to retrieve guest information track loyalty points and calculate average guest age nice this one’s going to be fun let’s head over to our code so we know we want a class and we know that we want uh name rank and age so I’m going to start with that and build that out let’s say guest so I’m going to go here we will go to init self uh uh I’m going to just say uh last first Rank and age for each of those let’s create our properties so I’ll actually call it last name last uh first name that’ll be first and you can see that last I missed my T here we go my ranks for the purpose of what we’re trying to build here I’d like them to be integers so I will convert that and age we can do the same thing with if we want to find the average I’m going to need that to be an integer form all right very good our first method let’s create one which is going to give us all the basic information about a guest so like who they are um their age and this we are actually going to give it a list of guests if I I have 10 guests then I will have 10 elements in my list and I want to print off the basic information about each guest so let’s just say my all my guests are going to be given here and I can say for every guest in my list we’re going to need a list for this let’s make one uh I’m just going to call it all guests there we go so for every guest in my list all guests I would like to print off a few things here I’m just going to say self. first self. last name I should be saying and then forour age I’m going to do age but let’s just make it look kind of nice let’s say age and let’s say self. AG so forever guests print off all their information very good okay going forward we want a loyalty program so I want to keep track of like who are my gold guests that’s important right um and this will also take my list of guests like so so when I call this method I’m giving it a list of guests and I want to see who has a higher rank and if their rank is high enough I want to add them to a gold members program so to start things off let’s just create a local list so like gold members this is our list so anyone who meets a certain condition is going to be added to this list and let’s say a gold member must have greater than or equal to 10 loyalty points if they do they will be added to this list great so I want to basically take each last name of my guest and I want to add them to this so I’m going to take self. last name right that’s the last name of my guest and for every guest in my list all guests they are being added to this So currently my list Gold members is a list of every guest’s last name but I don’t want that I only want them to be in this if they have at least 10 points what can I do for this well at the end of my list I’m going to say if my rank is greater than or equal to 10 they will be added to this list I’m going to type that out for you guys because these list concatenations they are quite challenging so breaking them down is actually easier so the first thing I do is I create a list for any member any guest who has more than 10 points okay so any guest who has more than 10 points or who let’s change this again to meets certain conditions there we go uh for number two so the second thing we do is for every guest in my list add their last name to the list okay and then the last thing we do is so this condition must be met there we go in order to be added to this list okay so that breaks it down for us all right we have this new list so let’s clean that up so if gold members is true what do I want to do well the first thing I want to do is just naturally I’ll print off a header that says Gold members nice so my header then for every member that makes sense in my list my new list Gold members I will print off their name now let’s do something a little fancy let’s say I want to T their name in it’s going to say guest then it’s going to say the guest’s name their last name great all right that was a lot if you stuck with that great job rewatch that last five minutes of what we just did to break down how this list was generated which is a faster and more efficient way to make lists going on to our final method we are really just getting the guests average age so yeah taking self and we’re going to give it our list of guests again okay now I’m going to create a counter variable initially the total age is zero every age in our list we’re going to add on to this which I can then use to divide to calculate my average let’s make our Loop for every guest in my list of all guests TS my total age counter variable I want to add the self. I want to add the age to my counter variable once I’ve done that then I want to get my average age so let’s just say average age is equal to now I need to calculate that so taking our average and I’m going to divide it by the length of my list all guests that’s us finding the average then we can print off something nice like your average grade so average uh customer age not grade excuse me customer age there we go then we will just print in our average age our class is done it’s just got those three methods in there at the end outside of our class we’re going to do a few things here now so we will create an input for let’s say number of guests and this is our integer input we can use this for the range so enter a number of guests there we go so for I in range we can enter our number of guests input this is going to be interesting here so every time my range Loops I want to ask one input and through one input I want to collect um a name I can do it like this I want to collect a first name a last name I want to collect a rank and I want to collect an age these will be entered as one and they will be separated by a slash from this single input I want to make a list and that list is going to have four elements first name last name rank and age how do we make a list from an input well we can use the split method and I want to split everywhere I have a slash in order to make my list okay now that we have a list I want to add this to our other list of all guests so all guests is like our parent list one element in that is going to be a child list of data so all guests like so I want to append what do I want to append well I want to append an object I want to append an object guest right so I could do do the same thing right and if I make this longer which let’s do the same thing and say guest is equal to guest so guest is our object it’s created every time our for Loop runs and the value is our class guest our class if we go up and look it needs four arguments last name first name rank and age the last name is the first element in our our new list called Data so I’m going to say data index0 that’s the last name data index one I’m going to say integer data index 2 and I can say int data 3 right so I’m taking the elements from my list if I were to make a very quick list let’s say a first name okay uh that is going to be John comma do comma uh rank 8 comma uh age let’s say 45 so data one is targeting John so data zero that’s the first element of my list is targeting John data one is targeting you see how we’re creating that from our data list that we made here right so this is the same thing very good now I do have first last uh rank in age uh let me change this to match that first last Rank and age okay very nice now that we have that we are done with our loop on the outside I want to create a a starting point so just where is my Loop going to officially start so I’m creating a variable and the value is the first element in my list all guests now that I have an object right remember that we are going to append our guest and guest is really an object I can take my object and I can link my methods so loyalty points program is what we call it and I’m going to give it my list all guests I can take my object and I can get the guest info we will give it our list and then I will get the average guest age which we did call guest average that was it giving it our list very nice okay let’s run our program see what we have Happening Here enter number of guests I will say three guests to show us first name last name rank age okay so John SL do rank five age 45 enter our second person let’s say Jane do she has a rank of 10 she’s a loyal customer she’s 33 our final one let’s say is Josh wner score of I get a 15 I’m really I’m a loyal customer and let’s say 25 enter look at what we have going on there I have a few things we want to look at so not a whole lot’s happening actually it just printed off John Doe 45 average customer age 45 now that’s because we have our object our class guest we need to Target the properties which are in guest remember our properties are up here so because we’re passing a list this list just has objects so for each object we need to access the properties for we need to go through our class and instead of like self. name which was our initial property okay we need to go through and I need to link my object guest right because we’re passing the list as the parameter we need to access each element and each element is an object each object has these four properties great uh in our Gold members I’m going to do the same thing okay we are going to say guest last name uh instead of self. rank we can say guest. rank uh there we go and going down to our uh Age We anywhere we have the word self we’re really just going to say guest uh all guests that’s looks good let me try and run this again I’m just going to do two people this time guests to John 8 uh 45 Jane do she has a 12 she is 33 there we are now we have a finished product we have gold members and it prints off John Doe his last name or EXC excuse me it’s probably Jane do right because Jane has 12 they have the same last name it prints off the guest information and then it prints off the average customer age great you just made a reservation system right like a loyalty program very nice that was our bonus challenge we have introduced classes how we work with classes in this overall lesson as we head into the next lesson we are going to talk about a new topic of class inheritance I’ll see you guys in the next [Music] video hi guys guys and welcome back to the next lesson in the last lesson we looked at defining and creating your very own classes now in this lesson we are going to continue on that path and we are going to look at class inheritance but first let me ask you what do you think of when you hear the word inheritance well chances are it’s probably the same for python too let’s stop dive in and take a look at some things we already know so a few things we already know right we have on the screen three classes computers animals and games within these three classes we have currently three objects right so MacBook windows and Linux they all come from the same class they are all computers or for games there are many types of games but at the end of the day they’re all games right so in our example here computers is a class or a family while the three others are objects now I could create a class for each type of computer as well and this would take key data for from the parent that I could give to the child that is the topic of this lesson so here we are we have our class car you can see four objects each object has three properties so in our first example we have this red car I believe the type of car from a long time ago is called a Road Runner that’s the type and then the other two are color and wheels now you can see each object shares two of the same properties color and the number of Wheels but the type of car for each is different we have four objects all coming from a single class but what if I said we could change that what if we could make a child class and give it the attributes of this car class well we can in this example I have a class called vintage let me move me up just a little right there a new class is named vintage and this inherits the car class this is our example of class inheritance so as you can see here I have a new class vintage vintage inside the parentheses is taking an argument this argument is our other class car so it’s really inheriting everything we created in the original car class all the properties and the methods I’m going to go back very quickly as I do I want you to keep an eye on the the Road Runner right we saw that in the last class if I go back you can see the properties of the Road Runner are the same I have type color and wheels that’s a vintage car I’m going into our new child class and you can see that I brought Road Runner with all the original properties now I have three addition objects all of these objects are a part of the Vintage class but they also have properties from the original car class in this vintage class we have one new additional property you can see here at the bottom price this is only applied in this child class let’s break this down even a little more so we’ve learned a new class we have our four objects and we have one new property in this child class vintage that new property is a price we are inheriting our main class now you’re going to hear me start to say some new terms anytime we inherit the class that we do inherit we can call that the super class the super class is being given to other classes pretty cool huh all right we are going to talk about two paths two routes to inheritance super classes and derived classes now you’re going to hear me say two things I like to call a super class the parent class and a derived Class A Child class because a child inherits the properties of their parents the same thing works for classes I’ve put a few examples on the screen so I have all Audi’s are cars all dogs are animals all sofas are furniture and all jeans are pants all of those are true right now if I went to my animal I could make a very special class for dog and I could have dog inheriting some normal attributes from animals that most animals share such as Legs hair right there are many attributes that all animals share that would come from our super class animals for dogs what can a dog do well a dog can bark right that is only a dog we have two routes to inheritance Route One the class is given only new methods so it’s only given new methods we do not create any new properties for this class which makes inheritance extremely easy because we do not need to create our init method that Constructor that we learned learned in the last lesson if we do not have any new properties we do not need to create an init for our child class we can use the super class’s Constructor function that’s root one now in root two the class is given both new properties as well as new methods anytime you create new properties we need to make a new Constructor in that child class and we must also activate the super class as well and I’m going to show us how we can do both of these in this lesson so going back to our first slide of this lesson we saw something similar to this right but now I’ve redone it computers that’s going to be our super class and our derived classes all the children will be Windows MacBook and Linux they are all a class which inherits main properties and methods from the super class games is also the same thing it could be considered our super class we have an RPG a racing and a single player they are all styles of games they could be a child class inheriting everything they need from that super class pretty cool all right I’m going to head over to the next video where I’m going to break down the first path to inheritance I’ll see you guys over in the next video [Music] all right amazing so far in this lesson I introduced the general idea and concept of class inheritance now we are going to take a look at the first path to class inheritance in route one is inheriting everything from our super class let’s take a look at some code creating a child class that only needs new methods that’s a key takeaway from this it only needs new methods we are not giving it any new properties when we make an object an instance of a child class our super class that in it is a automatically called and used for our child class on the left I have my super class main you can see I have an init function as well as one other method then I am creating my child class my child class is inheriting my super class you can see there is no new properties only new methods pretty cool right let’s use some color coordination now you can see that main is being inherited from that super class and then our properties so for example self. property one I can now use that anywhere I want in my child class because we are inheriting those from that super class I don’t need to make those all over over again I can use them as I would all right you can see now I’ve gotten a bit more complex I’ve taken our example and I’ve now put in some Live code we have our super class Main and we have one method in that class user info our child class is user score it’s inheriting that super class as well as creating two of its own methods the first method Cal score is using the property self age from our super class and our second method check age is also using that same property I’m creating a child class called underscore and this will be a class which uses all the super classes properties some color coordination right so everything in green right that’s coming from the super class I don’t have to rebuild we can continue to reuse great amazing all right great this was Route One to class inheritance before we do any coding recap what we just did and we’re going to head over the next video and we are going to check out the rout two the path to to class inheritance I’ll see you guys in the next [Music] video so far in this lesson I have introduced the concept of class inheritance as well as the first root to class inheritance in the first rot we did not create any new properties but often times we want to have new properties associated with a child class this is the second route to class inheritance in this route we are going to look at something called the super function let’s dive in here when creating a child class we are still passing in the super class as a argument and old and new properties are used in this child class as well as new methods so I have my child class user score we are inheriting main The Constructor in this child class we have is right here and you can see some new things are happening specifically right here what is going on here what is this well super is a powerful function super allows us to inherit not just all the methods but it also allows us to inherit all the properties from our super class but we use the super function when we also want to introduce new properties that are only a part of our child class such as score this was created right here in this child class let’s take a look break this down even more this is a bigger concept so everything in GR green that’s coming from our super class everything in blue has been created and it’s only linked and found inside of this child class remember that super is really allowing us to inherit both the properties and the methods but it’s also allowing us to create new properties I’ve put all this in green so inside our child Constructor the first three three parameters are actually the parameters we are inheriting from our super class we can then follow that by making any new properties that this child class is going to have pause the video screenshot the video look at what’s really happening and if you need to try and take notes of your own to show this to encapsulate this what is the topic that I just introduced why are we using super and how can we use super right so here we go when we create an object of the child class remember that the super class Constructor in it is automatically called because we are using super this is basically like saying super Act activate if I create a child object it calls my child init Constructor which then calls my super class Constructor as well here is our example so I took some of the example from root one our super class is Maine Maine has three parameters what are those parameters name age location for each of those I have created three properties which you can see I’m using throughout the method in my super class heading over to our child class user score we inherit that Nifty super class and then we are also inheriting our properties I’m going to move me down for this slide in our Constructor of the child we first pass in the three parameters which are found in our super class we are basically activating those we then are free to create any new properties that we want that are only found in this child class I can use these new Properties or the old properties just like I would any variable okay so I’ve colorcoded this broken this down take a look I love the colors they are all linked to each other right so our child class inherits main we also need to tell Python and activate the original properties before we create any new properties you can see in my method check average that I am accepting a list as a parameter I can then use that list within that method’s code finally at the end of our code I have a list called test list I have an object called user and I am calling my check average method with that test list in the output of our terminal we would result in five amazing all right let’s head over into VSS code I’ve prepared

    some good challenges for us and we are going to build on our class inheritance I’ll see you guys in VSS [Music] code great to kick things off through our first challenge this is going to be route one for class inheritance so as we looked at in our description I’m going to have a class animal and this is going to hold all the info about our animals that we want to know so it’s going to have a region an animal type right like our species uh we could have a color and then I am going to want to know is the animal dangerous or not so I’m creating a property here soon for lethal for each of these go through and create a property so we have our four properties set up and the only thing we really want this method to do is I want to just get a basic animal bio so information about the animal and let’s just kind of call this like our animal passport so it’s like the information about the animal for each animal I want to go through and let’s print off all four of those properties with some basic information so an animal is going to be found in we can put self. region right how would you like to structure our self. animal type let’s say species self thought animal type let’s jump in there for the animal color let’s just say color and we can say self. color and then our last one let’s say dangerous and this is going to be a Boolean value so it’s going to return either uh true or false so self. lethal great our super class is completed right so now I’m going to create a child class a derived class for this child class let’s call this like I don’t know a clinic and it’s going to be given all the animals details and we are able to search through those details and find a specific species or region something like that so I’m going to inherit animal now this because it’s the first path the class inheritance is not going to have any properties of its own therefore we do not need a Constructor in this class our first method can just be called animal let’s call this one animal info keep them different all animal info is going to do is it can say this is a and we’ll do self. species from uh region so self. type no not type excuse me self. region and then over here let’s do this is a so animal type like so very nice then our final method is I’m going to kind of call this uh search let’s call this search and what I want to do is I’m going to give this method an animal so a type of animal and more specifically I’m going to be giving it a list of animals I want to go through this list and I want to find all the animals that are in a specific region of the world so when this method is called I’m going to be asked for a region so let’s say here input and I could just say uh enter a region let’s make sure that’s lowercase to prevent any of our errors and I’m going to go through and I’m going to say for every animal in my list animals if the animal the current animal. region is equal to region animal is my object and I’m linking the property region which is created up here in our super class animal so if the current object’s region is equal to the region that I have just input I want to do something with that and I’m just going to print off and I’m just going to say uh species because I want to know which species are found in that uh location and I can say animal type nice okay my classes are done now on the outside here I am going to create a new list and this is the list that’s going to be given to my search m method right and I want to be able to continuously add animals so if I say hey there’s five animals I want to add five animals as objects to this list now what we can do is I’m going to create a variable called amount of animals and that is going to be an INT input so how many animal in number of animals like so nice for I well this we don’t want in it in for I in range of the amount of animals we have every time this repeats I need to collect the basic information about an animal so I need a region I need a species I need a color and I need lethal which I’ll do a bit differently here then I will create an object object so let’s say animal is equal to our animal class okay so I’m creating an animal for that great so region let’s just take this one enter a region it’s going to be the same uh species let’s say enter a species color we can do the same enter a color now lethal strange so lethal is going to be a Boolean value and it’s only going to be created well right here initially so I’m not going to say enter this I’m going to say let’s say is it dangerous like so so that’s a yes or no question so lethal is going to be true if the input is equal to yes leth will be true great creating our object how can I structure this out well let’s just pass all of our inputs in so region animal type which I call species here uh we have color and then we have a Boolean of lethal there we go finally I can take my animals list and let’s append our animal and and let’s just change my spelling around here uh there we are looking good all right so our Loop’s done if I add five animals they will be in my list animals great on the outside let’s create our object of uh Clinic which should be fine that’s equal to our class clinic now for this I will need to give it a few attributes as well so let’s just start off with region animal type color who does the clinic currently have let’s just say Asia let’s say tiger and let’s say color of orange and let’s say lethal yeah we can say true for that very good I am now going to call all the methods we created so I’ll take Clinic my first method is animal bio so I’m going to call animal bio great so I’ve called animal bio let’s call our other two so Clinic dot we have animal info and then we have our clinic and then we have our search which I can call and search will take my list of animals all right looking good let’s go through and add some animals in let’s say there’s two animals we want to add to our list the first animal I’ll enter the region I will say America let’s say a bear let’s say a brown bear and let’s say yes it’s dangerous our second animal let’s say Asia let’s say snake let’s say green and it is also dangerous awesome what is happening here well when I made my object Clinic I gave it Asia tiger Orin true that’s being printed out as my animal passport which is the method I made in my super class then we are calling our animal info method this is a tiger from Asia finally we called the search method giving it a list of animals and then being asked for an input what’s happening in the search method well for every animal in my list animals if that current animal’s region is equal to the input above I would like to print off that animal species and let’s change this I’m not going to do self. animal type anymore I want to take my object animal and do animal type great I’m going to run this Asia now it’s still saying tiger because we need to rerun the application so trash can I’m going to go up and run this again great let’s do two animals very quickly I’ll go through America let’s say bear Brown yes uh region Asia species snake green yes uh enter region now I’ll say Asia there we go our species was snake because that was what I was looking for that was found in that region amazing nicely done great way to kick things off while working with class inheritance I’ll see you guys in the next challenge video [Music] welcome to the first challenge of class inheritance in the this kickoff challenge I’ve decided not to make it too easy but to make it a bit more fun when we create these two classes revolving around superheroes we need an easy way to kick things off with class inheritance and I believe that this is it this code is all about superheroes and their incredible abilities we’re going to dive in to this exciting world and explain this in simpler terms I’m hoping you’ve already had a read through this challenge description let’s head over into our code okay here we are in our code now I need to create a super class before I create my children classes and in this challenge we’re going to have one super class and one child class we know that our super class is going to be called super hero we know that the first method in a class is in it what does the super class in it need what does every superhero have in common well they’re going to have a name and a power what can they do for each of these we can create our property our variable for this class self. name equals name self. power equals power in the super class we’re going to have a few methods now the first method can be like uh use power right and this is just going to display a little information about our player this can say something like uh player’s name is using something power right and inside here we can put our name and we will put here our power to use them both all right so now anytime we call that method it’ll use the player’s name and the power that they have okay great um we could call one called All right we could make one called intro hero or just intro honestly um and this one could kind of do like the same thing something like that for our hero okay cool let’s make uh two more right so just getting in the habit of using our properties using F strings creating methods here right all these methods are very straightforward into the point so print what do you want to print here I could just say self. name has saved the day right what do each of these methods do well all they’re doing is printing something I’m using the properties that we defined inside our Constructor in different methods around my class let’s create a final one and let’s call this like power level now in here what we can do is I want to know how much power they have and specifically like what is their power for example if I come out here and I say fly or I say strength I want to know how powerful they are or specifically how long they are so fly is three strength is eight that’s the length of the word so I kind of want to figure that out out here because power level self. power is going to be a word so in here I could just say length and we could get the length of our power word right and then the level of power we have we could just say okay whatever their power length is that’s going to be their level but then you can multiply it by something like 10 10 then we can give back our level we can return our level so our super class is done uh for the purpose let’s kind of create one let’s say Batman before we create a child’s class let’s create our object just using the super class okay so let’s say Batman honestly Batman does not have a power but I am going to put flight just cuz his name is Batman very nice let’s run this code now nothing’s going to happen I should be airfree great I’m airfree now after this I could take my object Batman and let’s call like intro hero and let’s call one more and let’s say batman. power level there we go now let’s run these and this this I’m going to print off because I’m returning I won’t be able to see anything there we go I am Batman and I have the power flight and the power is going to be 60 all right because flight is six letters 6 * 10 is 60 our super class is working okay now I’d like to be more specific and I want to create that child class so let’s create a subass and let’s call this flying so this child class will be given to all the superheroes that can fly and they are still superheroes so they can inherit the original superhero class inside here I need to create one new property what do we need to do if we create new properties for a child class well new properties mean in it we need to have in it inside in it I’m going to put the first two parameters of my initial super class name and power so name power then I can create any new properties I may have so let’s just say speed like flying speed how fast can they fly before I create a property for Speed I need to activate my super class we can do this by using the super function linked to the init method just like so inside in it what do I want to initialize well I want to initialize my two parameters name and power then feel free you can create any new properties that this class is going to hold nice our class superhero Constructor is completed and ready to be built out reading through the challenge what two methods do we need here well I would like to have a method called use power use power the only thing this is going to do is I’m going to combine a few things here I am going to print off and we can print off our name right so I’m going to say like Batman is flying at the speed of that’s cool then I’ll put my speed uh miles per hour there we go so in here I can use my self. name and I’m going to use self. speed now remember that this property is being inherited and initialized through my super class because we’re inheriting it and we’re using the word self that is unlocking everything in our super class pretty cool that is the purpose of class inheritance okay um our last method I’m going to say like calc distance right because I want to Cal calculate the distance the superhero can fly and I’m going to give it a flight time how long were they flying for and the distance is going to be a local variable a variable that’s only created and used inside this method and the value is going to be our speed right and I’m going to multiply that by our flight time I can then return my distance variable all righty our classes are fully built that’s it I’m going to head down here to our objects now I’m going to create two objects here I’m going to keep Batman actually um and I am going to create another one called Superman Superman is going to be an object of the flying class that is my child class now here I need to give it a name he will have flight and then because he’s from the child class I need to give him three arguments Batman is from the superhero class which only requires two arguments so for Superman I can say what is our last one speed I will say 250 for Speed let’s change Batman’s to strength like so great on the second object all right I am going to let’s call Superman I am going to [Music] use this method with Superman so I can use intro hero again nice I can use Superman let’s use use power that’s coming from our child class right here then let’s call oo I’m going to call a attack I’m going to create a variable and this can be superman. Cal distance all right then just down here at the bottom let’s just print out some information so I kind of want to say like my superhero can fly a distance of um they can fly a distance of whatever this method returns so I can use attack because that will be the value so superhero can fly a distance of however long miles in what is their flight distance flight distance hours for name I could say Superman right um but I actually want to Target the properties so remember we work with this why not say superman. name superman. name okay let’s give this a worldl we’re gonna see a whole bunch of things happening here okay nice um I could even put a print here so we can even read this more clearly the Batman one runs like normal and then we have our Superman I am Clark Kent I have the power flight right that’s happening right there use power it says Clark Kent is flying at a speed of 200 miles hour okay and then our last one is Clark Kent can fly a distance of 7,000 500 miles in 30 hours wow very nice guys that was our first real introduction to class inheritance we have a super class called superhero this is being given to our child class flying the child class inherits everything from the super class and also has one new property of its own I made two objects our Batman object is taking the class superhero the super class and Superman is using the child class flying very nicely done let’s head over into our next challenge I will see you guys [Music] there [Music] here we are in our Second Challenge I hope the first one really kicked things off for you guys and Spark some interest and understanding of class inheritance this is our Second Challenge in this one our code we are making is going to be a library management system this system is going to allow you to manage a collection of books and our system is going to provide functionalities for adding books displaying all books searching for books by author and searching for books within a specific year range wow so we are actually creating here a library management system we are going to use super classes and we will have children classes as well don’t stress out although we are going to have many different classes a lot of what we’re going to be doing is using our properties to Output strings with print but this is really going to build on the purpose of showing you that you can work with multiple classes all right let’s jump into our library management system I’ll head over to our code in our code to kick things off we need our super class we are in a library what should this be called book logic okay our first method always our Constructor what information do we need to know about a book title author two good things and year when did they publish the book for each of those just go through remember every parameter that we give in it needs to have some type of property we can use throughout our program so I’m creating one S.E equals year nice that’s it now the only thing this super class is going to do is display information about a book how can we do that well let’s just create and let’s just say book info remember all your properties and functions and methods you should be using really specific names to help you understand but help other developers understand too so book info awesome what do we want to print out here well I’m going to print off a title I’m going to print off an author and I’m going to print off a Year oops I should have done an F string there you can say year so in here self. year there we go uh in here here self. author and our final one will be our title property cool that’s it okay so this is completed uh and to kick things right off I will create an object called Harry Potter that we can use to change as we create uh I will call this Harry Potter I haven’t read a Harry Potter book in a really long time uh J K rolling I know that um and then I don’t recall when the books came out like the Sorcerer of stone I’m going to put 200 2005 that’s probably not right let’s take our our new object Harry Potter and I am just going to link the book info method right what do you expect to be output these three lines to run a quick test let’s just make sure the initial super class is working and we can see there in our terminal that it is and it looks great all right so our object is completed it’s always a good idea to keep our classes together that’s why I put all this space right here now what two types of books do we have we have non-fiction and fiction books for each of these let’s create a child class so I can create a class called fiction book I know this is a a child so it will inherit our super class now this child class I would like it to have a genre so if I want to create a genre what do we need in it okay before I continue just remember those two takeaway points most of these challenges I’m trying to get you comfortable with new key terms and new aspects like the super function and things like that if you do not have a new property do not make the Constructor function in your child class you could just start making new methods once you inherit just like from our lesson all right this in it is going to take a few things uh I can just go up here and I’m going to copy these three parameters use them here and then our last one I can create a genre to activate all of those we can say super in it and then put those inside there don’t forget to make a new property for the final parameter nice all righty so fiction book I’m going to create a method to let’s say show info about this book now I want to basically pick up where I left off so when I call this show info method I want this to basically automatically run then I also want to say like genre and I’m going to have myself. genre but that seems a bit counterintuitive that’s just repeating a lot these were already taken from from our super class so let’s use the book info method and let’s say well let’s keep the same names so I can say book info now the problem becomes which one is going to work well if I create an object from my child class it’s going to use the child method when it hits and runs the child method the first thing I want it to do is I want it to call the book info method from my super class then it can print off my genre so let’s give that a run so we can see what’s happening here I’m going to change my class to fiction book uh genre I don’t know is Harry Potter adventure adventure okay you can can see here I’m now calling book info which is actually this method now because I am using my child class run our code there we are so instead of just printing all over again I just activated my book info method that came from the super class okay now going forward changed both of these to book info right and I did that because I’m going to be working with many classes here but if I only had these two classes we don’t need Super if we had our own name in the super class so info I don’t really need to say super doino because it has its own unique name to use it I could use it just like a property and I could say self . info that corresponds to our info method from the super class and I’m inheriting it because we’re inheriting our super class this would do the same thing right so if I only have two classes this is perfectly fine because I have more than two I’m about to make I’m going to keep with using super and I will we’ll keep with the naming Convention of info for now all right our next class the opposite of fiction is non-fiction so let’s say non-fiction book but it’s still a book so it still inherits our super class and our in it is still going to take those properties now a non-fiction book is going to have a topic what’s the book of about so that’s pretty much the same thing as genre but let’s use topic we will do our super init right get all those working again get our parameters in there and then create a property for our new parameter topic okay pretty cool now I want to do the same thing I’m going to copy this method I’m going to take it I’m going to put it in here they are all called info the order the Precedence that they take is the object that you make so when I create my objects I’m going to create three objects one object from each class so we can really see what’s happening whatever object is using that class that’s is what’s going to take precedence now instead of genre I’m going to change this to topic and instead of our property topic great I hope we see what’s happening I hope the gears are turning all righty going down so everything is pretty much completed okay um we do need our last class but let’s get some things running first so Harry Potter um I I don’t know a good non-fiction book so National Geographic that can be nonfiction book okay Nat goo let’s do our info um I don’t have book info anymore right I’ve changed that and then let’s create one more as like the main book so to show us that I can create from the super class so main is just our super class book so I can say test um author I will say me and year let’s say 2023 uh then I will call Main a.info which is the info method in the super class so you see they are all using the info method but remember their info methods are all slightly different okay uh for the purpose of readability let’s put some prints here okay let’s run brilliant there we go let’s make this even bigger this is from our super class test Josh year our fiction book has the three of the same properties and then we have a genre and then our nonfiction book has the same three properties but it has a topic right very very cool all right let’s close this I’m now going to make my last class which will be the most useful one actually what we’ve done so far is kind of like create a database of what type of book is it and what genre it has but now I need to create a library to store everything not just the general descriptions so let’s create a class Library this will not inherit anything which is a good thing for us uh this Library class is going to do a few different things and all the interesting stuff so I will create an init here but in it is not actually going to really do anything it is going to serve as a home for all of our books so let’s create a list where all of our books will be held we can create a method to add add a book I should say one book we’re not adding two at a time so self and then I’m going to give it one book I want to append this book to my list books all right just like so it’s going to go in there okay nice um let’s uh display books I want to show all the books that are in my list pretty much so how could we display all the books think about that I have a list I want to go through it and I want to print all the titles of the books how how can we do that a for Loop for every book in my list books cool I can take book and he guesses what we want to do here info I want to call the info method because I am using the word self after I print off the info of every book I am going to put a space we will see this in action in a little bit but if I have 10 books each book has a name an author and a year I want to see that 10 times so all the information about the books all right um we are able to search by author which is pretty cool so I want the ability that you have a favorite author you can look for that author in the library that sounds useful so in order to do this what I’m going to do is I want to Loop through all the books we have and every book I go through if it has the author I’m looking for I want to take that book and I want to add it to a special list just for that author once I’ve gone through the entire Library I can print off that new list of the books that were written by the author I’m searching for so the first thing we can do in this new method is let’s just say uh found books this is like a local list that any book that I’m looking for written by that author is going to be added for for every book in our list books if the current book author is equal to our parameter the author I’m looking for object property I’m accessing my objects property every time our Loop runs it’s checking for the author and it’s checking to make sure the value of this property is what we entered into our parameter or what we gave to our method so if that’s the case I’m going to take my new list and I want to append that current book I’m on great once the Loop’s done if the new list contains data so if that’s true if there’s books inside that list great I’m I want to print off and I can kind of print off some info about this author so I can say like books by uh and then let’s get our author name in here well I can’t really say uh self. author right because this is a class that’s not inheriting anything so I can say author that’s the info we give here for every book in my new list found books what do we want to do here well book book I want to info I want to call my info method on that book just like we did in the previous one great um I might as well throw an else in here uh just to alert the user that uh no books found by this author you should be really seeing what’s happening we are building on gradually the foundations of python which you should have entered this course with and we are building on object orientated programming so taking those fundamentals and the foundations you already have and turning that into object orientated programming nice all righty uh very nice that brings us to our final method um I did say that we wanted the ability to search by year right so I want the ability for that so I’m going to give it a self right in a year but oo let’s also say start year and an end year right that’s what we should be doing there okay so once again I pretty much want to do the same general idea as the search author I want a child list okay and this child list so for every book in our list books okay great if my start year so that’s my parameter if my start year is we can say less than or equal to the current books Year and that book year is less than or equal to what our end year okay so I’m accessing the current book’s year and I’m saying if the book’s year is greater than this number and less than this number I want to do something um I’m noticing a problem that I could have let’s um do a few things here uh well the problem can be fixed on the outside right just be careful these are using the child class uh these do need to be integers when they’re passed into this class as we are doing some logical Expressions so if this is the case what do we want to do just append it to your list right so what do you want to append I want to append that current book great when that’s done if we do have books in the library that have that then let’s print off just some basic information and you could say like books uh between okay uh I’m going to say start year so books between the year 2000 and the year 2010 I can say that uh nice then for every book in our new list found books what do we want to do drum roll please take the book call the info method on that book to get off our info um um I’m just going to say else print let’s just say error okay errors it’s fine wow look at everything we did take a moment pause me scroll up look at what you’ve done nice very nicely done all right so getting back down here to the bottom okay so I actually already have some books I’m going to use use as my examples okay so I’ll space these out for you be creative here okay so I create an object called Library that’s being right there in this Library I have four books I still have Harry Potter I have the Great Gatsby two fiction books they are objects from the child class fiction book I then have two nonfiction books Childs from the non-fiction class now I can actually go through and I can use all of these so library is like our main object and I want to add these books to my library that I can use later how can I do that how can I add these four books to my library well you have have an add book method and this takes a book or an object I can append an object to a list just like we did in the last lesson this object I now have the ability to access their properties because we added an object to our list so library. add book book one I’m going to go through and we’re going to add each book to our list okay so now each book is added right it’s like a database now I can take my library and I can do some pretty useful things here let’s say library let’s call display books method that’s going to print all the info about the books run it wow look at that that’s cool nice so we have each book’s information just like a normal Library database system very useful very nice let’s call library search author who do I want to look for let’s go up and let’s take F Scott Fitzgerald Let’s search for him okay uh and then while I’m here let’s say library . search year uh now it takes a start year and an end year so where am I at here let’s specifically look for this book so I’m going to say the year 2000 until the year 2020 that’s two decades let’s turn off display books there we go so I searched for f Scotts Fitzgerald so it says books by fcot Scotts Fitzgerald it prints off the books by him books between 2000 and 2020 prints off that book if you’re still here you stuck with us amazing guys if you struggled at all with this that’s fine slow down okay go back to the previous task take the task and I want you to change elements in it and make it your own make it about a hobby you’re passionate about or something you enjoy break down class inheritance all these new terms I’m using properties methods parameters arguments you should know these now this far into the course if there’s anything you want to review go back and review take a few of the quizzes you’re doing great I’ll see you in the next challenge [Music] here we are in the final challenge of this lesson for class inheritance if anything I’ve called this one the fourth challenge but this might be a bonus this one is going to be quite challenging and use things we haven’t learned yet in this course but through the foundation and fundamentals of python you should have already learned and experimented with we will use dictionaries in this challenge if you are not confident with dictionaries or you’ve only learned that briefly I suggest you go and you spend a few minutes when I say a few minutes I mean 10 or 20 to refresh on what a dictionary is and how we add and access the values of a dictionary I’ll give you a tip here in a few minutes on how to remember how to access elements from a dictionary what we want to do here is we are creating a country information system and it’s going to allow users to retrieve information about different countries our system is built using class inheritance to categorize countries into two types developed countries and developing countries now I’m hoping you read my description for this challenge a dictionary very briefly right here I’m going to type it out I am going to say let’s say we have a dictionary called country okay to access a value dictionary key is equal to a value okay I’m going to type this out so and I’m going to say how I tell my other students is I say dictionary let’s use an arrow so dictionary key unlocks a value okay if you have to say that 20 times do it it annoy yourself go to sleep thinking about that dictionary key unlocks a value dictionary key unlocks a value anytime you want the value of a dictionary you need to insert the dictionary key the key unlocks a door the same thing for a dictionary let’s go into our code all right so our super class is going to be country because we have developed and developing countries so let’s make a class called country our Constructor should have a few details what do you think this Constructor should have I’m going to say a name a capital city and a population that’s a good starting point for a country because a country well a country needs all three of those it needs a name it needs a capital city and a country well hope hopefully needs a population I’m going to say self. pop actually and we still need to use population okay nice now I’m going to get the info about this country but instead of just printing line by line I want to create a dictionary that I can use in other parts of my code because the ultimate goal is I want to return the object’s value in the final lines of code which you’ll see here briefly so I’m going to return I’m going to return a dictionary now in a dictionary remember we have key pairs so the first is our key then the value is what’s next so self. name together these are a key pair I have my key I have my value every key must have a value if I delete the key I automatically delete the value I have a name uh capital and finally population okay brilliant that’s all that this is doing it’s returning a dictionary for me that I can add things to and use as I wish all righty our next class let’s call this developed country so countries who are already developed they will inherit the initial Foundation of our super class and let’s create an init okay so self we can take our three parameters from the super class right there in this class because it’s a developed country let’s give it a GDP okay so super I am free to activate everything from that and we can create a GDP gross domestic product for this child class nice okay now I only want one real method here so similar to what we have been doing guys I can create my info method get info I have that in my super class but this is going to be slightly different I need to access my dictionary but my dictionary is held in my super class any guesses or thoughts on how we can do this I’ll give you bonus points if you actually put in the comments of this lesson what you thought of before I said anything how do we access this dictionary well let’s create a dictionary I haven’t kind of created one yet so let’s say I don’t know my dictionary is called info the value of info let’s initialize and let’s get our dictionary get info okay so now I have a dictionary to work with my dictionary is called info I want to add my gross domestic product to my dictionary so how do we access that again remember dictionary key value say say that three times dictionary key value so my dictionary is called info insert the key what is my key well it’s going to be GDP what is the value self. GDP cool I can now return my new dictionary look at what we’ve done compare this with working with dictionaries and other things you know okay nice this is a data structure we haven’t used in this course yet dictionaries are our friends they are like Advanced lists dictionary key value or a dictionary key unlocks a value very nice Okay um then let’s go down here and let’s make a class for developing country we can still give that our super class country we will still create our Constructor uh let’s give it those three following then I’m going to give it uh HDI there we go that’s for developing countries cuz they can use that uh in it cool paste in those nice and we’re pretty much going to do the same thing here guys so I’ll create my property for HDI and then uh down here I can also create a method for getting info which initially is going to be past the same thing so I’m creating a dictionary from this right and then I need to add a new key pair to the dictionary so I’m going to access my dictionary the new key it’s going to be HDI and the value is going to be our property HDI then we can return this dictionary info what do you guys think right our super classes country we have two children classes now we can create a class that is going to use all three of these so let’s say class world right all the countries around the world how can we add objects to this class well if you said hey Josh why don’t you use a list well you’re on the right path let’s say countries empty list cool what do you think we need let’s add a country right we’ve been working with this so country uh let’s add in a country let’s take our list countries let’s append that single country we’ve just added okay let’s give some more space then our final one I’ve said that we need to create is let’s just say get country uh info keep with that naming convention so I’m going to be giving it a name okay whoops for every country in my list countries if that current country name is equal to the name that I’m searching for we can return there we go return the current country and I can call the method we made inside get info right so whatever country if I’m searching for a developing country and I say country get get info it’s going to give me this if I am searching for a developed country it would give me this they are both called get info but remember that this method is linked to the object itself if the object is a developed country then this method is linked if it’s a developing country this method is linked all right I have returned the info um anything else as like a safety net let’s just return none cool wow objects need to be built now our classes are done so our first object let’s just say world world class I’m going to use that as like the parent the main object now I’ve already come up with some numbers okay for three different countries so let’s just put those in here okay you can read over those be creative guys um do some research on your home countries right so find the information use your country as one of the objects and then find two places you would love to travel to that’s always good if you’re stuck and you don’t know what to put okay so I have my three countries uh us India and China right and I’m going to use these so I got my objects I need to add my objects to my database pretty much right so my database is at world class that’s what’s being used all right so we can add in our actual objects right we are appending those to the class world so I can deconstruct them in the world class and I can use their properties okay at this stage in our code it does nothing right cuz ADD country it does nothing you just have a list that’s all it’s doing right so okay great let’s go down now remember we’re working with dictionaries so as like a test let’s just start off and I’m just going to create a variable but the value is going to be a method so world. get country info cool as you can see get country info takes a name so we need to search for something so let’s say here Vietnam I can create a condition I can say if the country is true okay so if it’s returning something right because it’s either going to return this or return this so if it’s returning something then let’s say like I don’t know country info let’s print off the basic information and I’m going to Loop through now remember our data is held in a dictionary so I want to Loop through and I want to print off the key pairs I want to print off the key and the value to every key pair in my dictionary how do we do that with a for Loop this is slow slightly more advanced with our Loops but let’s break down the idea so for every key and value in my country info it’s my dictionary I want to get their items so I want to if I were to translate this for every key and value in my dictionary I want to get their items okay I can print let’s print off my dictionary [Music] key and my dictionary value cool and then else I’m just going to put here as like prevention I’ll say country not found wow what do you think is going to happen when I run this program okay let’s run it country not found what’s going on I said Vietnam oh I don’t have Vietnam as an object right I’m hoping you guys caught that okay let’s take this let’s now say India country not found that’s also an issue why why is that if I cap capitalize India now there we go there we are okay so before I get on this information I’m going to talk about that initially I said India right you are not putting the object right so for example if I put this object India let’s watch what happens country not found we are not putting an object you are putting the country name okay because get country info it takes a name for every country in my list if the country name is equal to the name I entered return country info right so let me go back now let’s do USA Country not found okay well because the proper name is United States okay prints off country info let me go down here so we can see it says name United States right name is a key the value is United States capital Washington Capital is a key Washington is the value right do you see how we’re unlocking our entire dictionary and using those key pairs very well well done you guys I’m so proud of you for how far we’ve come over the last three lessons you have learned so much about object orientated programming you got an intro to working with objects we learned how to define and create your own classes and objects and in this lesson we talked about class inheritance which has prepared you for our next lesson let’s head over and let’s introduce the next Concept in in objectoriented programming I’ll see you guys in the next [Music] lesson all right Welcome to our next lesson in the last lesson we introduced the idea of class inheritance and how we can create a super class and give that class to other derived classes or child classes in this lesson I’m going to introduce to you the concept of multiple class inheritance now when it comes to this I want you to think about just normal inheritance but instead of accepting just one class we can accept multiple classes great let’s jump in as our example here has we have the animal class and I want you to view the animal class as the Base Class everything is derived everything comes from this animal class and it provides the basic for all the animals each animal can then do something special so we have two sub classes we have can swim and can fly and then finally we have a child class we have a class called bird and bird is inheriting not one but two classes right we have our Base Class we have our classes that Define behavior yes I did not make a l Land class right so animals for land but you could have that right so every animal could have a few things we have our species the type of animal you could have a region of the world this animal is found is it dangerous things like that right and then other special classes for specific animals like a fish a shark a dolphin or can fly right you would apply that to a bird so everything there is being passed down okay we do this the same way we inherit a single class but we do this with two classes so in the example we can do that by entering two classes in in those classes we just need to separate by a comma therefore we can inherit any other classes we want more than just one so take a look at this code this is a very very basic setup of multiple class inheritance but it still does a good job at expressing what’s really happening behind the scenes we have a class for our animal this is the base class this class also holds our Constructor method in it with only one property we also have one method eat and this just prints off the name of the animal is eating great the animal class is complete I then have a subass and this class is called can fly and this will be applied to any object that is an animal and can also fly so my bird finally we set up our child class this is the class that’s inheriting our two other let’s call those parent classes we create a Constructor and we initialize the name from the super class animal I then Justified one additional property for color for the color of the bird right and then I have one method here and this is going to print off the color bird is sleeping so the red bird is sleeping right the blue bird is sleeping at the very bottom then I’m creating an object from my bird class then I’m linking my object my bird to the three different methods we built each method is a part of a different class but we are inheriting all of our classes in one okay let’s space out our alignment here’s the setup for that in order broken down right python reading top to bottom it’s good that you have a good structure for your code now if you haven’t quite caught it I’m going to get an error why is my program going to run an error think about it pause it try and find the air great because initially I did not have the color but because my object is from the bird class I have name in color what color is the bird when I create my object I’m giving the name or the species and then I’m giving the color therefore calling all three methods because we’re using the super function here in the child class we can pass the name to the parent class and to the other classes which need it the most right they’re all kind of hopping around and by using that super function we can therefore take what we want to initialize and pass that around to the other classes that we are inheriting or our super classes right I have my super function and because I’m inheriting these two super classes I can initialize the name to use in my two super classes great let’s take a look at the first challenge that I want to kick things off with here we are so don’t go back okay don’t go back you can try this one on your own before you jump into VSS code and you watch a few of the challenges that I have prepared this may or may not be one of the challenges that you’ll see a video of I want you to try to recreate the code from the previous slide use it as an example to build your own I chose the topic animal with can fly and can walk but you should be choosing a topic that interests you where do your passions lie create one Base Class which is my animal super class and then two Behavior or style classes which mind work can fly and can walk finally create a final class for one child class and you just need to use print to interact with all the classes nothing too complicated just to Showcase your understanding of multiple class inheritance remember to use the super function to pass the arguments around to our different classes I’ll see you guys over in vs code for our first [Music] challenge [Music] all right here we are in the first challenge I’m excited for this one guys let’s go through and check out the description quickly which I hope you’re all brushed up with and Dive Right In so in the world of transportation we are evolving we have Smart Cars we have electric cars hybrids we still have gasoline it’s changing we have a super class called vehicle and this represents the generic vehicle with all the generic attributes mag model year but we also have two specialized classes and this is going to be your electric vehicle and your gasoline vehicle the electric vehicle is going to focus on any vehicle that’s powered by battery and it’s going to include Properties or features like battery capacity and the ability to charge our gasoline vehicle class is going to deal with vehicles that are obviously powered by gasoline and this will have its own properties like fuel capacity and ability to refuel both of these classes have a method called get range which is going to help us calculate the range of a vehicle based on their respective energy sources our job is to make a derived Class A Child Called High hybrid hybrid is going to inherit everything let’s jump in heading over to our code all right to kick things off let’s make our base class right everything is going to have vehicle so I’ll say vehicle I will Define my Constructor in it with our key self we then have a make a model and a year for each of those those you can Define your properties then I am not going to do anything else for this class this class is like a mini database if I have 10 different car objects each object is going to have these three I can hold in one object three values that’s all this is going to do so think of this class like a mini database for each object awesome continuing on let’s make our class for electric car okay um this will actually not inherit anything either so I can create a Constructor and for this I’m creating its own property so remember let’s just create battery capacity that’s a good one and I’m going to say create one so let’s say self. uh let’s say battery cap is equal to battery capacity great then I will create a method for charging all of our electric cars can charge self inside we can just return the battery capacity that’s all we want to do for that finally what is an important thing to know for an electric car well our range now I cannot say range because range is already a special python function so let’s call this get range that’s its own unique name right that’s a much better name our range we can just return our let’s say our battery capacity and let’s say the range on the battery capacity is multiplied by five looking great all righty and our last let’s call Super class or parent class is the last type of C car we have and I’m just going to say gas car the gas car has its own Constructor and then its own property is going to be fuel capacity and we can make one called fuel cap and that’s going to be equal to our fuel capacity parameter inside here we can call one and say refuel or get gas right and all we’re going to do is pretty much the same thing we did for the electric car one so we can say self. battery well not battery in this example it’ll be fuel cap and then we will have self. getet range and for this range we can return something like let’s say you got 20 miles to the gallon right so if you got 20 miles to the gallons we can multiply that by 20 great so we have three parent classes or or super classes here now I want to drop these in to a child class a derived class and this derived class is now a very specific example of a type of car we see out on the road let’s make a final class called hybrid it’s a hybrid car so hybrid hybrid is going to inherit actually everything right it’s going to get the info from the vehicle class it’s going to get the electric car info cuz a hybrid’s half electric and half gas so look what’s happening we can take any other class and we can pass those in I’m giving three classes to a derived class now our hybrid we are going to do a lot here well not actually a whole lot because it’s really just in it doing all the work for us what do I need to put inside in it well I need to put all all the parameters we initially made so all the parameters from vehicle I’m going to go and I’m going to put the parameter from electric car because we’re going to need that uh and then we are going to put in the parameter from gas car which was fuel capacity what do you think I need to do now inside in it I don’t have any new properties I’m inheriting them all I need to activate them each of them so I’m going to say super. init don’t forget your underscores so for this init I’m going to take these first three because that’s coming from my first super class great let’s just copy that row we need two more so I can have my next row for super in it and inside here we just need to activate our battery capacity from the electric car super class our final one we just need to activate our fuel capacity right so now everything is stored locally in this hybrid class which I can call all three of my other classes to use methods and get information ah this is great let’s finish out this challenge what I’m going to do here is I’m going to create an object let’s just call this car and my car is going to be a hybrid type of car what arguments do we need to give here well we need to give it a lot actually so I’m going to start things off with a uh make of car because I have here make model year in order so my make let’s say a Toyota I think you know the model of car I’m going to do I’m going to do a Prius uh let’s say a year uh year let’s do 20 23 uh for battery capacity let’s just give it a round number let’s say battery capacity is five and then finally fuel capacity let’s say it can hold 40 great on my car object I want to call a few things but notice right we are returning when we’re returning from a function or a method the value is going to be used as the value to a variable so instead of taking my object right now I’m going to create a variable and let’s say I want to know my battery capacity what is the value to this variable going to be well the value to the variable is going to be whatever this returns if this returns 20 okay then this should be 20 to get that I need to call My Method so I’m going to take car and I am going to call charge just to run through very quickly if I print off my variable battery capacity it should print off five all right so okay I’m actually given an error let’s go through and address this quickly so missing two required ah all right inside of our init let’s just go in because I’m using three of these uh it’s bouncing around let’s just go inside here and let’s say self for each of these okay I’m using three supers let’s just put in self trash my terminal let’s try it again I should see the number five and in matter of fact we do not see five okay let’s take these let’s not use super three times in a row let’s link our actual class so in the first one vehicle in our second one electric car and our final one let’s say gas car great so I’ve linked the classes within it there we are I’m giving back my number five right because battery capacity is holding the value of whatever this method returns that’s five looking good good tests now now going forward let’s just print off basic information about our car such as battery capacity fuel capacity battery range fuel range okay so we have battery capacity I have my fuel capacity and we have our battery I have two batteries those no battery range when we’ve run our code we are going to see a few outputs here there we go back battery capacity of 5 Kow per hour fuel capacity of 40 gallons we have our battery range of 25 miles and our fuel range of also 25 miles looking great except these last two they’re both saying 25 miles I’m going to throw a really easy fix in there let’s just honestly say get fuel range for this one uh split things up a little bit so let’s say fuel range run it again as our final test and we should see there we go looking much better great I hope this was a very easy way to introduce to you guys the basics and the concepts of multiple class inheritance look back through these videos especially in this video and before going into the next one leave a few comments and a few notes in your code use VSS code as a big notebook I’ll see you guys in our next [Music] challenge all right great let’s kick off our next challenge there is a bank that offers multiple types of accounts to its customers just like any bank we have a type called savings account and our savings account is a special type of account that allows customers to save their money and earn interest although it’s not that high we still get interest this is what we want to build out we are also going to have a few other classes like our main account class our interest account and then all of our transaction history needs to be held somewhere too this challenge is going to be a bit harder than our other ones and we are going to be doing some mathematical operations as well think Banking and think how this can provide a real value to a customer this is a real world scenario problem jumping over into our code let’s kick things off and let’s make our account super class this is strictly going to hold our account number our account balance and then any deposits or withdrawals we make to this account will also be applied here as well so all the basics our Constructor method is going to take our account number and our balance so let’s say account num and uh let’s say our balance like so every user needs to have their account and every user is going to have a balance with that bank as well so balance we need a method for all our deposits now this doesn’t actually have to do a whole lot every time this method is called all that we want to do is we want to take our current balance and we want to add an amount to this so this amount can be declared as a parameter when we call this method we want to give this method an integer or a float to be added to the existing account balance nice pause the video try to make the withdraw method yourself what could go wrong in this method pause the video here all right our withdraw method let’s say withdrawal um withdrawal is also going to need an amount how much do you want to take from the account before we withdraw we need to make sure that the balance well we need to make sure we have enough in the account how can you do that using a conditional statement if your self. balance is greater than um or equal to your amount you can do that right then you’re going to take your current balance and you’re going to subtract your amount what could go wrong well you have no money so let’s print off and let’s say uh not enough funds like so okay um that’s it great the last method I asked for us to make is going to be a get balance method that is just going to return how much money is in the user’s account so I can just say get balance the balance of your account and all we want to do is return and we can return get balance or I should say return the current balance like so very good so our main account is done right a user opens an account at the bank and these are their options with that bank they can deposit and withdraw or get their balance that’s it but now a user wants to go forth and open a savings account so this is going to be an interest type of account let’s create a class for this let’s say interest account this new type of account is going to inherit the current account the base account in this interest account we are going to have its own properties so let’s initialize very quickly let’s say self uh let’s go up here I’m going to take account number and balance pop that in here and then the methods of its own we need a rate right their interest rate before I create their interest rate let’s activate our super methods so let’s pop those in there uh let’s pop in self and let’s create our interest rate property n there we go very nice what do we want in here well the only real method of this is I would like to create like a calc interest I want to calculate the interest so I can return what do I want to return let’s say self dobal balance I want to take my current balance and I want to multiply it by the interest rate which is going to be our new property that we just created here right that would calculate our interest rate how much are we going to receive good our interest account class is completed before we make our actual savings account we want to create a book like for a bookkeeper or a mini database in a way and I need a place that’s going to store all my transactions for me and this will allow us to store them in a list so let’s create a class called transactions this is not going to inherit anything actually this is a new class that I can append things to so let’s say in it and in it doesn’t need any parameters we are just going to create a property for a list okay that I can append things to and remove if you wanted to as well uh every we do so if I deposit I withdraw technically that’s a transaction so I would like to add something to my list let’s say that and let’s say transaction cool uh let’s call our list and let’s append what do you want to append I want to append the singular transaction brilliant finally let’s get our transaction history so let’s just say history uh and for this I’m going to say for every transaction in my list transactions I would like to print off the transaction like so looking great okay so look back through what’s happening so far I’m about to jump in and I’m about to make the final class our savings account because that’s what we’re trying to build right now we’re building a whole system I built the account we built the interest rate account and then we have like a notebook or a checkbook it prints off all of our transactions and keeps those in check great our final class let’s create us a savings account I am going to inherit now here I actually only need to inherit the interest account and our transactions but why why is that going to give me access to everything I need in my account that doesn’t make sense because interest rate is actually inheriting a account for us so I don’t need to pass in three classes like I did in the last challenge because I’m giving interest account the account super class this is like storing two classes in one so I’m only needing to give my savings account class two classes instead of three great in savings account let’s create our in it and we sort of need a lot of things here we need an account number you need your balance and you need your interest rate right which is what we defined everywhere else so let’s pop those in here then I am going to call my two classes so interest account do init right this is like our super. init what am I initializing from interest account well I’m actually initializing account number in balance and interest rate in reality right everything then finally I want to use my transactions class and I don’t need to put inside in it I don’t need to put anything because we don’t have anything inside the init of our transactions class so the only thing we can put in here here is self right our key that unlocks everything all of our classes are completed we can now begin to work with our objects so going down here let’s go forth and let’s create an object called savings and this is going to be our savings account what do we need here well I need an account number so be creative right if it’s a savings account I could do savings account double one I’m the first savings account at that bank right bank balance let’s say I have 5,000 in the account and I am earning an interest rate of 0.08% all right I can take my savings object and I could deposit and

    withdraw from this right so let’s hold off on the deposits and withdrawals until we kind of see everything else is what’s happening right right let’s get and let’s go forth let’s say print transactions well I can’t print transactions yet I have get balance so let’s return the balance currently I’m going to come down here let’s say savings do uh nope let’s just create a variable called uh balance and let’s take our object now and let’s say get balance remember I’m returning a value which can be used us as the value to my variable balance so I’m going to say balance and then let’s say here our balance variable that’s it okay to fix this error let’s just go up uh super. in it but three were given let’s try two things really quickly the first one let’s change super here let’s say account let’s see if that does our trick for us it does right so now it’s printing off the balance of 5,000 and that’s what I wanted to haveen right great okay we have our variable the value is 5,000 okay now I can do a few new things let’s do savings and let’s call the deposit method let’s say cool I’m going to give $2500 so at this point right I should have 7500 but I am also going to make a withdraw and I’m going to say I owe rent so I’m going to withdraw 6 50 okay great I’ve done my withdrawals so let’s calculate our New Balance great New Balance this is how much I have left all righty let’s continue on so now going forth let’s create one called interest that’s going to be a variable and I actually already have a balance so this is going to work out good so interest I want to get a returned value so let’s say savings and let’s say our Cal interest method right now that I have those we can add in our transactions so let’s add two transactions what transactions do we have well we did this one and we did this one so currently for adding transactions you could add the numbers um um for this I’m just going to keep it neat and let’s just make a string let’s say deposit let’s just say 500 okay and let’s say withdraw uh let’s say uh withdraw and let’s not even do that let’s say how much did I put in I deposited 2500 into the initial balance and I withdrew 650 from that balance I have my balance and then let’s get off and let’s print off our uh interest interest and then we can get our variable interests like so looking great I am going to run our program look at that there we have our balance right we then have our interest of 548 now the one thing I’m noticing I didn’t display my transactions here right I should print those off so let’s say saving let’s say h what do we call that I called that history so I want to call the history method all right let’s get that bank info I approve of that looking good we have a deposit of this much withdrawal of this much I have my current balance now and I have the interest that I’m earning on the account looking great I hope the gears are turning guys remember before you watch these videos these Live code videos pause the videos try these problems on your own try and find those Solutions because I’ve given you the text files which breaks a lot of it down so work through a part of it watch the video on maybe how I did it pause me again and then work through the next video that’s how we challenge ourselves and get better remember errors are your friends use them to your advantage to help you solve a problem I’ll see you guys in our next [Music] video great here we are in our next challenge with multiple class inheritance in this one we’re trying to create a customer loyalty system I want you guys to think back on how we did the last Challenge and use the knowledge gained from that in order to implement the correct logic and code to solve this one we are going to create a loyalty system which allows the tracking and managing of loyalty points points earned by customers so start to think about hotels or like Airline points every time you fly you earn points to rank up your status within an airline or an organization we will use class inheritance to organize customers and store their transaction history great I’m hoping you guys have taken the time to read through what we need to do here let’s head over and let’s implement our logic and start coding all righty to kick things off we want to create a single object so I’m going to create a single class to hold the information for our customer so let’s create a Constructor and the only real information is we are going to take a customer ID so like so and then a customer name every name is linked to an ID so let’s create our our properties for these and this is the only information our customer needs at least for the time being so when I create a customer object the value will be this class customer and that single object is going to hold our ID and our name nice let’s proceed and let’s make a class called loyalty points this class will be responsible for earning points redeeming points and checking our balance our Constructor is not going to require the properties we made in the customer class and it’s not going to require any information given to it but we do need one property with the initial value of zero soft do points we can create create a method which will allow us to earn points and earn points will take the number of points so I’ll I’ll say amount how many have we earned and all we can do is take our property points and we’re going to add in our amount great what if you want to spend those points you found a great deal on a flight well you should be able to redeem those points how many do you want to redeem that is our amount now we first need to check if you even have enough points so if the points you have are greater than or equal to the amount your requesting to take out then you are permitted to do so and we can subtract the amount requested in our redeem method else let’s just say here yeah you you don’t have enough points uh so I’m going to say not enough points like so great and then our final one that responsibility is to basically show Point balance and all we can do here is we can return self. points all righty our two classes are done right we have one specifically for for our customer we have one specifically for our points that’s going to handle the earning of points and the redeeming of points let’s create a new class that’s going to inherit both of these who Could That Be Well a special customer a VIP customer what if we make a class called VIP customer and this will get our customer and it will also get our loyalty points inside here not a whole lot’s happening but I want to be able to create one object that inherits the functionality of the two super classes customer and loyalty points so I won’t make any new methods here think of this as a mini database I will create init though and init is just going to initialize our customer class and our loyalty points class so all we need to do here is I’m going to take our parameters from the init of customer paste those in like so and then let’s just initialize both of our classes so customer. init say self paste in those take out that extra comma okay so I’ve initialized that one and then I’m going to come down here and I’m going to initialize our loyalty points class and just give it all righty VIP is done we have three classes all of these correspond in work together and they are held in one class created right here now moving on we will need two more classes actually right this is a great example of O Let’s create our two classes for our transactions my first class is going to be called transaction it’s not doing a whole lot it’ll be like a database just like our customer class to store relevant information about each transaction so making my Constructor the job of this is to hold three things a transaction ID number a customer and an amount so these will be given to to an object three values and they will be stored inside one object instead of three objects great now that I have that class done I can use this within another class so transaction will be each transaction will be one object each object will hold three parameters or three values a transaction ID number a customer ID or a customer name I should say in the amount now I have the ability to create a class called transaction history inside here we want a place to store all of our transactions so I can create a list called transactions we will create a method which will allow us to add our transactions so it’s going to take a single transaction we can take our list we can take our list and we want to append that singular transaction like so let’s fix this that shouldn’t be a semicolon that should be a colon brilliant in our last one I basically just want to show all the transactions it’s a way to check our account so let’s say show transactions and I want to Loop through the list that we created here so for every transaction in my list transactions I would like to print what do I want to display about each transaction well I want those ideally so I’m going to say transaction Let’s uh link our trans transaction ID for now let’s link our customer well let’s link our current transaction customer name and then finally we can link our transaction amount great let’s create our objects and let’s watch what’s really happening here all right we have just made five classes this is the most we’ve made yet these two are working together within our VIP customer and then we have two different classes here one is responsible for our transaction information then one is responsible for our transaction history go back through the code and see what’s happening there all righty our objects let’s just make one object and let’s say I have a VIP customer and he he or she is an object from our class VIP customer I need to give them a customer ID so be creative uh vip1 all right and then a name let’s say I am the VIP customer great let’s my account let’s add a few points to it so VIP earn points how many do I want to earn let’s say I’ve just signed up for a new Airline credit card where they they have an award bonus of 40,000 miles within the first 3 months and then I would like to spend 12,500 points on a quick flight so that’s what’s happening there all right now for each of these I should have a transaction right so let’s make one called transaction one and the value of this can be our class transaction I have two transactions which we see above so let’s make two objects the first argument will be the transaction name or ID number so let’s say uh T1 it’s the first transaction on my account what do we need here I need who well who is my object VIP and finally the amount well the first amount we said 40,000 so I’m going to put that there in our second transaction we have our same object and then this time I spent 12,500 and just because I’m reading this out let’s make this a string so then I could actually say plus just for the purpose of our list and seeing and viewing the transaction history here great great all righty so we have three objects on the screen and we are calling two methods it’s looking nice it’s coming together nice now that we have those let’s make one called transaction history this is going to be an object from our transaction history class now we don’t need to give it any arguments here but we can use those methods so let’s say add transactions what do you want to add well I want to add transaction one I also want to add transaction two remember these are being added to our list up in this class that we built like so there we are so we’re adding those transactions that we created here now that I have transactions added what could we do I want to show all the transactions that we’ve had happen so take our transaction history history and we are going to link the method show transactions great so it’s going to show all of those that are occurring now the last things we need to do is just get our customer ID our customer name and the number of points in their account so because we are returning the number of points in the account I need to make a variable to store that value so let’s say uh balance now balance is our variable the value is equal to our get Point balance so show Point balance there we go then we just need to print off a few things so let’s print off I’m going to say here let’s say customer ID and let’s just drop in their uh customer ID number let’s print off here and let’s say our customer name let’s say our vip. name looking good and our final one let’s just say uh loyalty Point balance and here we can just use our variable balance this looks great we took what we learned from last lesson we implemented key factors here in this Challenge and we even built on it more let’s run our program we have our transactions being listed so transaction one Josh uh I added 40,000 points then we subtracted that and then you can see I’m getting my ID my name and then the balance I have in my account after all those loyalty Point transactions let’s head over into our final challenge for multiple class inheritance I’ll see you there [Music] here we are in our final challenge for multiple class inheritance in this one we are trying to bring in the fundamentals of what you could need to build an eCommerce store or the logic that’s happening in the back end so we’re trying to create an online shopping system which is going to allow the interaction between customers and sellers the system is designed using class inheritance to tell the difference between customers and sellers each with their specific functionalities read through this challenge I’ve put this as the the final one for this lesson but do we need to use multiple class inheritance or just normal class inheritance you tell me I want you to give this one a shot before watching this video how do you solve this challenge this challenge is also going to require us to use the open function from python we haven’t looked at this now this is something you may have to research on your own Maybe you’ve seen it before how do we use the open function what operators do we use with it I’m going to break that down as I go through those parts of this challenge let’s head into our code to kick things off up top we want a class for user now this we are going to create a single object from and it’s going to store a username and the email of the buyer or the person who is signing into the account right if you log on to Amazon this is you for each let’s create the properties we can use as we are building this out we will say self. username and self. email as those are the parameters great I’m going to mark this class like so now we can create a class for customer customer will inherit user we need to access the username and the email inside our customer let’s build our Constructor our Constructor because we are inheriting will take our username our email I will drop down here and let’s just initialize it so with our init and remember to pass in our username and our email like so oops I will make one new property here this property is going to be our shopping cart so all the items you add to your cart will be appended to a list inside customer we would like to have one that’s called add to cart what will this do well this is going to add a product that you want to the card we can append that we can append that we have ad cart uh what if you don’t want the item then you need to be able to remove that item from the cart so what item do you want to remove I want to remove this product if that product we’re searching for is in my shopping cart then we now have the ability to remove it so we can say cart use the remove method remove is the opposite of a pend when working with lists right and then anything else we can print off and just say uh item not in your cart let’s view our cart so what do we currently have in that cart how can we do this let’s go through and let’s just say items in cart then we need to go through so for every product in my shopping cart we would like to print off the name of that product so take our product link the property name are we still here I certainly hope so this brings us to the last method now I want to have the ability to save my cart as a file specifically a text file so all text files they end with our extension txt so for example filename.txt I want to save all this information into a separate file to do this we will use the open function and I need to give it a file name what we can say is with the open function I want to open the file name and I want to write new contents inside this file I’m going to call this file file so with the open function I want to open this file and I am now going to refer to this file using the name file this is like a nickname or a variable we are creating that is linked to this file for every product in my shopping cart I want to write in my file what would you like to write in the file well I can add an FST string and I want to write in the file I want to write the product name and I would also like to write the product price looking great once we’ve appended all of those to a separate text file that’s going to be held somewhere else then we can just print off and I could say something like cart saved to file name it’s done right once we run this code we will see the implementation and the output of it but that is how I could use the open function very basically to work with a text file and append to a text file the two real new key phrases here if you’ve never worked with this before um I’m hoping you did research before watching this challenge is we have the with operator and we have the open function with those we can use the right method to write contents inside our file all of our customer information is completed we now want to build the opposite and we want to build the opposite for the seller so I can create a class for seller we don’t need a class for the sell’s attributes because they can actually inherit user if you are a seller on Etsy you’re still a user if you’re a buyer on Etsy see you’re still a user both of those have a username and an email linked to those accounts which is why I’m using user for both of those going forth with our seller class we will initialize and inside here we will say username and we will say email again I can take what we did here so my super init I’ll take cart I’m going to change that but let’s take it I initialized our super class and let’s change we do need a list but the seller is going to have a list of products instead not a shopping cart a list of products they can do the same thing as we did in the above so without looking I’m going to scroll down can you do the same methods just in the seller class so for for example we have ADD product we have remove product then our last two we would have view your products which brings us to our final one you could have save product can you complete those without scrolling up the same Concepts we’re just changing a few small details within add product we need our keyword self and then we are going to be giving it a list or specifically individual products to be appended to a list so self products append product we can do the same for here we’re going to give it s we are going to give it one product before removing we need to check if that product is in my list of products then I have permission I can remove that from my list what do I want to remove the product that I give as the parameter anything else we can alert the user and say uh products not found great for our view products we are going to print off all the products that I have in stock so list of products we can then Loop through and say for every product in my list of products I would like to print off specifically the product name so I’m going to go here we don’t need that string I’m going to take my product link the name property good if you’re new to the open function what do we do here how do I save the products to a text file well we need to give it a file name to be saved somewhere I am going to say with my open function file name I want to write the contents inside as a file for every product in my list products I would like to take my file and I would like to write contents inside of it what am I trying to write here well I’m trying to write the product name and I am trying to write the price of the product how much am I selling it for once we’re done with that you can just print off and you can say uh products saved to your file name where are they going to be saved amazing we are here for our final class now I do need to create a class right cuz because a product is an object and this object is going to store information about the product itself such as a name and a price which we’ve been working with for each of these let’s create that so name is equal to name your price is equal to price that you are giving the product we then have the basic info so basic info about the product we are just going to go forth and I could say print PR what do I want to print here the name of the product so selfname now that we’re in this class and I would like to also print the price of the product so self. price great classes are done it is time to create our objects which are going to use these methods that we have now built on the outside let’s create two people let’s create create a customer and the customer will be from the customer class and let’s create a seller it’s a simple transaction between a buyer and a seller on an eCommerce platform I need a username so Billy Bob two3 that’s the first username uh an email is going to be Billy at Hulu that sounds like a bad that sounds like a hot mail right our seller is going to be Sarah Jane 88 and her email is going to be Jane at Yahoo because who uses Yahoo anymore all right so we have our two objects customer and seller now the seller is going to have a bunch of products so like product one and we could pretty much add all these so I’m going to copy this and let’s say she has three products in her store the first product can be a shoes pair of shoes so I’ll say shoes she sells her shoes for $65 yeah that’s cool 65 even okay her next product is a ring and she sells the ring for 125 something special about it then lastly she sells a t-shirt this t-shirt can be what 28 bucks we have our three products which are going to correspond to the seller and the seller is going to sell them to the customer going forth all we need to do is let’s take our customer and let’s add those products to the cart right so so what do we want to add to the cart well I want to add here I can say product one product two and product three to our cart now they are in our customer’s cart using the add to cart method that we made we can take our customer and let’s say view cart we can view the contents of the C so if I were to run this let’s watch what happens there we go I have items and cart I have all three of those items that the seller has so shoes ring and t-shirt looking good so far we’re airfree I can continue on and let’s now take our customer and I want to save my cart I need to give it a file name so what do I want the file to be called where I save this so let’s just say customer cart giving it the text extension for the text files then we can have what methods haven’t we used remove from cart haven’t used that yet so let’s remove an item let’s say ooh the ring is too much we don’t want the ring anymore so here I can take my customer and I can say remove I should say remove from cart uh product two I don’t want product two anymore let’s now view the customers update cart I’m going to run that great there we go so cart saved this text extension I will view that here in a bit let’s just complete and let’s go with our seller so I’m going to say seller add product what do we want to add well all of those products we’ve created so the seller is going to have all three of these let’s go product two and product three like so very good then I’m going to take my seller I would like to view the products the seller has and finally what do I want to do I want to save the products where do I want to save it let’s say seller products. txt all right I’m going to run this great look at that items and cart we have our three here we have our text file extension this is our updated cart and then here we have the list of products from the seller now where are the text files that’s the question they’re going to be over here let’s open our text files up top here we have our text file customer card text with the contents we have our seller product text with the contents if we wanted to get these on one line all we would have to do let’s go up here to our open function let’s just put those on a new line and we can do the same for our other one amazing well done guys that was our final challenge for multiple class inheritance I will see you guys in the next video spend some time to review what we’ve done here before going into our next lesson I’ll see you there [Music] we’ve come so far this is our last lesson of of this course for objectoriented programming and this is a great way to end the course as we are going to talk about special class methods only found in Python and only used within a class these are essentially Python’s version of like Special Forces or like the Navy Seals let’s check out what I’m talking about what are these special methods so special methods are automatically ran when an object is created and this is the same thing that happens with in it right because in it means initialize it means start and in it is automatically used and called when we create an object we don’t even think about this it just automatically happens these are double underscore methods in it has two before and two after and these double underscore methods make operator overloading possible now I can say special methods but I could also say Dunder method Dunder means double underscore method it’s a Dunder method and these give extended meaning beyond their predefined operational meaning so you already know one special method in it we’ve been using this this whole course so you have a general idea of what in it is and how in it works but with python we have so many other special methods that we could use we are only going to take a look at a handful in this course once you get a general idea of what they are how they work you’ll be able to implement your own logic in use new ones outside of this course let’s check out a few of these now here is a list of some special methods now the first one I’ve put as in it just to warm things off because you already know that one is down right we use in it to build variables for the object we have a Dunder method called Dell and Dell has the ability to delete an object I want you to think about now how do you delete an object from a dictionary well the same kind of applies for this Dell method we have the dunder method string and this Returns the object representation in a string format so it takes the object and it turns it into a string we have the Len or the length method and this Returns the length of an object we have the equal method which allows us to compare the Val values of two objects using the equal sign operator that’s really useful we then have the addition method and this allows us to add two objects you can start to think if there’s an add method is there a subtract method yeah there is one and we can take a look at that there’s endless special methods where’re only looking at a few here and we’re not going to cover all of these in the next few slides but you know that they have them and in the challenges I might give you one where you use a method that’s not in here think about how can we do that where could you learn about that let’s take a look at the first Dunder method I have which is going to be a string this method creates a string representation of our object it’s called by the builtin string function we have this this this is a normal built-in function that comes with python and it’s commonly used to define human readable strings if you want to have information a person can read we would convert it to a string you can see I have a class person with in it and then under in it I have my string Dunder method it is returning the name and the age of my object which is John 25 when I print my object it’s automatically going to return this to me as a string so I can construct the string using the name and the age properties from our in it and it’ll return a string for us we create an instance of person if you try to print the object without our string method check out out what happens it’s not necessarily an error but it’s just printing off literally the word object here is how that would look so everything done correctly with our Dunder string method here we would get a nice output like this if we try to print an object without the string method we would get this so this is a useful tactic right now why do we use this this string method is helpful for a lot of things debugging and displaying object info that’s in very specifically human readable format you will see this in code examples as you broaden and strengthen your programming career let’s take a look at the next example of a Dunder method next up we have the delete method and this method is called when an object is about to be destroyed destroyed it’s used to perform any final actions before the object is removed from the program’s memory so think about any cleanup tasks or actions you may have any connections we need to close anything that needs to be handled before we delete an object this is why we would use the delete method now it’s not actually very commonly used but it is very useful when you’re trying to achieve that goal and it can be helpful in situations where manual cleanup of your code is necessary we have our class file within it and then we have our Dunder method delete currently all this is doing is printing it’s not doing anything very useful right but it is being called now to use it we create our object and we use the python Dell operator Dell object name this Dell operator is the same operator we use when working with dictionaries in deleting objects from dictionaries so you should have seen this operator before that can be used with our Dell Dunder method great here is how that would look by calling Dell on the object it would call the Dell method and in this example it would say deleting file data. text moving on to another new method our add method now this is quite useful especially when working with integers or trying to do anything like that this allows objects of a class to be added together now really look what’s Happening Here we have in it with two properties an X and A Y then we have that special ad method and this special ad method is taking one parameter other you will commonly see this parameter other it’s like a special keyword or a special parameter used by developers it’s just like with a for Loop for I in range I we just use I we like it right so other is the same and that represents an other object we then enter that and we’re checking if other is also an object of the same class so if that instance is the same as my class Vector that’s what that line translates to if our parameter other is the same object or from the same class as we State here then we can do something so if yes we want to add the corresponding X and Y components of the two vectors together new X New Y we’re taking the current x value and we’re adding it to the other object’s x value we can then return a new object with the new values anything else you can raise a type air for the unsupported type of our addition great in result this creates a new object So currently before the program ran we had Vector one vector 2 result is actually going to be Vector 3 right we are adding them together and getting a result this would be the output our new object has the values of six and eight why well remember we added together the values of our objects so six is 2 + 4 8 3 + 5 that is giving us our output of what we’re looking at we are then taking the object and linking the properties X and Y to get our values of six and 8 this is a lot okay if you need to pause pause the video go back to the previous slide as I find that one incredibly helpful this one broken down how I’ve broken this down read that that’s translated to plain English that helps me a lot when learning and I certainly hope that that helps you if we have the addition method we must have a subtraction method we do our subtraction method works the exact same as the add method well not the exact same it works the exact opposite as that method you can see here I have the same codee the only difference is inside here I am subtracting those values and then at the bottom I am also subtracting those values this does the opposite right so my new object is going to be 2 -4 because 7 – 5 is 2 4 – 8 is -4 that’s the value of my new object if I were to print off Vector 1 that gives me 7 and four and if I were to print off my result or res that would give me two and -4 all of these are working the same that’s great this brings us to the final method here and this will be our equal method and I included this one as this is actually quite useful and it allows us to check if two objects are equal imagine if you have 10 different objects from a class just like in our last lesson’s final challenge we created this eCommerce platform store and we had three products what if a store had a hundred products you can see how this method could be used to our advantage we have a class called rectangle and then we have our equal method inside there now equal also takes the other parameter just like with add and subtract and we can check if the objects are from the same class and if this returns true so if the width of my object is equal to the width of the other object and the height of my object is equal to the height of the other object then true it’s equal those objects those rectangles have the same width and the same height it’s going to return true because they’re the same object now check out how I can use that I can print and I can take my object and I can use the equal operator with my second object R1 is equal to R2 that’s true R1 is equal to R3 no that is false python will call this method on the object to its left so this would be called on the R1 cuz R1 is to the left of the equal operator we check if other is also the same object of the same class if yes check if the objects have the same width same height and if that’s true we can return true which results in a true output amazing that wraps up this lesson now before you jump into my videos for vs code you have a wealth of knowledge now as in we started this course objectoriented programming with the introductions of objects the introduction to how to define a class we looked at class inheritance and then multiple class inheritance that brought us all the way to this final lesson of special methods in Python take the next hour take the next 2 hours spend the rest of the day and try to build classes using all the knowledge you’ve gained from this course and try and include a few of these special methods we’ve learned I’ll see you guys in vs [Music] code [Music] great here we are in the first challenge for the introduction of Dunder methods or the special methods for which we use when working with classes diving in I have worded these challenges slightly different in the explanation to make it hopefully EAS easier or just a different strategy for going through the problem if we go through these one by one ideally we should be creating some pretty cool classes with our objects and our Solutions working correctly in this first one we want to create a system for checking the different roles within a company so I’m about to jump in here and I’m just going to Define my Base Class employee with our init and this is going to initialize the name property and employee ID property let’s jump over into our code up top here let’s create our class and I will call this employee employee is tasked with creating the properties of our name and employee ID for each of these we can create those properties then we’re going to use our string method as in what we want to do is when I print off my object I want it to print off the employees name and their ID so I can do that by using the special string method and we can return what do I want to return well I’m going to return a string like employee then right here let’s do some interpolation let’s say our name so employee name very nice all right so that is going to return us the employee name and that employee ID whenever we print off the object itself that’s the advantage to using this string method is we can print an object and it will automatically return or print something back to us great um moving on let’s create a method for to check if something is equal to something else so we know that we’re going to have other and other is that just that special parameter word you could say anything else but you will popularly see the word other in here as a parameter what we want to do is we want to see if two employees share the same employee ID because that’s not possible and speaking of employee ID let me add in my parameter there my value and to do this we are going to say if I’m going to create a condition and we are going to use the is instance function inside here we are going to say is the other person is the other parameter is that also an object from my employee class that’s what we need to check first to make sure I have a object from the same class if that is then we can check if they have the same employee ID if they do I want to return the value true so how can I do that in one line of code I want to return something if it’s true what we can say is if the employee ID is equal to the other object’s employee ID that’s going to be true else if it’s not true we can return false like so so now I can use this to check first is the other object from the same class using the is instance function and then we are going to return true if they share the same employee ID which is impossible that’s not allowed our last method that I want in this uh super class or this class is I want the ad method the ad method can also take an other and well in this case actually I’m going to create this ad method but it’s going to kind of raise an error actually so I’m going to say raise and let’s say uh value errror what do I want to say what do I want to alert the user to EV value err and I just want to say can not add employees right that’s impossible I can’t add to employees because they’re not numbers they’re objects and those objects those properties one of them is a string we can’t do that so I want to raise an error if we try to add those two together and that can be done by using raise the python keyword and then the type of error carrying on I have my employee class now let’s make a class for uh manager and manager is going to inherit and I want you to think about while I’m making in it here what is it going to inherit well the manager they are still an employee that’s not changing right the manager is just the number one employee in that location so the manager is going to have their their own name and their own employee ID as well as which department are they the manager of that’s important let’s activate that super class quickly here and put like that perfect and let’s create our property of department and say that is the value of our parameter great now that we have that all running we are going to do a few things now each method in this challenge they’re all going to be special methods and they’re to show you what we can really do with those and how we can use these special methods to your advantage right so look at what’s happening and think about in your own projects or your own Creations how could you implement these special methods the first special method here I’m going to do is let’s do another string and when this is ran we want to return a few things so I’m going to give back here like a manager name and a manager ID and their department so when this is called let’s return and let’s say name so the name of the manager and then here we can say like that manager has an ID and that manager has a department let’s just say DPT great there we go so I’m returning the manager’s name ID and their Department next up to bat let’s do the same thing so I’m just going to bring these down actually okay we have the ability to check if the same employee ID is shared and check if a manager was added together okay and then finally our last one right we have a staff and the staff can really inherit everything so I’m going to I’m going to take this I’m going to take the manager class and we can just bring that down and put this here I’m going to ch change manager to staff but it’s still going to inherit employee right so each class is ideally doing the same thing but wait until we create our objects to see the interaction between them so a staff is employee now the staff will not really get a department their only difference is going to be a role so what role in the company do they have so let’s change that to role uh uh let’s say Ru here great looking good cannot add let’s say staff members all righty now comes the creation of the objects and what we really want to do with these so first up let’s create some employees let’s say employee one and I’m I’m going to copy this cuz for each let’s create two objects so let’s say I have two employees I have two managers and then I have staff and so we can really see the interaction between these objects so employee they are going to be an object of the employee class and we can just give them let’s say John do let’s say h what is the other employee ID he can be one employee 2 let’s carry on with that and let’s say janeo she is going to be employee two great our managers we can give them the manager class and they also get a name let’s say uh uh Bruce Bruce okay uh they are employee ID let’s say nine and their department is going to be marketing great uh manager two they can be Sarah Jane her employee ID is eight and she’s going to be ahead of sales our two staff let’s say Mark Jones let’s say Mark Jones is 12 and let’s say his role is going to be he’s a mark marketing Ops Dev and then let’s say our other staff member this is going to be Emily Davis and she can be 14 her job is going to be software engineer now let’s use the classes we’ve built and see how we can use these special methods to our advantage so let’s just go through and I’m just going to go through and I’m going to print off a few things so let’s print off employee let’s print off manager one let’s print off uh staff one right so these are just objects but because we’re doing string representation with our special string method we should actually get back some information while I run my code oops okay so let’s go up and fix this line 20 where is line 20 super let’s change this to employee while I’m up here let’s change this to employee all righty trash our terminal run it again great there we are so the three objects I’m printing employee I have the name and the ID number uh the manager is Bruce Bruce id9 Department marketing and then the staff is Mark Jones id2 position marketing op step oh that’s so cool so we are using that new method to print off our objects and now we can actually return that value great let’s carry on so now that I’ve done that let’s check if some of our objects are equal so I know we have employee one and I want to call the equal method on the object to its left which is employee one and I’m going to check if it’s equal equal to employee 2 I can do one more um ideally both of these should return false false very nice okay they are not equal right they are different staff one you can see these three different Arguments for each object they’re different they cannot be equal great um and then finally let’s try and add the managers together right because I did include the add special function and I want to raise an error let’s go down let’s say manager 1 plus manager 2 let’s watch the error get risen raise cannot add well okay if I’m using the ad I should be giving it a parameter even though we won’t do anything with the value of that parameter let’s create it now that we have all three of those let me trash let’s Replay that code great there we are so I’m still given an error right but then we’re given our value air right here right our value air cannot add a manager and that is raising our value air it was risen great that was the interaction we had between three classes we created one super class employee with two sub classes manager and staff each of these classes use the same Three Special methods and we could see the interaction between those as we created and use our objects at the bottom very nicely done I will see you over in our next challenge [Music] Welcome to our next challenge I decided to put a challenge together for you Sports lovers as I don’t tend to do too many sports challenges they tend to be about Finance or travel something about that so here’s a sports challenge using our special methods now we will have three classes each class will be using the same special methods kind of like in the last challenge although instead of using the addition method you will be using the subtraction method we will be creating sports teams in and using two data types as well you’ll be using lists and sets to complete this challenge let’s jump into our code and start going on our super class the first class we want to put together is going to be a generic class for sport right every sport starts with something similar in this case it’s just going to be a name and we can build off that name so let’s start at the Foundation at the basics and let’s just create a place for us to store a name of a sport here so I can create my init and I will create one property called self. name we can return a string if we print a sport object and really all we can return here is just say this is and then I guess the name of the sport self. name looking good let’s actually just create one final special method and let’s do the ADD but I’m going to make it not possible to add one of the objects from the sport class I don’t want that so similar to the last one we can raise a type air and say not possible and then I know in the other ones I’m going to have the subtraction one so let’s just raise an err in this one as I also don’t want this to be possible using our super class sport right so all of these are very Bland very basic right now now we can start to build the other two classes which are going to start to do a few things we are going to have a class called football football is a sport we can inherit that and football has a few of its own details so besides just a name which I need to inherit um it’s also going to have a team right so who is that team and let’s just take our sport class let’s in it and let’s say self name and then create a team property like so when we print an object so I’m going to create a string representation here here we want to return the name of the team and the teams they match with or the teams that they have so how this would look is I could create an FST string and I could say this is we can put ourself name here then what we can say is all righty we can check if they are equal so I’m going to say self we are going to say other do you remember how to check if they’re equal what do we need to check first we need to check if they’re an instance of who other what are we checking if they’re an instance of the football class if that’s true then we can check to see if the values are equal so we can take the name and we can say if the current object’s name is equal equal to the other object’s name and my object’s team is equal to the other objects team that’s going to be true else oh I don’t even need an else let’s just return false great then the last one we’ll do for this one is I included in the task for you to create a subtraction method so let’s use the sub special method and I am going to have the ability to do something here so this is going to take a parameter of other and before we can do anything we need to make sure it’s an instance from the same class so let’s take our other and let’s put in football now when this is called we want to create a list and this list is going to have team names but specifically it’s going to be a set in a list and remember a set is one of the four data types or data structures in Python the other three being list Tes and dictionaries a set is used to store multiple items within a single variable so seeing that a set is unordered you can’t change it and you can’t have duplicate values that makes it useful because we can’t have duplicate teams so let’s create a list here in a way and let’s say uh let’s call this shared teams that seems like it’ll work let’s say it’s a list and then inside the list we’re going to have a set right now the set we’re going to have our self. team and our other set is going to be other team like so I can then check and I can say okay so if I have elements if I have something in my list shared teams then I can do something then I want to create a new object from the football class using the list values I’ve just created so I can return a new football object and the team name I’m going to put a is an F string and I’m going to use the team name as myself. name like so okay that’s working then we can say for our other one let’s just say uh our list of shared teams and to separate I’ll put like two dots great so I’m returning a new object else if that isn’t case let’s return uh the there’s just no common teams no common teams between them all righty and then lastly if that was not true right then we can just uh return let’s say not possible kind reminder there all right looking great I am going to do the same thing here for the basketball class so let’s take this what do we need to change with this class now well let’s change everywhere it says football we are going to give it a new class okay and this can be our basketball class it’s going to do the same thing as the football class it inherits sport it has a team we are checking if the values are equal and we have the ability to add teams as well using our sets all right now that we’ve gotten through all that the last things we should do is let’s play around let’s see what these values are going to return so let’s create let’s just create a very basic one so this is the most basic class this is our super class right this is super basic all right there we are um if I go through right and if I print and I print basic what do you expect to see well we expect to see this is this is super basic all right that makes no sense but if I go up to my super class that’s exactly what I’m returning okay all right so we know that works this is I’m just going to say super basic that’ll just look better we have that let’s create um objects from the other two so let’s say football one football 2 they are both objects of the football class um the name let’s call them well what sport is that the name yeah what sport is it so football okay and then team I’m actually going to make a list here of teams I’m going to hard code this for a second and I’m going to say well let’s take some football teams here let’s say the Giants and let’s say the Dolphins guys I haven’t watched American football in years so don’t judge me on choosing those teams uh okay let’s say uh football let’s say now the teams let’s say the Steelers and let’s say the Eagles there we are so I have the name of the sport and then a list which contains two teams this list is what’s going to be passed through here and subtracted against we can do the same thing for basketball so let’s say basketball one basketball 2 they are both from that basketball class okay we have a name again so as a string I’m giving the sport of basketball okay and then for your teams you can give a list again uh I’m going to say the Jazz and I am going to to say here the Kings okay uh and then oops our other teams let’s say Golden State and let’s say the Rockets brilliant so we have all of those now that we have let’s go through each one and let’s just make sure that they’re giving us some type of information that we’re looking for so printing off our objects to call our string method here we are this is super basic this is football team matched with teams Giants and dolphins seems like it’s working great trash my terminal now let’s try a few of the other special methods so let’s go through and let’s say oh I don’t know let’s print off let’s check if some teams are equal so let’s check if football one equals football 2 let’s check if basketball ball is equal to football what do we think is going to happen here okay let’s give it a check great so it is working both of these are false how could I check if one of them is true let’s think about that right I want to turn one true what would I need to change if we wanted to do that we change change this and we say like team a in both of these and then the other team we can say is going to be Team B now when I run this the equal operator is going to evaluate those and check because we’re passing those in and you can see that it’s true now it’s true because when I go up we are checking if the objects are both from the the same class and we’re checking if the name and the teams are the same so it’s returning true great that brings us to our last ones let’s try our subtraction method so let’s print off and let’s say basketball one minus basketball 2 what can we do here what is the output going to be let’s run it okay so we’re getting no common teams between them right that’s because each of these teams is completely different what if I change Golden State and I now put Kings there we go this is basketball team matched with teams Kings right that I’m subtracting and it found that it’s in both of these great very nicely done on this challenge let’s move on to our next one and I hope the gear are spinning everything we’ve been working with here is slowly coming together you’re doing great we have two more challenges left and I will see you guys in the next [Music] video [Music] welcome back to our next challenge give a read through now in this challenge we’ve done Library as a topic for multiple class inheritance and that really just focused on one product they had books now imagine a company with multiple products we don’t just have books but if you go go to a library at least when I was a kid I could get books or I could even rent movies and DVDs we want to create a few things on how we can handle this together now let’s head over into our code and start on our Base Class our super class item starting in the code let’s create our class item now everything in the system is going to be an item a book or a movie doesn’t matter they’re both items so that’s why I’m creating this super class which will be given to both of those items now we need to give it a title and an author or director Creator so selfname great now that we have those let’s do a very basic return using the string method and let’s just say here what they’re getting so just return and say self. title self. name is by the director or the author great there we are so we have an item now an item is going to have two attributes a title that name and it’ll also have an author great continuing on let’s create our first class which will inherit so we have a book and this book is an item this book is going to have something of its own so it’s not just a title and an author it’s also going to have the number of pages right just like a movie might have the length of the film so slightly different now let’s initialize and let’s say item in it we are going to say self we are going to say title and we are going to say author then let’s say here let’s create a property for the number of pages Pages great now maybe we want to return the length of that book this is a bit strange but let’s return the length of the book based on the string representation of the length let’s just use Len we haven’t used this one yet and let’s say self and let’s say we want to return the length of self. pages right cuz Len you can’t really return the length of a number but let’s watch what happens with this all right so our book is complete let’s create a movie and let’s say a movie is also an item right or technically a movie is not an item so a DVD is let’s say that uh this is going to inherit some stuff now we are going to inherit title that’s going to come from the item class but then a DVD doesn’t have an author it has a director so let’s say director there and let’s say length or duration how long is the film so we have that which means I can take item we can initialize item very quickly and the only thing we’re actually initializing here is we’re going to initialize our title but then I’m also going to initialize director because director and author are kind of like the same thing although it’s not the same name that’s fine I’m still going to take that as the second parameter from my super class so let’s just for now initialize director then the real new property is our duration let’s say that is equal to our duration okay uh what is the length of this movie going to be well let’s use Len let’s say return let’s say self. duration right now that we have that let me clean this up okay looking Grand continuing downward now I’m going to make one final class now really Watch What Happens here so I’m going to create a class and I’m going to say library item Library item is going to inherit it’s going to inherit book and DVD so let’s say that library book is this X book and DVD are those X’s so I have a tree I just made a tree okay now if you look at that everything started with item so this new class library book has access to the class item even though it does not directly inherit Library item only inherits book and DVD but both of those classes inherit item so I’m passing the item class through other classes for which I can use in this class that’s a new level of inheritance all right so in this final class let’s initialize well everything I want access to pretty much everything I want access to my title my author my pages my director my duration uh and then let’s make a new one how many how many copies does the library have available let’s say copies so I’m going to go through and I’m going to say book in it okay now everything coming from book initialize so title author and Pages everything coming from DVD initialize so what’s coming from DVD we have a title as well we have a director this time and then we have a duration great um and then our new one I’m going to say copies is equal to copy iies wow this is a bigger class we’re putting together here so pause the video just take two or three minutes to look through this new class we just made and see how we’re initializing everything and how it’s being passed down through the classes this is a really important fundamental concept here okay this last class all it’s going to have this is going to have a string method and the addition method which we’ll get to here in a second let’s just start with string and let’s say here for string let’s return an F string okay let’s try that so if I return my library item object I should get the title is by this author the book is this long and my DVD is going to be this long or do something else creative how could you use those properties to return something something in the string method finally I want to create and use the ad method now imagine I have a copy of a book like Harry Potter 1 and then I get more copies of another Harry Potter one I want to be able to add those copies together right because it’s the same book and I’m adding them to my library so I’m going to use the ad method to do so so we have other what do we need here so if we need to check is an instance of the same class so if other is from library item okay and my current title of the book is equal to the other title of the book it means they’re a match they’re the same object and they have the same title so for example I’m inheriting book and DD okay so this is making sure that either the titles of two books match or the titles of two DVDs match I cannot add together a book and a DVD they are different right and I can do that because we’re inheriting two different classes all right what I want to do is let’s say combo again and I want to have a combination I want to add together my current copies with the other copies available that’s how I can do that we can then return a new library item object I can return here the title of the object which was the existing title really okay um the author is the existing author the pages it’s still the same number of pages it’s still the same director all the information is still the same the only information that is not the same is the final attribute the number of copies this is increasing to match the variable we’ve just added combo I’m updating the number of copies by creating this new object finally I’m going to throw an else in here and I’m going to rate a type err and I’m just going to say cannot add two different objects together to alert them just like a friendly reminder hey you can’t do that amazing our classes are completed we are ready to move on to create our objects I’m going to go forth here and I’m going to create an object of each I’m going to say book I’m going to say DVD and I’m going to say a library item so I have one from each we can play with so let’s say book for our book let’s just say Harry Potter okay our author we can say JK rolling um and then what else do we need to know here I’m going to say Pages oh I don’t know let’s say 500 so DVD is going to be an object of our DVD class let’s give it the movie Inception that was a good film let’s say the director was Christopher Nolan okay and then the duration of that let’s say in minutes uh let’s say it was an hour and 30 minutes okay great and then our final item is going to be a library item so I’m going to use my library item class now I’m going to do really two things here I need to include so much information so let’s give it a title let’s say python course let’s say I am the author or director let’s say how many pages let’s say 500 it can be a number um I need a director now because I’m creating an object from the library item which is a bit strange okay I’m going to go through real quick and I’m going to print off off each object let’s give a quick test to that okay so I have been given an error ah it’s because I’m using name not title okay so I’m going to say self. name inherit that that makes more sense so I use that in other places should be good okay there we go so I have Harry Potter is by JK rolling Inception is by Christopher Nolan all in all everything is working generally how we want it to work let’s test a few new things out now so let’s print the length of an object now if we did not have the Len function inside our classes like up in here then [Music] great here we are in our next challenge now I’ve done Financial challenges I’ve done things about travel I haven’t done one about about crypto so I had to include that one here what we’re going to be trying to build is a cryptocurrency management system and we’re going to make a main Base Class of crypto and then two child classes of Bitcoin and ethereum to represent those two most popular cryptocurrencies and their properties our code is going to allow users to create new cryptocurrencies compare them add

    them set prices and calculate the value of their portfolio at the end of this you’re going to be creating a mini portfolio and using a dictionary to create objects based on that let’s head over into our code which I can call here and I can just say crypto it’ll be very generic and this is going to be a very generic class I can have in it and in it is just going to take the name of the crypto okay okay so let’s make our property for that we can return a string representation and all we can return for this cuz we don’t have a whole lot of information just yet we can just say this is okay um we can check if the objects are equal to cuz we can’t have the same names right Bitcoin there’s only one Bitcoin there’s only one ethereum so self other and and here we can check if is an instance if what if other is an instance of the crypto class then we can check if the self. name is equal to the others self. name that would return to us true right else we can return false all right we can expand on this in the coming classes I I going to create an add special method here and I want to have the ability to add two crypto names together so keep in mind they’re just strings so not too many errors should happen and I should be allowed to do this but I do need to check if they an instance of the same class still so I can say other I can say what’s my class crypto now now let’s just create a variable called combo and this is going to be the combination of my strings that will be the value so what do I want to do I want to add together my self. name uh I can say plus uh let’s say a space let’s give a space and then we can say other dot name okay looking good then let’s create a new crypto from this combo name so I can return a new object the name will be combo so I can use that to create a new crypto if only if it actually worked like that um else we can’t perform addition so let me just raise and I’m going to raise a value eror and I’m going to say uh canot preform addition between them okay next let’s create a method to set the price so this can take a parameter price and I’m going to create a property right here because I don’t need to define the value when I create my object only when I use this method set price so I can Define it locally inside this method but because I’m using self it’s a key it unlocks it for which I can use throughout my class let’s say I can add my parameter price onto that now let’s say Def and let’s get the price I have a method to add price or set the price now I want to get the price so the first thing I need to do here is before I get the price I need to check if this object has the attribute price so I’m going to first put in here what do I want to check well I want to check myself my object and I want to see if my object has the price property so I’m going to say price if that’s the case let’s just return the price else let’s just say print print off uh price not set looking good and oh how many methods do we have 1 two 3 four five six including in it let’s finish up the super class with one final method and down here let’s create a method and let’s just say uh Cal value I want to calculate the total value of everything and I’m going to be giving it a quantity so how how much of something do I have so I’ll say Quantity and I can say if we have the attribute if I myself has the attribute of a price then what I would like to do is I would like to return the current price times the quantity that I have like so else once again I can just print off and say price not set great so our super class is done that’s built now before we create any objects let’s create just two child classes so let’s create one for Bitcoin and we can give that crypto cuz that is uh for now let me just type pass and I will create one for ethereum and let’s call that also crypto let’s inherit crypto I should say great now the two classes aren’t going to be doing a whole lot so once I do one I’m just going to copy its components but just to give it a bit more functionality for class inheritance using our special methods let’s give in it and oops I have an extra underscore so inside in it it’s not really going to do anything right but we do want to activate crypto and let’s initialize it and let’s just give it a name because I don’t have the property let’s say Bitcoin now when I create a new Bitcoin when I mint a Bitcoin let’s say string and let’s return what can we possibly return you can be creative here put something you’d like just say uh Bitcoin is decentralized okay then let’s create a method called mine and create return statement that just returns something like oops let’s say mining the next block great I’m going to copy this paste this in ethereum just change a few of your attributes right so instead of Bitcoin we can say ethereum ethereum what do we want to say here ethereum uses smart contracts we can say that and and then instead of saying that let’s say minting tokens all right we have our three class is done the really interesting stuff is happening in our super class and then the two children classes just Bitcoin and ethereum a few things here are happening now let’s start playing around with these classes we’ve made so let’s create some objects let’s create uh some crypto objects so let’s say crypto 1 equals class crypto crypto 2 equals crypto class we can say Bitcoin and we will say ether all right so within each of these right uh Bitcoin and ether do not require any arguments because we hardcoded the name inside the init Constructor so our other cryptos we do need to put something here so I will put Solana as a name and then I will put let’s say cardano Okay um there we have two others so Bitcoin eth soul and adaa now you could print off your objects right if I go through and I print off crypto one that’s going to return a string representation of salana right and we can also check and we can check a few things so all of the other ones work the same I can say Bitcoin is Bitcoin equal to crypto 2 actually let’s say crypto 3 let’s put in crypto 3 here and I’ll do two of these so I’m going to copy that so initially let’s say Bitcoin is equal to crypto 3 and then we are going to say Bitcoin is equal to Ether uh crypto 3 is also Bitcoin so running this is going to result in the same so let’s change this here it’s missing one required let’s give it uh self okay and let’s go up to here and we can also give it great there we are so firstly I’m returning a string repres presentation of this because we are printing off crypto one which is salana and then I’m giving true right so Bitcoin equals crypto 3 that’s true because both of those share the same name Bitcoin all righty looking great let’s run a few more tests so let’s just try to add real quick let’s say ether plus crypto2 right I can try and run that I’m going to turn these off for [Music] now all right so you have adding you could have the subtraction special method then we also added some other methods of our own right we made a get price a set price and a cal value why don’t I take my ether object and I say set price so how much is the price of eth at uh I’m going to Ballpark I think it’s at like 1750 so let’s say 17 uh 50 then we can print off right now if I were to print off my ether object and I say get price I should be given this let’s check we’re also adding together ether and crypto too which those that’s not going to work let’s just create a hardcoded property up here and let’s say self. price initially is equal to zero great running that resolve that right so it is giving me 1750 this is ethereum cardano a cryptocurrency so that is US adding together the cryptos right because actually I’m adding together those strings right there all right so everything there is working I’m not going to call every method that we made you guys can play around with that but at the end here let’s try something different let me create a portfolio this portfolio can be a list right but each element in my list is going to be a little dictionary so let me just enter this and let’s say each item each key pair so my first key pair is going to be crypto and it’s going to be let’s say Bitcoin right and then and my second key pair is going to be quantity and I’m going to say an integer so how many do you have let’s say five um and then let’s call the other one let’s pretty much do the same but this time let’s say ether and let’s say Quantity let’s say let’s say 32 if you know you know let’s let’s just add one more in here let’s say uh our last one can be crypto and for this one I think I have crypto one which is salana let’s say Quantity okay and let’s say 25 okay what could [Music] I congratulations and well done in your endeavors in this course I’m so proud of you guys you’ve made it to the end throughout this entire course we have introduced instrumental Concepts in the fundamentals of objectoriented programming in Python we will use these Concepts throughout our entire programming journey and as we begin to introduce more Frameworks and libraries to work together in Python the understandings and the concepts you’ve gained in this course will be key in determining how you do with that thank you so much and I just want to take a moment to say thank you for your purchase as I know it’s a big deal when choosing an online class stay tuned for any future courses I may have cuz they are coming well done and congratulations I’ll see you in our next class together

    By Amjad Izhar
    Contact: amjad.izhar@gmail.com
    https://amjadizhar.blog