Author: Amjad Izhar

  • 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

  • Islamic Modernism: A Critical Analysis

    Islamic Modernism: A Critical Analysis

    This transcript discusses the emergence of Jadid Islam, a modern interpretation of Islamic teachings, and its challenges to traditional interpretations. The conversation features prominent scholars debating the compatibility of modernity with Islamic principles, particularly concerning issues like women’s rights, finance (interest), and the role of tradition. Specific individuals like Javed Ghamdi and Hasan Ilyas are mentioned in relation to their contributions to Jadid thought and its reception. The speakers explore the implications of Jadid Islam for various aspects of Muslim life, including social practices, gender roles, and economic systems, referencing both Quranic verses and Hadith. Finally, the discussion touches upon Western influence and the strategies employed by Jadid proponents to attract followers, particularly women.

    Navigating Modernity: A Study Guide

    Short Answer Quiz

    1. What is the main concern of the speakers regarding the “modernists” and their interpretation of Islam?
    2. How do the speakers define “modernity” and what is its relationship to religion?
    3. What is the significance of “Hadith” in the context of the discussion and how is it viewed by the “modernists” referenced?
    4. What historical event does the discussion refer to as a starting point for modernism?
    5. How did the speakers characterize the approaches of different groups of Muslims toward modernity?
    6. What role does the Rent Corporation play in the discussion and what are their stated objectives?
    7. What are the key characteristics of “moderate Muslims” according to the document discussed?
    8. What is the speaker’s critique of the “modernist” view of the veil and the issue of gender equality?
    9. What specific economic issue did the discussion focus on in relation to the ideas of the “modernists”?
    10. How do the speakers argue that modernists undermine tradition within Islam?

    Answer Key for Quiz

    1. The main concern of the speakers is that “modernists” are reinterpreting Islamic teachings and traditions in a way that they perceive as aligning with secular and Western ideals, potentially leading to the erosion of core Islamic values and practices.
    2. The speakers define “modernity” as a philosophy focused on reason, humanism, and technological progress. They see it as potentially conflicting with traditional religious principles, as modernity often prioritizes human intellect and worldly concerns over divine guidance.
    3. Hadith, the accounts of the Prophet’s sayings and actions, is crucial for Islamic law and guidance. The speakers highlight that “modernists” tend to downplay or dismiss the importance of Hadith, arguing for a more liberal interpretation of Islam based solely on the Quran or reason.
    4. The discussion points to the 16th century in Spain as a starting point, where scientific discoveries challenged religious authorities. This challenge led to the development of a modernist movement that questioned traditional teachings and power structures.
    5. The speakers describe three responses: some fully embraced modernity, some rejected it completely, and some tried to blend it with Islam. These responses reflect the diverse range of opinions within Muslim communities when faced with modernization and westernization.
    6. The Rent Corporation is identified as a non-profit research organization that has developed policies for different countries in the Middle East, including the promotion of moderate Muslims. They seem to be influencing Western foreign policy in that area by offering strategies for promoting specific types of Muslims.
    7. According to the document, “moderate Muslims” are characterized by their support of democratic culture, international human rights (including gender equality and freedom of worship), and a willingness to engage in interreligious dialogue.
    8. The speakers criticize the “modernist” view of the veil by highlighting the way the modernists approach it as a matter of personal choice, often without giving proper regard to tradition. They also see it as indicative of a larger challenge to Islamic values regarding gender relations.
    9. The speakers discuss the issue of interest (riba) and its permissibility in Islamic law and question a modernist’s shift in opinion. They point out how modernists initially considered it forbidden but later justified it, implying inconsistencies in their views.
    10. The speakers believe that modernists undermine tradition by presenting their new ideas as the new correct interpretation, dismissing or downplaying the traditional interpretations of Quran and Hadith, and the consensus of scholars, while giving priority to individual reasoning.

    Essay Questions

    1. Analyze the speakers’ perspective on the relationship between tradition and modernity within Islam. How do they define each concept and what are the key areas of tension they identify?
    2. Discuss the role of the Rent Corporation and its policies, as presented in the discussion. How do these policies reflect the broader goals of Western influence and what does this imply about power dynamics?
    3. Examine the characterization of “moderate Muslims” as presented in the discussion. How does this depiction align or conflict with the speakers’ own views and what are the implications of these differing perspectives?
    4. Using the examples of the veil/gender and interest/banking, analyze the strategies of “modernists,” particularly Gadi Sahab, as portrayed by the speakers. How do they redefine these Islamic principles and how does that relate to modern secular principles?
    5. Explore the speakers’ argument that “modernists” are introducing a new religion of Islam by attacking the hadith and consensus of scholars. What evidence do they provide and what are the potential consequences of this approach, as they see it?

    Glossary of Key Terms

    • Hadith: Accounts of the Prophet Muhammad’s sayings, actions, and approvals, considered a vital source of Islamic law and guidance, second to the Quran.
    • Modernism: A philosophical movement that emphasizes reason, science, and individual freedom over tradition, often leading to a reinterpretation of established religious and cultural practices.
    • Tradition: In this context, refers to established practices and interpretations of Islam based on the Quran, Hadith, and the consensus of Islamic scholars over generations.
    • Ijma: The consensus of the Islamic community, particularly of scholars, on a specific issue of Islamic law.
    • Riba: Arabic word for interest. In Islamic law, riba is not allowed because money can only be used for direct value, such as through trade, instead of the accrual of wealth through loans.
    • Sunna: The way of life of Prophet Muhammad; his practices, examples, or traditions, often used in conjunction with the Quran to guide Muslims.
    • Taqleed: The act of following the legal opinions of Islamic scholars.
    • Moderate Muslims: A term used by the Rent Corporation to describe a particular segment of Muslims who support certain democratic values, human rights, and interreligious dialogue; it is a term which the speakers in the source use critically.
    • Secularism: The principle of separation of the state from religious institutions.
    • Liberalism: A political ideology that emphasizes individual rights, freedoms, and limited government.
    • Kalisai: A term used in this text, referring to the Christian church or Christianity
    • Salaf Saliheen: The first three generations of Muslims after the death of the Prophet Muhammad. This term is used to refer to the people the Muslim faith is based upon and who should be emulated, especially by traditional Muslims.
    • Mutakhorin: The later scholars of Islamic law, after the Salaf. This term is used as a counter to the Salaf to indicate the importance of those early leaders.
    • Mahram: A male relative, such as a father, brother, or husband, who acts as a guardian for women in Muslim law.
    • Tashri: The process of establishing laws or rulings, particularly in Islamic law.
    • Taw al-Ism: An Islamic principle related to punishment and culpability.
    • Mufassir: A person who interprets the Quran.
    • Muhsin: A righteous person.
    • Sharia: Islamic law based on the Quran and Sunnah.
    • Jadid Diyat: A term used in the text to refer to a new, modernized approach or interpretation of Islamic principles.

    Modernism, Islam, and the Critique of Ghamidi

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

    Briefing Document: Analysis of Excerpted Text on Modernism and Islam

    Introduction:

    This document analyzes excerpts from a transcribed discussion focused on critiques of modernism within the context of Islam, specifically targeting the views of Javed Ahmad Ghamidi (referred to as Gadi Sahab). The discussion features three speakers: Sheikh Usman Safdar, Sheikh Muss Abrar, and an unnamed host, likely from a religious educational institute. The speakers analyze Ghamidi’s interpretations of Islamic teachings, his methods, and his impact on the Muslim community. They also contextualize his ideas within broader debates about modernism and its relationship to Islam, referencing a RAND Corporation report that suggests strategies for promoting “moderate Islam.”

    Main Themes & Key Ideas:

    1. Critique of Ghamidi’s Approach:
    • Rejection of Hadith: The speakers highlight Ghamidi’s apparent dismissal of Hadith (prophetic traditions) as a source of religious guidance. One speaker states, “Whatever thing Gadin sahab would deny I was quite happy that I believed in the Hadith I am Hadith if it has any importance for me.” They emphasize Ghamidi’s argument that there is “no need of hadith” for some matters. This is presented as a core issue, with the speakers asserting that Hadith holds significance in Islamic understanding.
    • Emphasis on Individual Interpretation: Ghamidi is accused of prioritizing his own reason and understanding over established Islamic scholarship (Ijma). “What do we have to do with the Ijma of the whole Ummah?” one speaker notes, capturing a perceived attitude of dismissing collective consensus. They highlight that he is seen as placing individual intellect above divine guidance and interpretation passed down by scholars and the community.
    • Simplified, Modernized Islam: The speakers accuse Ghamidi of trying to make Islam easier and more appealing to modern sensibilities, at the cost of traditional teachings. “Hasan Ilyas Saheb has explained Gamdia in an easy way … Actually Gadi Sahab has been reformed many times … Presenting Gadi Jam in an easy to understand manner.” This “easy” Islam is considered a form of distortion by the speakers.
    • Secretive and Harsh Methods: The speakers claim that Ghamidi presents his views in a covert way, packaged in “harsh words” initially and now presented in an easier and more attractive manner. It is stated that his methods are now more “challenging” and designed to attract a wider audience.
    • Impact on Society: It is implied that Ghamidi’s views have gained traction, especially among the younger generation, leading to a “school of thought.” This perceived popularity is of concern to the speakers as they feel that the basis of Islamic teaching is being eroded by Ghamidi’s ideas.
    1. Modernism vs. Tradition:
    • Definition of Modernity: The speakers explore what “modern” means, contrasting it with the traditional teachings of Islam and mentioning the historical origins of modernism rooted in 16th and 17th century Europe, especially in the context of conflicts with the church. They are quick to mention it is rooted in a rejection of religion. They use “modern” as a way to show the movement that Ghamidi is leading is not new. The term “postmodernity” is introduced to emphasize that even modern thought is now being superseded by something new, but this new concept is still rooted in anti-religious thought.
    • Critique of Modernist Ideologies: The speakers identify key tenets of modernism they find problematic: a focus on individual autonomy, excessive reliance on reason, and a prioritization of human will above divine will. They see a movement towards secularism. “It is your devotion, as if there is no one to worship … Do as you please and what is liberalism that you get freedom.” They interpret modernism as a threat to Islamic principles, especially in its promotion of a liberal approach to religion.
    • The Challenge to Traditional Islam: The discussion highlights how modernism is seen as creating a deficiency complex among Muslims who witness the scientific and technological progress of the West, and so want to find ways to “modernize” Islam by making the religion compatible to what they see as “progress”.
    • Countering Modernism’s Claims: They emphasize that ancient teachings can have immense value and are not necessarily incompatible with progress. “His message is that everything that is ancient Every thing that is old and ancient it cannot be a karma or it cannot be a human being’s is not enough for success, no matter how old it is.” They also point out that technological progress is not a central tenet of modernism but is a separate development.
    1. The RAND Corporation and the Promotion of “Moderate Islam”:
    • A Strategic Approach: The speakers reference a RAND Corporation policy document outlining a strategy to support “moderate Muslims” in the Middle East. This report divides Muslims into four groups (fundamentalists, extremists, secularists and modernists) and suggests supporting and promoting the “modernist” faction.
    • Targeted Support: The report advocates for providing financial and media support to modernists, including promoting their presence in media channels. “You have to tell them about the modernist class We have to support them, we have to fund them You should see them formally in the media.” This connection adds a layer of geopolitical strategy to the discussion, suggesting a foreign influence in the shaping of modern Islamic discourse.
    • Characteristics of “Moderate” Muslims: The RAND report defines “moderate Muslims” as those who support democracy, human rights, gender equality, and interfaith dialogue. They emphasize that “moderate Muslims” should challenge “discriminatory injunctions in the Quran and Sunna.” This includes revising the laws of inheritance, for instance. This definition is also seen as a rejection of traditional Islam.
    1. Specific Issues and Interpretations:
    • The Issue of Interest: Ghamidi’s shifting stance on interest in banking is discussed, moving from a strict prohibition in 2008 to a more lenient view by 2015, which suggests that his position is not based on principle but is flexible to the modern world. The speakers highlight the contradiction. They also state that by labeling those who pay interest as being “oppressed”, Ghamidi is creating a new system of thought to justify the modern system of debt that goes against the Quranic verse that calls those who engage in usury as being “sinners.”
    • Women’s Issues (Purdah/Veil, Mahram): The discussion delves into the issue of the hijab (veil) and mahram (male guardian for women), criticizing Ghamidi’s view that a simple headscarf is enough for modest dress and his view that in modern times, women do not need a mahram for travel. The speakers emphasize that these are clear Islamic laws and protections for women’s safety and dignity which Ghamidi is distorting. They explain that the true meaning of purdah is to keep the sexes separate so that evil thoughts do not enter the minds. They state that the modern concept of a free-mixing workplace is a dangerous environment for this.
    • Beard and Appearance: The speakers discuss Ghamidi’s ambiguity regarding the beard, suggesting he does not view it as a religious requirement, although he and his followers keep it. The speakers see this as further evidence of his rejection of traditional Islamic practices.
    • The Uniqueness of the Prophet’s Caste: Ghamidi is seen as removing the special importance of the Prophet (PBUH). The speakers cite a news program where Ghamidi equated his importance with the prophets, stating “ji jo It is like I am calling you Mam Saheb Like I’m describing the day to you I am not in this matter, so are the prophets.” This statement is seen as blasphemous.
    • New and Old Issues: The speakers state that Ghamidi is only focusing on old issues and not addressing new issues that are affecting the Muslim world. They are trying to present that his interpretations are not based on Quran and Sunnah, but rather his own whim, and so his interpretations can change at any time. They also state that there is little debate among Ghamidi’s group over new issues, which the speakers feel are more important.
    1. Call for Traditional Understanding:
    • Adherence to Established Scholarship (Ijma): Throughout the discussion, the speakers repeatedly emphasize the importance of Ijma (scholarly consensus) and the established interpretations of the Quran and Sunnah, rejecting any new interpretations that deviate from this consensus.
    • Protection of Religious Principles: The speakers express deep concern that Ghamidi’s views are eroding fundamental Islamic principles, traditions, and values. They see a need to educate the Muslim community and expose what they believe to be the distortions that Ghamidi is causing.
    • A Rejection of Modernist Interpretations: They believe that the modernist agenda as a whole is a distortion of Islamic teachings and are working to counter this.

    Quotes illustrating key points:

    • “Whatever thing Gadin sahab would deny I was quite happy that I believed in the Hadith I am Hadith if it has any importance for me.” (Speaker expressing belief in the importance of Hadith)
    • “There is no need at all you tell me who Is it an issue that requires a Hadith.” (Rephrasing of Ghamidi’s denial of the importance of the Hadith.)
    • “It is a period of stubbornness, it is a period of modernity It is new and the technology that is inside it it is booming but if it can be said that This is also called the era of postmodernity Because they also say that the modem is finished.” (Explanation of the link between modernity and technology)
    • “So you should understand that those who are his disciples now If yes then this post is the era of Gadi Jam.” (Labeling the trend as “Gadi Jam”)
    • “The purpose was that if I started moving towards him … Hasan Ilyas Saheb has explained Gamdia in an easy way Made it important, made it easy, made people understand Actually Gadi Sahab has been reformed many times.” (Stating that Ghamidi and his followers are making the message easier and more accessible.)
    • “The modem is basically Hume talks about humanity I don’t do it, right? The other thing is that what is the rational rule that you have used your intelligence Think like this and consider your own intelligence as your real you have to give this resam in its place and Then its basis is the denial of Allah.” (Explaining that modernism is based in human reasoning rather than divine will)
    • “It is said that we had given a new perspective to the Muslims. we are going to start okay isn’t it good By the way let me point out that in today’s times I am also more or less the same person in Saudi Arabia.” (Demonstrating that the idea of “modernizing” Islam is moving into the Middle East)
    • “His message is that everything that is ancient Every thing that is old and ancient it cannot be a karma or it cannot be a human being’s is not enough for success, no matter how old it is.” (Summarizing Ghamidi’s view that old traditions are not important for success)
    • “Respect for the rights of women and religious people Minority moderates are hospitable too Muslim Feminist and Open to Religions Plim and Interfaith Dialogue i.e. Tan Mazhabi There should be different types of religions for this.” (A RAND report’s definition of a “moderate Muslim.”)
    • “The one who gives the offer and the one who takes it Shame on all those who write and become witnesses I said, everybody is equal.” (2008 quote from Ghamidi calling those who deal in interest a sinner)
    • “The one who pays the interest is a poor and oppressed person, right? He is giving it to you from his legitimate earnings Why are you telling him that he is a criminal?” (2015 quote from Ghamidi shifting the blame away from those who give interest)

    Conclusion:

    The speakers in this discussion express serious concerns about Ghamidi’s interpretations of Islam, viewing them as a deviation from traditional teachings, influenced by modernism and possibly even political strategies aimed at promoting a specific “moderate Islam.” They are particularly worried about his dismissal of the Hadith, his emphasis on individual reasoning over scholarly consensus, and what they see as a distortion of key Islamic concepts and practices. They position themselves as defenders of traditional Islam and seek to educate the Muslim community about the perceived dangers of Ghamidi’s and modernistic interpretations. They state that Ghamidi is presenting a new version of Islam that is attractive, but is not the way that Islam is intended to be interpreted. This is seen as a serious threat to the traditional teachings of the religion.

    This briefing document provides a detailed overview of the main themes and ideas presented in the text, highlighting the key arguments and perspectives of the speakers. It reveals a complex debate about authenticity, interpretation, and the role of Islam in a rapidly changing world.

    Modernist Interpretations of Islam

    FAQ on Modernist Interpretations of Islam

    • What is the central conflict or tension being discussed in the context of Islam? The primary conflict revolves around the tension between traditional Islamic teachings and modern interpretations. There’s a push by some to reinterpret Islamic principles and practices in light of contemporary values and societal norms, while others strongly advocate for maintaining traditional understandings. This conflict extends to areas such as the interpretation of the Quran and Hadith, the role of women in society, and the acceptance of modern scientific and technological advancements.
    • Who are the key figures or groups involved in this debate? The debate involves several key players. On one side are traditional Islamic scholars and followers who emphasize strict adherence to the Quran and Hadith as interpreted by past generations. On the other side, there are modernist thinkers who argue for a more contextual and flexible understanding of Islamic teachings. Javed Ahmad Ghamidi and his disciples are cited as examples of those advocating for modernist interpretations, while scholars like Sheikh Usman Safdar and Sheikh Muss Abrar appear to be critical of these views. Additionally, the discussion mentions Western think tanks and policy organizations that appear to be supporting modernist movements within Islam, in order to challenge traditional understandings.
    • What are some specific areas where modernist interpretations differ from traditional views? Several specific areas of divergence are discussed. These include the interpretation of Hadith, which some modernists downplay or reject if it conflicts with their understanding of reason or modern values. Modernists also tend to emphasize the importance of individual human dignity and rights, sometimes prioritizing these over traditional interpretations of religious laws. Furthermore, they advocate for gender equality and reinterpreting traditional Islamic laws related to women. They also advocate for re-examining interest-based financial systems, challenging interpretations of “riba” (usury) and its relevance in modern banking.
    • How do modernists view the concept of tradition (“Taqlid”) in Islam? Modernists generally criticize taqlid, the practice of blindly following the interpretations of past scholars. They argue that each generation must interpret religious texts for themselves using their own intellect and understanding of their present context. The texts suggests that modernists believe Islam can adapt to contemporary circumstances, so this approach justifies those changes. This perspective also encourages critical analysis of established religious norms, and allows for the rejection of practices they deem as outdated.
    • What is the role of reason in modernist interpretations of Islam? Modernist thinkers place a high value on reason, believing that the Quran and Hadith should be understood using rational thought. If they think that existing interpretations are irrational, then those interpretations should be re-evaluated. They suggest that if any tradition clashes with modern reason, then that tradition should be rejected. This approach challenges the idea that interpretations should be simply passed down or understood literally from previous generations without any application of reason or logic.
    • How do modernists view the role of women in Islam? Modernist viewpoints often emphasize gender equality, arguing against discriminatory practices and interpretations. They advocate for a reinterpretation of Quranic and Sunnah passages that seem to create inequalities, such as inheritance laws or modesty requirements. Some modernists suggest that the hijab is not always required and is more of a cultural construct, not something that is demanded by Islam. They also advocate for women to be able to participate in all aspects of life, including the public sphere, without being limited by traditional interpretations.
    • What is the controversy regarding modern interpretations of the issue of interest in banking (“Riba”)? Traditionally, Islam prohibits “riba,” typically understood as interest. Modernists argue for a re-examination of the concept of riba, suggesting that what was prohibited in the past may not apply to the financial systems of today. Some propose that contemporary interest-based financial structures, if not exploitative, may be permissible, claiming that they support those in need. They will challenge traditional interpretations of ‘riba’ by re-framing and applying Islamic principles in a different way to contemporary circumstances.
    • How do Modernists see the relationship between Islam and scientific advancement? Modernists don’t see Islam as being in conflict with science and technology. They believe Islam encourages rationality and that modern scientific discoveries should be integrated with their religious views. By not taking a literal interpretation of texts, some modernists are suggesting that Islam should not limit intellectual curiosity and advancements. They interpret religion as harmonious with science and technology and not at odds with one another.

    Modernity and Tradition in Islam

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

    Timeline of Main Events & Ideas

    • Pre-19th Century:The text alludes to a period where traditional religious views, particularly within Christianity (Kalisayi), were dominant.
    • Science begins making discoveries, creating tension with traditional religious interpretations.
    • The Church is said to have suppressed scientific discoveries which they deemed as threats.
    • The concept of “modern” begins to develop in the West around the 16th-18th centuries as a reaction to traditional religious authority.
    • 19th Century:The “Modern era” is identified as beginning in the 19th century
    • The “modern” mindset begins to take hold, particularly within Europe, impacting how people viewed religion and tradition.
    • Colonial Era (19th-20th Century):European colonialism significantly impacts the Muslim world, leading to feelings of deficiency in response to European progress in science and technology.
    • Muslims begin to grapple with how to reconcile their faith with Western modernity.
    • Three main reactions emerge within the Muslim community:
    • Complete Adoption: A group wholeheartedly embraces Western modernity, often rejecting traditional religious practices and interpretations. (Example given is Turkey under Kamal Ataturk)
    • Total Rejection: A group rejects modernity completely, including science and technology, sticking rigidly to traditional interpretations.
    • Selective Integration: A third group seeks to integrate aspects of modernity within an Islamic framework, often reinterpreting traditional Islamic texts and practices.
    • 20th/21st Century:The discussion of “post-modernity” begins, a concept that follows modernity.
    • Javed Ahmad Ghamidi and his Movement: Ghamidi’s movement emerges, challenging traditional interpretations of Islam, particularly regarding Hadith and the role of reason in religion. It is considered by some as a “modernist” movement.
    • Hasan Ilyas: Emerges as a critic of Ghamidi, challenging his interpretations. It is mentioned Ilyas has made Ghamidi’s ideas more digestible.
    • The Rise of Modernist Thought: Modernist ideas become more prevalent within Muslim circles, with some adopting liberal and secularist views.
    • Rand Corporation Involvement: The text reveals a U.S. think tank, the Rand Corporation, has a vested interest in supporting “moderate” and “modernist” Muslims as a way to counteract “fundamentalist” elements in the Muslim world.
    • Rand Corporation policies advocate for funding, formal media presence, and empowerment of this class to counteract fundamentalism and the traditional religious class.
    • The discussion of “traditional” Islamic practices is heavily featured, like modesty and veiling.
    • Debate Over Ijma and Authority: Discussions arise about whether consensus of Islamic scholars (Ijma) can be challenged, and who has the authority to reinterpret religious texts.
    • Issues in Banking & Finance: The evolution of Ghamidi’s views on interest (riba) in banking is highlighted.
    • In 2008, Ghamidi’s work declared both giving and taking interest to be haram.
    • By 2015, his view shifts to a position that declares interest-takers as “oppressed.”
    • Debates on Women’s Rights and Modesty: The text outlines challenges to traditional views regarding women’s roles and practices such as veiling, women travelling without a male guardian, and shaking hands.
    • Contemporary IssuesNew interpretations of Islam are presented in media, by figures within this movement, to a Western audience.
    • The rise of “modern Islam” in the West is examined, focusing on why women are embracing it.
    • Figures with this movement downplay traditional Islamic requirements, such as the beard, and challenge existing interpretations of Islamic rulings.

    Cast of Characters

    • Javed Ahmad Ghamidi: A prominent Pakistani Islamic scholar. He is presented as a “modernist” thinker who reinterprets Islamic texts and challenges traditional religious interpretations, particularly on the issues of Hadith, reasoning, and banking. He has a large following but is also facing criticism for his views.
    • Hasan Ilyas Saheb: A critic of Javed Ahmad Ghamidi. He is presented as someone who has made Ghamidi’s ideas more understandable to the public and has openly challenged Ghamidi’s positions.
    • Sheikh Usman Safdar: CEO of Madina Islamic Center. He is one of the primary speakers in the dialogue and a traditionalist, often critiquing Ghamidi’s modernist ideas.
    • Sheikh Muss Abrar: Research Director of the Medina Center. Also a speaker in the dialogue, he is a traditionalist who voices concerns about modern interpretations of Islam.
    • Kamal Ataturk: Mentioned as an example of a leader who completely adopted Western modernity and secularism in Turkey.
    • Ahmed Khan: Mentioned as an historical figure that tried to reconcile Islam with Western modernity by presenting it in new ways.
    • Charles Bernard: Author of a Rand Corporation document discussing approaches to Islam in the Middle East.
    • Mohammed Shahrukh Mun Hari Ara: A Syrian scholar who is presented as one of the moderate Muslims who is supported by The Rand Corporation.
    • Prophet Muhammad (PBUH): The central figure of Islam, whose teachings and traditions (Hadith) are the subjects of much debate and reinterpretation.
    • Various Ulama (Islamic Scholars): Mentioned throughout the text as representing traditional Islamic thought and interpretations. Their consensus (Ijma) is often challenged by modernist thinkers.
    • The Modernists (and “Midwives of Modernism”): This is a broad group encompassing those who seek to reconcile Islam with modernity, often by reinterpreting scripture and tradition. It includes figures like Ghamidi and, by extension, those who have adopted his ideas.

    Key Themes & Concepts

    • Modernity vs. Tradition: The central conflict throughout the text, focusing on the tension between adhering to traditional interpretations of Islam and adapting to modern values and thought.
    • Interpretation of Religious Texts: Much debate centers on who has the authority to interpret the Quran and Hadith and how those texts should be understood in the modern era.
    • Reason vs. Divine Authority: Modernist thinkers are presented as prioritizing reason and human intellect, sometimes over traditional interpretations of religious texts.
    • The Role of the Hadith: One major point of contention is whether Hadith, the sayings and actions of the Prophet, are integral to understanding Islam or if they should be reinterpreted or rejected.
    • Women’s Rights and Modesty: Traditional views on women’s roles and modesty are challenged by those seeking greater gender equality and individual freedoms.
    • Financial Matters (Riba/Interest): The debate over the permissibility of interest in banking is a case study on how modernist and traditionalist views clash when applying religious rulings to modern economic systems.
    • Influence of Western Institutions: The Rand Corporation’s involvement showcases how Western institutions are taking an active role in influencing Islamic discourse and promoting certain types of Islamic thought.

    Let me know if you’d like more clarification on any of these points.

    Islamic Modernism: A Critical Analysis

    Islamic modernism is a complex topic with varied interpretations and approaches [1-3]. The sources discuss it in the context of a debate between traditional Islamic views and more contemporary perspectives [1, 2, 4]. Here’s a breakdown of key aspects of Islamic modernism discussed in the sources:

    • Core Ideas of Islamic Modernism:
    • Reinterpretation of Islamic Texts: Modernists seek to reinterpret the Quran and Hadith to make them relevant to modern times [2, 5, 6]. This involves questioning traditional interpretations and offering new perspectives [2, 7].
    • Emphasis on Reason and Intellect: Modernists often prioritize reason and human intellect in understanding Islamic teachings [8, 9]. They may view reason as a tool for interpreting religious texts [9].
    • Focus on Progress: Modernists believe that Islam is not an impediment to progress and that Muslims can embrace modernity while remaining faithful to their religion [3, 10, 11].
    • Adaptation to Modernity: There is a desire to adapt Islam to modern values and norms, including those relating to technology, science and culture [10, 12, 13].
    • Key Themes and Issues:
    • Modernity vs. Tradition: The central conflict is between those who adhere to traditional interpretations and practices of Islam and those who seek to modernize it [1-3, 10]. Some view modernism as a threat to Islam, while others see it as a necessary step for the faith to thrive in the modern world [1, 2, 4].
    • The Role of Hadith: Some modernists question the authority of Hadith, or at least certain interpretations of it [2, 4, 9, 14]. Some may prioritize the Quran over Hadith or suggest that some Hadith are not applicable in modern times [2, 4, 9, 14].
    • Humanity: Islamic modernists emphasize the value of human beings, sometimes to the point of prioritizing human needs and desires over traditional religious interpretations [8, 9].
    • The Influence of Western Thought: Western thought and culture have influenced some modernist ideas, particularly concepts like liberalism and secularism [7, 14].
    • Gender Equality: Some modernists advocate for greater gender equality, challenging traditional interpretations of Islamic teachings on women’s rights [5, 15-17]. This may involve questioning traditional views on women’s roles, dress, and rights within the family and society [5, 15, 16].
    • Financial Matters: Islamic modernists have offered new interpretations of traditional financial rules, including the prohibition of interest (riba) [18-20].
    • Freedom of Worship: Modernists often support freedom of worship and interfaith dialogue [5, 11].
    • Critiques of Modernism:
    • Undermining Traditional Teachings: Critics argue that modernists are undermining the core principles and teachings of Islam by reinterpreting texts and prioritizing human reason [2, 6, 7].
    • Westernization: Some believe that modernism is a form of westernization that dilutes Islam [10].
    • Selective Interpretation: Some argue that modernists selectively interpret Islamic texts to fit their own agendas [2, 7, 14].
    • Disregard for Consensus: Some modernists are criticized for disregarding the consensus of the broader Muslim community (Ijma) [6, 7, 15].
    • Internal Contradictions: Modernist views can be inconsistent and contradictory, raising questions about the authenticity of their approach [18-20].
    • The Role of Key Figures:
    • Javed Ahmad Ghamidi: The sources mention Javed Ahmad Ghamidi as a prominent figure associated with Islamic modernism [1, 2, 14, 18]. His views on Hadith, interest, and other issues are discussed [2, 4, 18, 19].
    • Hasan Ilyas: Hasan Ilyas is also mentioned as a contemporary figure who is challenging some of Ghamidi’s views and presenting Islam in an accessible way [2, 4, 21]
    • Modernism as a Strategy:
    • Some sources suggest that modernism is a strategy promoted by Western think tanks to influence Islamic societies [22-24]. They may support moderate Muslims and fund media outlets that promote modernist interpretations of Islam [23, 24].
    • These sources argue that Western powers aim to weaken traditional Islamic practices and values and promote a more secular, Western-aligned version of Islam [23-25].
    • Practical Implications:
    • The sources note that modernist interpretations are gaining traction, particularly among the youth and women [1, 26]. This has practical implications for Islamic societies [13, 21, 26].

    In conclusion, Islamic modernism is a contested and multifaceted movement that involves reinterpreting Islamic teachings in light of modern values and conditions. While some see it as a necessary evolution of the faith, others view it as a dangerous departure from tradition. The debate between these perspectives is ongoing [1-3]

    Hadith and Islamic Modernism

    The importance of Hadith is a contested issue within the context of Islamic modernism, as seen in the sources [1-3]. Here’s a breakdown of the different perspectives:

    • Traditional View:
    • Hadith, which are accounts of the Prophet Muhammad’s sayings and actions, are considered a vital source of Islamic law and guidance, second only to the Quran [1, 4-7].
    • Many Muslims believe that Hadith are essential for understanding and applying the Quran’s teachings [1, 4, 6, 7].
    • The consensus of the Ulama (religious scholars) on an issue is very important and should be followed. [5, 6].
    • Modernist View:
    • Questioning Authority: Some Islamic modernists question the authority and authenticity of Hadith, or at least some interpretations of it [1, 3-5, 8-10].
    • Prioritizing the Quran: Modernists may prioritize the Quran over Hadith, arguing that the Quran is the ultimate source of authority and that Hadith should be interpreted in light of the Quran [4, 6, 11].
    • Rejecting Certain Hadith: Some modernists may reject certain Hadith that they believe contradict reason, modern values, or the core principles of Islam [1, 3-5, 8-10].
    • Reinterpretation: Modernists often seek to reinterpret Hadith to make them relevant to modern times [1, 3]. They may argue that some Hadith were specific to the Prophet’s time and are not universally applicable [1, 12, 13].
    • Points of Contention:
    • Authenticity: There are disagreements about the authenticity and reliability of some Hadith [3, 4].
    • Interpretation: Even when the authenticity of a Hadith is accepted, there are different interpretations and applications of the Hadith to current issues, and modernists disagree with traditional interpretations [1, 3, 4, 6].
    • Reason vs. Hadith: Modernists sometimes prioritize human reason over traditional interpretations of Hadith [4].
    • Consensus (Ijma): Some modernists may not give importance to the consensus of the Muslim scholars on a matter [5, 6].
    • Specific Examples:
    • Javed Ahmad Ghamidi is presented as a figure who questions the importance of Hadith in some contexts and is shown to have said, “Hadith has no importance for me,” and “There is no need for you to tell me which issue it is, is there any need of hadith” [1, 3].
    • The sources note that some modernists may also attack Hadith directly [8].
    • Some modernists are portrayed as believing that they are “not bound” by Hadith [1].
    • Hasan Ilyas is mentioned as having openly challenged Ghamidi’s views on Hadith [3].
    • The sources discuss the idea that some modernists are “placing reason above the Qur’an and Hadith” [4].
    • Consequences of Questioning Hadith:
    • Critics argue that questioning Hadith can undermine the foundations of Islamic law and practice [4, 5, 7, 8].
    • The sources present concerns that such approaches can result in the “destruction of Islam” [1].

    In summary, the importance of Hadith is a key point of contention between traditionalists and modernists within Islam. While traditionalists consider Hadith a vital source of guidance, some modernists question their authority or seek to reinterpret them. This difference in perspective has implications for many aspects of Islamic belief and practice.

    Jadid Interpretations of Islam

    The sources use the term Jadid to refer to modernist interpretations of Islam, and it is often contrasted with traditional understandings of the faith [1-3]. Here’s a breakdown of the key aspects of Jadid interpretations as discussed in the sources:

    • Core Characteristics of Jadid Interpretations:
    • Newness and Innovation: Jadid literally means “new” in Urdu [4], and it signifies a departure from traditional Islamic thought. It emphasizes the need for fresh perspectives and approaches to Islam [2, 3].
    • Relevance to Modern Times: Jadid interpretations seek to make Islam relevant to contemporary society [3, 5]. This involves re-evaluating traditional Islamic teachings in light of modern values, knowledge, and circumstances [3].
    • Emphasis on Reason: Jadid thinkers prioritize human reason and intellect in understanding Islam [6, 7]. They often believe that reason should guide the interpretation of religious texts [7].
    • Focus on Humanism: Jadid interpretations often emphasize the importance of human beings and human needs. They may prioritize human welfare over strict adherence to traditional religious rules and practices [6].
    • Flexibility and Adaptability: Jadid approaches tend to be more flexible and adaptable than traditional interpretations. They are willing to modify or reinterpret religious rules and practices to fit modern contexts [3, 4].
    • Challenge to Tradition: Jadid interpretations often challenge established traditions and interpretations of Islam. They may question the authority of religious scholars and seek to establish new understandings of faith [3, 8].
    • Redefinition of Islamic Concepts: Jadid thinkers often redefine or reinterpret core Islamic concepts, such as the meaning of worship, the role of women, and the nature of God [9].
    • Specific Examples of Jadid Interpretations:
    • Reinterpreting Hadith: Jadid approaches often involve reinterpreting or questioning the authority of Hadith. Some may argue that certain Hadith are not applicable in modern times or that they should be interpreted in light of reason and the Quran [1, 3].
    • Redefining the Role of Women: Jadid interpretations often advocate for greater gender equality and challenge traditional views on women’s roles in society [9, 10]. This can include re-evaluating traditional Islamic dress codes and restrictions on women’s activities [11]. For instance, it is suggested that the minimum requirement for women’s dress is a scarf on the head [11].
    • Rethinking Financial Matters: Jadid thinkers have offered new interpretations of Islamic financial rules, including those relating to interest (riba). Some may argue that paying interest is not necessarily forbidden in modern times [12, 13].
    • Redefining concepts of Halal and Haram: Jadid thinkers are portrayed as making religion easy by limiting the list of things that are considered haram, which is in contrast to traditional interpretations that may be more strict [14, 15].
    • Promoting Freedom of Worship: Jadid interpretations often support freedom of worship and interfaith dialogue, sometimes suggesting that people of other faiths may also go to heaven [16].
    • Motivations Behind Jadid Interpretations:
    • Responding to Modern Challenges: Jadid interpretations are often seen as a response to the challenges and complexities of the modern world [2, 5]. They seek to address issues that traditional interpretations may not adequately address [17].
    • Seeking Progress and Development: Jadid thinkers often believe that Islam should not be an obstacle to progress and development. They want to make Islam compatible with modern advancements [4].
    • Influence of Western Thought: The sources also suggest that Jadid interpretations are influenced by Western thought and culture, particularly concepts such as liberalism and secularism [5, 8].
    • Criticisms of Jadid Interpretations:
    • Undermining Tradition: Critics argue that Jadid interpretations undermine the foundations of traditional Islamic belief and practice [4, 18]. They may view it as a departure from the true teachings of Islam [19].
    • Selective Interpretation: Critics claim that Jadid thinkers selectively interpret Islamic texts to fit their own agendas [18, 20]. They may accuse them of distorting religious teachings to align with their personal preferences or with Western ideals [8].
    • Disregarding Consensus: Some Jadid thinkers are criticized for disregarding the consensus of the broader Muslim community (Ijma) and the traditional understanding of religious texts [8, 19].
    • Potential for Misguidance: Critics are concerned that Jadid interpretations may lead people astray from the true path of Islam.
    • Western Agenda: Some sources suggest that Jadid interpretations are part of a larger Western strategy to weaken Islam by supporting those who promote a more secular and Western-aligned version of Islam [21, 22].
    • Key Figures and Movements:
    • Javed Ahmad Ghamidi: is identified as a prominent figure associated with Jadid interpretations. His views on Hadith, interest, and other issues are discussed as examples of Jadid thought [2, 3].
    • Hasan Ilyas: is presented as someone who is challenging some of Ghamidi’s views and presenting Islam in an accessible way [3, 23, 24].
    • Modernist Movements: The sources indicate that Jadid interpretations are part of a broader modernist movement within Islam [23].

    In conclusion, Jadid interpretations represent a significant trend within contemporary Islam. They are characterized by a willingness to reinterpret religious teachings in light of modern values and circumstances, with an emphasis on reason and humanism. However, these interpretations are also the subject of considerable debate, with critics raising concerns about their impact on traditional Islamic belief and practice.

    Modernity’s Challenge to Traditional Islam

    Modernity presents a range of challenges to traditional Islamic beliefs and practices, as depicted in the sources. These challenges manifest in various ways, impacting interpretations of religious texts, societal norms, and the very core of Islamic identity. Here’s a breakdown of these challenges:

    • Clash of Worldviews:
    • Modern vs. Traditional: The sources highlight a fundamental tension between a “modern” worldview and traditional Islamic perspectives [1, 2]. This tension is characterized by differing views on the importance of reason, the interpretation of religious texts, and the application of Islamic law.
    • Technology and Science: Modernity is associated with technological advancements and scientific discoveries [2, 3]. These can sometimes clash with traditional understandings of the world and religious teachings, leading to challenges in how to reconcile the two.
    • Western Influence: Modernity is often seen as being linked to Western culture, values and ways of life, such as liberalism and secularism, which are seen as potentially undermining traditional Islamic norms [3-5].
    • Challenges to Religious Authority:
    • Questioning of Hadith: Modernity has led to a questioning of the authority and interpretation of Hadith, which is a key source of Islamic law and guidance [1, 6]. Modernists may prioritize reason or the Quran over Hadith, which is a challenge to the traditional view [7].
    • Reinterpretation of Texts: Modernists engage in reinterpreting the Quran and Sunnah in light of modern contexts, which can lead to new understandings that differ from traditional interpretations [3, 6, 8].
    • Challenge to Ijma: Modernists may not give importance to the consensus of the broader Muslim community (Ijma), or the traditional understanding of religious texts, which is a key source of Islamic law for the traditional view [8, 9].
    • Role of Religious Scholars: Modernity challenges the traditional authority of religious scholars, with modernists sometimes questioning their interpretations and advocating for direct engagement with religious texts [10].
    • Societal and Cultural Challenges:
    • Changing Gender Roles: Modernity has led to changing views on gender roles, challenging traditional Islamic norms regarding women’s rights, dress, and social participation. Modernist interpretations often advocate for greater gender equality [11-15].
    • Individual Freedom: Modernity emphasizes individual freedom and autonomy, which can clash with traditional Islamic views that may place greater emphasis on community and religious obligations [9, 16].
    • Secularism and Liberalism: The influence of secularism and liberalism challenges the role of religion in public life and individual conduct, leading to debates about how Islam should adapt to a more secular world [9].
    • Financial Matters: Modernity’s economic structures, such as interest-based banking, pose challenges to traditional Islamic financial principles, leading to new interpretations of Islamic law on these issues [17-19].
    • Cultural Norms: The sources suggest that modern interpretations of Islam may try to align with local cultural norms, such as those in Pakistan [13].
    • Specific Issues and Debates:
    • The concept of Jadid: The sources depict Jadid as the new, or modern way, of interpreting Islam, which often contrasts with traditional interpretations [3, 20, 21].
    • Halal and Haram: Modernists are portrayed as making religion easier by limiting the list of things that are considered haram (forbidden), in contrast to traditional interpretations which may have a stricter view [10, 16].
    • Dress and Modesty: The sources discuss how modern interpretations approach issues of dress and modesty, particularly regarding women and the hijab [12, 13, 16]. Some modernists may argue that the minimum requirement for women’s dress is a scarf on the head, while others are more strict.
    • Travel and Mahram: Traditional views require women to travel with a male guardian (mahram). Modernists may challenge these restrictions, arguing they are no longer necessary in modern times when travel is safer [15, 22].
    • Interfaith Dialogue: Some modernists promote interfaith dialogue and may suggest that non-Muslims can also attain salvation, which is a challenge to more traditional views that may see Islam as the only true path [11, 23].
    • New Forms of Entertainment and Media: Modern forms of entertainment and media can be seen as posing challenges to traditional Islamic values. The sources suggest that some people try to use these modern platforms to present new interpretations of Islam [24, 25].
    • Consequences of Modern Interpretations:
    • Internal Divisions: These challenges and differing interpretations create internal divisions and disagreements within the Muslim community, between traditionalists and modernists [5, 10, 20, 26].
    • Accusations of Deviance: Traditionalists often view modern interpretations as a deviation from the true path of Islam [3, 10, 27].
    • Influence of External Agendas: Some sources suggest that some modern interpretations of Islam are supported by outside organizations with their own goals [24, 28].
    • Erosion of Tradition: Critics worry that modern interpretations erode important aspects of tradition which are seen as essential to Islam.

    In summary, modernity presents a complex set of challenges to traditional Islam. These challenges encompass a wide range of issues, from the interpretation of religious texts to the application of Islamic law in modern society, with a significant impact on the role of women. The tension between traditional and modern viewpoints creates divisions within the Muslim community, and there are debates about how Islam should adapt to the changing world.

    Islamic Reform: Tradition and Modernity in Tension

    Religious reform, as portrayed in the sources, is a complex and contested process, primarily centered on the tension between traditional interpretations of Islam and modern, or Jadid, perspectives [1-3]. The sources present a picture of ongoing efforts to reinterpret and adapt religious teachings to contemporary contexts, while also highlighting the challenges and controversies associated with such reforms.

    Here’s a breakdown of key themes related to religious reform that are discussed in the sources:

    • The Nature of Religious Reform:
    • Modernization (Jadid) as Reform: The sources frequently use the term Jadid to describe a movement toward modernizing religious interpretations [1-3]. This involves reevaluating traditional Islamic teachings in light of modern values, knowledge, and circumstances. It’s seen as an effort to make Islam relevant and compatible with the modern world [2].
    • Reinterpretation, not Rejection: It’s important to note that reform, as described in the sources, does not necessarily mean a complete rejection of traditional Islam. Rather, it often involves reinterpreting religious texts and practices [2, 3].
    • Emphasis on Reason: The sources show that reformers tend to emphasize the role of human reason in understanding religious texts. They believe that reason should guide interpretations and inform the application of Islamic teachings in modern contexts [2, 3].
    • Key Areas of Reform:
    • Hadith: There are challenges to the traditional authority of Hadith [1, 3]. Reformers may question the authenticity or relevance of certain Hadith in modern times, or they may offer new interpretations that align with modern values and reason.
    • Role of Women: This is a key area of reform, with calls for greater gender equality and a reevaluation of traditional Islamic dress codes and restrictions on women’s activities [1-3]. Some reformers may argue for less strict interpretations of hijab or for women’s right to travel without a male guardian (mahram), or that it is permissible to work in mixed-gender environments [2-5].
    • Financial Matters: Traditional Islamic finance principles, particularly regarding interest (riba), are challenged. Reformers may seek to find ways to make Islamic finance compatible with modern economic systems, sometimes reinterpreting what is prohibited in Islam related to financial matters [2, 3, 6].
    • Halal and Haram: Some reformers are portrayed as limiting the list of things that are considered haram (forbidden), which is in contrast to traditional interpretations that may be more strict [7, 8].
    • Interfaith Dialogue: Some reformers promote interfaith dialogue and may suggest that non-Muslims can also attain salvation [9-11].
    • Motivations for Reform:
    • Response to Modernity: Reform is often presented as a response to the challenges and complexities of the modern world, including the influence of Western culture and values [2, 3, 12]. Reformers seek to address issues that traditional interpretations may not adequately address [2, 3].
    • Seeking Progress: Reformers believe that Islam should not be an obstacle to progress and development. They want to make Islam compatible with modern advancements in science, technology, and society [3, 12-14].
    • Addressing Perceived Injustices: Some reforms are motivated by a desire to address perceived injustices within traditional Islamic societies, such as gender inequality or restrictions on individual freedoms [2, 3, 5, 9-11].
    • Controversies and Opposition to Reform:
    • Challenges to Tradition: Religious reform is often met with resistance from those who view it as a threat to established traditions and interpretations. Critics accuse reformers of undermining the foundations of Islam by selectively interpreting religious texts [2, 3, 14].
    • Accusations of Deviance: Reformers are often accused of deviating from the true path of Islam and following their own desires [15-19].
    • Influence of External Agendas: Critics sometimes claim that reformers are influenced by outside agendas (for example, western organizations) and are not acting in the best interests of Islam [9, 18-20].
    • Disregarding Ijma: Some reformers are criticized for disregarding the consensus of the broader Muslim community (Ijma), or the traditional understanding of religious texts [2, 3, 8, 15, 17, 21].
    • Specific Examples of Reformers and Movements:
    • Javed Ahmad Ghamidi: Ghamidi is portrayed as a key figure associated with Jadid interpretations [1-3]. His views on Hadith, interest, and other issues are discussed as examples of Jadid thought [3, 6, 7, 15-17, 22-28].
    • Hasan Ilyas: is portrayed as someone who is challenging some of Ghamidi’s views and presenting Islam in an accessible way [1, 3, 25].
    • Modernist Movements: The sources indicate that Jadid interpretations are part of a broader modernist movement within Islam [1-3, 9, 10, 12-20, 29-31].
    • Reform as a Political Act
    • The Role of Outside Actors: The sources also portray a view that some religious reform is driven by outside actors who are not interested in the best interests of Islam or Muslims [18, 19].
    • Government Policies: The sources imply that there are countries (like Saudi Arabia) that want to move toward modern interpretations in order to be more progressive [1, 13].

    In conclusion, religious reform, as described in the sources, is an ongoing process characterized by efforts to reinterpret traditional Islamic teachings in light of modern values and circumstances. While some see these reforms as necessary to ensure the relevance of Islam in the modern world, others view them as a threat to the foundations of the faith. The tension between traditional and modern viewpoints creates divisions within the Muslim community, and there are debates about the motives and consequences of these changes.

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

  • Surah Younus Tafseer by Syed Abu-al-Ala Maudoodi

    Surah Younus Tafseer by Syed Abu-al-Ala Maudoodi

    YouTube Link

    10-Surah Younus Tafseer
    https://www.youtube.com/watch?v=a5Nonp9cw0U

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

  • Surah Tauba Tafseer by Syed Abu-al-Ala Maudoodi

    Surah Tauba Tafseer by Syed Abu-al-Ala Maudoodi

    YouTube Link

    9-Surah Tauba Tafseer
    https://www.youtube.com/watch?v=4gD_PTy1J2w

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

  • Surah Al-Anfaal Tafseer by Syed Abu-al-Ala Maudoodi

    Surah Al-Anfaal Tafseer by Syed Abu-al-Ala Maudoodi

    YouTube Link

    8-Surah Anfal
    https://www.youtube.com/watch?v=KzNrn7Ql2ZA

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