chore: update roadmap content json (#8397)

Co-authored-by: kamranahmedse <4921183+kamranahmedse@users.noreply.github.com>
pull/8407/head
github-actions[bot] 1 week ago committed by GitHub
parent e362d4250e
commit cda2be543d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 84
      public/roadmap-content/ai-engineer.json
  2. 19
      public/roadmap-content/angular.json
  3. 4
      public/roadmap-content/api-design.json
  4. 44
      public/roadmap-content/aspnet-core.json
  5. 5
      public/roadmap-content/backend.json
  6. 19
      public/roadmap-content/computer-science.json
  7. 106
      public/roadmap-content/cpp.json
  8. 2
      public/roadmap-content/cyber-security.json
  9. 10
      public/roadmap-content/devops.json
  10. 15
      public/roadmap-content/engineering-manager.json
  11. 15
      public/roadmap-content/game-developer.json
  12. 55
      public/roadmap-content/java.json
  13. 2
      public/roadmap-content/javascript.json
  14. 163
      public/roadmap-content/mlops.json
  15. 5
      public/roadmap-content/nodejs.json
  16. 4
      public/roadmap-content/php.json
  17. 7
      public/roadmap-content/python.json
  18. 20
      public/roadmap-content/qa.json
  19. 12
      public/roadmap-content/sql.json
  20. 7
      public/roadmap-content/system-design.json
  21. 5
      public/roadmap-content/typescript.json

@ -30,7 +30,7 @@
"type": "article"
},
{
"title": "AI engineers: What they do and how to become one",
"title": "AI Engineers: What they do and how to become one",
"url": "https://www.techtarget.com/whatis/feature/How-to-become-an-artificial-intelligence-engineer",
"type": "article"
}
@ -162,17 +162,17 @@
"description": "Retrieval-Augmented Generation (RAG) is an AI approach that combines information retrieval with language generation to create more accurate, contextually relevant outputs. It works by first retrieving relevant data from a knowledge base or external source, then using a language model to generate a response based on that information. This method enhances the accuracy of generative models by grounding their outputs in real-world data, making RAG ideal for tasks like question answering, summarization, and chatbots that require reliable, up-to-date information.\n\nLearn more from the following resources:",
"links": [
{
"title": "What is Retrieval Augmented Generation (RAG)?",
"title": "What is Retrieval Augmented Generation (RAG)? - Datacamp",
"url": "https://www.datacamp.com/blog/what-is-retrieval-augmented-generation-rag",
"type": "article"
},
{
"title": "What is Retrieval-Augmented Generation? Google",
"title": "What is Retrieval-Augmented Generation? - Google",
"url": "https://cloud.google.com/use-cases/retrieval-augmented-generation",
"type": "article"
},
{
"title": "What is Retrieval-Augmented Generation? IBM",
"title": "What is Retrieval-Augmented Generation? - IBM",
"url": "https://www.youtube.com/watch?v=T-D1OfcDW1M",
"type": "video"
}
@ -183,7 +183,7 @@
"description": "Prompt engineering is the process of crafting effective inputs (prompts) to guide AI models, like GPT, to generate desired outputs. It involves strategically designing prompts to optimize the model’s performance by providing clear instructions, context, and examples. Effective prompt engineering can improve the quality, relevance, and accuracy of responses, making it essential for applications like chatbots, content generation, and automated support. By refining prompts, developers can better control the model’s behavior, reduce ambiguity, and achieve more consistent results, enhancing the overall effectiveness of AI-driven systems.\n\nLearn more from the following resources:",
"links": [
{
"title": "Visit DedicatedPrompt Engineering Roadmap",
"title": "Visit Dedicated Prompt Engineering Roadmap",
"url": "https://roadmap.sh/prompt-engineering",
"type": "article"
},
@ -204,7 +204,7 @@
"type": "article"
},
{
"title": "Ai agents and their types",
"title": "AI Agents and Their Types",
"url": "https://play.ht/blog/ai-agents-use-cases/",
"type": "article"
},
@ -359,7 +359,7 @@
"description": "Anthropic's Claude is an AI language model designed to facilitate safe and scalable AI systems. Named after Claude Shannon, the father of information theory, Claude focuses on responsible AI use, emphasizing safety, alignment with human intentions, and minimizing harmful outputs. Built as a competitor to models like OpenAI's GPT, Claude is designed to handle natural language tasks such as generating text, answering questions, and supporting conversations, with a strong focus on aligning AI behavior with user goals while maintaining transparency and avoiding harmful biases.\n\nLearn more from the following resources:",
"links": [
{
"title": "Claude Website",
"title": "Claude",
"url": "https://claude.ai",
"type": "article"
},
@ -439,7 +439,7 @@
"description": "Mistral AI is a company focused on developing open-weight, large language models (LLMs) to provide high-performance AI solutions. Mistral aims to create models that are both efficient and versatile, making them suitable for a wide range of natural language processing tasks, including text generation, translation, and summarization. By releasing open-weight models, Mistral promotes transparency and accessibility, allowing developers to customize and deploy AI solutions more flexibly compared to proprietary models.\n\nLearn more from the resources:",
"links": [
{
"title": "Minstral AI Website",
"title": "Mistral AI",
"url": "https://mistral.ai/",
"type": "article"
},
@ -455,7 +455,7 @@
"description": "Cohere is an AI platform that specializes in natural language processing (NLP) by providing large language models designed to help developers build and deploy text-based applications. Cohere’s models are used for tasks such as text classification, language generation, semantic search, and sentiment analysis. Unlike some other providers, Cohere emphasizes simplicity and scalability, offering an easy-to-use API that allows developers to fine-tune models on custom data for specific use cases. Additionally, Cohere provides robust multilingual support and focuses on ensuring that its NLP solutions are both accessible and enterprise-ready, catering to a wide range of industries.\n\nLearn more from the following resources:",
"links": [
{
"title": "Cohere Website",
"title": "Cohere",
"url": "https://cohere.com/",
"type": "article"
},
@ -482,7 +482,7 @@
"description": "The OpenAI API provides access to powerful AI models like GPT, Codex, DALL-E, and Whisper, enabling developers to integrate capabilities such as text generation, code assistance, image creation, and speech recognition into their applications via a simple, scalable interface.\n\nLearn more from the following resources:",
"links": [
{
"title": "Open AI API",
"title": "OpenAI API",
"url": "https://openai.com/api/",
"type": "article"
}
@ -514,7 +514,7 @@
"type": "article"
},
{
"title": "How to write AI prompts",
"title": "How to Write AI prompts",
"url": "https://www.descript.com/blog/article/how-to-write-ai-prompts",
"type": "article"
},
@ -626,7 +626,7 @@
"type": "article"
},
{
"title": "What is a prompt injection attack?",
"title": "What is a Prompt Injection Attack?",
"url": "https://www.wiz.io/academy/prompt-injection-attack",
"type": "article"
}
@ -706,7 +706,7 @@
"description": "Sending end-user IDs in your requests can be a useful tool to help OpenAI monitor and detect abuse. This allows OpenAI to provide your team with more actionable feedback in the event that we detect any policy violations in your application.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Sending end-user IDs - OpenAi",
"title": "Sending End-user IDs - OpenAI",
"url": "https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids",
"type": "article"
}
@ -792,7 +792,7 @@
"description": "Open-source large language models (LLMs) are models whose source code and architecture are publicly available for use, modification, and distribution. They are built using machine learning algorithms that process and generate human-like text, and being open-source, they promote transparency, innovation, and community collaboration in their development and application.\n\nLearn more from the following resources:",
"links": [
{
"title": "The best large language models (LLMs) in 2024",
"title": "The Best Large Language Models (LLMs) in 2024",
"url": "https://zapier.com/blog/best-llm/",
"type": "article"
},
@ -813,7 +813,7 @@
"type": "course"
},
{
"title": "Hugging Face Website",
"title": "Hugging Face",
"url": "https://huggingface.co",
"type": "article"
},
@ -898,7 +898,7 @@
"description": "Ollama is a platform that offers large language models (LLMs) designed to run locally on personal devices, enabling AI functionality without relying on cloud services. It focuses on privacy, performance, and ease of use by allowing users to deploy models directly on laptops, desktops, or edge devices, providing fast, offline AI capabilities. With tools like the Ollama SDK, developers can integrate these models into their applications for tasks such as text generation, summarization, and more, benefiting from reduced latency, greater data control, and seamless local processing.\n\nLearn more from the following resources:",
"links": [
{
"title": "Ollama Website",
"title": "Ollama",
"url": "https://ollama.com/",
"type": "article"
},
@ -983,12 +983,12 @@
"description": "In the context of embeddings, recommendation systems use vector representations to capture similarities between items, such as products or content. By converting items and user preferences into embeddings, these systems can measure how closely related different items are based on vector proximity, allowing them to recommend similar products or content based on a user's past interactions. This approach improves recommendation accuracy and efficiency by enabling meaningful, scalable comparisons of complex data.\n\nLearn more from the following resources:",
"links": [
{
"title": "What role does AI play in recommendation systems and engines?",
"title": "What Role does AI Play in Recommendation Systems and Engines?",
"url": "https://www.algolia.com/blog/ai/what-role-does-ai-play-in-recommendation-systems-and-engines/",
"type": "article"
},
{
"title": "What is a recommendation engine?",
"title": "What is a Recommendation Engine?",
"url": "https://www.ibm.com/think/topics/recommendation-engine",
"type": "article"
}
@ -1009,6 +1009,11 @@
"title": "Data Classification",
"description": "Once data is embedded, a classification algorithm, such as a neural network or a logistic regression model, can be trained on these embeddings to classify the data into different categories. The advantage of using embeddings is that they capture underlying relationships and similarities between data points, even if the raw data is complex or high-dimensional, improving classification accuracy in tasks like text classification, image categorization, and recommendation systems.\n\nLearn more from the following resources:",
"links": [
{
"title": "What Is Data Classification?",
"url": "https://www.paloaltonetworks.com/cyberpedia/data-classification",
"type": "article"
},
{
"title": "Text Embeddings, Classification, and Semantic Search (w/ Python Code)",
"url": "https://www.youtube.com/watch?v=sNa_uiqSlJo",
@ -1050,10 +1055,10 @@
},
"4GArjDYipit4SLqKZAWDf": {
"title": "Pricing Considerations",
"description": "The pricing for the OpenAI Embedding API is based on the number of tokens processed and the specific embedding model used. Costs are determined by the total tokens needed to generate embeddings, so longer texts will result in higher charges. To manage costs, developers can optimize by shortening inputs or batching requests. Additionally, selecting the right embedding model for your performance and budget requirements, along with monitoring token usage, can help control expenses.",
"description": "The pricing for the OpenAI Embedding API is based on the number of tokens processed and the specific embedding model used. Costs are determined by the total tokens needed to generate embeddings, so longer texts will result in higher charges. To manage costs, developers can optimize by shortening inputs or batching requests. Additionally, selecting the right embedding model for your performance and budget requirements, along with monitoring token usage, can help control expenses.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "OpenAI API Pricing",
"title": "OpenAI Pricing",
"url": "https://openai.com/api/pricing/",
"type": "article"
}
@ -1061,8 +1066,19 @@
},
"apVYIV4EyejPft25oAvdI": {
"title": "Open-Source Embeddings",
"description": "Open-source embeddings are pre-trained vector representations of data, usually text, that are freely available for use and modification. These embeddings capture semantic meanings, making them useful for tasks like semantic search, text classification, and clustering. Examples include Word2Vec, GloVe, and FastText, which represent words as vectors based on their context in large corpora, and more advanced models like Sentence-BERT and CLIP that provide embeddings for sentences and images. Open-source embeddings allow developers to leverage pre-trained models without starting from scratch, enabling faster development and experimentation in natural language processing and other AI applications.",
"links": []
"description": "Open-source embeddings are pre-trained vector representations of data, usually text, that are freely available for use and modification. These embeddings capture semantic meanings, making them useful for tasks like semantic search, text classification, and clustering. Examples include Word2Vec, GloVe, and FastText, which represent words as vectors based on their context in large corpora, and more advanced models like Sentence-BERT and CLIP that provide embeddings for sentences and images. Open-source embeddings allow developers to leverage pre-trained models without starting from scratch, enabling faster development and experimentation in natural language processing and other AI applications.\n\nLearn more from the following resources:",
"links": [
{
"title": "Embeddings",
"url": "https://platform.openai.com/docs/guides/embeddings",
"type": "article"
},
{
"title": "A Guide to Open-Source Embedding Models",
"url": "https://www.bentoml.com/blog/a-guide-to-open-source-embedding-models",
"type": "article"
}
]
},
"ZV_V6sqOnRodgaw4mzokC": {
"title": "Sentence Transformers",
@ -1288,8 +1304,14 @@
},
"ZcbRPtgaptqKqWBgRrEBU": {
"title": "Performing Similarity Search",
"description": "In a similarity search, the process begins by converting the user’s query (such as a piece of text or an image) into an embedding—a vector representation that captures the query’s semantic meaning. This embedding is generated using a pre-trained model, such as BERT for text or a neural network for images. Once the query is converted into a vector, it is compared to the embeddings stored in the vector database.",
"links": []
"description": "In a similarity search, the process begins by converting the user’s query (such as a piece of text or an image) into an embedding—a vector representation that captures the query’s semantic meaning. This embedding is generated using a pre-trained model, such as BERT for text or a neural network for images. Once the query is converted into a vector, it is compared to the embeddings stored in the vector database.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "What is Similarity Search & How Does it work?",
"url": "https://www.truefoundry.com/blog/similarity-search",
"type": "article"
}
]
},
"lVhWhZGR558O-ljHobxIi": {
"title": "RAG & Implementation",
@ -1396,7 +1418,7 @@
"type": "article"
},
{
"title": "Retrieval Augmented Generation (RAG) with vector databases: Expanding AI Capabilities",
"title": "Retrieval Augmented Generation (RAG) with Vector Databases: Expanding AI Capabilities",
"url": "https://objectbox.io/retrieval-augmented-generation-rag-with-vector-databases-expanding-ai-capabilities/",
"type": "article"
}
@ -1508,7 +1530,7 @@
"description": "Replicate is a platform that allows developers to run machine learning models in the cloud without needing to manage infrastructure. It provides a simple API for deploying and scaling models, making it easy to integrate AI capabilities like image generation, text processing, and more into applications. Users can select from a library of pre-trained models or deploy their own, with the platform handling tasks like scaling, monitoring, and versioning.\n\nLearn more from the following resources:",
"links": [
{
"title": "Replicate Website",
"title": "Replicate",
"url": "https://replicate.com/",
"type": "article"
},
@ -1529,7 +1551,7 @@
"type": "article"
},
{
"title": "Ai agents and their types",
"title": "AI agents and their types",
"url": "https://play.ht/blog/ai-agents-use-cases/",
"type": "article"
},
@ -1662,7 +1684,7 @@
"description": "Multimodal AI enhances image understanding by integrating visual data with other types of information, such as text or audio. By combining these inputs, AI models can interpret images more comprehensively, recognizing objects, scenes, and actions, while also understanding context and related concepts. For example, an AI system could analyze an image and generate descriptive captions, or provide explanations based on both visual content and accompanying text.\n\nLearn more from the following resources:",
"links": [
{
"title": "Low or high fidelity image understanding - OpenAI",
"title": "Low or High Fidelity Image Understanding - OpenAI",
"url": "https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding",
"type": "article"
}
@ -1673,7 +1695,7 @@
"description": "Image generation is a process in artificial intelligence where models create new images based on input prompts or existing data. It involves using generative models like GANs (Generative Adversarial Networks), VAEs (Variational Autoencoders), or more recently, transformer-based models like DALL-E and Stable Diffusion.\n\nLearn more from the following resources:",
"links": [
{
"title": "DALL-E Website",
"title": "DALL-E",
"url": "https://openai.com/index/dall-e-2/",
"type": "article"
},
@ -1827,7 +1849,7 @@
"description": "LangChain is a framework designed to build applications that integrate multiple AI models, especially those focusing on language understanding, generation, and multimodal capabilities. For multimodal apps, LangChain facilitates seamless interaction between text, image, and even audio models, enabling developers to create complex workflows that can process and analyze different types of data.\n\nLearn more from the following resources:",
"links": [
{
"title": "LangChain Website",
"title": "LangChain",
"url": "https://www.langchain.com/",
"type": "article"
},
@ -1865,7 +1887,7 @@
},
{
"title": "Aider - AI Pair Programming in Terminal",
"url": "https://github.com/Aider-AI/aider",
"url": "https://aider.chat/",
"type": "article"
},
{

@ -1160,20 +1160,10 @@
"url": "https://angular.dev/guide/di/creating-injectable-service",
"type": "article"
},
{
"title": "What is an Angular Service",
"url": "https://www.javatpoint.com/what-is-an-angular-service",
"type": "article"
},
{
"title": "Service for API Calls",
"url": "https://www.knowledgehut.com/blog/web-development/make-api-calls-angular",
"type": "article"
},
{
"title": "Service Tutorial with Example",
"url": "https://www.positronx.io/angular-service-tutorial-with-example/",
"type": "article"
}
]
},
@ -1228,11 +1218,6 @@
"url": "https://angular.dev/guide/forms/reactive-forms",
"type": "article"
},
{
"title": "Angular Reactive Forms",
"url": "https://www.javatpoint.com/angular-reactive-forms",
"type": "article"
},
{
"title": "How To Use Reactive Forms in Angular",
"url": "https://www.digitalocean.com/community/tutorials/angular-reactive-forms-introduction",
@ -1255,8 +1240,8 @@
"description": "Since Angular 14, reactive forms are strictly typed by default. You don't have to define extra custom types or add a ton of type annotations to your form declarations to benefit from this extra type safety, as Angular will infer types from the default value of a form control. Non-typed forms are still supported. To use them, you must import the `Untyped` symbols from `@angular/forms`.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Angular Official Docs - @let",
"url": "https://angular.dev/api/core/@let",
"title": "Angular Official Docs - Typed Forms",
"url": "https://angular.dev/guide/forms/typed-forms",
"type": "article"
},
{

@ -176,8 +176,8 @@
"type": "article"
},
{
"title": "Cookies - Mozilla",
"url": "https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies",
"title": "Using HTTP cookies - Mozilla",
"url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies",
"type": "article"
}
]

@ -231,11 +231,6 @@
"title": "Data Structures and Algorithms",
"description": "As the name indicates, a **Data Structure** is a way of organizing the data in the **memory** so it can be used efficiently. Some common data structures are array, linked list, stack, hashtable, queue, tree, heap, and graph.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Data Structures and Algorithms",
"url": "https://www.javatpoint.com/data-structure-tutorial",
"type": "article"
},
{
"title": "C# resources",
"url": "https://dev.to/adavidoaiei/fundamental-data-structures-and-algorithms-in-c-4ocf",
@ -483,7 +478,7 @@
]
},
"qpVxwuyA2oE06MZLtEdP1": {
"title": "Razon Pages",
"title": "Razor Pages",
"description": "Razor Pages is a feature of the [ASP.NET](http://ASP.NET) Core framework that allows developers to build web applications using a combination of Razor markup (a markup syntax for defining dynamic HTML) and C# code. Razor Pages is built on top of the [ASP.NET](http://ASP.NET) Core MVC (Model-View-Controller) framework, and provides a simpler, more intuitive way to build web pages and handle user input.\n\nRazor Pages are useful for building simple, self-contained web pages that do not require a complex navigation or layout structure, and are often used for building small to medium-size web applications.\n\nFor more information, visit the following links:",
"links": [
{
@ -1846,8 +1841,14 @@
},
"oMMBzRrHkUymxAR4oqr75": {
"title": "Manual Mapping",
"description": "",
"links": []
"description": "Manual object mapping in [ASP.NET](http://ASP.NET) Core means explicitly assigning values from one object to another without using third-party libraries like AutoMapper. This approach gives you full control over how properties are mapped and allows for custom transformations if needed.\n\nFor instance, if an **Employee** entity has properties such as Id, Name, Email, and Department, and we need to convert it into an **EmployeeDTO** without exposing sensitive data like Id, a manual mapping method can selectively map only the necessary fields. However, it comes with trade-offs, such as increased boilerplate code and the need for manual updates whenever the data model changes. In a real-world [ASP.NET](http://ASP.NET) Core application, manual mapping can be implemented using static helper methods or extension methods that take an entity as input and return a DTO, ensuring that the mapping logic remains centralized and reusable across different parts of the application.\n\nTo learn more, visit the following resources:",
"links": [
{
"title": "Manual vs Automapping in ASP.NET?",
"url": "https://medium.com/@anderson.buenogod/manual-vs-automated-mapping-in-c-which-approach-is-best-for-your-project-50de1fd73bfa",
"type": "article"
}
]
},
"s57tKy1rajlJbKFDVXLqs": {
"title": "Task Scheduling",
@ -2332,10 +2333,31 @@
}
]
},
"azure-service-bus@gBuaVZfqJ0-g21sKohQtx.md": {
"gBuaVZfqJ0-g21sKohQtx": {
"title": "Azure Service Bus",
"description": "",
"links": []
"description": "Azure Service Bus is a scalable and reliable messaging platform that can handle a high volume of messages, it's also easy to use, has a lot of features like subscription, Topics, Dead Letter, and easy to integrate with other Azure services, and it's a managed service which means Microsoft takes care of the infrastructure and scaling. However, it's worth noting that Azure Service Bus is a paid service and the cost will depend on the number of messages and the size of the data that you are sending and receiving.\n\nTo learn more, visit the following links:",
"links": [
{
"title": "Getting Started With Azure Service Bus and ASP.NET Core",
"url": "https://www.c-sharpcorner.com/article/get-started-with-azure-service-bus-queues-asp-net-core-part-1/",
"type": "article"
},
{
"title": "How to Send & receive messages from Azure Service Bus queue (.NET)?",
"url": "https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dotnet-get-started-with-queues?tabs=passwordless",
"type": "article"
},
{
"title": "What is Azure Service Bus?",
"url": "https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview",
"type": "article"
},
{
"title": "Explore top posts about Azure",
"url": "https://app.daily.dev/tags/azure?ref=roadmapsh",
"type": "article"
}
]
},
"SQKIUa_UsJ4cls-Vs9yHU": {
"title": "Mass Transit",

@ -389,6 +389,11 @@
"title": "Git & GitHub Crash Course For Beginners",
"url": "https://www.youtube.com/watch?v=SWYqp7iY_Tc",
"type": "video"
},
{
"title": "Learn Git - Full Course",
"url": "https://www.youtube.com/watch?v=rH3zE7VlIMs",
"type": "video"
}
]
},

@ -336,11 +336,6 @@
"url": "https://roadmap.sh/datastructures-and-algorithms",
"type": "article"
},
{
"title": "Data Structures and Algorithms",
"url": "https://www.javatpoint.com/data-structure-tutorial",
"type": "article"
},
{
"title": "Explore top posts about Data Structures",
"url": "https://app.daily.dev/tags/data-structures?ref=roadmapsh",
@ -1033,7 +1028,7 @@
},
"m0umGQNdvg95UiNpQZsQN": {
"title": "Factorial",
"description": "Factorial complexity algorithms have a runtime of `O(n!)`. This is the worst case scenario for an algorithm. Factorial complexity algorithms are very inefficient and should be avoided.\n\n def generate_permutations(s):\n # Base case: If the string length is 1, return a list containing the string\n if len(s) == 1:\n return [s]\n \n # Initialize the result list\n permutations = []\n \n # Recursively generate all permutations\n for i in range(len(s)):\n # Current character\n current_char = s[i]\n # Remaining characters\n remaining_chars = s[:i] + s[i+1:]\n # Generate all permutations of the remaining characters\n for perm in generate_permutations(remaining_chars):\n # Add the current character to the front of each generated permutation\n permutations.append(current_char + perm)\n \n return permutations",
"description": "Factorial complexity algorithms have a runtime of `O(n!)`. This is the worst case scenario for an algorithm. Factorial complexity algorithms are very inefficient and should be avoided.\n\n def generate_permutations(s):\n # Base case: If the string length is 1, return a list containing the string\n if len(s) == 1:\n return [s]\n \n # Initialize the result list\n permutations = []\n \n # Recursively generate all permutations\n for i in range(len(s)):\n # Current character\n current_char = s[i]\n # Remaining characters\n remaining_chars = s[:i] + s[i + 1 :]\n # Generate all permutations of the remaining characters\n for perm in generate_permutations(remaining_chars):\n # Add the current character to the front of each generated permutation\n permutations.append(current_char + perm)\n \n return permutations",
"links": []
},
"7a6-AnBI-3tAU1dkOvPkx": {
@ -1042,7 +1037,7 @@
"links": [
{
"title": "Top Algorithms and Data Structures",
"url": "https://towardsdatascience.com/top-algorithms-and-data-structures-you-really-need-to-know-ab9a2a91c7b5",
"url": "https://medium.com/data-science/top-algorithms-and-data-structures-you-really-need-to-know-ab9a2a91c7b5",
"type": "article"
}
]
@ -1798,11 +1793,6 @@
"url": "https://www.coursera.org/learn/algorithms-part2/lecture/TAtDr/knuth-morris-pratt",
"type": "course"
},
{
"title": "The Knuth-Morris-Pratt (KMP)Algorithm",
"url": "https://www.javatpoint.com/daa-knuth-morris-pratt-algorithm",
"type": "article"
},
{
"title": "9.1 Knuth-Morris-Pratt KMP String Matching Algorithm",
"url": "https://www.youtube.com/watch?v=V5-7GzOfADQ",
@ -1818,11 +1808,6 @@
"title": "Boyer Moore Algorithm",
"url": "https://www.coursera.org/learn/algorithms-part2/lecture/CYxOT/boyer-moore",
"type": "course"
},
{
"title": "The Boyer-Moore Algorithm",
"url": "https://www.javatpoint.com/daa-boyer-moore-algorithm",
"type": "article"
}
]
},

@ -1,7 +1,7 @@
{
"ofwdZm05AUqCIWmfgGHk8": {
"title": "Diamond Inheritance",
"description": "Diamond inheritance is a specific scenario in multiple inheritance where a class is derived from two or more classes, which in turn, are derived from a common base class. It creates an ambiguity that arises from duplicating the common base class, which leads to an ambiguous behavior while calling the duplicate members.\n\nTo resolve this ambiguity, you can use virtual inheritance. A virtual base class is a class that is shared by multiple classes using `virtual` keyword in C++. This ensures that only one copy of the base class is inherited in the final derived class, and thus, resolves the diamond inheritance problem.\n\n_Example:_\n\n #include <iostream>\n \n class Base {\n public:\n void print() {\n std::cout << \"Base class\" << std::endl;\n }\n };\n \n class Derived1 : virtual public Base {\n public:\n void derived1Print() {\n std::cout << \"Derived1 class\" << std::endl;\n }\n };\n \n class Derived2 : virtual public Base {\n public:\n void derived2Print() {\n std::cout << \"Derived2 class\" << std::endl;\n }\n };\n \n class Derived3 : public Derived1, public Derived2 {\n public:\n void derived3Print() {\n std::cout << \"Derived3 class\" << std::endl;\n }\n };\n \n int main() {\n Derived3 d3;\n d3.print(); // Now, there is no ambiguity in calling the base class function\n d3.derived1Print();\n d3.derived2Print();\n d3.derived3Print();\n \n return 0;\n }\n \n\nIn the code above, `Derived1` and `Derived2` are derived from the `Base` class using virtual inheritance. So, when we create an object of `Derived3` and call the `print()` function from the `Base` class, there is no ambiguity, and the code executes without any issues.",
"description": "Diamond inheritance is a specific scenario in multiple inheritance where a class is derived from two or more classes, which in turn, are derived from a common base class. It creates an ambiguity that arises from duplicating the common base class, which leads to an ambiguous behavior while calling the duplicate members.\n\nTo resolve this ambiguity, you can use virtual inheritance. A virtual base class is a class that is shared by multiple classes using `virtual` keyword in C++. This ensures that only one copy of the base class is inherited in the final derived class, and thus, resolves the diamond inheritance problem.\n\n_Example:_\n\n #include <iostream>\n \n class Base {\n public:\n void print() {\n std::cout << \"Base class\\n\";\n }\n };\n \n class Derived1 : virtual public Base {\n public:\n void derived1Print() {\n std::cout << \"Derived1 class\\n\";\n }\n };\n \n class Derived2 : virtual public Base {\n public:\n void derived2Print() {\n std::cout << \"Derived2 class\\n\";\n }\n };\n \n class Derived3 : public Derived1, public Derived2 {\n public:\n void derived3Print() {\n std::cout << \"Derived3 class\\n\";\n }\n };\n \n int main() {\n Derived3 d3;\n d3.print(); // Now, there is no ambiguity in calling the base class function\n d3.derived1Print();\n d3.derived2Print();\n d3.derived3Print();\n \n return 0;\n }\n \n\nIn the code above, `Derived1` and `Derived2` are derived from the `Base` class using virtual inheritance. So, when we create an object of `Derived3` and call the `print()` function from the `Base` class, there is no ambiguity, and the code executes without any issues.",
"links": []
},
"ZHjU60uzJTezADRhDTESG": {
@ -11,7 +11,7 @@
},
"NvODRFR0DLINB0RlPSsvt": {
"title": "Introduction to Language",
"description": "C++ is a general-purpose, high-performance programming language. It was developed by Bjarne Stroustrup at Bell Labs starting in 1979. C++ is an extension of the C programming language, adding features such as classes, objects, and exceptions.\n\nBasics of C++ Programming\n-------------------------\n\nHere are some basic components and concepts in C++ programming:\n\nIncluding Libraries\n-------------------\n\nIn C++, we use the `#include` directive to include libraries or header files into our program. For example, to include the standard input/output library, we write:\n\n #include <iostream>\n \n\nMain Function\n-------------\n\nThe entry point of a C++ program is the `main` function. Every C++ program must have a `main` function:\n\n int main() {\n // Your code goes here\n return 0;\n }\n \n\nInput/Output\n------------\n\nTo perform input and output operations in C++, we can use the built-in objects `std::cin` for input and `std::cout` for output, available in the `iostream` library. Here's an example of reading an integer and printing its value:\n\n #include <iostream>\n \n int main() {\n int number;\n std::cout << \"Enter an integer: \";\n std::cin >> number;\n std::cout << \"You entered: \" << number << std::endl;\n return 0;\n }\n \n\nVariables and Data Types\n------------------------\n\nC++ has several basic data types for representing integer, floating-point, and character values:\n\n* `int`: integer values\n* `float`: single-precision floating-point values\n* `double`: double-precision floating-point values\n* `char`: single characters\n* `bool`: boolean values\n\nVariables must be declared with a data type before they can be used:\n\n int x;\n float y;\n double z;\n char c;\n bool b;\n \n\nControl Structures\n------------------\n\nC++ provides control structures for conditional execution and iteration, such as `if`, `else`, `while`, `for`, and `switch` statements.\n\n### If-Else Statement\n\n if (condition) {\n // Code to execute if the condition is true\n } else {\n // Code to execute if the condition is false\n }\n \n\n### While Loop\n\n while (condition) {\n // Code to execute while the condition is true\n }\n \n\n### For Loop\n\n for (initialization; condition; update) {\n // Code to execute while the condition is true\n }\n \n\n### Switch Statement\n\n switch (variable) {\n case value1:\n // Code to execute if variable == value1\n break;\n case value2:\n // Code to execute if variable == value2\n break;\n // More cases...\n default:\n // Code to execute if variable does not match any case value\n }\n \n\nFunctions\n---------\n\nFunctions are reusable blocks of code that can be called with arguments to perform a specific task. Functions are defined with a return type, a name, a parameter list, and a body.\n\n ReturnType functionName(ParameterType1 parameter1, ParameterType2 parameter2) {\n // Function body\n // ...\n return returnValue;\n }\n \n\nFor example, here's a function that adds two integers and returns the result:\n\n int add(int a, int b) {\n return a + b;\n }\n \n int main() {\n int result = add(3, 4);\n std::cout << \"3 + 4 = \" << result << std::endl;\n return 0;\n }\n \n\nThis basic introduction to C++ should provide you with a good foundation for further learning. Explore more topics such as classes, objects, inheritance, polymorphism, templates, and the Standard Template Library (STL) to deepen your understanding of C++ and start writing more advanced programs.\n\nLearn more from the following resources:",
"description": "C++ is a general-purpose, high-performance programming language. It was developed by Bjarne Stroustrup at Bell Labs starting in 1979. C++ is an extension of the C programming language, adding features such as classes, objects, and exceptions.\n\nBasics of C++ Programming\n-------------------------\n\nHere are some basic components and concepts in C++ programming:\n\nIncluding Libraries\n-------------------\n\nIn C++, we use the `#include` directive to include libraries or header files into our program. For example, to include the standard input/output library, we write:\n\n #include <iostream>\n \n\nMain Function\n-------------\n\nThe entry point of a C++ program is the `main` function. Every C++ program must have a `main` function:\n\n int main() {\n // Your code goes here\n return 0;\n }\n \n\nInput/Output\n------------\n\nTo perform input and output operations in C++, we can use the built-in objects `std::cin` for input and `std::cout` for output, available in the `iostream` library. Here's an example of reading an integer and printing its value:\n\n #include <iostream>\n \n int main() {\n int number;\n std::cout << \"Enter an integer: \";\n std::cin >> number;\n std::cout << \"You entered: \" << number << '\\n';\n return 0;\n }\n \n\nVariables and Data Types\n------------------------\n\nC++ has several basic data types for representing integer, floating-point, and character values:\n\n* `int`: integer values\n* `float`: single-precision floating-point values\n* `double`: double-precision floating-point values\n* `char`: single characters\n* `bool`: boolean values\n\nVariables must be declared with a data type before they can be used:\n\n int x;\n float y;\n double z;\n char c;\n bool b;\n \n\nControl Structures\n------------------\n\nC++ provides control structures for conditional execution and iteration, such as `if`, `else`, `while`, `for`, and `switch` statements.\n\n### If-Else Statement\n\n if (condition) {\n // Code to execute if the condition is true\n } else {\n // Code to execute if the condition is false\n }\n \n\n### While Loop\n\n while (condition) {\n // Code to execute while the condition is true\n }\n \n\n### For Loop\n\n for (initialization; condition; update) {\n // Code to execute while the condition is true\n }\n \n\n### Switch Statement\n\n switch (variable) {\n case value1:\n // Code to execute if variable == value1\n break;\n case value2:\n // Code to execute if variable == value2\n break;\n // More cases...\n default:\n // Code to execute if variable does not match any case value\n }\n \n\nFunctions\n---------\n\nFunctions are reusable blocks of code that can be called with arguments to perform a specific task. Functions are defined with a return type, a name, a parameter list, and a body.\n\n ReturnType functionName(ParameterType1 parameter1, ParameterType2 parameter2) {\n // Function body\n // ...\n return returnValue;\n }\n \n\nFor example, here's a function that adds two integers and returns the result:\n\n int add(int a, int b) {\n return a + b;\n }\n \n int main() {\n int result = add(3, 4);\n std::cout << \"3 + 4 = \" << result << '\\n';\n return 0;\n }\n \n\nThis basic introduction to C++ should provide you with a good foundation for further learning. Explore more topics such as classes, objects, inheritance, polymorphism, templates, and the Standard Template Library (STL) to deepen your understanding of C++ and start writing more advanced programs.\n\nLearn more from the following resources:",
"links": [
{
"title": "LearnC++",
@ -27,7 +27,7 @@
},
"x_28LiDVshqWns_aIBsdx": {
"title": "What is C++?",
"description": "C++ is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language. It was first introduced in 1985 and provides object-oriented features like classes and inheritance. C++ is widely used in various applications like game development, system programming, embedded systems, and high-performance computing.\n\nC++ is a statically-typed language, meaning that the type of a variable is determined during compilation, and has an extensive library called the C++ Standard Library, which provides a rich set of functions, algorithms, and data structures for various tasks.\n\nC++ builds upon the features of C, and thus, most C programs can be compiled and run with a C++ compiler.\n\nCode Example\n------------\n\nHere's a simple example of a C++ program that demonstrates some essential features of the language:\n\n #include <iostream>\n \n // A simple function to add two numbers\n int add(int a, int b) {\n return a + b;\n }\n \n class Calculator {\n public:\n // A member function to multiply two numbers\n int multiply(int a, int b) {\n return a * b;\n }\n };\n \n int main() {\n int x = 5;\n int y = 3;\n \n // Using the standalone function 'add'\n int sum = add(x, y);\n std::cout << \"Sum: \" << sum << std::endl;\n \n // Using a class and member function\n Calculator calc;\n int product = calc.multiply(x, y);\n std::cout << \"Product: \" << product << std::endl;\n \n return 0;\n }\n \n\nIn the above program, we define a simple function `add` and a class `Calculator` with a member function `multiply`. The `main` function demonstrates how to use these to perform basic arithmetic.\n\nLearn more from the following resources:",
"description": "C++ is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language. It was first introduced in 1985 and provides object-oriented features like classes and inheritance. C++ is widely used in various applications like game development, system programming, embedded systems, and high-performance computing.\n\nC++ is a statically-typed language, meaning that the type of a variable is determined during compilation, and has an extensive library called the C++ Standard Library, which provides a rich set of functions, algorithms, and data structures for various tasks.\n\nC++ builds upon the features of C, and thus, most C programs can be compiled and run with a C++ compiler.\n\nCode Example\n------------\n\nHere's a simple example of a C++ program that demonstrates some essential features of the language:\n\n #include <iostream>\n \n // A simple function to add two numbers\n int add(int a, int b) {\n return a + b;\n }\n \n class Calculator {\n public:\n // A member function to multiply two numbers\n int multiply(int a, int b) {\n return a * b;\n }\n };\n \n int main() {\n int x = 5;\n int y = 3;\n \n // Using the standalone function 'add'\n int sum = add(x, y);\n std::cout << \"Sum: \" << sum << '\\n';\n \n // Using a class and member function\n Calculator calc;\n int product = calc.multiply(x, y);\n std::cout << \"Product: \" << product << '\\n';\n \n return 0;\n }\n \n\nIn the above program, we define a simple function `add` and a class `Calculator` with a member function `multiply`. The `main` function demonstrates how to use these to perform basic arithmetic.\n\nLearn more from the following resources:",
"links": [
{
"title": "w3schools C++ tutorial",
@ -53,17 +53,17 @@
},
"tl6VCQ5IEGDVyFcgj7jDm": {
"title": "Why use C++",
"description": "C++ is a popular and widely used programming language for various reasons. Here are some of the reasons why you might choose to utilize C++:\n\nPerformance\n-----------\n\nC++ is designed to provide high performance and efficiency. It offers fine-grained control over system resources, making it easier to optimize your software.\n\nPortability\n-----------\n\nC++ is supported on different computer architectures and operating systems, allowing you to write portable code that runs on various platforms without making major modifications.\n\nObject-Oriented Programming\n---------------------------\n\nC++ supports object-oriented programming (OOP) - a paradigm that allows you to design programs using classes and objects, leading to better code organization and reusability.\n\n class MyClass {\n public:\n void myFunction() {\n // Code here\n }\n };\n \n int main() {\n MyClass obj;\n obj.myFunction();\n }\n \n\nSupport for low-level and high-level programming\n------------------------------------------------\n\nC++ allows you to write both low-level code, like memory manipulation, as well as high-level abstractions, like creating classes and using the Standard Template Library (STL).\n\n #include <iostream>\n #include <vector>\n \n int main() {\n // Low-level programming\n int number = 42;\n int* ptr_number = &number;\n \n // High-level programming\n std::vector<int> myVector = {1, 2, 3};\n for (const auto &i: myVector) {\n std::cout << i << std::endl;\n }\n }\n \n\nExtensive Libraries\n-------------------\n\nC++ offers a vast range of libraries and tools, such as the Standard Template Library (STL), Boost, and Qt, among others, that can aid in the development of your projects and make it more efficient.\n\nCombination with C language\n---------------------------\n\nC++ can be combined with C, offering the capabilities of both languages and allowing you to reuse your existing C code. By incorporating C++ features, you can enhance your code and improve its functionality.\n\nActive Community\n----------------\n\nC++ has been around for a long time and has a large, active community of users who contribute to the growth of the language, express new ideas, and engage in discussions that help develop the language further. This makes finding solutions to any problems you experience much easier.\n\nIn summary, C++ offers a great balance of performance, portability, and feature set, making it a versatile and powerful programming language suitable for many applications. With its extensive libraries, active community, and continuous development, C++ is an excellent choice for any software development project.",
"description": "C++ is a popular and widely used programming language for various reasons. Here are some of the reasons why you might choose to utilize C++:\n\nPerformance\n-----------\n\nC++ is designed to provide high performance and efficiency. It offers fine-grained control over system resources, making it easier to optimize your software.\n\nPortability\n-----------\n\nC++ is supported on different computer architectures and operating systems, allowing you to write portable code that runs on various platforms without making major modifications.\n\nObject-Oriented Programming\n---------------------------\n\nC++ supports object-oriented programming (OOP) - a paradigm that allows you to design programs using classes and objects, leading to better code organization and reusability.\n\n class MyClass {\n public:\n void myFunction() {\n // Code here\n }\n };\n \n int main() {\n MyClass obj;\n obj.myFunction();\n }\n \n\nSupport for low-level and high-level programming\n------------------------------------------------\n\nC++ allows you to write both low-level code, like memory manipulation, as well as high-level abstractions, like creating classes and using the Standard Template Library (STL).\n\n #include <iostream>\n #include <vector>\n \n int main() {\n // Low-level programming\n int number = 42;\n int* ptr_number = &number;\n \n // High-level programming\n std::vector<int> myVector = {1, 2, 3};\n for (const auto &i: myVector) {\n std::cout << i << '\\n';\n }\n }\n \n\nExtensive Libraries\n-------------------\n\nC++ offers a vast range of libraries and tools, such as the Standard Template Library (STL), Boost, and Qt, among others, that can aid in the development of your projects and make it more efficient.\n\nCombination with C language\n---------------------------\n\nC++ can be combined with C, offering the capabilities of both languages and allowing you to reuse your existing C code. By incorporating C++ features, you can enhance your code and improve its functionality.\n\nActive Community\n----------------\n\nC++ has been around for a long time and has a large, active community of users who contribute to the growth of the language, express new ideas, and engage in discussions that help develop the language further. This makes finding solutions to any problems you experience much easier.\n\nIn summary, C++ offers a great balance of performance, portability, and feature set, making it a versatile and powerful programming language suitable for many applications. With its extensive libraries, active community, and continuous development, C++ is an excellent choice for any software development project.",
"links": []
},
"2Ag0t3LPryTF8khHLRfy-": {
"title": "C vs C++",
"description": "C and C++ are two popular programming languages with some similarities, but they also have key differences. C++ is an extension of the C programming language, with added features such as object-oriented programming, classes, and exception handling. Although both languages are used for similar tasks, they have their own syntax and semantics, which makes them distinct from each other.\n\nSyntax and Semantics\n--------------------\n\n### C\n\n* C is a procedural programming language.\n* Focuses on functions and structured programming.\n* Does not support objects or classes.\n* Memory management is manual, using functions like `malloc` and `free`.\n\n #include <stdio.h>\n \n void printHello() {\n printf(\"Hello, World!\\n\");\n }\n \n int main() {\n printHello();\n return 0;\n }\n \n\n### C++\n\n* C++ is both procedural and object-oriented.\n* Supports both functions and classes.\n* Incorporates different programming paradigms.\n* Memory management can be manual (like C) or rely on constructors/destructors and smart pointers.\n\n #include <iostream>\n \n class HelloWorld {\n public:\n void printHello() {\n std::cout << \"Hello, World!\" << std::endl;\n }\n };\n \n int main() {\n HelloWorld obj;\n obj.printHello();\n return 0;\n }\n \n\nCode Reusability and Modularity\n-------------------------------\n\n### C\n\n* Code reusability is achieved through functions and modular programming.\n* High cohesion and low coupling are achieved via structured design.\n* Function libraries can be created and included through headers.\n\n### C++\n\n* Offers better code reusability with classes, inheritance, and polymorphism.\n* Code modularity is enhanced through namespaces and well-designed object-oriented hierarchy.\n\nError Handling\n--------------\n\n### C\n\n* Error handling in C is done primarily through return codes.\n* Lacks support for exceptions or any built-in error handling mechanism.\n\n### C++\n\n* Offers exception handling, which can be used to handle errors that may occur during program execution.\n* Enables catching and handling exceptions with `try`, `catch`, and `throw` keywords, providing more control over error handling.\n\nConclusion\n----------\n\nBoth C and C++ are powerful languages with unique features and capabilities. While C is simpler and focuses on procedural programming, C++ offers the versatility of using different programming paradigms and improved code organization. Understanding the differences between these two languages can help you decide which one is more suitable for your specific needs and programming style.",
"description": "C and C++ are two popular programming languages with some similarities, but they also have key differences. C++ is an extension of the C programming language, with added features such as object-oriented programming, classes, and exception handling. Although both languages are used for similar tasks, they have their own syntax and semantics, which makes them distinct from each other.\n\nSyntax and Semantics\n--------------------\n\n### C\n\n* C is a procedural programming language.\n* Focuses on functions and structured programming.\n* Does not support objects or classes.\n* Memory management is manual, using functions like `malloc` and `free`.\n\n #include <stdio.h>\n \n void printHello() {\n printf(\"Hello, World!\\n\");\n }\n \n int main() {\n printHello();\n return 0;\n }\n \n\n### C++\n\n* C++ is both procedural and object-oriented.\n* Supports both functions and classes.\n* Incorporates different programming paradigms.\n* Memory management can be manual (like C) or rely on constructors/destructors and smart pointers.\n\n #include <iostream>\n \n class HelloWorld {\n public:\n void printHello() {\n std::cout << \"Hello, World!\\n\";\n }\n };\n \n int main() {\n HelloWorld obj;\n obj.printHello();\n return 0;\n }\n \n\nCode Reusability and Modularity\n-------------------------------\n\n### C\n\n* Code reusability is achieved through functions and modular programming.\n* High cohesion and low coupling are achieved via structured design.\n* Function libraries can be created and included through headers.\n\n### C++\n\n* Offers better code reusability with classes, inheritance, and polymorphism.\n* Code modularity is enhanced through namespaces and well-designed object-oriented hierarchy.\n\nError Handling\n--------------\n\n### C\n\n* Error handling in C is done primarily through return codes.\n* Lacks support for exceptions or any built-in error handling mechanism.\n\n### C++\n\n* Offers exception handling, which can be used to handle errors that may occur during program execution.\n* Enables catching and handling exceptions with `try`, `catch`, and `throw` keywords, providing more control over error handling.\n\nConclusion\n----------\n\nBoth C and C++ are powerful languages with unique features and capabilities. While C is simpler and focuses on procedural programming, C++ offers the versatility of using different programming paradigms and improved code organization. Understanding the differences between these two languages can help you decide which one is more suitable for your specific needs and programming style.",
"links": []
},
"Zc_TTzmM36yWsu3GvOy9x": {
"title": "Setting up your Environment",
"description": "Setting up C++ requires a few steps, including installing a compiler, configuring an Integrated Development Environment (IDE), and creating a new C++ project.\n\n1\\. Installing a Compiler\n-------------------------\n\nA compiler is required to convert C++ code into machine language. Some popular C++ compilers include:\n\n* GCC (GNU Compiler Collection) for Linux and macOS, but can also be used on Windows through MinGW\n* MSVC (Microsoft Visual C++) for Windows\n\nTo install a compiler, simply follow the instructions provided by the respective websites.\n\n2\\. Configuring an IDE\n----------------------\n\nAn IDE is a software application that provides facilities for programming, such as code editing, debugging, and building. Some popular C++ IDEs include:\n\n* [@article@Visual Studio](https://visualstudio.microsoft.com/vs/features/cplusplus/) (Windows, macOS)\n* [@article@Eclipse](https://eclipse.org) (Windows, macOS, Linux)\n* [@article@Code::Blocks](http://www.codeblocks.org) (Windows, macOS, Linux)\n\nAfter downloading and installing an IDE, you might need to configure it to use the installed compiler. Check the documentation of the respective IDE for instructions on how to do this.\n\n3\\. Creating a New C++ Project\n------------------------------\n\nOnce you have your IDE and compiler set up, you can create a new C++ project and start writing code. In general, follow these steps to create a new C++ project:\n\n* Open the IDE and create a new project.\n* Select the project type (C++ Application or Console Application).\n* Specify the project name and location.\n* Let the IDE generate the main.cpp and build files (such as Makefile or CMakeLists.txt) for you.\n\nExample: Hello World in C++\n---------------------------\n\nCreate a new file called `main.cpp` within your project and include this code:\n\n #include <iostream>\n \n int main() {\n std::cout << \"Hello, World!\" << std::endl;\n return 0;\n }\n \n\nThen, follow the IDE's instructions to build and run your program. You should see \"Hello, World!\" displayed in the console.\n\nSummary\n-------\n\nSetting up C++ involves:\n\n* Installing a compiler (e.g. GCC, MinGW, or MSVC)\n* Configuring an IDE (e.g. Visual Studio, Eclipse, or Code::Blocks)\n* Creating a new C++ project and writing code\n\nBy following these steps, you'll be ready to start developing C++ applications!",
"description": "Setting up C++ requires a few steps, including installing a compiler, configuring an Integrated Development Environment (IDE), and creating a new C++ project.\n\n1\\. Installing a Compiler\n-------------------------\n\nA compiler is required to convert C++ code into machine language. Some popular C++ compilers include:\n\n* GCC (GNU Compiler Collection) for Linux and macOS, but can also be used on Windows through MinGW\n* MSVC (Microsoft Visual C++) for Windows\n\nTo install a compiler, simply follow the instructions provided by the respective websites.\n\n2\\. Configuring an IDE\n----------------------\n\nAn IDE is a software application that provides facilities for programming, such as code editing, debugging, and building. Some popular C++ IDEs include:\n\n* [@article@Visual Studio](https://visualstudio.microsoft.com/vs/features/cplusplus/) (Windows, macOS)\n* [@article@Eclipse](https://eclipse.org) (Windows, macOS, Linux)\n* [@article@Code::Blocks](http://www.codeblocks.org) (Windows, macOS, Linux)\n\nAfter downloading and installing an IDE, you might need to configure it to use the installed compiler. Check the documentation of the respective IDE for instructions on how to do this.\n\n3\\. Creating a New C++ Project\n------------------------------\n\nOnce you have your IDE and compiler set up, you can create a new C++ project and start writing code. In general, follow these steps to create a new C++ project:\n\n* Open the IDE and create a new project.\n* Select the project type (C++ Application or Console Application).\n* Specify the project name and location.\n* Let the IDE generate the main.cpp and build files (such as Makefile or CMakeLists.txt) for you.\n\nExample: Hello World in C++\n---------------------------\n\nCreate a new file called `main.cpp` within your project and include this code:\n\n #include <iostream>\n \n int main() {\n std::cout << \"Hello, World!\\n\";\n return 0;\n }\n \n\nThen, follow the IDE's instructions to build and run your program. You should see \"Hello, World!\" displayed in the console.\n\nSummary\n-------\n\nSetting up C++ involves:\n\n* Installing a compiler (e.g. GCC, MinGW, or MSVC)\n* Configuring an IDE (e.g. Visual Studio, Eclipse, or Code::Blocks)\n* Creating a new C++ project and writing code\n\nBy following these steps, you'll be ready to start developing C++ applications!",
"links": []
},
"0J_ltQEJh2g28OE2ZEYJj": {
@ -89,7 +89,7 @@
},
"SEq0D2Zg5WTsIDtd1hW9f": {
"title": "Running your First Program",
"description": "In this section, we'll discuss the basic structure of a C++ program, walk you through your first program (the \"Hello, World!\" example), and provide additional explanations of its syntax.\n\nHello, World!\n-------------\n\nThe first program that most people learn to write in any programming language is often a simple one that displays the message \"Hello, World!\" on the screen. Here's the classic \"Hello, World!\" program in C++:\n\n #include <iostream>\n \n int main() {\n std::cout << \"Hello, World!\" << std::endl;\n return 0;\n }\n \n\nLet's break down the different components of this program:\n\nHeader Files & Preprocessor Directives\n--------------------------------------\n\nThe first line of the program `#include <iostream>` is a [preprocessor directive](https://en.cppreference.com/w/cpp/preprocessor) that tells the compiler to include the header file `iostream`. Header files provide function and class declarations that we can use in our C++ programs.\n\n #include <iostream>\n \n\n`main()` Function\n-----------------\n\nIn C++, the `main()` function serves as the entry point of your program. The operating system runs your program by calling this `main()` function. It should be defined only once in your program and must return an integer. The keyword `int` is the return type of this function which is an integer. Unlike C in C++ it is mandatory to have `int` as the return type for the `main` function.\n\n int main() {\n // Your code goes here.\n }\n \n\nOutput to the Console\n---------------------\n\nTo output text to the console, we use the `std::cout` object and the insertion operator `<<`. In the \"Hello, World!\" example, we used the following line to print \"Hello, World!\" to the console:\n\n std::cout << \"Hello, World!\" << std::endl;\n \n\n* `std`: This is the namespace where C++ standard library entities (classes and functions) reside. It stands for \"standard\" and is an abbreviation for the Standard Template Library (STL).\n* `std::cout`: The standard \"character output\" stream that writes to the console\n* `\"Hello, World!\"`: The string literal to print\n* `std::endl`: The \"end line\" manipulator that inserts a newline character and flushes the output buffer\n\nReturn Statement\n----------------\n\nLastly, the `return 0;` statement informs the operating system that the program executed successfully. Returning any other integer value indicates that an error occurred:\n\n return 0;\n \n\nNow that you understand the basic components of a C++ program, you can write your first program, compile it, and run it to see the \"Hello, World!\" message displayed on the screen.",
"description": "In this section, we'll discuss the basic structure of a C++ program, walk you through your first program (the \"Hello, World!\" example), and provide additional explanations of its syntax.\n\nHello, World!\n-------------\n\nThe first program that most people learn to write in any programming language is often a simple one that displays the message \"Hello, World!\" on the screen. Here's the classic \"Hello, World!\" program in C++:\n\n #include <iostream>\n \n int main() {\n std::cout << \"Hello, World!\\n\";\n return 0;\n }\n \n\nLet's break down the different components of this program:\n\nHeader Files & Preprocessor Directives\n--------------------------------------\n\nThe first line of the program `#include <iostream>` is a [preprocessor directive](https://en.cppreference.com/w/cpp/preprocessor) that tells the compiler to include the header file `iostream`. Header files provide function and class declarations that we can use in our C++ programs.\n\n #include <iostream>\n \n\n`main()` Function\n-----------------\n\nIn C++, the `main()` function serves as the entry point of your program. The operating system runs your program by calling this `main()` function. It should be defined only once in your program and must return an integer. The keyword `int` is the return type of this function which is an integer. Unlike C in C++ it is mandatory to have `int` as the return type for the `main` function.\n\n int main() {\n // Your code goes here.\n }\n \n\nOutput to the Console\n---------------------\n\nTo output text to the console, we use the `std::cout` object and the insertion operator `<<`. In the \"Hello, World!\" example, we used the following line to print \"Hello, World!\" to the console:\n\n std::cout << \"Hello, World!\\n\";\n \n\n* `std`: This is the namespace where C++ standard library entities (classes and functions) reside. It stands for \"standard\"\n* `std::cout`: The standard \"character output\" stream that writes to the console\n* `\"Hello, World!\"`: The string literal to print\n* `'\\n'`: The \"end line\" manipulator that inserts a newline character and flushes the output buffer\n\nReturn Statement\n----------------\n\nLastly, the `return 0;` statement informs the operating system that the program executed successfully. Returning any other integer value indicates that an error occurred:\n\n return 0;\n \n\nNow that you understand the basic components of a C++ program, you can write your first program, compile it, and run it to see the \"Hello, World!\" message displayed on the screen.",
"links": []
},
"kl2JI_Wl47c5r8SYzxvCq": {
@ -104,7 +104,7 @@
},
"Y9gq8WkDA_XGe68JkY2UZ": {
"title": "Logical Operators",
"description": "Logical operators are used to perform logical operations on the given expressions, mostly to test the relationship between different variables or values. They return a boolean value i.e., either true (1) or false (0) based on the result of the evaluation.\n\nC++ provides the following logical operators:\n\n* **AND Operator (&&)** The AND operator checks if both the operands/conditions are true, then the expression is true. If any one of the conditions is false, the whole expression will be false.\n \n (expression1 && expression2)\n \n \n Example:\n \n int a = 5, b = 10;\n if (a > 0 && b > 0) {\n std::cout << \"Both values are positive.\" << std::endl;\n }\n \n \n* **OR Operator (||)** The OR operator checks if either of the operands/conditions are true, then the expression is true. If both the conditions are false, it will be false.\n \n (expression1 || expression2)\n \n \n Example:\n \n int a = 5, b = -10;\n if (a > 0 || b > 0) {\n std::cout << \"At least one value is positive.\" << std::endl;\n }\n \n \n* **NOT Operator (!)** The NOT operator reverses the result of the condition/expression it is applied on. If the condition is true, the NOT operator will make it false and vice versa.\n \n !(expression)\n \n \n Example:\n \n int a = 5;\n if (!(a < 0)) {\n std::cout << \"The value is not negative.\" << std::endl;\n }\n \n \n\nUsing these operators, you can create more complex logical expressions, for example:\n\n int a = 5, b = -10, c = 15;\n \n if (a > 0 && (b > 0 || c > 0)) {\n std::cout << \"At least two values are positive.\" << std::endl;\n }\n \n\nThis covers the essential information about logical operators in C++.",
"description": "Logical operators are used to perform logical operations on the given expressions, mostly to test the relationship between different variables or values. They return a boolean value i.e., either true (1) or false (0) based on the result of the evaluation.\n\nC++ provides the following logical operators:\n\n* **AND Operator (&&)** The AND operator checks if both the operands/conditions are true, then the expression is true. If any one of the conditions is false, the whole expression will be false.\n \n (expression1 && expression2)\n \n \n Example:\n \n int a = 5, b = 10;\n if (a > 0 && b > 0) {\n std::cout << \"Both values are positive.\\n\";\n }\n \n \n* **OR Operator (||)** The OR operator checks if either of the operands/conditions are true, then the expression is true. If both the conditions are false, it will be false.\n \n (expression1 || expression2)\n \n \n Example:\n \n int a = 5, b = -10;\n if (a > 0 || b > 0) {\n std::cout << \"At least one value is positive.\\n\";\n }\n \n \n* **NOT Operator (!)** The NOT operator reverses the result of the condition/expression it is applied on. If the condition is true, the NOT operator will make it false and vice versa.\n \n !(expression)\n \n \n Example:\n \n int a = 5;\n if (!(a < 0)) {\n std::cout << \"The value is not negative.\\n\";\n }\n \n \n\nUsing these operators, you can create more complex logical expressions, for example:\n\n int a = 5, b = -10, c = 15;\n \n if (a > 0 && (b > 0 || c > 0)) {\n std::cout << \"At least two values are positive.\\n\";\n }\n \n\nThis covers the essential information about logical operators in C++.",
"links": []
},
"zE4iPSq2KsrDSByQ0sGK_": {
@ -130,7 +130,7 @@
},
"_IP_e1K9LhNHilYTDh7L5": {
"title": "for / while / do while loops",
"description": "Loops are an essential concept in programming that allow you to execute a block of code repeatedly until a specific condition is met. In C++, there are three main types of loops: `for`, `while`, and `do-while`.\n\nFor Loop\n--------\n\nA `for` loop is used when you know the number of times you want to traverse through a block of code. It consists of an initialization statement, a condition, and an increment/decrement operation.\n\nHere's the syntax for a `for` loop:\n\n for (initialization; condition; increment/decrement) {\n // block of code to execute\n }\n \n\nFor example:\n\n #include <iostream>\n \n int main() {\n for (int i = 0; i < 5; i++) {\n std::cout << \"Iteration: \" << i << std::endl;\n }\n return 0;\n }\n \n\nWhile Loop\n----------\n\nA `while` loop runs as long as a specified condition is `true`. The loop checks for the condition before entering the body of the loop.\n\nHere's the syntax for a `while` loop:\n\n while (condition) {\n // block of code to execute\n }\n \n\nFor example:\n\n #include <iostream>\n \n int main() {\n int i = 0;\n while (i < 5) {\n std::cout << \"Iteration: \" << i << std::endl;\n i++;\n }\n return 0;\n }\n \n\nDo-While Loop\n-------------\n\nA `do-while` loop is similar to a `while` loop, with the key difference being that the loop body is executed at least once, even when the condition is `false`.\n\nHere's the syntax for a `do-while` loop:\n\n do {\n // block of code to execute\n } while (condition);\n \n\nFor example:\n\n #include <iostream>\n \n int main() {\n int i = 0;\n do {\n std::cout << \"Iteration: \" << i << std::endl;\n i++;\n } while (i < 5);\n return 0;\n }\n \n\nIn summary, loops are an integral part of C++ programming that allow you to execute a block of code multiple times. The three types of loops in C++ are `for`, `while`, and `do-while`. Each type has its own specific use case and can be chosen depending on the desired behavior.\n\nLearn more from the following resources:",
"description": "Loops are an essential concept in programming that allow you to execute a block of code repeatedly until a specific condition is met. In C++, there are three main types of loops: `for`, `while`, and `do-while`.\n\nFor Loop\n--------\n\nA `for` loop is used when you know the number of times you want to traverse through a block of code. It consists of an initialization statement, a condition, and an increment/decrement operation.\n\nHere's the syntax for a `for` loop:\n\n for (initialization; condition; increment/decrement) {\n // block of code to execute\n }\n \n\nFor example:\n\n #include <iostream>\n \n int main() {\n for (int i = 0; i < 5; i++) {\n std::cout << \"Iteration: \" << i << '\\n';\n }\n return 0;\n }\n \n\nWhile Loop\n----------\n\nA `while` loop runs as long as a specified condition is `true`. The loop checks for the condition before entering the body of the loop.\n\nHere's the syntax for a `while` loop:\n\n while (condition) {\n // block of code to execute\n }\n \n\nFor example:\n\n #include <iostream>\n \n int main() {\n int i = 0;\n while (i < 5) {\n std::cout << \"Iteration: \" << i << '\\n';\n i++;\n }\n return 0;\n }\n \n\nDo-While Loop\n-------------\n\nA `do-while` loop is similar to a `while` loop, with the key difference being that the loop body is executed at least once, even when the condition is `false`.\n\nHere's the syntax for a `do-while` loop:\n\n do {\n // block of code to execute\n } while (condition);\n \n\nFor example:\n\n #include <iostream>\n \n int main() {\n int i = 0;\n do {\n std::cout << \"Iteration: \" << i << '\\n';\n i++;\n } while (i < 5);\n return 0;\n }\n \n\nIn summary, loops are an integral part of C++ programming that allow you to execute a block of code multiple times. The three types of loops in C++ are `for`, `while`, and `do-while`. Each type has its own specific use case and can be chosen depending on the desired behavior.\n\nLearn more from the following resources:",
"links": [
{
"title": "C++ For Loop",
@ -146,7 +146,7 @@
},
"oYi3YOc1GC2Nfp71VOkJt": {
"title": "Functions",
"description": "A **function** is a group of statements that perform a specific task, organized as a separate unit in a program. Functions help in breaking the code into smaller, manageable, and reusable blocks.\n\nThere are mainly two types of functions in C++:\n\n* **Standard library functions**: Pre-defined functions available in the C++ standard library, such as `sort()`, `strlen()`, `sqrt()`, and many more. These functions are part of the standard library, so you need to include the appropriate header file to use them.\n \n* **User-defined functions**: Functions created by the programmer to perform a specific task. To create a user-defined function, you need to define the function and call it in your code.\n \n\nDefining a Function\n-------------------\n\nThe general format for defining a function in C++ is:\n\n return_type function_name(parameter list) {\n // function body\n }\n \n\n* `return_type`: Data type of the output produced by the function. It can be `void`, indicating that the function doesn't return any value.\n* `function_name`: Name given to the function, following C++ naming conventions.\n* `parameter list`: List of input parameters/arguments that are needed to perform the task. It is optional, you can leave it blank when no parameters are needed.\n\nExample\n-------\n\n #include <iostream>\n \n // Function to add two numbers\n int addNumbers(int a, int b) {\n int sum = a + b;\n return sum;\n }\n \n int main() {\n int num1 = 5, num2 = 10;\n int result = addNumbers(num1, num2); // Calling the function\n std::cout << \"The sum is: \" << result << std::endl;\n return 0;\n }\n \n\nIn this example, the function `addNumbers` takes two integer parameters, `a` and `b`, and returns the sum of the numbers. We then call this function from the `main()` function and display the result.\n\nFunction Prototypes\n-------------------\n\nIn some cases, you might want to use a function before actually defining it. To do this, you need to declare a **function prototype** at the beginning of your code.\n\nA function prototype is a declaration of the function without its body, and it informs the compiler about the function's name, return type, and parameters.\n\n #include <iostream>\n \n // Function prototype\n int multiplyNumbers(int x, int y);\n \n int main() {\n int num1 = 3, num2 = 7;\n int result = multiplyNumbers(num1, num2); // Calling the function\n std::cout << \"The product is: \" << result << std::endl;\n return 0;\n }\n \n // Function definition\n int multiplyNumbers(int x, int y) {\n int product = x * y;\n return product;\n }\n \n\nIn this example, we use a function prototype for `multiplyNumbers()` before defining it. This way, we can call the function from the `main()` function even though it hasn't been defined yet in the code.\n\nLearn more from the following resources:",
"description": "A **function** is a group of statements that perform a specific task, organized as a separate unit in a program. Functions help in breaking the code into smaller, manageable, and reusable blocks.\n\nThere are mainly two types of functions in C++:\n\n* **Standard library functions**: Pre-defined functions available in the C++ standard library, such as `sort()`, `strlen()`, `sqrt()`, and many more. These functions are part of the standard library, so you need to include the appropriate header file to use them.\n \n* **User-defined functions**: Functions created by the programmer to perform a specific task. To create a user-defined function, you need to define the function and call it in your code.\n \n\nDefining a Function\n-------------------\n\nThe general format for defining a function in C++ is:\n\n return_type function_name(parameter list) {\n // function body\n }\n \n\n* `return_type`: Data type of the output produced by the function. It can be `void`, indicating that the function doesn't return any value.\n* `function_name`: Name given to the function, following C++ naming conventions.\n* `parameter list`: List of input parameters/arguments that are needed to perform the task. It is optional, you can leave it blank when no parameters are needed.\n\nExample\n-------\n\n #include <iostream>\n \n // Function to add two numbers\n int addNumbers(int a, int b) {\n int sum = a + b;\n return sum;\n }\n \n int main() {\n int num1 = 5, num2 = 10;\n int result = addNumbers(num1, num2); // Calling the function\n std::cout << \"The sum is: \" << result << '\\n';\n return 0;\n }\n \n\nIn this example, the function `addNumbers` takes two integer parameters, `a` and `b`, and returns the sum of the numbers. We then call this function from the `main()` function and display the result.\n\nFunction Prototypes\n-------------------\n\nIn some cases, you might want to use a function before actually defining it. To do this, you need to declare a **function prototype** at the beginning of your code.\n\nA function prototype is a declaration of the function without its body, and it informs the compiler about the function's name, return type, and parameters.\n\n #include <iostream>\n \n // Function prototype\n int multiplyNumbers(int x, int y);\n \n int main() {\n int num1 = 3, num2 = 7;\n int result = multiplyNumbers(num1, num2); // Calling the function\n std::cout << \"The product is: \" << result << '\\n';\n return 0;\n }\n \n // Function definition\n int multiplyNumbers(int x, int y) {\n int product = x * y;\n return product;\n }\n \n\nIn this example, we use a function prototype for `multiplyNumbers()` before defining it. This way, we can call the function from the `main()` function even though it hasn't been defined yet in the code.\n\nLearn more from the following resources:",
"links": [
{
"title": "introduction to functions in c++",
@ -157,7 +157,7 @@
},
"obZIxRp0eMWdG7gplNIBc": {
"title": "Static Polymorphism",
"description": "Static polymorphism, also known as compile-time polymorphism, is a type of polymorphism that resolves the types and method calls at compile time rather than at runtime. This is commonly achieved through the use of function overloading and templates in C++.\n\nFunction Overloading\n--------------------\n\nFunction overloading is a way to create multiple functions with the same name but different parameter lists. The compiler determines the correct function to call based on the types and number of arguments used when the function is called.\n\nExample:\n\n #include <iostream>\n \n void print(int i) {\n std::cout << \"Printing int: \" << i << std::endl;\n }\n \n void print(double d) {\n std::cout << \"Printing double: \" << d << std::endl;\n }\n \n void print(const char* s) {\n std::cout << \"Printing string: \" << s << std::endl;\n }\n \n int main() {\n print(5); // Calls print(int i)\n print(3.14); // Calls print(double d)\n print(\"Hello\"); // Calls print(const char* s)\n \n return 0;\n }\n \n\nTemplates\n---------\n\nTemplates are a powerful feature in C++ that allows you to create generic functions or classes. The actual code for specific types is generated at compile time, which avoids the overhead of runtime polymorphism. The use of templates is the main technique to achieve static polymorphism in C++.\n\nExample:\n\n #include <iostream>\n \n // Template function to print any type\n template<typename T>\n void print(const T& value) {\n std::cout << \"Printing value: \" << value << std::endl;\n }\n \n int main() {\n print(42); // int\n print(3.14159); // double\n print(\"Hello\"); // const char*\n \n return 0;\n }\n \n\nIn conclusion, static polymorphism achieves polymorphic behavior during compile time using function overloading and templates, instead of relying on runtime information like dynamic polymorphism does. This can result in more efficient code since method calls are resolved at compile time.",
"description": "Static polymorphism, also known as compile-time polymorphism, is a type of polymorphism that resolves the types and method calls at compile time rather than at runtime. This is commonly achieved through the use of function overloading and templates in C++.\n\nFunction Overloading\n--------------------\n\nFunction overloading is a way to create multiple functions with the same name but different parameter lists. The compiler determines the correct function to call based on the types and number of arguments used when the function is called.\n\nExample:\n\n #include <iostream>\n \n void print(int i) {\n std::cout << \"Printing int: \" << i << '\\n';\n }\n \n void print(double d) {\n std::cout << \"Printing double: \" << d << '\\n';\n }\n \n void print(const char* s) {\n std::cout << \"Printing string: \" << s << '\\n';\n }\n \n int main() {\n print(5); // Calls print(int i)\n print(3.14); // Calls print(double d)\n print(\"Hello\"); // Calls print(const char* s)\n \n return 0;\n }\n \n\nTemplates\n---------\n\nTemplates are a powerful feature in C++ that allows you to create generic functions or classes. The actual code for specific types is generated at compile time, which avoids the overhead of runtime polymorphism. The use of templates is the main technique to achieve static polymorphism in C++.\n\nExample:\n\n #include <iostream>\n \n // Template function to print any type\n template<typename T>\n void print(const T& value) {\n std::cout << \"Printing value: \" << value << '\\n';\n }\n \n int main() {\n print(42); // int\n print(3.14159); // double\n print(\"Hello\"); // const char*\n \n return 0;\n }\n \n\nIn conclusion, static polymorphism achieves polymorphic behavior during compile time using function overloading and templates, instead of relying on runtime information like dynamic polymorphism does. This can result in more efficient code since method calls are resolved at compile time.",
"links": []
},
"sgfqb22sdN4VRJYkhAVaf": {
@ -172,7 +172,7 @@
},
"xjiFBVe-VGqCqWfkPVGKf": {
"title": "Lambdas",
"description": "A lambda function, or simply \"lambda\", is an anonymous (unnamed) function that is defined in place, within your source code, and with a concise syntax. Lambda functions were introduced in C++11 and have since become a widely used feature, especially in combination with the Standard Library algorithms.\n\nSyntax\n------\n\nHere is a basic syntax of a lambda function in C++:\n\n [capture-list](parameters) -> return_type {\n // function body\n };\n \n\n* **capture-list**: A list of variables from the surrounding scope that the lambda function can access.\n* **parameters**: The list of input parameters, just like in a regular function. Optional.\n* **return\\_type**: The type of the value that the lambda function will return. This part is optional, and the compiler can deduce it in many cases.\n* **function body**: The code that defines the operation of the lambda function.\n\nUsage Examples\n--------------\n\nHere are a few examples to demonstrate the use of lambda functions in C++:\n\n* Lambda function with no capture, parameters, or return type.\n\n auto printHello = []() {\n std::cout << \"Hello, World!\" << std::endl;\n };\n printHello(); // Output: Hello, World!\n \n\n* Lambda function with parameters.\n\n auto add = [](int a, int b) {\n return a + b;\n };\n int result = add(3, 4); // result = 7\n \n\n* Lambda function with capture-by-value.\n\n int multiplier = 3;\n auto times = [multiplier](int a) {\n return a * multiplier;\n };\n int result = times(5); // result = 15\n \n\n* Lambda function with capture-by-reference.\n\n int expiresInDays = 45;\n auto updateDays = [&expiresInDays](int newDays) {\n expiresInDays = newDays;\n };\n updateDays(30); // expiresInDays = 30\n \n\nNote that, when using the capture by reference, any change made to the captured variable _inside_ the lambda function will affect its value in the surrounding scope.\n\nLearn more from the following resources:",
"description": "A lambda function, or simply \"lambda\", is an anonymous (unnamed) function that is defined in place, within your source code, and with a concise syntax. Lambda functions were introduced in C++11 and have since become a widely used feature, especially in combination with the Standard Library algorithms.\n\nSyntax\n------\n\nHere is a basic syntax of a lambda function in C++:\n\n [capture-list](parameters) -> return_type {\n // function body\n };\n \n\n* **capture-list**: A list of variables from the surrounding scope that the lambda function can access.\n* **parameters**: The list of input parameters, just like in a regular function. Optional.\n* **return\\_type**: The type of the value that the lambda function will return. This part is optional, and the compiler can deduce it in many cases.\n* **function body**: The code that defines the operation of the lambda function.\n\nUsage Examples\n--------------\n\nHere are a few examples to demonstrate the use of lambda functions in C++:\n\n* Lambda function with no capture, parameters, or return type.\n\n auto printHello = []() {\n std::cout << \"Hello, World!\\n\";\n };\n printHello(); // Output: Hello, World!\n \n\n* Lambda function with parameters.\n\n auto add = [](int a, int b) {\n return a + b;\n };\n int result = add(3, 4); // result = 7\n \n\n* Lambda function with capture-by-value.\n\n int multiplier = 3;\n auto times = [multiplier](int a) {\n return a * multiplier;\n };\n int result = times(5); // result = 15\n \n\n* Lambda function with capture-by-reference.\n\n int expiresInDays = 45;\n auto updateDays = [&expiresInDays](int newDays) {\n expiresInDays = newDays;\n };\n updateDays(30); // expiresInDays = 30\n \n\nNote that, when using the capture by reference, any change made to the captured variable _inside_ the lambda function will affect its value in the surrounding scope.\n\nLearn more from the following resources:",
"links": [
{
"title": "Lambda Expressions",
@ -193,12 +193,12 @@
},
"MwznA4qfpNlv6sqSNjPZi": {
"title": "Data Types",
"description": "In C++, data types are used to categorize different types of data that a program can process. They are essential for determining the type of value a variable can hold and how much memory space it will occupy. Some basic data types in C++ include integers, floating-point numbers, characters, and booleans.\n\nFundamental Data Types\n----------------------\n\nInteger (int)\n-------------\n\nIntegers are whole numbers that can store both positive and negative values. The size of `int` depends on the system architecture (usually 4 bytes).\n\nExample:\n\n int num = 42;\n \n\nThere are variants of `int` that can hold different ranges of numbers:\n\n* short (`short int`): Smaller range than `int`.\n* long (`long int`): Larger range than `int`.\n* long long (`long long int`): Even larger range than `long int`.\n\nFloating-Point (float, double)\n------------------------------\n\nFloating-point types represent real numbers, i.e., numbers with a decimal point. There are two main floating-point types:\n\n* **float**: Provides single-precision floating-point numbers. It typically occupies 4 bytes of memory.\n\nExample:\n\n float pi = 3.14f;\n \n\n* **double**: Provides double-precision floating-point numbers. It consumes more memory (usually 8 bytes) but has a higher precision than `float`.\n\nExample:\n\n double pi_high_precision = 3.1415926535;\n \n\nCharacter (char)\n----------------\n\nCharacters represent a single character, such as a letter, digit, or symbol. They are stored using the ASCII value of the symbol and typically occupy 1 byte of memory.\n\nExample:\n\n char letter = 'A';\n \n\nBoolean (bool)\n--------------\n\nBooleans represent logical values: `true` or `false`. They usually occupy 1 byte of memory.\n\nExample:\n\n bool is_cpp_great = true;\n \n\nDerived Data Types\n------------------\n\nDerived data types are types that are derived from fundamental data types. Some examples include:\n\nArrays\n------\n\nArrays are used to store multiple values of the same data type in consecutive memory locations.\n\nExample:\n\n int numbers[5] = {1, 2, 3, 4, 5};\n \n\nPointers\n--------\n\nPointers are used to store the memory address of a variable.\n\nExample:\n\n int num = 42;\n int* pNum = &num;\n \n\nReferences\n----------\n\nReferences are an alternative way to share memory locations between variables, allowing you to create an alias for another variable.\n\nExample:\n\n int num = 42;\n int& numRef = num;\n \n\nUser-Defined Data Types\n-----------------------\n\nUser-defined data types are types that are defined by the programmer, such as structures, classes, and unions.\n\nStructures (struct)\n-------------------\n\nStructures are used to store different data types under a single variable and accessibility of member variables and methods are public.\n\nExample:\n\n struct Person {\n std::string name;\n int age;\n float height;\n };\n \n Person p1 = {\"John Doe\", 30, 5.9};\n \n\nClasses (class)\n---------------\n\nClasses are similar to structures, but the accessibility of the member data and function are governed by access specifiers. By default access to members of a class is private.\n\nExample:\n\n class Person {\n public:\n std::string name;\n int age;\n \n void printInfo() {\n std::cout << \"Name: \" << name << \", Age: \" << age << std::endl;\n };\n };\n \n Person p1;\n p1.name = \"John Doe\";\n p1.age = 30;\n \n\nUnions (union)\n--------------\n\nUnions are used to store different data types in the same memory location.\n\nExample:\n\n union Data {\n int num;\n char letter;\n float decimal;\n };\n \n Data myData;\n myData.num = 42;",
"description": "In C++, data types are used to categorize different types of data that a program can process. They are essential for determining the type of value a variable can hold and how much memory space it will occupy. Some basic data types in C++ include integers, floating-point numbers, characters, and booleans.\n\nFundamental Data Types\n----------------------\n\nInteger (int)\n-------------\n\nIntegers are whole numbers that can store both positive and negative values. The size of `int` depends on the system architecture (usually 4 bytes).\n\nExample:\n\n int num = 42;\n \n\nThere are variants of `int` that can hold different ranges of numbers:\n\n* short (`short int`): Smaller range than `int`.\n* long (`long int`): Larger range than `int`.\n* long long (`long long int`): Even larger range than `long int`.\n\nFloating-Point (float, double)\n------------------------------\n\nFloating-point types represent real numbers, i.e., numbers with a decimal point. There are two main floating-point types:\n\n* **float**: Provides single-precision floating-point numbers. It typically occupies 4 bytes of memory.\n\nExample:\n\n float pi = 3.14f;\n \n\n* **double**: Provides double-precision floating-point numbers. It consumes more memory (usually 8 bytes) but has a higher precision than `float`.\n\nExample:\n\n double pi_high_precision = 3.1415926535;\n \n\nCharacter (char)\n----------------\n\nCharacters represent a single character, such as a letter, digit, or symbol. They are stored using the ASCII value of the symbol and typically occupy 1 byte of memory.\n\nExample:\n\n char letter = 'A';\n \n\nBoolean (bool)\n--------------\n\nBooleans represent logical values: `true` or `false`. They usually occupy 1 byte of memory.\n\nExample:\n\n bool is_cpp_great = true;\n \n\nDerived Data Types\n------------------\n\nDerived data types are types that are derived from fundamental data types. Some examples include:\n\nArrays\n------\n\nArrays are used to store multiple values of the same data type in consecutive memory locations.\n\nExample:\n\n int numbers[5] = {1, 2, 3, 4, 5};\n \n\nPointers\n--------\n\nPointers are used to store the memory address of a variable.\n\nExample:\n\n int num = 42;\n int* pNum = &num;\n \n\nReferences\n----------\n\nReferences are an alternative way to share memory locations between variables, allowing you to create an alias for another variable.\n\nExample:\n\n int num = 42;\n int& numRef = num;\n \n\nUser-Defined Data Types\n-----------------------\n\nUser-defined data types are types that are defined by the programmer, such as structures, classes, and unions.\n\nStructures (struct)\n-------------------\n\nStructures are used to store different data types under a single variable and accessibility of member variables and methods are public.\n\nExample:\n\n struct Person {\n std::string name;\n int age;\n float height;\n };\n \n Person p1 = {\"John Doe\", 30, 5.9};\n \n\nClasses (class)\n---------------\n\nClasses are similar to structures, but the accessibility of the member data and function are governed by access specifiers. By default access to members of a class is private.\n\nExample:\n\n class Person {\n public:\n std::string name;\n int age;\n \n void printInfo() {\n std::cout << \"Name: \" << name << \", Age: \" << age << '\\n';\n };\n };\n \n Person p1;\n p1.name = \"John Doe\";\n p1.age = 30;\n \n\nUnions (union)\n--------------\n\nUnions are used to store different data types in the same memory location.\n\nExample:\n\n union Data {\n int num;\n char letter;\n float decimal;\n };\n \n Data myData;\n myData.num = 42;",
"links": []
},
"f1djN0GxoeVPr_0cl6vMq": {
"title": "Static Typing",
"description": "In C++, static typing means that the data type of a variable is determined at compile time, before the program is executed. This means that a variable can only be used with data of a specific type, and the compiler ensures that the operations performed with the variable are compatible with its type. If there is a mismatch , the compiler will adjust the data type of variable to match another provided it's feasible . This process is known as `Type Conversion`. If compiler not able to achieve type conversion , `Invalid Type Conversion` error will be raised during compilation of the code .\n\nC++ is a statically typed language, which means that it uses static typing to determine data types and perform type checking during compile time. This helps with ensuring type safety and can prevent certain types of errors from occurring during the execution of the program.\n\nHere's a simple code example to demonstrate static typing in C++:\n\n #include <iostream>\n \n int main() {\n int num = 65; // 'num' is statically typed as an integer\n double pi = 3.14159; // 'pi' is statically typed as a double\n char c = 'c'; // 'c' is statically typed as a char\n \n c = num; // This asssigment would convert num's value to ASCII equivalent character\n num = pi; // This assignment would convert pi's value from double type to int type\n \n std::cout << \"The value of num is: \" << num << std::endl;\n std::cout << \"The value of pi is: \" << pi << std::endl;\n std::cout << \"The value of c is: \"<< c << std::endl;\n return 0;\n }\n \n\nIn the code above, the variable `num` is statically typed as an `int`, `pi` is statically typed as a `double`, and `c` is statically typed as a `char`. If you attempt to assign the value of `pi` to `num`, the value `3.14159` will be converted to the integer `3` and assigned to `num`. Similarly, when the value of `num` is assigned to `c`, the compiler will convert the value `65` to its corresponding [ASCII](https://www.ascii-code.com) code, which is `A`.\n\nLearn more from the following resources:",
"description": "In C++, static typing means that the data type of a variable is determined at compile time, before the program is executed. This means that a variable can only be used with data of a specific type, and the compiler ensures that the operations performed with the variable are compatible with its type. If there is a mismatch , the compiler will adjust the data type of variable to match another provided it's feasible . This process is known as `Type Conversion`. If compiler not able to achieve type conversion , `Invalid Type Conversion` error will be raised during compilation of the code .\n\nC++ is a statically typed language, which means that it uses static typing to determine data types and perform type checking during compile time. This helps with ensuring type safety and can prevent certain types of errors from occurring during the execution of the program.\n\nHere's a simple code example to demonstrate static typing in C++:\n\n #include <iostream>\n \n int main() {\n int num = 65; // 'num' is statically typed as an integer\n double pi = 3.14159; // 'pi' is statically typed as a double\n char c = 'c'; // 'c' is statically typed as a char\n \n c = num; // This asssigment would convert num's value to ASCII equivalent character\n num = pi; // This assignment would convert pi's value from double type to int type\n \n std::cout << \"The value of num is: \" << num << '\\n';\n std::cout << \"The value of pi is: \" << pi << '\\n';\n std::cout << \"The value of c is: \"<< c << '\\n';\n return 0;\n }\n \n\nIn the code above, the variable `num` is statically typed as an `int`, `pi` is statically typed as a `double`, and `c` is statically typed as a `char`. If you attempt to assign the value of `pi` to `num`, the value `3.14159` will be converted to the integer `3` and assigned to `num`. Similarly, when the value of `num` is assigned to `c`, the compiler will convert the value `65` to its corresponding [ASCII](https://www.ascii-code.com) code, which is `A`.\n\nLearn more from the following resources:",
"links": [
{
"title": "Type-Coversion",
@ -214,7 +214,7 @@
},
"i0EAFEUB-F0wBJWOtrl1A": {
"title": "Dynamic Typing",
"description": "C++ is known as a statically-typed language, which means the data types of its variables are determined at compile time. However, C++ also provides concepts to have certain level of _dynamic typing_, which means determining the data types of variables at runtime.\n\nHere is a brief overview of two ways to achieve dynamic typing in C++:\n\n`void*` Pointers\n----------------\n\nA `void*` pointer is a generic pointer that can point to objects of any data type. They can be used to store a reference to any type of object without knowing the specific type of the object.\n\nExample:\n\n #include <iostream>\n \n int main() {\n int x = 42;\n float y = 3.14f;\n std::string z = \"Hello, world!\";\n \n void* void_ptr;\n \n void_ptr = &x;\n std::cout << \"int value: \" << *(static_cast<int*>(void_ptr)) << std::endl;\n \n void_ptr = &y;\n std::cout << \"float value: \" << *(static_cast<float*>(void_ptr)) << std::endl;\n \n void_ptr = &z;\n std::cout << \"string value: \" << *(static_cast<std::string*>(void_ptr)) << std::endl;\n \n return 0;\n }\n \n\n`std::any` (C++17)\n------------------\n\nC++17 introduced the `std::any` class which represents a generalized type-safe container for single values of any type.\n\nExample:\n\n #include <iostream>\n #include <any>\n \n int main() {\n std::any any_value;\n \n any_value = 42;\n std::cout << \"int value: \" << std::any_cast<int>(any_value) << std::endl;\n \n any_value = 3.14;\n std::cout << \"double value: \" << std::any_cast<double>(any_value) << std::endl;\n \n any_value = std::string(\"Hello, world!\");\n std::cout << \"string value: \" << std::any_cast<std::string>(any_value) << std::endl;\n \n return 0;\n }\n \n\nKeep in mind that both `void*` pointers and `std::any` have performance implications due to the additional type checking and casting that take place during runtime. They should be used carefully and only when absolutely necessary.",
"description": "C++ is known as a statically-typed language, which means the data types of its variables are determined at compile time. However, C++ also provides concepts to have certain level of _dynamic typing_, which means determining the data types of variables at runtime.\n\nHere is a brief overview of two ways to achieve dynamic typing in C++:\n\n`void*` Pointers\n----------------\n\nA `void*` pointer is a generic pointer that can point to objects of any data type. They can be used to store a reference to any type of object without knowing the specific type of the object.\n\nExample:\n\n #include <iostream>\n \n int main() {\n int x = 42;\n float y = 3.14f;\n std::string z = \"Hello, world!\";\n \n void* void_ptr;\n \n void_ptr = &x;\n std::cout << \"int value: \" << *(static_cast<int*>(void_ptr)) << '\\n';\n \n void_ptr = &y;\n std::cout << \"float value: \" << *(static_cast<float*>(void_ptr)) << '\\n';\n \n void_ptr = &z;\n std::cout << \"string value: \" << *(static_cast<std::string*>(void_ptr)) << '\\n';\n \n return 0;\n }\n \n\n`std::any` (C++17)\n------------------\n\nC++17 introduced the `std::any` class which represents a generalized type-safe container for single values of any type.\n\nExample:\n\n #include <iostream>\n #include <any>\n \n int main() {\n std::any any_value;\n \n any_value = 42;\n std::cout << \"int value: \" << std::any_cast<int>(any_value) << '\\n';\n \n any_value = 3.14;\n std::cout << \"double value: \" << std::any_cast<double>(any_value) << '\\n';\n \n any_value = std::string(\"Hello, world!\");\n std::cout << \"string value: \" << std::any_cast<std::string>(any_value) << '\\n';\n \n return 0;\n }\n \n\nKeep in mind that both `void*` pointers and `std::any` have performance implications due to the additional type checking and casting that take place during runtime. They should be used carefully and only when absolutely necessary.",
"links": []
},
"r0yD1gfn03wTpEBi6zNsu": {
@ -235,7 +235,7 @@
},
"uUzRKa9wGzdUwwmAg3FWr": {
"title": "References",
"description": "A reference can be considered as a constant pointer (not to be confused with a pointer to a constant value) which always points to (references) the same object. They are declared using the `&` (ampersand) symbol.\n\nDeclaration and Initialization\n------------------------------\n\nTo declare a reference, use the `&` symbol followed by the variable type and the reference's name. Note that you must initialize a reference when you declare it.\n\n int var = 10; // Declare an integer variable\n int& ref = var; // Declare a reference that \"points to\" var\n \n\nUsage\n-----\n\nYou can use the reference just like you'd use the original variable. When you change the value of the reference, the value of the original variable also changes, because they both share the same memory location.\n\n var = 20; // Sets the value of var to 20\n std::cout << ref << std::endl; // Outputs 20\n \n ref = 30; // Sets the value of ref to 30\n std::cout << var << std::endl; // Outputs 30\n \n\nFunction Parameters\n-------------------\n\nYou can use references as function parameters to create an alias for an argument. This is commonly done when you need to modify the original variable or when passing an object of considerable size to avoid the cost of copying.\n\n void swap(int& a, int& b) {\n int temp = a;\n a = b;\n b = temp;\n }\n \n int main() {\n int x = 5, y = 10;\n std::cout << \"Before Swap: x = \" << x << \" y = \" << y << std::endl; // Outputs 5 10\n \n swap(x, y);\n std::cout << \"After Swap: x = \" << x << \" y = \" << y << std::endl; // Outputs 10 5\n }",
"description": "A reference can be considered as a constant pointer (not to be confused with a pointer to a constant value) which always points to (references) the same object. They are declared using the `&` (ampersand) symbol.\n\nDeclaration and Initialization\n------------------------------\n\nTo declare a reference, use the `&` symbol followed by the variable type and the reference's name. Note that you must initialize a reference when you declare it.\n\n int var = 10; // Declare an integer variable\n int& ref = var; // Declare a reference that \"points to\" var\n \n\nUsage\n-----\n\nYou can use the reference just like you'd use the original variable. When you change the value of the reference, the value of the original variable also changes, because they both share the same memory location.\n\n var = 20; // Sets the value of var to 20\n std::cout << ref << '\\n'; // Outputs 20\n \n ref = 30; // Sets the value of ref to 30\n std::cout << var << '\\n'; // Outputs 30\n \n\nFunction Parameters\n-------------------\n\nYou can use references as function parameters to create an alias for an argument. This is commonly done when you need to modify the original variable or when passing an object of considerable size to avoid the cost of copying.\n\n void swap(int& a, int& b) {\n int temp = a;\n a = b;\n b = temp;\n }\n \n int main() {\n int x = 5, y = 10;\n std::cout << \"Before Swap: x = \" << x << \" y = \" << y << '\\n'; // Outputs 5 10\n \n swap(x, y);\n std::cout << \"After Swap: x = \" << x << \" y = \" << y << '\\n'; // Outputs 10 5\n }",
"links": []
},
"mSFwsTYvmg-GwG4_DEIEf": {
@ -290,22 +290,22 @@
},
"dKCYmxDNZubCVcR5rf8b-": {
"title": "Scope",
"description": "**Scope** refers to the visibility and accessibility of variables, functions, classes, and other identifiers in a C++ program. It determines the lifetime and extent of these identifiers. In C++, there are four types of scope:\n\n* **Global scope:** Identifiers declared outside any function or class have a global scope. They can be accessed from any part of the program (unless hidden by a local identifier with the same name). The lifetime of a global identifier is the entire duration of the program.\n\n #include <iostream>\n \n int globalVar; // This is a global variable\n \n int main() {\n std::cout << \"Global variable: \" << globalVar << std::endl;\n }\n \n\n* **Local scope:** Identifiers declared within a function or a block have a local scope. They can be accessed only within the function or the block they were declared in. Their lifetime is limited to the duration of the function/block execution.\n\n #include <iostream>\n \n void localExample() {\n int localVar; // This is a local variable\n localVar = 5;\n std::cout << \"Local variable: \" << localVar << std::endl;\n }\n \n int main() {\n localExample();\n // std::cout << localVar << std::endl; //error: ‘localVar’ was not declared in this scope\n }\n \n\n* **Namespace scope:** A namespace is a named scope that groups related identifiers together. Identifiers declared within a namespace have the namespace scope. They can be accessed using the namespace name and the scope resolution operator `::`.\n\n #include <iostream>\n \n namespace MyNamespace {\n int namespaceVar = 42;\n }\n \n int main() {\n std::cout << \"Namespace variable: \" << MyNamespace::namespaceVar << std::endl;\n }\n \n\n* **Class scope:** Identifiers declared within a class have a class scope. They can be accessed using the class name and the scope resolution operator `::` or, for non-static members, an object of the class and the dot `.` or arrow `->` operator.\n\n #include <iostream>\n \n class MyClass {\n public:\n static int staticMember;\n int nonStaticMember;\n \n MyClass(int value) : nonStaticMember(value) {}\n };\n \n int MyClass::staticMember = 7;\n \n int main() {\n MyClass obj(10);\n std::cout << \"Static member: \" << MyClass::staticMember << std::endl;\n std::cout << \"Non-static member: \" << obj.nonStaticMember << std::endl;\n }\n \n\nUnderstanding various types of scope in C++ is essential for effective code structuring and management of resources in a codebase.",
"description": "**Scope** refers to the visibility and accessibility of variables, functions, classes, and other identifiers in a C++ program. It determines the lifetime and extent of these identifiers. In C++, there are four types of scope:\n\n* **Global scope:** Identifiers declared outside any function or class have a global scope. They can be accessed from any part of the program (unless hidden by a local identifier with the same name). The lifetime of a global identifier is the entire duration of the program.\n\n #include <iostream>\n \n int globalVar; // This is a global variable\n \n int main() {\n std::cout << \"Global variable: \" << globalVar << '\\n';\n }\n \n\n* **Local scope:** Identifiers declared within a function or a block have a local scope. They can be accessed only within the function or the block they were declared in. Their lifetime is limited to the duration of the function/block execution.\n\n #include <iostream>\n \n void localExample() {\n int localVar; // This is a local variable\n localVar = 5;\n std::cout << \"Local variable: \" << localVar << '\\n';\n }\n \n int main() {\n localExample();\n // std::cout << localVar << '\\n'; //error: ‘localVar’ was not declared in this scope\n }\n \n\n* **Namespace scope:** A namespace is a named scope that groups related identifiers together. Identifiers declared within a namespace have the namespace scope. They can be accessed using the namespace name and the scope resolution operator `::`.\n\n #include <iostream>\n \n namespace MyNamespace {\n int namespaceVar = 42;\n }\n \n int main() {\n std::cout << \"Namespace variable: \" << MyNamespace::namespaceVar << '\\n';\n }\n \n\n* **Class scope:** Identifiers declared within a class have a class scope. They can be accessed using the class name and the scope resolution operator `::` or, for non-static members, an object of the class and the dot `.` or arrow `->` operator.\n\n #include <iostream>\n \n class MyClass {\n public:\n static int staticMember;\n int nonStaticMember;\n \n MyClass(int value) : nonStaticMember(value) {}\n };\n \n int MyClass::staticMember = 7;\n \n int main() {\n MyClass obj(10);\n std::cout << \"Static member: \" << MyClass::staticMember << '\\n';\n std::cout << \"Non-static member: \" << obj.nonStaticMember << '\\n';\n }\n \n\nUnderstanding various types of scope in C++ is essential for effective code structuring and management of resources in a codebase.",
"links": []
},
"iIdC7V8sojwyEqK1xMuHn": {
"title": "Namespaces",
"description": "In C++, a namespace is a named scope or container that is used to organize and enclose a collection of code elements, such as variables, functions, classes, and other namespaces. They are mainly used to divide and manage the code base, giving developers control over name collisions and the specialization of code.\n\nSyntax\n------\n\nHere's the syntax for declaring a namespace:\n\n namespace identifier {\n // code elements\n }\n \n\nUsing Namespaces\n----------------\n\nTo access elements within a namespace, you can use the scope resolution operator `::`. Here are some examples:\n\n### Declaring and accessing a namespace\n\n #include <iostream>\n \n namespace animals {\n std::string dog = \"Bobby\";\n std::string cat = \"Lilly\";\n }\n \n int main() {\n std::cout << \"Dog's name: \" << animals::dog << std::endl;\n std::cout << \"Cat's name: \" << animals::cat << std::endl;\n \n return 0;\n }\n \n\n### Nesting namespaces\n\nNamespaces can be nested within other namespaces:\n\n #include <iostream>\n \n namespace outer {\n int x = 10;\n \n namespace inner {\n int y = 20;\n }\n }\n \n int main() {\n std::cout << \"Outer x: \" << outer::x << std::endl;\n std::cout << \"Inner y: \" << outer::inner::y << std::endl;\n \n return 0;\n }\n \n\n`using` Keyword\n---------------\n\nYou can use the `using` keyword to import namespaced elements into the current scope. However, this might lead to name conflicts if multiple namespaces have elements with the same name.\n\n### Using a single element from a namespace\n\n #include <iostream>\n \n namespace animals {\n std::string dog = \"Bobby\";\n std::string cat = \"Lilly\";\n }\n \n int main() {\n using animals::dog;\n \n std::cout << \"Dog's name: \" << dog << std::endl;\n \n return 0;\n }\n \n\n### Using the entire namespace\n\n #include <iostream>\n \n namespace animals {\n std::string dog = \"Bobby\";\n std::string cat = \"Lilly\";\n }\n \n int main() {\n using namespace animals;\n \n std::cout << \"Dog's name: \" << dog << std::endl;\n std::cout << \"Cat's name: \" << cat << std::endl;\n \n return 0;\n }\n \n\nIn conclusion, namespaces are a useful mechanism in C++ to organize code, avoid naming conflicts, and manage the visibility of code elements.",
"description": "In C++, a namespace is a named scope or container that is used to organize and enclose a collection of code elements, such as variables, functions, classes, and other namespaces. They are mainly used to divide and manage the code base, giving developers control over name collisions and the specialization of code.\n\nSyntax\n------\n\nHere's the syntax for declaring a namespace:\n\n namespace identifier {\n // code elements\n }\n \n\nUsing Namespaces\n----------------\n\nTo access elements within a namespace, you can use the scope resolution operator `::`. Here are some examples:\n\n### Declaring and accessing a namespace\n\n #include <iostream>\n \n namespace animals {\n std::string dog = \"Bobby\";\n std::string cat = \"Lilly\";\n }\n \n int main() {\n std::cout << \"Dog's name: \" << animals::dog << '\\n';\n std::cout << \"Cat's name: \" << animals::cat << '\\n';\n \n return 0;\n }\n \n\n### Nesting namespaces\n\nNamespaces can be nested within other namespaces:\n\n #include <iostream>\n \n namespace outer {\n int x = 10;\n \n namespace inner {\n int y = 20;\n }\n }\n \n int main() {\n std::cout << \"Outer x: \" << outer::x << '\\n';\n std::cout << \"Inner y: \" << outer::inner::y << '\\n';\n \n return 0;\n }\n \n\n`using` Keyword\n---------------\n\nYou can use the `using` keyword to import namespaced elements into the current scope. However, this might lead to name conflicts if multiple namespaces have elements with the same name.\n\n### Using a single element from a namespace\n\n #include <iostream>\n \n namespace animals {\n std::string dog = \"Bobby\";\n std::string cat = \"Lilly\";\n }\n \n int main() {\n using animals::dog;\n \n std::cout << \"Dog's name: \" << dog << '\\n';\n \n return 0;\n }\n \n\n### Using the entire namespace\n\n #include <iostream>\n \n namespace animals {\n std::string dog = \"Bobby\";\n std::string cat = \"Lilly\";\n }\n \n int main() {\n using namespace animals;\n \n std::cout << \"Dog's name: \" << dog << '\\n';\n std::cout << \"Cat's name: \" << cat << '\\n';\n \n return 0;\n }\n \n\nIn conclusion, namespaces are a useful mechanism in C++ to organize code, avoid naming conflicts, and manage the visibility of code elements.",
"links": []
},
"CK7yf8Bo7kfbV6x2tZTrh": {
"title": "Headers / CPP Files",
"description": "Code splitting refers to the process of breaking down a large code base into smaller, more manageable files or modules. This helps improve the organization, maintainability, and readability of the code. In C++, code splitting is generally achieved through the use of separate compilation, header files, and source files.\n\n### Header Files (.h or .hpp)\n\nHeader files, usually with the `.h` or `.hpp` extension, are responsible for declaring classes, functions, and variables that are needed by multiple source files. They act as an interface between different parts of the code, making it easier to manage dependencies and reduce the chances of duplicated code.\n\nExample of a header file:\n\n // example.h\n #ifndef EXAMPLE_H\n #define EXAMPLE_H\n \n class Example {\n public:\n void printMessage();\n };\n \n #endif\n \n\n### Source Files (.cpp)\n\nSource files, with the `.cpp` extension, are responsible for implementing the actual functionality defined in the corresponding header files. They include the header files as needed and provide the function and class method definitions.\n\nExample of a source file:\n\n // example.cpp\n #include \"example.h\"\n #include <iostream>\n \n void Example::printMessage() {\n std::cout << \"Hello, code splitting!\" << std::endl;\n }\n \n\n### Separate Compilation\n\nC++ allows for separate compilation, which means that each source file can be compiled independently into an object file. These object files can then be linked together to form the final executable. This provides faster build times when making changes to a single source file since only that file needs to be recompiled, and the other object files can be reused.\n\nExample of separate compilation and linking:\n\n # Compile each source file into an object file\n g++ -c main.cpp -o main.o\n g++ -c example.cpp -o example.o\n \n # Link object files together to create the executable\n g++ main.o example.o -o my_program\n \n\nBy following the code splitting technique, you can better organize your C++ codebase, making it more manageable and maintainable.",
"description": "Code splitting refers to the process of breaking down a large code base into smaller, more manageable files or modules. This helps improve the organization, maintainability, and readability of the code. In C++, code splitting is generally achieved through the use of separate compilation, header files, and source files.\n\n### Header Files (.h or .hpp)\n\nHeader files, usually with the `.h` or `.hpp` extension, are responsible for declaring classes, functions, and variables that are needed by multiple source files. They act as an interface between different parts of the code, making it easier to manage dependencies and reduce the chances of duplicated code.\n\nExample of a header file:\n\n // example.h\n #ifndef EXAMPLE_H\n #define EXAMPLE_H\n \n class Example {\n public:\n void printMessage();\n };\n \n #endif\n \n\n### Source Files (.cpp)\n\nSource files, with the `.cpp` extension, are responsible for implementing the actual functionality defined in the corresponding header files. They include the header files as needed and provide the function and class method definitions.\n\nExample of a source file:\n\n // example.cpp\n #include \"example.h\"\n #include <iostream>\n \n void Example::printMessage() {\n std::cout << \"Hello, code splitting!\\n\";\n }\n \n\n### Separate Compilation\n\nC++ allows for separate compilation, which means that each source file can be compiled independently into an object file. These object files can then be linked together to form the final executable. This provides faster build times when making changes to a single source file since only that file needs to be recompiled, and the other object files can be reused.\n\nExample of separate compilation and linking:\n\n # Compile each source file into an object file\n g++ -c main.cpp -o main.o\n g++ -c example.cpp -o example.o\n \n # Link object files together to create the executable\n g++ main.o example.o -o my_program\n \n\nBy following the code splitting technique, you can better organize your C++ codebase, making it more manageable and maintainable.",
"links": []
},
"CMlWNQwpywNhO9B6Yj6Me": {
"title": "Structures and Classes",
"description": "Structures and classes are user-defined data types in C++ that allow for the grouping of variables of different data types under a single name. They make it easier to manage and organize complex data by creating objects that have particular attributes and behaviors. The main difference between a structure and a class is their default access specifier: members of a structure are public by default, while members of a class are private.\n\nStructures\n----------\n\nA structure is defined using the `struct` keyword, followed by the structure's name and a set of curly braces `{}` enclosing the members (variables and/or functions) of the structure. The members can be of different data types. To create an object of the structure's type, use the structure name followed by the object name.\n\nHere's an example of defining a structure and creating an object:\n\n struct Employee {\n int id;\n std::string name;\n float salary;\n };\n \n Employee e1; // create an object of the 'Employee' structure\n \n\nYou can access the members of a structure using the dot operator `.`:\n\n e1.id = 1;\n e1.name = \"John Doe\";\n e1.salary = 40000;\n \n\nClasses\n-------\n\nA class is defined using the `class` keyword, followed by the class's name and a set of curly braces `{}` enclosing the members (variables and/or functions) of the class. Like structures, class members can be of different data types. You can create objects of a class using the class name followed by the object name.\n\nHere's an example of a class definition and object creation:\n\n class Student {\n int roll_no;\n std::string name;\n float marks;\n \n public:\n void set_data(int r, std::string n, float m) {\n roll_no = r;\n name = n;\n marks = m;\n }\n \n void display() {\n std::cout << \"Roll no: \" << roll_no\n << \"\\nName: \" << name\n << \"\\nMarks: \" << marks << std::endl;\n }\n };\n \n Student s1; // create an object of the 'Student' class\n \n\nSince the data members of a class are private by default, we cannot access them directly using the dot operator from outside the class. Instead, we use public member functions to set or get their values:\n\n s1.set_data(1, \"Alice\", 95.0);\n s1.display();\n \n\nThat's a brief summary of structures and classes in C++. Remember that while they may seem similar, classes provide more control over data encapsulation and can be used to implement more advanced features like inheritance and polymorphism.",
"description": "Structures and classes are user-defined data types in C++ that allow for the grouping of variables of different data types under a single name. They make it easier to manage and organize complex data by creating objects that have particular attributes and behaviors. The main difference between a structure and a class is their default access specifier: members of a structure are public by default, while members of a class are private.\n\nStructures\n----------\n\nA structure is defined using the `struct` keyword, followed by the structure's name and a set of curly braces `{}` enclosing the members (variables and/or functions) of the structure. The members can be of different data types. To create an object of the structure's type, use the structure name followed by the object name.\n\nHere's an example of defining a structure and creating an object:\n\n struct Employee {\n int id;\n std::string name;\n float salary;\n };\n \n Employee e1; // create an object of the 'Employee' structure\n \n\nYou can access the members of a structure using the dot operator `.`:\n\n e1.id = 1;\n e1.name = \"John Doe\";\n e1.salary = 40000;\n \n\nClasses\n-------\n\nA class is defined using the `class` keyword, followed by the class's name and a set of curly braces `{}` enclosing the members (variables and/or functions) of the class. Like structures, class members can be of different data types. You can create objects of a class using the class name followed by the object name.\n\nHere's an example of a class definition and object creation:\n\n class Student {\n int roll_no;\n std::string name;\n float marks;\n \n public:\n void set_data(int r, std::string n, float m) {\n roll_no = r;\n name = n;\n marks = m;\n }\n \n void display() {\n std::cout << \"Roll no: \" << roll_no\n << \"\\nName: \" << name\n << \"\\nMarks: \" << marks << '\\n';\n }\n };\n \n Student s1; // create an object of the 'Student' class\n \n\nSince the data members of a class are private by default, we cannot access them directly using the dot operator from outside the class. Instead, we use public member functions to set or get their values:\n\n s1.set_data(1, \"Alice\", 95.0);\n s1.display();\n \n\nThat's a brief summary of structures and classes in C++. Remember that while they may seem similar, classes provide more control over data encapsulation and can be used to implement more advanced features like inheritance and polymorphism.",
"links": []
},
"7sdEzZCIoarzznwO4XcCv": {
@ -315,12 +315,12 @@
},
"WjHpueZDK-d3oDNMVZi9w": {
"title": "Multiple Inheritance",
"description": "Multiple inheritance is a feature in C++ where a class can inherit characteristics (data members and member functions) from more than one parent class. The concept is similar to single inheritance (where a class inherits from a single base class), but in multiple inheritance, a class can have multiple base classes.\n\nWhen a class inherits multiple base classes, it becomes a mixture of their properties and behaviors, and can override or extend them as needed.\n\nSyntax\n------\n\nHere is the syntax to declare a class with multiple inheritance:\n\n class DerivedClass : access-specifier BaseClass1, access-specifier BaseClass2, ...\n {\n // class body\n };\n \n\nThe `DerivedClass` will inherit members from both `BaseClass1` and `BaseClass2`. The `access-specifier` (like `public`, `protected`, or `private`) determines the accessibility of the inherited members.\n\nExample\n-------\n\nHere is an example of multiple inheritance in action:\n\n #include <iostream>\n \n // Base class 1\n class Animal\n {\n public:\n void eat()\n {\n std::cout << \"I can eat!\" << std::endl;\n }\n };\n \n // Base class 2\n class Mammal\n {\n public:\n void breath()\n {\n std::cout << \"I can breathe!\" << std::endl;\n }\n };\n \n // Derived class inheriting from both Animal and Mammal\n class Dog : public Animal, public Mammal\n {\n public:\n void bark()\n {\n std::cout << \"I can bark! Woof woof!\" << std::endl;\n }\n };\n \n int main()\n {\n Dog myDog;\n \n // Calling members from both base classes\n myDog.eat();\n myDog.breath();\n \n // Calling a member from the derived class\n myDog.bark();\n \n return 0;\n }\n \n\nNote\n----\n\nIn some cases, multiple inheritance can lead to complications such as ambiguity and the \"diamond problem\". Ensure that you use multiple inheritance judiciously and maintain well-structured and modular classes to prevent issues.\n\nFor more information on C++ multiple inheritance and related topics, refer to C++ documentation or a comprehensive C++ programming guide.",
"description": "Multiple inheritance is a feature in C++ where a class can inherit characteristics (data members and member functions) from more than one parent class. The concept is similar to single inheritance (where a class inherits from a single base class), but in multiple inheritance, a class can have multiple base classes.\n\nWhen a class inherits multiple base classes, it becomes a mixture of their properties and behaviors, and can override or extend them as needed.\n\nSyntax\n------\n\nHere is the syntax to declare a class with multiple inheritance:\n\n class DerivedClass : access-specifier BaseClass1, access-specifier BaseClass2, ...\n {\n // class body\n };\n \n\nThe `DerivedClass` will inherit members from both `BaseClass1` and `BaseClass2`. The `access-specifier` (like `public`, `protected`, or `private`) determines the accessibility of the inherited members.\n\nExample\n-------\n\nHere is an example of multiple inheritance in action:\n\n #include <iostream>\n \n // Base class 1\n class Animal\n {\n public:\n void eat()\n {\n std::cout << \"I can eat!\\n\";\n }\n };\n \n // Base class 2\n class Mammal\n {\n public:\n void breath()\n {\n std::cout << \"I can breathe!\\n\";\n }\n };\n \n // Derived class inheriting from both Animal and Mammal\n class Dog : public Animal, public Mammal\n {\n public:\n void bark()\n {\n std::cout << \"I can bark! Woof woof!\\n\";\n }\n };\n \n int main()\n {\n Dog myDog;\n \n // Calling members from both base classes\n myDog.eat();\n myDog.breath();\n \n // Calling a member from the derived class\n myDog.bark();\n \n return 0;\n }\n \n\nNote\n----\n\nIn some cases, multiple inheritance can lead to complications such as ambiguity and the \"diamond problem\". Ensure that you use multiple inheritance judiciously and maintain well-structured and modular classes to prevent issues.\n\nFor more information on C++ multiple inheritance and related topics, refer to C++ documentation or a comprehensive C++ programming guide.",
"links": []
},
"b3-QYKNcW3LYCNOza3Olf": {
"title": "Object Oriented Programming",
"description": "Object-oriented programming (OOP) is a programming paradigm that uses objects, which are instances of classes, to perform operations and interact with each other. In C++, you can achieve OOP through the use of classes and objects.\n\nClasses\n-------\n\nA class is a blueprint for creating objects. It defines the structure (data members) and behavior (member functions) for a type of object. Here's an example of a simple class:\n\n class Dog {\n public:\n std::string name;\n int age;\n \n void bark() {\n std::cout << name << \" barks!\" << std::endl;\n }\n };\n \n\nThis `Dog` class has two data members: `name` and `age`, and one member function `bark`. You can create an object of this class and access its members like this:\n\n Dog myDog;\n myDog.name = \"Fido\";\n myDog.age = 3;\n myDog.bark(); // Output: Fido barks!\n \n\nEncapsulation\n-------------\n\nEncapsulation is the concept of bundling data and functions that operate on that data within a single unit, such as a class. It helps to hide the internal implementation details of a class and expose only the necessary information and functionalities. In C++, you can use access specifiers like `public`, `private`, and `protected` to control the visibility and accessibility of class members. For example:\n\n class Dog {\n private:\n std::string name;\n int age;\n \n public:\n void setName(std::string n) {\n name = n;\n }\n \n void setAge(int a) {\n age = a;\n }\n \n void bark() {\n std::cout << name << \" barks!\" << std::endl;\n }\n };\n \n\nIn this example, we've made the `name` and `age` data members `private` and added public member functions `setName` and `setAge` to modify them. This way, the internal data of the `Dog` class is protected and only accessible through the provided functions.\n\nInheritance\n-----------\n\nInheritance is the concept of deriving new classes from existing ones, which enables code reusability and organization. In C++, inheritance is achieved by using a colon `:` followed by the base class' access specifier and the base class name. For example:\n\n class Animal {\n public:\n void breathe() {\n std::cout << \"I can breathe\" << std::endl;\n }\n };\n \n class Dog : public Animal {\n public:\n void bark() {\n std::cout << \"Dog barks!\" << std::endl;\n }\n };\n \n\nIn this example, the `Dog` class inherits from the `Animal` class, so the `Dog` class can access the `breathe` function from the `Animal` class. When you create a `Dog` object, you can use both `breathe` and `bark` functions.\n\n Dog myDog;\n myDog.breathe(); // Output: I can breathe\n myDog.bark(); // Output: Dog barks!\n \n\nPolymorphism\n------------\n\nPolymorphism allows you to use a single interface to represent different types. In C++, it's mainly achieved using function overloading, virtual functions, and overriding. For example:\n\n class Animal {\n public:\n virtual void makeSound() {\n std::cout << \"The Animal makes a sound\" << std::endl;\n }\n };\n \n class Dog : public Animal {\n public:\n void makeSound() override {\n std::cout << \"Dog barks!\" << std::endl;\n }\n };\n \n class Cat : public Animal {\n public:\n void makeSound() override {\n std::cout << \"Cat meows!\" << std::endl;\n }\n };\n \n\nIn this example, we have an `Animal` base class with a virtual `makeSound` function. We then derive two classes, `Dog` and `Cat`, which override the `makeSound` function. This enables polymorphic behavior, where an `Animal` pointer or reference can be used to access the correct `makeSound` function depending on the derived class type.\n\n Animal *animals[2] = {new Dog, new Cat};\n animals[0]->makeSound(); // Output: Dog barks!\n animals[1]->makeSound(); // Output: Cat meows!\n \n\nThat's a brief overview of object-oriented programming concepts in C++.",
"description": "Object-oriented programming (OOP) is a programming paradigm that uses objects, which are instances of classes, to perform operations and interact with each other. In C++, you can achieve OOP through the use of classes and objects.\n\nClasses\n-------\n\nA class is a blueprint for creating objects. It defines the structure (data members) and behavior (member functions) for a type of object. Here's an example of a simple class:\n\n class Dog {\n public:\n std::string name;\n int age;\n \n void bark() {\n std::cout << name << \" barks!\\n\";\n }\n };\n \n\nThis `Dog` class has two data members: `name` and `age`, and one member function `bark`. You can create an object of this class and access its members like this:\n\n Dog myDog;\n myDog.name = \"Fido\";\n myDog.age = 3;\n myDog.bark(); // Output: Fido barks!\n \n\nEncapsulation\n-------------\n\nEncapsulation is the concept of bundling data and functions that operate on that data within a single unit, such as a class. It helps to hide the internal implementation details of a class and expose only the necessary information and functionalities. In C++, you can use access specifiers like `public`, `private`, and `protected` to control the visibility and accessibility of class members. For example:\n\n class Dog {\n private:\n std::string name;\n int age;\n \n public:\n void setName(std::string n) {\n name = n;\n }\n \n void setAge(int a) {\n age = a;\n }\n \n void bark() {\n std::cout << name << \" barks!\\n\";\n }\n };\n \n\nIn this example, we've made the `name` and `age` data members `private` and added public member functions `setName` and `setAge` to modify them. This way, the internal data of the `Dog` class is protected and only accessible through the provided functions.\n\nInheritance\n-----------\n\nInheritance is the concept of deriving new classes from existing ones, which enables code reusability and organization. In C++, inheritance is achieved by using a colon `:` followed by the base class' access specifier and the base class name. For example:\n\n class Animal {\n public:\n void breathe() {\n std::cout << \"I can breathe\\n\";\n }\n };\n \n class Dog : public Animal {\n public:\n void bark() {\n std::cout << \"Dog barks!\\n\";\n }\n };\n \n\nIn this example, the `Dog` class inherits from the `Animal` class, so the `Dog` class can access the `breathe` function from the `Animal` class. When you create a `Dog` object, you can use both `breathe` and `bark` functions.\n\n Dog myDog;\n myDog.breathe(); // Output: I can breathe\n myDog.bark(); // Output: Dog barks!\n \n\nPolymorphism\n------------\n\nPolymorphism allows you to use a single interface to represent different types. In C++, it's mainly achieved using function overloading, virtual functions, and overriding. For example:\n\n class Animal {\n public:\n virtual void makeSound() {\n std::cout << \"The Animal makes a sound\\n\";\n }\n };\n \n class Dog : public Animal {\n public:\n void makeSound() override {\n std::cout << \"Dog barks!\\n\";\n }\n };\n \n class Cat : public Animal {\n public:\n void makeSound() override {\n std::cout << \"Cat meows!\\n\";\n }\n };\n \n\nIn this example, we have an `Animal` base class with a virtual `makeSound` function. We then derive two classes, `Dog` and `Cat`, which override the `makeSound` function. This enables polymorphic behavior, where an `Animal` pointer or reference can be used to access the correct `makeSound` function depending on the derived class type.\n\n Animal *animals[2] = {new Dog, new Cat};\n animals[0]->makeSound(); // Output: Dog barks!\n animals[1]->makeSound(); // Output: Cat meows!\n \n\nThat's a brief overview of object-oriented programming concepts in C++.",
"links": []
},
"hNBErGNiegLsUJn_vgcOR": {
@ -335,22 +335,22 @@
},
"7h1VivjCPDwriL7FirtFv": {
"title": "Dynamic Polymorphism",
"description": "Dynamic polymorphism is a programming concept in object-oriented languages like C++ where a derived class can override or redefine methods of its base class. This means that a single method call can have different implementations based on the type of object it is called on.\n\nDynamic polymorphism is achieved through **virtual functions**, which are member functions of a base class marked with the `virtual` keyword. When you specify a virtual function in a base class, it can be overridden in any derived class to provide a different implementation.\n\nExample\n-------\n\nHere's an example in C++ demonstrating dynamic polymorphism.\n\n #include <iostream>\n \n // Base class\n class Shape {\n public:\n virtual void draw() {\n std::cout << \"Drawing a shape\" << std::endl; \n }\n };\n \n // Derived class 1\n class Circle : public Shape {\n public:\n void draw() override {\n std::cout << \"Drawing a circle\" << std::endl; \n }\n };\n \n // Derived class 2\n class Rectangle : public Shape {\n public:\n void draw() override {\n std::cout << \"Drawing a rectangle\" << std::endl;\n }\n };\n \n int main() {\n Shape* shape;\n Circle circle;\n Rectangle rectangle;\n \n // Storing the address of circle\n shape = &circle;\n \n // Call circle draw function\n shape->draw();\n \n // Storing the address of rectangle\n shape = &rectangle;\n \n // Call rectangle draw function\n shape->draw();\n \n return 0;\n }\n \n\nThis code defines a base class `Shape` with a virtual function `draw`. Two derived classes `Circle` and `Rectangle` both override the `draw` function to provide their own implementations. Then in the `main` function, a pointer of type `Shape` is used to call the respective `draw` functions of `Circle` and `Rectangle` objects. The output of this program will be:\n\n Drawing a circle\n Drawing a rectangle\n \n\nAs you can see, using dynamic polymorphism, we can determine at runtime which `draw` method should be called based on the type of object being used.",
"description": "Dynamic polymorphism is a programming concept in object-oriented languages like C++ where a derived class can override or redefine methods of its base class. This means that a single method call can have different implementations based on the type of object it is called on.\n\nDynamic polymorphism is achieved through **virtual functions**, which are member functions of a base class marked with the `virtual` keyword. When you specify a virtual function in a base class, it can be overridden in any derived class to provide a different implementation.\n\nExample\n-------\n\nHere's an example in C++ demonstrating dynamic polymorphism.\n\n #include <iostream>\n \n // Base class\n class Shape {\n public:\n virtual void draw() {\n std::cout << \"Drawing a shape\\n\"; \n }\n };\n \n // Derived class 1\n class Circle : public Shape {\n public:\n void draw() override {\n std::cout << \"Drawing a circle\\n\"; \n }\n };\n \n // Derived class 2\n class Rectangle : public Shape {\n public:\n void draw() override {\n std::cout << \"Drawing a rectangle\\n\";\n }\n };\n \n int main() {\n Shape* shape;\n Circle circle;\n Rectangle rectangle;\n \n // Storing the address of circle\n shape = &circle;\n \n // Call circle draw function\n shape->draw();\n \n // Storing the address of rectangle\n shape = &rectangle;\n \n // Call rectangle draw function\n shape->draw();\n \n return 0;\n }\n \n\nThis code defines a base class `Shape` with a virtual function `draw`. Two derived classes `Circle` and `Rectangle` both override the `draw` function to provide their own implementations. Then in the `main` function, a pointer of type `Shape` is used to call the respective `draw` functions of `Circle` and `Rectangle` objects. The output of this program will be:\n\n Drawing a circle\n Drawing a rectangle\n \n\nAs you can see, using dynamic polymorphism, we can determine at runtime which `draw` method should be called based on the type of object being used.",
"links": []
},
"B2SGBENzUMl0SAjG4j91V": {
"title": "Exception Handling",
"description": "Exception handling in C++ is a mechanism to handle errors, anomalies, or unexpected events that can occur during the runtime execution of a program. This allows the program to continue running or exit gracefully when encountering errors instead of crashing abruptly.\n\nC++ provides a set of keywords and constructs for implementing exception handling:\n\n* `try`: Defines a block of code that should be monitored for exceptions.\n* `catch`: Specifies the type of exception to be caught and the block of code that shall be executed when that exception occurs.\n* `throw`: Throws an exception that will be caught and handled by the appropriate catch block.\n* `noexcept`: Specifies a function that doesn't throw exceptions or terminates the program if an exception is thrown within its scope.\n\nExample\n-------\n\nHere's an example demonstrating the basic usage of exception handling:\n\n #include <iostream>\n \n int divide(int a, int b) {\n if (b == 0) {\n throw \"Division by zero!\";\n }\n return a / b;\n }\n \n int main() {\n int num1, num2;\n \n std::cout << \"Enter two numbers for division: \";\n std::cin >> num1 >> num2;\n \n try {\n int result = divide(num1, num2);\n std::cout << \"The result is: \" << result << std::endl;\n } catch (const char* msg) {\n std::cerr << \"Error: \" << msg << std::endl;\n }\n \n return 0;\n }\n \n\nIn this example, we define a function `divide` that throws an exception if `b` is zero. In the `main` function, we use a `try` block to call `divide` and output the result. If an exception is thrown, it is caught inside the `catch` block, which outputs an error message. This way, we can handle the error gracefully rather than letting the program crash when attempting to divide by zero.\n\nStandard Exceptions\n-------------------\n\nC++ provides a standard set of exception classes under the `<stdexcept>` library which can be used as the exception type for more specific error handling. Some of these classes include:\n\n* `std::exception`: Base class for all standard exceptions.\n* `std::logic_error`: Represents errors which can be detected statically by the program.\n* `std::runtime_error`: Represents errors occurring during the execution of a program.\n\nHere's an example showing how to use standard exceptions:\n\n #include <iostream>\n #include <stdexcept>\n \n int divide(int a, int b) {\n if (b == 0) {\n throw std::runtime_error(\"Division by zero!\");\n }\n return a / b;\n }\n \n int main() {\n int num1, num2;\n \n std::cout << \"Enter two numbers for division: \";\n std::cin >> num1 >> num2;\n \n try {\n int result = divide(num1, num2);\n std::cout << \"The result is: \" << result << std::endl;\n } catch (const std::exception& e) {\n std::cerr << \"Error: \" << e.what() << std::endl;\n }\n \n return 0;\n }\n \n\nIn this example, we modified the `divide` function to throw a `std::runtime_error` instead of a simple string. The catch block now catches exceptions derived from `std::exception` and uses the member function `what()` to display the error message.",
"description": "Exception handling in C++ is a mechanism to handle errors, anomalies, or unexpected events that can occur during the runtime execution of a program. This allows the program to continue running or exit gracefully when encountering errors instead of crashing abruptly.\n\nC++ provides a set of keywords and constructs for implementing exception handling:\n\n* `try`: Defines a block of code that should be monitored for exceptions.\n* `catch`: Specifies the type of exception to be caught and the block of code that shall be executed when that exception occurs.\n* `throw`: Throws an exception that will be caught and handled by the appropriate catch block.\n* `noexcept`: Specifies a function that doesn't throw exceptions or terminates the program if an exception is thrown within its scope.\n\nExample\n-------\n\nHere's an example demonstrating the basic usage of exception handling:\n\n #include <iostream>\n \n int divide(int a, int b) {\n if (b == 0) {\n throw \"Division by zero!\";\n }\n return a / b;\n }\n \n int main() {\n int num1, num2;\n \n std::cout << \"Enter two numbers for division: \";\n std::cin >> num1 >> num2;\n \n try {\n int result = divide(num1, num2);\n std::cout << \"The result is: \" << result << '\\n';\n } catch (const char* msg) {\n std::cerr << \"Error: \" << msg << '\\n';\n }\n \n return 0;\n }\n \n\nIn this example, we define a function `divide` that throws an exception if `b` is zero. In the `main` function, we use a `try` block to call `divide` and output the result. If an exception is thrown, it is caught inside the `catch` block, which outputs an error message. This way, we can handle the error gracefully rather than letting the program crash when attempting to divide by zero.\n\nStandard Exceptions\n-------------------\n\nC++ provides a standard set of exception classes under the `<stdexcept>` library which can be used as the exception type for more specific error handling. Some of these classes include:\n\n* `std::exception`: Base class for all standard exceptions.\n* `std::logic_error`: Represents errors which can be detected statically by the program.\n* `std::runtime_error`: Represents errors occurring during the execution of a program.\n\nHere's an example showing how to use standard exceptions:\n\n #include <iostream>\n #include <stdexcept>\n \n int divide(int a, int b) {\n if (b == 0) {\n throw std::runtime_error(\"Division by zero!\");\n }\n return a / b;\n }\n \n int main() {\n int num1, num2;\n \n std::cout << \"Enter two numbers for division: \";\n std::cin >> num1 >> num2;\n \n try {\n int result = divide(num1, num2);\n std::cout << \"The result is: \" << result << '\\n';\n } catch (const std::exception& e) {\n std::cerr << \"Error: \" << e.what() << '\\n';\n }\n \n return 0;\n }\n \n\nIn this example, we modified the `divide` function to throw a `std::runtime_error` instead of a simple string. The catch block now catches exceptions derived from `std::exception` and uses the member function `what()` to display the error message.",
"links": []
},
"oWygnpwHq2poXQMTTSCpl": {
"title": "Exit Codes",
"description": "Exit codes, also known as \"return codes\" or \"status codes\", are numeric values that a program returns to the calling environment (usually the operating system) when it finishes execution. These codes are used to indicate the success or failure of a program's execution.\n\n0 is the standard exit code for a successful execution, while non-zero exit codes typically indicate errors or other exceptional situations. The actual meanings of non-zero exit codes can vary between different applications or systems.\n\nIn C++, you can return an exit code from the `main` function by using the `return` statement, or you can use the `exit()` function, which is part of the C++ Standard Library.\n\nExample: Using return in `main`\n-------------------------------\n\n #include <iostream>\n \n int main() {\n // Some code here...\n \n if (/*some error condition*/) {\n std::cout << \"An error occurred.\" << std::endl;\n return 1;\n }\n \n // More code here...\n \n if (/*another error condition*/) {\n std::cout << \"Another error occurred.\" << std::endl;\n return 2;\n }\n \n return 0; // Successful execution\n }\n \n\nExample: Using the `exit()` function\n------------------------------------\n\n #include <iostream>\n #include <cstdlib>\n \n void some_function() {\n // Some code here...\n \n if (/*some error condition*/) {\n std::cout << \"An error occurred.\" << std::endl;\n std::exit(1);\n }\n \n // More code here...\n }\n \n int main() {\n some_function();\n \n // Some other code here...\n \n return 0; // Successful execution\n }\n \n\nIn both examples above, the program returns exit codes depending on different error conditions encountered during execution. The codes 1 and 2 are used to distinguish between the two error conditions.",
"description": "Exit codes, also known as \"return codes\" or \"status codes\", are numeric values that a program returns to the calling environment (usually the operating system) when it finishes execution. These codes are used to indicate the success or failure of a program's execution.\n\n0 is the standard exit code for a successful execution, while non-zero exit codes typically indicate errors or other exceptional situations. The actual meanings of non-zero exit codes can vary between different applications or systems.\n\nIn C++, you can return an exit code from the `main` function by using the `return` statement, or you can use the `exit()` function, which is part of the C++ Standard Library.\n\nExample: Using return in `main`\n-------------------------------\n\n #include <iostream>\n \n int main() {\n // Some code here...\n \n if (/*some error condition*/) {\n std::cout << \"An error occurred.\\n\";\n return 1;\n }\n \n // More code here...\n \n if (/*another error condition*/) {\n std::cout << \"Another error occurred.\\n\";\n return 2;\n }\n \n return 0; // Successful execution\n }\n \n\nExample: Using the `exit()` function\n------------------------------------\n\n #include <iostream>\n #include <cstdlib>\n \n void some_function() {\n // Some code here...\n \n if (/*some error condition*/) {\n std::cout << \"An error occurred.\\n\";\n std::exit(1);\n }\n \n // More code here...\n }\n \n int main() {\n some_function();\n \n // Some other code here...\n \n return 0; // Successful execution\n }\n \n\nIn both examples above, the program returns exit codes depending on different error conditions encountered during execution. The codes 1 and 2 are used to distinguish between the two error conditions.",
"links": []
},
"NJud5SXBAUZ6Sr78kZ7jx": {
"title": "Exceptions",
"description": "Exception handling is a method used to tackle runtime errors so that normal flow of the program can be maintained. In C++, this is accomplished using three keywords: `try`, `catch`, and `throw`.\n\ntry { ... }\n-----------\n\nIn the `try` block, you write the code that can possibly generate an exception. If an exception is encountered, the control is passed to the relevant `catch` block to handle the issue.\n\nExample:\n\n try {\n // code that might throw an exception\n }\n \n\ncatch (...) { ... }\n-------------------\n\nThe `catch` block follows the `try` block and is responsible for handling the exceptions thrown by the `try` block. There can be multiple `catch` blocks to handle different types of exceptions.\n\nExample:\n\n catch (int e) {\n // handle exception of type int\n }\n catch (char e) {\n // handle exception of type char\n }\n catch (...) {\n // handle any other exception\n }\n \n\nthrow ... ;\n-----------\n\nIn case an error occurs within the `try` block, you can use the `throw` keyword to generate an exception of the specific type. This will then be caught and handled by the corresponding `catch` block.\n\nExample:\n\n try {\n int num1 = 10, num2 = 0;\n if (num2 == 0) {\n throw \"Division by zero not allowed!\";\n } else {\n int result = num1 / num2;\n std::cout << \"Result: \" << result << std::endl;\n }\n }\n catch (const char* e) {\n std::cout << \"Error: \" << e << std::endl;\n }\n \n\nIn summary, exception handling in C++ is a technique to handle runtime errors while maintaining the normal flow of the program. The `try`, `catch`, and `throw` keywords are used together to create the structure to deal with exceptions as they occur.",
"description": "Exception handling is a method used to tackle runtime errors so that normal flow of the program can be maintained. In C++, this is accomplished using three keywords: `try`, `catch`, and `throw`.\n\ntry { ... }\n-----------\n\nIn the `try` block, you write the code that can possibly generate an exception. If an exception is encountered, the control is passed to the relevant `catch` block to handle the issue.\n\nExample:\n\n try {\n // code that might throw an exception\n }\n \n\ncatch (...) { ... }\n-------------------\n\nThe `catch` block follows the `try` block and is responsible for handling the exceptions thrown by the `try` block. There can be multiple `catch` blocks to handle different types of exceptions.\n\nExample:\n\n catch (int e) {\n // handle exception of type int\n }\n catch (char e) {\n // handle exception of type char\n }\n catch (...) {\n // handle any other exception\n }\n \n\nthrow ... ;\n-----------\n\nIn case an error occurs within the `try` block, you can use the `throw` keyword to generate an exception of the specific type. This will then be caught and handled by the corresponding `catch` block.\n\nExample:\n\n try {\n int num1 = 10, num2 = 0;\n if (num2 == 0) {\n throw \"Division by zero not allowed!\";\n } else {\n int result = num1 / num2;\n std::cout << \"Result: \" << result << '\\n';\n }\n }\n catch (const char* e) {\n std::cout << \"Error: \" << e << '\\n';\n }\n \n\nIn summary, exception handling in C++ is a technique to handle runtime errors while maintaining the normal flow of the program. The `try`, `catch`, and `throw` keywords are used together to create the structure to deal with exceptions as they occur.",
"links": []
},
"y4-P4UNC--rE1vni8HdTn": {
@ -365,7 +365,7 @@
},
"CG01PTVgHtjfKvsJkJLGl": {
"title": "auto (Automatic Type Deduction)",
"description": "**Auto**\n\n`auto` is a keyword in C++ language introduced in C++11, which is used for automatic type deduction. It automatically deduces the type of a variable from the type of its initializer expression at compile time.\n\nThe `auto` keyword is useful when you are dealing with complex types or when the type of a variable is hard to predict. It can help in writing cleaner and less error-prone code.\n\nHere's a simple example of using `auto` for type deduction:\n\n #include <iostream>\n #include <vector>\n \n int main() {\n // Traditional way of declaring a variable:\n int myInt = 5;\n \n // Using auto for type deduction:\n auto myAutoInt = 5; // Automatically deduces the type as 'int'\n \n // Example with more complex types:\n std::vector<int> myVector = {1, 2, 3, 4, 5};\n \n // Without auto, iterating the vector would look like this:\n for (std::vector<int>::iterator it = myVector.begin(); it != myVector.end(); ++it) {\n std::cout << *it << std::endl;\n }\n \n // With auto, the iterator declaration becomes simpler:\n for (auto it = myVector.begin(); it != myVector.end(); ++it) {\n std::cout << *it << std::endl;\n }\n }\n \n\nKeep in mind that `auto` deduces the type based on the initializer expression, so if you don't provide an initial value, you will get a compile-time error:\n\n auto myVar; // Error: Cannot deduce the type without initializer\n \n\nIn C++14, you can also use `auto` with function return types to let the compiler automatically deduce the return type based on the returned expression:\n\n auto add(int x, int y) {\n return x + y; // The compiler deduces the return type as 'int'\n }",
"description": "**Auto**\n\n`auto` is a keyword in C++ language introduced in C++11, which is used for automatic type deduction. It automatically deduces the type of a variable from the type of its initializer expression at compile time.\n\nThe `auto` keyword is useful when you are dealing with complex types or when the type of a variable is hard to predict. It can help in writing cleaner and less error-prone code.\n\nHere's a simple example of using `auto` for type deduction:\n\n #include <iostream>\n #include <vector>\n \n int main() {\n // Traditional way of declaring a variable:\n int myInt = 5;\n \n // Using auto for type deduction:\n auto myAutoInt = 5; // Automatically deduces the type as 'int'\n \n // Example with more complex types:\n std::vector<int> myVector = {1, 2, 3, 4, 5};\n \n // Without auto, iterating the vector would look like this:\n for (std::vector<int>::iterator it = myVector.begin(); it != myVector.end(); ++it) {\n std::cout << *it << '\\n';\n }\n \n // With auto, the iterator declaration becomes simpler:\n for (auto it = myVector.begin(); it != myVector.end(); ++it) {\n std::cout << *it << '\\n';\n }\n }\n \n\nKeep in mind that `auto` deduces the type based on the initializer expression, so if you don't provide an initial value, you will get a compile-time error:\n\n auto myVar; // Error: Cannot deduce the type without initializer\n \n\nIn C++14, you can also use `auto` with function return types to let the compiler automatically deduce the return type based on the returned expression:\n\n auto add(int x, int y) {\n return x + y; // The compiler deduces the return type as 'int'\n }",
"links": []
},
"PiMhw1oP9-NZEa6I9u4lX": {
@ -386,17 +386,17 @@
},
"5g22glc97siQOcTkHbwan": {
"title": "const_cast",
"description": "`const_cast` is a type of casting in C++ that allows you to remove or add constness to a variable. In other words, it enables you to modify a `const` or `volatile` object, or change a pointer or reference to a `const` or `volatile` type. This is useful in certain scenarios when you need to pass a `const` variable as an argument or when a function parameter requires a non-const type, but you want to make sure the variable remains constant throughout the code.\n\nKeep in mind that using `const_cast` to modify a truly `const` variable can lead to undefined behavior, so it is best to use this feature only when absolutely necessary.\n\nExample\n-------\n\nHere's a code example showing how to use `const_cast`:\n\n #include <cassert>\n #include <iostream>\n \n void modifyVariable(int* ptr) {\n *ptr = 42;\n }\n \n int main() {\n const int original_value = 10;\n int* non_const_value_ptr = const_cast<int*>(&original_value);\n std::cout << \"Original value: \" << original_value << std::endl;\n \n modifyVariable(non_const_value_ptr);\n std::cout << \"Modified value: \" << *non_const_value_ptr << \", original_value: \" << original_value << std::endl;\n \n assert(non_const_value_ptr == &original_value);\n \n return 0;\n }\n \n \n\nIn this example, we first create a `const` variable, `original_value`. Then we use `const_cast` to remove the constness of the variable and assign it to a non-const pointer, `non_const_value_ptr`. The `modifyVariable` function takes an `int*` as an argument and modifies the value pointed to by the pointer, which would not have been possible if we passed the original `const int` directly. Finally, we print the `original_value` and the `*non_const_value_ptr`, which shows that the value has been modified using `const_cast`.\n\nPlease note that this example comes with some risks, as it touches undefined behavior. \\*/",
"description": "`const_cast` is a type of casting in C++ that allows you to remove or add constness to a variable. In other words, it enables you to modify a `const` or `volatile` object, or change a pointer or reference to a `const` or `volatile` type. This is useful in certain scenarios when you need to pass a `const` variable as an argument or when a function parameter requires a non-const type, but you want to make sure the variable remains constant throughout the code.\n\nKeep in mind that using `const_cast` to modify a truly `const` variable can lead to undefined behavior, so it is best to use this feature only when absolutely necessary.\n\nExample\n-------\n\nHere's a code example showing how to use `const_cast`:\n\n #include <cassert>\n #include <iostream>\n \n void modifyVariable(int* ptr) {\n *ptr = 42;\n }\n \n int main() {\n const int original_value = 10;\n int* non_const_value_ptr = const_cast<int*>(&original_value);\n std::cout << \"Original value: \" << original_value << '\\n';\n \n modifyVariable(non_const_value_ptr);\n std::cout << \"Modified value: \" << *non_const_value_ptr << \", original_value: \" << original_value << '\\n';\n \n assert(non_const_value_ptr == &original_value);\n \n return 0;\n }\n \n \n\nIn this example, we first create a `const` variable, `original_value`. Then we use `const_cast` to remove the constness of the variable and assign it to a non-const pointer, `non_const_value_ptr`. The `modifyVariable` function takes an `int*` as an argument and modifies the value pointed to by the pointer, which would not have been possible if we passed the original `const int` directly. Finally, we print the `original_value` and the `*non_const_value_ptr`, which shows that the value has been modified using `const_cast`.\n\nPlease note that this example comes with some risks, as it touches undefined behavior. \\*/",
"links": []
},
"4BdFcuQ5KNW94cu2jz-vE": {
"title": "dynamic_cast",
"description": "`dynamic_cast` is a type of casting operator in C++ that is used specifically for polymorphism. It safely converts pointers and references of a base class to its derived class and checks the validity of the conversion during runtime. If the conversion is not valid (i.e., the object is not of the target type), it returns a null pointer instead of producing undefined behavior. Therefore, `dynamic_cast` can prevent potential crashes and errors when using polymorphism.\n\nHere is a basic example of how `dynamic_cast` can be used:\n\n #include <iostream>\n \n class BaseClass {\n public:\n virtual void display() {\n std::cout << \"BaseClass\" << std::endl;\n }\n };\n \n class DerivedClass : public BaseClass {\n public:\n void display() {\n std::cout << \"DerivedClass\" << std::endl;\n }\n };\n \n int main() {\n BaseClass *basePtr = new DerivedClass(); // Upcasting\n DerivedClass *derivedPtr;\n \n derivedPtr = dynamic_cast<DerivedClass *>(basePtr); // Downcasting\n if (derivedPtr) {\n derivedPtr->display(); // Output: DerivedClass\n } else {\n std::cout << \"Invalid type conversion.\";\n }\n \n delete basePtr;\n return 0;\n }\n \n\nIn this example, a pointer to a `DerivedClass` object is assigned to a `BaseClass` pointer (`basePtr`). Then, we attempt to downcast it back to a `DerivedClass` pointer using `dynamic_cast`. If the casting is successful, we can access the `DerivedClass` functionality through the new pointer (`derivedPtr`).",
"description": "`dynamic_cast` is a type of casting operator in C++ that is used specifically for polymorphism. It safely converts pointers and references of a base class to its derived class and checks the validity of the conversion during runtime. If the conversion is not valid (i.e., the object is not of the target type), it returns a null pointer instead of producing undefined behavior. Therefore, `dynamic_cast` can prevent potential crashes and errors when using polymorphism.\n\nHere is a basic example of how `dynamic_cast` can be used:\n\n #include <iostream>\n \n class BaseClass {\n public:\n virtual void display() {\n std::cout << \"BaseClass\\n\";\n }\n };\n \n class DerivedClass : public BaseClass {\n public:\n void display() {\n std::cout << \"DerivedClass\\n\";\n }\n };\n \n int main() {\n BaseClass *basePtr = new DerivedClass(); // Upcasting\n DerivedClass *derivedPtr;\n \n derivedPtr = dynamic_cast<DerivedClass *>(basePtr); // Downcasting\n if (derivedPtr) {\n derivedPtr->display(); // Output: DerivedClass\n } else {\n std::cout << \"Invalid type conversion.\";\n }\n \n delete basePtr;\n return 0;\n }\n \n\nIn this example, a pointer to a `DerivedClass` object is assigned to a `BaseClass` pointer (`basePtr`). Then, we attempt to downcast it back to a `DerivedClass` pointer using `dynamic_cast`. If the casting is successful, we can access the `DerivedClass` functionality through the new pointer (`derivedPtr`).",
"links": []
},
"ZMyFDJrpCauGrY5NZkOwg": {
"title": "reinterpret_cast",
"description": "`reinterpret_cast` is a type of casting in C++ that allows you to change the type of a pointer or an integer without altering the representation of the data. It is generally used when the conversion required is too low-level or not supported by other casting methods, such as `static_cast`.\n\nUsing `reinterpret_cast` should be handled with care, as it can lead to undefined behavior and severe problems if used incorrectly.\n\nHere's an example of usage:\n\n #include <iostream>\n \n int main() {\n int num = 42;\n int *num_ptr = &num;\n \n // Disguise the integer pointer as a char pointer\n char *char_ptr = reinterpret_cast<char *>(num_ptr);\n \n for (size_t i = 0; i < sizeof(int); ++i) {\n // Print the individual bytes of the integer as characters\n std::cout << \"Byte \" << i << \": \" << char_ptr[i] << std::endl;\n }\n \n return 0;\n }\n \n\nIn this example, we're using `reinterpret_cast` to change the type of a pointer from `int *` to `char *`, effectively treating the integer as an array of characters and printing each byte.\n\nRemember that when using `reinterpret_cast`, you should be cautious about dereferencing the converted pointers. The behavior can be unpredictable, and it can lead to issues, such as accessing memory regions that are not intended to be accessed. `reinterpret_cast` should be used sparingly and only when a low-level conversion is necessary.",
"description": "`reinterpret_cast` is a type of casting in C++ that allows you to change the type of a pointer or an integer without altering the representation of the data. It is generally used when the conversion required is too low-level or not supported by other casting methods, such as `static_cast`.\n\nUsing `reinterpret_cast` should be handled with care, as it can lead to undefined behavior and severe problems if used incorrectly.\n\nHere's an example of usage:\n\n #include <iostream>\n \n int main() {\n int num = 42;\n int *num_ptr = &num;\n \n // Disguise the integer pointer as a char pointer\n char *char_ptr = reinterpret_cast<char *>(num_ptr);\n \n for (size_t i = 0; i < sizeof(int); ++i) {\n // Print the individual bytes of the integer as characters\n std::cout << \"Byte \" << i << \": \" << char_ptr[i] << '\\n';\n }\n \n return 0;\n }\n \n\nIn this example, we're using `reinterpret_cast` to change the type of a pointer from `int *` to `char *`, effectively treating the integer as an array of characters and printing each byte.\n\nRemember that when using `reinterpret_cast`, you should be cautious about dereferencing the converted pointers. The behavior can be unpredictable, and it can lead to issues, such as accessing memory regions that are not intended to be accessed. `reinterpret_cast` should be used sparingly and only when a low-level conversion is necessary.",
"links": []
},
"IDOlquv6jlfecwQoBwkGZ": {
@ -406,7 +406,7 @@
},
"YSWN7nS8vA9nMldSUrZRT": {
"title": "Argument Dependent Lookup (ADL)",
"description": "Argument Dependent Lookup (ADL) or Koenig Lookup is a mechanism in C++ that allows the compiler to search for the appropriate function to call based on the types of arguments provided. It is particularly helpful when using overloaded functions or operators in a namespace.\n\nADL allows the compiler to find functions in the same namespace as the arguments, even if the function is not declared at the point of use or within the namespace provided. This is especially useful when working with templates or generic programming.\n\nExample\n-------\n\nConsider the following example using a namespace and overloaded `operator<<()`:\n\n namespace MyNamespace {\n class MyClass {\n public:\n int value;\n };\n \n std::ostream& operator<<(std::ostream& os, const MyClass& obj) {\n os << \"MyClass: \" << obj.value;\n return os;\n }\n }\n \n int main() {\n MyNamespace::MyClass obj;\n obj.value = 42;\n using std::cout; // Required to use 'cout' without fully qualifying it.\n cout << obj << std::endl; // ADL is used to find the correct overloaded 'operator<<'.\n }\n \n\nIn this example, when you call `cout << obj;` in `main()`, ADL is used to find the correct `operator<<()` in the `MyNamespace` namespace because the argument `obj` is of type `MyNamespace::MyClass`.",
"description": "Argument Dependent Lookup (ADL) or Koenig Lookup is a mechanism in C++ that allows the compiler to search for the appropriate function to call based on the types of arguments provided. It is particularly helpful when using overloaded functions or operators in a namespace.\n\nADL allows the compiler to find functions in the same namespace as the arguments, even if the function is not declared at the point of use or within the namespace provided. This is especially useful when working with templates or generic programming.\n\nExample\n-------\n\nConsider the following example using a namespace and overloaded `operator<<()`:\n\n namespace MyNamespace {\n class MyClass {\n public:\n int value;\n };\n \n std::ostream& operator<<(std::ostream& os, const MyClass& obj) {\n os << \"MyClass: \" << obj.value;\n return os;\n }\n }\n \n int main() {\n MyNamespace::MyClass obj;\n obj.value = 42;\n using std::cout; // Required to use 'cout' without fully qualifying it.\n cout << obj << '\\n'; // ADL is used to find the correct overloaded 'operator<<'.\n }\n \n\nIn this example, when you call `cout << obj;` in `main()`, ADL is used to find the correct `operator<<()` in the `MyNamespace` namespace because the argument `obj` is of type `MyNamespace::MyClass`.",
"links": []
},
"Lt7ss59KZw9Jwqj234jm2": {
@ -431,7 +431,7 @@
},
"VeVxZ230xkesQsIDig8zQ": {
"title": "iostream",
"description": "`iostream` is a header in the C++ Standard Library that provides functionality for basic input and output (I/O) operations. The I/O streams facilitate communication between your program and various sources, such as the console, files, or other programs.\n\n`iostream` includes the following classes:\n\n* `istream`: for input operations from an input source.\n* `ostream`: for output operations to an output target.\n* `iostream`: a combination of `istream` and `ostream` for both input and output operations.\n\nThese classes inherit from base classes `ios` and `ios_base`.\n\nAdditionally, `iostream` defines several objects that are instances of these classes and represent the standard input and output streams:\n\n* `cin`: an `istream` object to read from the standard input, typically corresponding to the keyboard.\n* `cout`: an `ostream` object to write to the standard output, typically the console.\n* `cerr`: an `ostream` object to write to the standard error output, typically used for displaying error messages.\n* `clog`: an `ostream` object, similar to `cerr`, but its output can be buffered.\n\nHere are some code examples on using `iostream` for input and output operations:\n\n #include <iostream>\n \n int main() {\n int a;\n std::cout << \"Enter a number: \";\n std::cin >> a;\n std::cout << \"You entered: \" << a << std::endl;\n return 0;\n }\n \n\n #include <iostream>\n \n int main() {\n std::cerr << \"An error occurred.\" << std::endl;\n std::clog << \"Logging information.\" << std::endl;\n return 0;\n }\n \n\nRemember to include the `iostream` header when using these features:\n\n #include <iostream>",
"description": "`iostream` is a header in the C++ Standard Library that provides functionality for basic input and output (I/O) operations. The I/O streams facilitate communication between your program and various sources, such as the console, files, or other programs.\n\n`iostream` includes the following classes:\n\n* `istream`: for input operations from an input source.\n* `ostream`: for output operations to an output target.\n* `iostream`: a combination of `istream` and `ostream` for both input and output operations.\n\nThese classes inherit from base classes `ios` and `ios_base`.\n\nAdditionally, `iostream` defines several objects that are instances of these classes and represent the standard input and output streams:\n\n* `cin`: an `istream` object to read from the standard input, typically corresponding to the keyboard.\n* `cout`: an `ostream` object to write to the standard output, typically the console.\n* `cerr`: an `ostream` object to write to the standard error output, typically used for displaying error messages.\n* `clog`: an `ostream` object, similar to `cerr`, but its output can be buffered.\n\nHere are some code examples on using `iostream` for input and output operations:\n\n #include <iostream>\n \n int main() {\n int a;\n std::cout << \"Enter a number: \";\n std::cin >> a;\n std::cout << \"You entered: \" << a << '\\n';\n return 0;\n }\n \n\n #include <iostream>\n \n int main() {\n std::cerr << \"An error occurred.\\n\";\n std::clog << \"Logging information.\\n\";\n return 0;\n }\n \n\nRemember to include the `iostream` header when using these features:\n\n #include <iostream>",
"links": []
},
"whyj6Z4RXFsVQYRfYYn7B": {
@ -441,17 +441,17 @@
},
"yGvE6eHKlPMBB6rde0llR": {
"title": "Date / Time",
"description": "In C++, you can work with dates and times using the `chrono` library, which is part of the Standard Library (STL). The `chrono` library provides various data types and functions to represent and manipulate time durations, time points, and clocks.\n\nDuration\n--------\n\nA `duration` represents a span of time, which can be expressed in various units such as seconds, minutes, hours, etc. To create a duration, use the `std::chrono::duration` template class. Common predefined duration types are:\n\n* `std::chrono::seconds`\n* `std::chrono::minutes`\n* `std::chrono::hours`\n\n**Example:**\n\n #include <iostream>\n #include <chrono>\n \n int main() {\n std::chrono::seconds sec(5);\n std::chrono::minutes min(2);\n std::chrono::hours hr(1);\n return 0;\n }\n \n\nTime Point\n----------\n\nA `time_point` represents a specific point in time. It is usually created using a combination of duration and a clock. In C++, there are three clock types provided by the `chrono` library:\n\n* `std::chrono::system_clock`: Represents the system-wide real time wall clock.\n* `std::chrono::steady_clock`: Represents a monotonic clock that is guaranteed to never be adjusted.\n* `std::chrono::high_resolution_clock`: Represents the clock with the shortest tick period.\n\n**Example:**\n\n #include <iostream>\n #include <chrono>\n \n int main() {\n std::chrono::system_clock::time_point tp = std::chrono::system_clock::now();\n return 0;\n }\n \n\nClock\n-----\n\nA clock provides access to the current time. It consists of the following elements:\n\n* `time_point`: A specific point in time.\n* `duration`: The time duration between two time points.\n* `now()`: A static function that returns the current time point.\n\n**Example:**\n\n #include <iostream>\n #include <chrono>\n \n int main() {\n // Get the current time_point using system_clock\n std::chrono::system_clock::time_point now = std::chrono::system_clock::now();\n \n // Get the time_point 1 hour from now\n std::chrono::system_clock::time_point one_hour_from_now = now + std::chrono::hours(1);\n return 0;\n }\n \n\nConverting Time Points to Calendar Time\n---------------------------------------\n\nTo convert a time point to calendar representation, you can use the `std::chrono::system_clock::to_time_t` function.\n\n**Example:**\n\n #include <iostream>\n #include <chrono>\n #include <ctime>\n \n int main() {\n std::chrono::system_clock::time_point now = std::chrono::system_clock::now();\n std::time_t now_c = std::chrono::system_clock::to_time_t(now);\n std::cout << \"Current time: \" << std::ctime(&now_c) << std::endl;\n return 0;\n }\n \n\nThis summarizes the basic functionality of working with date and time in C++ using the `chrono` library. You can find more advanced features, such as casting durations and time arithmetic, in the [C++ reference](https://en.cppreference.com/w/cpp/chrono).",
"description": "In C++, you can work with dates and times using the `chrono` library, which is part of the Standard Library (STL). The `chrono` library provides various data types and functions to represent and manipulate time durations, time points, and clocks.\n\nDuration\n--------\n\nA `duration` represents a span of time, which can be expressed in various units such as seconds, minutes, hours, etc. To create a duration, use the `std::chrono::duration` template class. Common predefined duration types are:\n\n* `std::chrono::seconds`\n* `std::chrono::minutes`\n* `std::chrono::hours`\n\n**Example:**\n\n #include <iostream>\n #include <chrono>\n \n int main() {\n std::chrono::seconds sec(5);\n std::chrono::minutes min(2);\n std::chrono::hours hr(1);\n return 0;\n }\n \n\nTime Point\n----------\n\nA `time_point` represents a specific point in time. It is usually created using a combination of duration and a clock. In C++, there are three clock types provided by the `chrono` library:\n\n* `std::chrono::system_clock`: Represents the system-wide real time wall clock.\n* `std::chrono::steady_clock`: Represents a monotonic clock that is guaranteed to never be adjusted.\n* `std::chrono::high_resolution_clock`: Represents the clock with the shortest tick period.\n\n**Example:**\n\n #include <iostream>\n #include <chrono>\n \n int main() {\n std::chrono::system_clock::time_point tp = std::chrono::system_clock::now();\n return 0;\n }\n \n\nClock\n-----\n\nA clock provides access to the current time. It consists of the following elements:\n\n* `time_point`: A specific point in time.\n* `duration`: The time duration between two time points.\n* `now()`: A static function that returns the current time point.\n\n**Example:**\n\n #include <iostream>\n #include <chrono>\n \n int main() {\n // Get the current time_point using system_clock\n std::chrono::system_clock::time_point now = std::chrono::system_clock::now();\n \n // Get the time_point 1 hour from now\n std::chrono::system_clock::time_point one_hour_from_now = now + std::chrono::hours(1);\n return 0;\n }\n \n\nConverting Time Points to Calendar Time\n---------------------------------------\n\nTo convert a time point to calendar representation, you can use the `std::chrono::system_clock::to_time_t` function.\n\n**Example:**\n\n #include <iostream>\n #include <chrono>\n #include <ctime>\n \n int main() {\n std::chrono::system_clock::time_point now = std::chrono::system_clock::now();\n std::time_t now_c = std::chrono::system_clock::to_time_t(now);\n std::cout << \"Current time: \" << std::ctime(&now_c) << '\\n';\n return 0;\n }\n \n\nThis summarizes the basic functionality of working with date and time in C++ using the `chrono` library. You can find more advanced features, such as casting durations and time arithmetic, in the [C++ reference](https://en.cppreference.com/w/cpp/chrono).",
"links": []
},
"OXQUPqxzs1-giAACwl3X1": {
"title": "Multithreading",
"description": "Multithreading is the concurrent execution of multiple threads within a single process or program. It improves the performance and efficiency of an application by allowing multiple tasks to be executed in parallel.\n\nIn C++, multithreading support is available through the `thread` library introduced in the C++11 standard.\n\nBasic Thread Creation\n---------------------\n\nTo create a new thread, include the `<thread>` header file and create an instance of `std::thread` that takes a function as an argument. The function will be executed in a new thread.\n\n #include <iostream>\n #include <thread>\n \n void my_function() {\n std::cout << \"This function is executing in a separate thread\" << std::endl;\n }\n \n int main() {\n std::thread t(my_function);\n t.join(); // waits for the thread to complete\n return 0;\n }\n \n\nThread with Arguments\n---------------------\n\nYou can pass arguments to the thread function by providing them as additional arguments to the `std::thread` constructor.\n\n #include <iostream>\n #include <thread>\n \n void print_sum(int a, int b) {\n std::cout << \"The sum is: \" << a + b << std::endl;\n }\n \n int main() {\n std::thread t(print_sum, 3, 5);\n t.join();\n return 0;\n }\n \n\nMutex and Locks\n---------------\n\nWhen multiple threads access shared resources, there is a possibility of a data race. To avoid this, use mutex and locks to synchronize shared resource access.\n\n #include <iostream>\n #include <mutex>\n #include <thread>\n \n std::mutex mtx;\n \n void print_block(int n, char c) {\n {\n std::unique_lock<std::mutex> locker(mtx);\n for (int i = 0; i < n; ++i) {\n std::cout << c;\n }\n std::cout << std::endl;\n }\n }\n \n int main() {\n std::thread t1(print_block, 50, '*');\n std::thread t2(print_block, 50, '$');\n \n t1.join();\n t2.join();\n \n return 0;\n }\n \n\nThis short introduction should help you get started with basic multithreading techniques in C++. There is a lot more to learn, such as thread pools, condition variables, and atomic operations for advanced synchronization and performance tuning.",
"description": "Multithreading is the concurrent execution of multiple threads within a single process or program. It improves the performance and efficiency of an application by allowing multiple tasks to be executed in parallel.\n\nIn C++, multithreading support is available through the `thread` library introduced in the C++11 standard.\n\nBasic Thread Creation\n---------------------\n\nTo create a new thread, include the `<thread>` header file and create an instance of `std::thread` that takes a function as an argument. The function will be executed in a new thread.\n\n #include <iostream>\n #include <thread>\n \n void my_function() {\n std::cout << \"This function is executing in a separate thread\\n\";\n }\n \n int main() {\n std::thread t(my_function);\n t.join(); // waits for the thread to complete\n return 0;\n }\n \n\nThread with Arguments\n---------------------\n\nYou can pass arguments to the thread function by providing them as additional arguments to the `std::thread` constructor.\n\n #include <iostream>\n #include <thread>\n \n void print_sum(int a, int b) {\n std::cout << \"The sum is: \" << a + b << '\\n';\n }\n \n int main() {\n std::thread t(print_sum, 3, 5);\n t.join();\n return 0;\n }\n \n\nMutex and Locks\n---------------\n\nWhen multiple threads access shared resources, there is a possibility of a data race. To avoid this, use mutex and locks to synchronize shared resource access.\n\n #include <iostream>\n #include <mutex>\n #include <thread>\n \n std::mutex mtx;\n \n void print_block(int n, char c) {\n {\n std::unique_lock<std::mutex> locker(mtx);\n for (int i = 0; i < n; ++i) {\n std::cout << c;\n }\n std::cout << '\\n';\n }\n }\n \n int main() {\n std::thread t1(print_block, 50, '*');\n std::thread t2(print_block, 50, '$');\n \n t1.join();\n t2.join();\n \n return 0;\n }\n \n\nThis short introduction should help you get started with basic multithreading techniques in C++. There is a lot more to learn, such as thread pools, condition variables, and atomic operations for advanced synchronization and performance tuning.",
"links": []
},
"1pydf-SR0QUfVNuBEyvzc": {
"title": "Containers",
"description": "C++ Containers are a part of the Standard Template Library (STL) that provide data structures to store and organize data. There are several types of containers, each with its own characteristics and use cases. Here, we discuss some of the commonly used containers:\n\n1\\. Vector\n----------\n\nVectors are dynamic arrays that can resize themselves as needed. They store elements in a contiguous memory location, allowing fast random access using indices.\n\nExample\n-------\n\n #include <iostream>\n #include <vector>\n \n int main() {\n std::vector<int> vec = {1, 2, 3, 4, 5};\n \n vec.push_back(6); // Add an element to the end\n \n std::cout << \"Vector contains:\";\n for (int x : vec) {\n std::cout << ' ' << x;\n }\n std::cout << std::endl;\n }\n \n\n2\\. List\n--------\n\nA list is a doubly-linked list that allows elements to be inserted or removed from any position in constant time. It does not support random access. Lists are better than vectors for scenarios where you need to insert or remove elements in the middle frequently.\n\nExample\n-------\n\n #include <iostream>\n #include <list>\n \n int main() {\n std::list<int> lst = {1, 2, 3, 4, 5};\n \n lst.push_back(6); // Add an element to the end\n \n std::cout << \"List contains:\";\n for (int x : lst) {\n std::cout << ' ' << x;\n }\n std::cout << std::endl;\n }\n \n\n3\\. Map\n-------\n\nA map is an associative container that stores key-value pairs. It supports the retrieval of values based on their keys. The keys are sorted in ascending order by default.\n\nExample\n-------\n\n #include <iostream>\n #include <map>\n \n int main() {\n std::map<std::string, int> m;\n \n m[\"one\"] = 1;\n m[\"two\"] = 2;\n \n std::cout << \"Map contains:\" << std::endl;\n for (const auto &pair : m) {\n std::cout << pair.first << \": \" << pair.second << std::endl;\n }\n }\n \n\n4\\. Unordered\\_map\n------------------\n\nSimilar to a map, an unordered map stores key-value pairs, but it is implemented using a hash table. This means unordered\\_map has faster average-case performance compared to map, since it does not maintain sorted order. However, worst-case performance can be worse than map.\n\nExample\n-------\n\n #include <iostream>\n #include <unordered_map>\n \n int main() {\n std::unordered_map<std::string, int> um;\n \n um[\"one\"] = 1;\n um[\"two\"] = 2;\n \n std::cout << \"Unordered map contains:\" << std::endl;\n for (const auto &pair : um) {\n std::cout << pair.first << \": \" << pair.second << std::endl;\n }\n }\n \n\nThese are just a few examples of C++ containers. There are other container types, such as `set`, `multiset`, `deque`, `stack`, `queue`, and `priority_queue`. Each container has its own use cases and unique characteristics. Learning about these containers and when to use them can greatly improve your efficiency and effectiveness in using C++.",
"description": "C++ Containers are a part of the Standard Template Library (STL) that provide data structures to store and organize data. There are several types of containers, each with its own characteristics and use cases. Here, we discuss some of the commonly used containers:\n\n1\\. Vector\n----------\n\nVectors are dynamic arrays that can resize themselves as needed. They store elements in a contiguous memory location, allowing fast random access using indices.\n\nExample\n-------\n\n #include <iostream>\n #include <vector>\n \n int main() {\n std::vector<int> vec = {1, 2, 3, 4, 5};\n \n vec.push_back(6); // Add an element to the end\n \n std::cout << \"Vector contains:\";\n for (int x : vec) {\n std::cout << ' ' << x;\n }\n std::cout << '\\n';\n }\n \n\n2\\. List\n--------\n\nA list is a doubly-linked list that allows elements to be inserted or removed from any position in constant time. It does not support random access. Lists are better than vectors for scenarios where you need to insert or remove elements in the middle frequently.\n\nExample\n-------\n\n #include <iostream>\n #include <list>\n \n int main() {\n std::list<int> lst = {1, 2, 3, 4, 5};\n \n lst.push_back(6); // Add an element to the end\n \n std::cout << \"List contains:\";\n for (int x : lst) {\n std::cout << ' ' << x;\n }\n std::cout << '\\n';\n }\n \n\n3\\. Map\n-------\n\nA map is an associative container that stores key-value pairs. It supports the retrieval of values based on their keys. The keys are sorted in ascending order by default.\n\nExample\n-------\n\n #include <iostream>\n #include <map>\n \n int main() {\n std::map<std::string, int> m;\n \n m[\"one\"] = 1;\n m[\"two\"] = 2;\n \n std::cout << \"Map contains:\\n\";\n for (const auto &pair : m) {\n std::cout << pair.first << \": \" << pair.second << '\\n';\n }\n }\n \n\n4\\. Unordered\\_map\n------------------\n\nSimilar to a map, an unordered map stores key-value pairs, but it is implemented using a hash table. This means unordered\\_map has faster average-case performance compared to map, since it does not maintain sorted order. However, worst-case performance can be worse than map.\n\nExample\n-------\n\n #include <iostream>\n #include <unordered_map>\n \n int main() {\n std::unordered_map<std::string, int> um;\n \n um[\"one\"] = 1;\n um[\"two\"] = 2;\n \n std::cout << \"Unordered map contains:\\n\";\n for (const auto &pair : um) {\n std::cout << pair.first << \": \" << pair.second << '\\n';\n }\n }\n \n\nThese are just a few examples of C++ containers. There are other container types, such as `set`, `multiset`, `deque`, `stack`, `queue`, and `priority_queue`. Each container has its own use cases and unique characteristics. Learning about these containers and when to use them can greatly improve your efficiency and effectiveness in using C++.",
"links": []
},
"-6AOrbuOE7DJCmxlcgCay": {
@ -461,32 +461,32 @@
},
"w4EIf58KP-Pq-yc0HlGxc": {
"title": "Variadic Templates",
"description": "Variadic templates are a feature in C++11 that allows you to define a template with a variable number of arguments. This is especially useful when you need to write a function or class that can accept different numbers and types of arguments.\n\nSyntax\n------\n\nThe syntax for variadic templates is very simple. To define a variadic template, use the `...` (ellipsis) notation:\n\n template <typename... Args>\n \n\nThis notation represents a parameter pack, which can contain zero or more arguments. You can use this parameter pack as a variable list of template parameters in your template definition.\n\nExamples\n--------\n\n### Summing Multiple Arguments Using Variadic Templates\n\n #include <iostream>\n \n // Base case for recursion\n template <typename T>\n T sum(T t) {\n return t;\n }\n \n // Variadic template\n template <typename T, typename... Args>\n T sum(T t, Args... args) {\n return t + sum(args...);\n }\n \n int main() {\n int result = sum(1, 2, 3, 4, 5); // expands to 1 + 2 + 3 + 4 + 5\n std::cout << \"The sum is: \" << result << std::endl;\n \n return 0;\n }\n \n\n### Tuple Class Using Variadic Templates\n\n template <typename... Types>\n class Tuple;\n \n // Base case: empty tuple\n template <>\n class Tuple<> {};\n \n // Recursive case: Tuple with one or more elements\n template <typename Head, typename... Tail>\n class Tuple<Head, Tail...> : public Tuple<Tail...> {\n public:\n Tuple(Head head, Tail... tail) : Tuple<Tail...>(tail...), head_(head) {}\n \n Head head() const { return head_; }\n \n private:\n Head head_;\n };\n \n int main() {\n Tuple<int, float, double> tuple(1, 2.0f, 3.0);\n std::cout << \"First element: \" << tuple.head() << std::endl;\n return 0;\n }\n \n\nPlease note that the examples shown are for educational purposes and might not be the most efficient or production-ready implementations. With C++17 and onward, there are even more concise ways to handle variadic templates, like using fold expressions.",
"description": "Variadic templates are a feature in C++11 that allows you to define a template with a variable number of arguments. This is especially useful when you need to write a function or class that can accept different numbers and types of arguments.\n\nSyntax\n------\n\nThe syntax for variadic templates is very simple. To define a variadic template, use the `...` (ellipsis) notation:\n\n template <typename... Args>\n \n\nThis notation represents a parameter pack, which can contain zero or more arguments. You can use this parameter pack as a variable list of template parameters in your template definition.\n\nExamples\n--------\n\n### Summing Multiple Arguments Using Variadic Templates\n\n #include <iostream>\n \n // Base case for recursion\n template <typename T>\n T sum(T t) {\n return t;\n }\n \n // Variadic template\n template <typename T, typename... Args>\n T sum(T t, Args... args) {\n return t + sum(args...);\n }\n \n int main() {\n int result = sum(1, 2, 3, 4, 5); // expands to 1 + 2 + 3 + 4 + 5\n std::cout << \"The sum is: \" << result << '\\n';\n \n return 0;\n }\n \n\n### Tuple Class Using Variadic Templates\n\n template <typename... Types>\n class Tuple;\n \n // Base case: empty tuple\n template <>\n class Tuple<> {};\n \n // Recursive case: Tuple with one or more elements\n template <typename Head, typename... Tail>\n class Tuple<Head, Tail...> : public Tuple<Tail...> {\n public:\n Tuple(Head head, Tail... tail) : Tuple<Tail...>(tail...), head_(head) {}\n \n Head head() const { return head_; }\n \n private:\n Head head_;\n };\n \n int main() {\n Tuple<int, float, double> tuple(1, 2.0f, 3.0);\n std::cout << \"First element: \" << tuple.head() << '\\n';\n return 0;\n }\n \n\nPlease note that the examples shown are for educational purposes and might not be the most efficient or production-ready implementations. With C++17 and onward, there are even more concise ways to handle variadic templates, like using fold expressions.",
"links": []
},
"sObOuccY0PDeGG-9GrFDF": {
"title": "Template Specialization",
"description": "Template specialization is a way to customize or modify the behavior of a template for a specific type or a set of types. This can be useful when you want to optimize the behavior or provide specific implementation for a certain type, without affecting the overall behavior of the template for other types.\n\nThere are two main ways you can specialize a template:\n\n* **Full specialization:** This occurs when you provide a specific implementation for a specific type or set of types.\n \n* **Partial specialization:** This occurs when you provide a more general implementation for a subset of types that match a certain pattern or condition.\n \n\nFull Template Specialization\n----------------------------\n\nFull specialization is used when you want to create a separate implementation of a template for a specific type. To do this, you need to use keyword `template<>` followed by the function template with the desired specialized type.\n\nHere is an example:\n\n #include <iostream>\n \n template <typename T>\n void printData(const T& data) {\n std::cout << \"General template: \" << data << std::endl;\n }\n \n template <>\n void printData(const char* const & data) {\n std::cout << \"Specialized template for const char*: \" << data << std::endl;\n }\n \n int main() {\n int a = 5;\n const char* str = \"Hello, world!\";\n printData(a); // General template: 5\n printData(str); // Specialized template for const char*: Hello, world!\n }\n \n\nPartial Template Specialization\n-------------------------------\n\nPartial specialization is used when you want to create a separate implementation of a template for a subset of types that match a certain pattern or condition.\n\nHere is an example of how you can partially specialize a template class:\n\n #include <iostream>\n \n template <typename K, typename V>\n class MyPair {\n public:\n MyPair(K k, V v) : key(k), value(v) {}\n \n void print() const {\n std::cout << \"General template: key = \" << key << \", value = \" << value << std::endl;\n }\n \n private:\n K key;\n V value;\n };\n \n template <typename T>\n class MyPair<T, int> {\n public:\n MyPair(T k, int v) : key(k), value(v) {}\n \n void print() const {\n std::cout << \"Partial specialization for int values: key = \" << key\n << \", value = \" << value << std::endl;\n }\n \n private:\n T key;\n int value;\n };\n \n int main() {\n MyPair<double, std::string> p1(3.2, \"example\");\n MyPair<char, int> p2('A', 65);\n p1.print(); // General template: key = 3.2, value = example\n p2.print(); // Partial specialization for int values: key = A, value = 65\n }\n \n\nIn this example, the `MyPair` template class is partially specialized to provide a different behavior when the second template parameter is of type `int`.",
"description": "Template specialization is a way to customize or modify the behavior of a template for a specific type or a set of types. This can be useful when you want to optimize the behavior or provide specific implementation for a certain type, without affecting the overall behavior of the template for other types.\n\nThere are two main ways you can specialize a template:\n\n* **Full specialization:** This occurs when you provide a specific implementation for a specific type or set of types.\n \n* **Partial specialization:** This occurs when you provide a more general implementation for a subset of types that match a certain pattern or condition.\n \n\nFull Template Specialization\n----------------------------\n\nFull specialization is used when you want to create a separate implementation of a template for a specific type. To do this, you need to use keyword `template<>` followed by the function template with the desired specialized type.\n\nHere is an example:\n\n #include <iostream>\n \n template <typename T>\n void printData(const T& data) {\n std::cout << \"General template: \" << data << '\\n';\n }\n \n template <>\n void printData(const char* const & data) {\n std::cout << \"Specialized template for const char*: \" << data << '\\n';\n }\n \n int main() {\n int a = 5;\n const char* str = \"Hello, world!\";\n printData(a); // General template: 5\n printData(str); // Specialized template for const char*: Hello, world!\n }\n \n\nPartial Template Specialization\n-------------------------------\n\nPartial specialization is used when you want to create a separate implementation of a template for a subset of types that match a certain pattern or condition.\n\nHere is an example of how you can partially specialize a template class:\n\n #include <iostream>\n \n template <typename K, typename V>\n class MyPair {\n public:\n MyPair(K k, V v) : key(k), value(v) {}\n \n void print() const {\n std::cout << \"General template: key = \" << key << \", value = \" << value << '\\n';\n }\n \n private:\n K key;\n V value;\n };\n \n template <typename T>\n class MyPair<T, int> {\n public:\n MyPair(T k, int v) : key(k), value(v) {}\n \n void print() const {\n std::cout << \"Partial specialization for int values: key = \" << key\n << \", value = \" << value << '\\n';\n }\n \n private:\n T key;\n int value;\n };\n \n int main() {\n MyPair<double, std::string> p1(3.2, \"example\");\n MyPair<char, int> p2('A', 65);\n p1.print(); // General template: key = 3.2, value = example\n p2.print(); // Partial specialization for int values: key = A, value = 65\n }\n \n\nIn this example, the `MyPair` template class is partially specialized to provide a different behavior when the second template parameter is of type `int`.",
"links": []
},
"WptReUOwVth3C9-AVmMHF": {
"title": "Type Traits",
"description": "Type Traits are a set of template classes in C++ that help in getting the information about the type's properties, behavior, or characteristics. They can be found in the `<type_traits>` header file. By using Type Traits, you can adapt your code depending on the properties of a given type, or even enforce specific properties for your type parameters in template code.\n\nSome common type traits are:\n\n* `std::is_pointer`: Checks if a given type is a pointer type.\n* `std::is_arithmetic`: Checks if the given type is an arithmetic type.\n* `std::is_function`: Checks if the given type is a function type.\n* `std::decay`: Applies decltype rules to the input type ( strips references, cv-qualifiers, etc. ).\n\nUsage\n-----\n\nYou can use type traits like this:\n\n #include <iostream>\n #include <type_traits>\n \n int main() {\n int a;\n int* a_ptr = &a;\n \n std::cout << \"Is 'a' a pointer? \" << std::boolalpha << std::is_pointer<decltype(a)>::value << std::endl;\n std::cout << \"Is 'a_ptr' a pointer? \" << std::boolalpha << std::is_pointer<decltype(a_ptr)>::value << std::endl;\n \n return 0;\n }\n \n\nComposing Type Traits\n---------------------\n\nSome type traits help you compose other traits or modify them, such as:\n\n* `std::conditional`: If a given boolean value is true, use type A; otherwise, use type B.\n* `std::enable_if`: If a given boolean value is true, use type A; otherwise, there is no nested type.\n\n #include <iostream>\n #include <type_traits>\n \n template <typename T>\n typename std::enable_if<std::is_arithmetic<T>::value, T>::type find_max(T a, T b) {\n return a > b ? a : b;\n }\n \n int main() {\n int max = find_max(10, 20);\n std::cout << \"Max: \" << max << std::endl;\n \n return 0;\n }\n \n\nIn this example, the `find_max` template function is only defined when T is an arithmetic type (e.g., int, float, double). This prevents unintended usage of the `find_max` function with non-arithmetic types.\n\nOverall, type traits are a powerful tool to create more generic, extensible, and efficient C++ code, providing a way to query and adapt your code based on type characteristics.",
"description": "Type Traits are a set of template classes in C++ that help in getting the information about the type's properties, behavior, or characteristics. They can be found in the `<type_traits>` header file. By using Type Traits, you can adapt your code depending on the properties of a given type, or even enforce specific properties for your type parameters in template code.\n\nSome common type traits are:\n\n* `std::is_pointer`: Checks if a given type is a pointer type.\n* `std::is_arithmetic`: Checks if the given type is an arithmetic type.\n* `std::is_function`: Checks if the given type is a function type.\n* `std::decay`: Applies decltype rules to the input type ( strips references, cv-qualifiers, etc. ).\n\nUsage\n-----\n\nYou can use type traits like this:\n\n #include <iostream>\n #include <type_traits>\n \n int main() {\n int a;\n int* a_ptr = &a;\n \n std::cout << \"Is 'a' a pointer? \" << std::boolalpha << std::is_pointer<decltype(a)>::value << '\\n';\n std::cout << \"Is 'a_ptr' a pointer? \" << std::boolalpha << std::is_pointer<decltype(a_ptr)>::value << '\\n';\n \n return 0;\n }\n \n\nComposing Type Traits\n---------------------\n\nSome type traits help you compose other traits or modify them, such as:\n\n* `std::conditional`: If a given boolean value is true, use type A; otherwise, use type B.\n* `std::enable_if`: If a given boolean value is true, use type A; otherwise, there is no nested type.\n\n #include <iostream>\n #include <type_traits>\n \n template <typename T>\n typename std::enable_if<std::is_arithmetic<T>::value, T>::type find_max(T a, T b) {\n return a > b ? a : b;\n }\n \n int main() {\n int max = find_max(10, 20);\n std::cout << \"Max: \" << max << '\\n';\n \n return 0;\n }\n \n\nIn this example, the `find_max` template function is only defined when T is an arithmetic type (e.g., int, float, double). This prevents unintended usage of the `find_max` function with non-arithmetic types.\n\nOverall, type traits are a powerful tool to create more generic, extensible, and efficient C++ code, providing a way to query and adapt your code based on type characteristics.",
"links": []
},
"3C5UfejDX-1Z8ZF6C53xD": {
"title": "SFINAE",
"description": "SFINAE is a principle in C++ template metaprogramming that allows the compiler to select the appropriate function or class when a specific template specialization fails during substitution. The term \"substitution failure\" refers to the process where the compiler tries to substitute template arguments into a function template or class template. If the substitution causes an error, the compiler won't consider that specific specialization as a candidate and will continue searching for a valid one.\n\nThe key idea behind SFINAE is that if a substitution error occurs, it is silently ignored, and the compiler continues to explore other template specializations or overloads. This allows you to write more flexible and generic code, as it enables you to have multiple specializations for different scenarios.\n\nCode Example\n------------\n\nHere's an example that demonstrates SFINAE in action:\n\n #include <iostream>\n #include <type_traits>\n \n template <typename T, typename = void>\n struct foo_impl {\n void operator()(T t) {\n std::cout << \"Called when T is not arithmetic\" << std::endl;\n }\n };\n \n template <typename T>\n struct foo_impl<T, std::enable_if_t<std::is_arithmetic<T>::value>> {\n void operator()(T t) {\n std::cout << \"Called when T is arithmetic\" << std::endl;\n }\n };\n \n template <typename T>\n void foo(T t) {\n foo_impl<T>()(t);\n }\n \n int main() {\n int a = 5;\n foo(a); // output: Called when T is arithmetic\n \n std::string s = \"example\";\n foo(s); // output: Called when T is not arithmetic\n }\n \n\nIn this example, we define two `foo_impl` functions are specialized based on the boolean value of `std::is_arithmetic<T>`. The first one is enabled when `T` is an arithmetic type, while the second one is enabled when `T` is not an arithmetic type. The `foo` function then calls the appropriate `foo_impl` specialization based on the result of the type trait.\n\nWhen calling `foo(a)` with an integer, the first specialization is selected, and when calling `foo(s)` with a string, the second specialization is selected. If there is no valid specialization, the code would fail to compile.",
"description": "SFINAE is a principle in C++ template metaprogramming that allows the compiler to select the appropriate function or class when a specific template specialization fails during substitution. The term \"substitution failure\" refers to the process where the compiler tries to substitute template arguments into a function template or class template. If the substitution causes an error, the compiler won't consider that specific specialization as a candidate and will continue searching for a valid one.\n\nThe key idea behind SFINAE is that if a substitution error occurs, it is silently ignored, and the compiler continues to explore other template specializations or overloads. This allows you to write more flexible and generic code, as it enables you to have multiple specializations for different scenarios.\n\nCode Example\n------------\n\nHere's an example that demonstrates SFINAE in action:\n\n #include <iostream>\n #include <type_traits>\n \n template <typename T, typename = void>\n struct foo_impl {\n void operator()(T t) {\n std::cout << \"Called when T is not arithmetic\\n\";\n }\n };\n \n template <typename T>\n struct foo_impl<T, std::enable_if_t<std::is_arithmetic<T>::value>> {\n void operator()(T t) {\n std::cout << \"Called when T is arithmetic\\n\";\n }\n };\n \n template <typename T>\n void foo(T t) {\n foo_impl<T>()(t);\n }\n \n int main() {\n int a = 5;\n foo(a); // output: Called when T is arithmetic\n \n std::string s = \"example\";\n foo(s); // output: Called when T is not arithmetic\n }\n \n\nIn this example, we define two `foo_impl` functions are specialized based on the boolean value of `std::is_arithmetic<T>`. The first one is enabled when `T` is an arithmetic type, while the second one is enabled when `T` is not an arithmetic type. The `foo` function then calls the appropriate `foo_impl` specialization based on the result of the type trait.\n\nWhen calling `foo(a)` with an integer, the first specialization is selected, and when calling `foo(s)` with a string, the second specialization is selected. If there is no valid specialization, the code would fail to compile.",
"links": []
},
"6hTcmJwNnQstbWWzNCfTe": {
"title": "Full Template Specialization",
"description": "Full template specialization allows you to provide a specific implementation, or behavior, for a template when used with a certain set of type parameters. It is useful when you want to handle special cases or optimize your code for specific types.\n\nSyntax\n------\n\nTo create a full specialization of a template, you need to define the specific type for which the specialization should happen. The syntax looks as follows:\n\n template <> //Indicates that this is a specialization\n className<specificType> //The specialized class for the specific type\n \n\nExample\n-------\n\nConsider the following example to demonstrate full template specialization:\n\n // Generic template\n template <typename T>\n class MyContainer {\n public:\n void print() {\n std::cout << \"Generic container.\" << std::endl;\n }\n };\n \n // Full template specialization for int\n template <>\n class MyContainer<int> {\n public:\n void print() {\n std::cout << \"Container for integers.\" << std::endl;\n }\n };\n \n int main() {\n MyContainer<double> d;\n MyContainer<int> i;\n \n d.print(); // Output: Generic container.\n i.print(); // Output: Container for integers.\n \n return 0;\n }\n \n\nIn this example, we defined a generic `MyContainer` template class along with a full specialization for `int` type. When we use the container with the `int` type, the specialized implementation's `print` method is called. For other types, the generic template implementation will be used.",
"description": "Full template specialization allows you to provide a specific implementation, or behavior, for a template when used with a certain set of type parameters. It is useful when you want to handle special cases or optimize your code for specific types.\n\nSyntax\n------\n\nTo create a full specialization of a template, you need to define the specific type for which the specialization should happen. The syntax looks as follows:\n\n template <> //Indicates that this is a specialization\n className<specificType> //The specialized class for the specific type\n \n\nExample\n-------\n\nConsider the following example to demonstrate full template specialization:\n\n // Generic template\n template <typename T>\n class MyContainer {\n public:\n void print() {\n std::cout << \"Generic container.\\n\";\n }\n };\n \n // Full template specialization for int\n template <>\n class MyContainer<int> {\n public:\n void print() {\n std::cout << \"Container for integers.\\n\";\n }\n };\n \n int main() {\n MyContainer<double> d;\n MyContainer<int> i;\n \n d.print(); // Output: Generic container.\n i.print(); // Output: Container for integers.\n \n return 0;\n }\n \n\nIn this example, we defined a generic `MyContainer` template class along with a full specialization for `int` type. When we use the container with the `int` type, the specialized implementation's `print` method is called. For other types, the generic template implementation will be used.",
"links": []
},
"1NYJtbdcdOB4-vIrnq4yX": {
"title": "Partial Template Specialization",
"description": "Partial template specialization is a concept in C++ templates, which allows you to specialize a template for a subset of its possible type arguments. It is particularly useful when you want to provide a customized implementation for a particular group of types without having to define separate specializations for all types in that group.\n\nPartial template specialization is achieved by providing a specialization of a template with a new set of template parameters. This new template will be chosen when the compiler deduces the types that match the partial specialization.\n\nHere is a code example that demonstrates partial template specialization:\n\n // Primary template\n template <typename T>\n struct MyTemplate {\n static const char* name() {\n return \"General case\";\n }\n };\n \n // Partial specialization for pointers\n template <typename T>\n struct MyTemplate<T*> {\n static const char* name() {\n return \"Partial specialization for pointers\";\n }\n };\n \n // Full specialization for int\n template <>\n struct MyTemplate<int> {\n static const char* name() {\n return \"Full specialization for int\";\n }\n };\n \n int main() {\n MyTemplate<double> t1; // General case\n MyTemplate<double*> t2; // Partial specialization for pointers\n MyTemplate<int> t3; // Full specialization for int\n \n std::cout << t1.name() << std::endl;\n std::cout << t2.name() << std::endl;\n std::cout << t3.name() << std::endl;\n \n return 0;\n }\n \n\nIn the example above, we have defined a primary template `MyTemplate` with a single type parameter `T`. We then provide a partial template specialization for pointer types by specifying `MyTemplate<T*>`. This means that the partial specialization will be chosen when the type argument is a pointer type.\n\nLastly, we provide a full specialization for the `int` type by specifying `MyTemplate<int>`. This will be chosen when the type argument is `int`.\n\nWhen running this example, the output will be:\n\n General case\n Partial specialization for pointers\n Full specialization for int\n \n\nThis demonstrates that the partial specialization works as expected, and is chosen for pointer types, while the full specialization is chosen for the `int` type.",
"description": "Partial template specialization is a concept in C++ templates, which allows you to specialize a template for a subset of its possible type arguments. It is particularly useful when you want to provide a customized implementation for a particular group of types without having to define separate specializations for all types in that group.\n\nPartial template specialization is achieved by providing a specialization of a template with a new set of template parameters. This new template will be chosen when the compiler deduces the types that match the partial specialization.\n\nHere is a code example that demonstrates partial template specialization:\n\n // Primary template\n template <typename T>\n struct MyTemplate {\n static const char* name() {\n return \"General case\";\n }\n };\n \n // Partial specialization for pointers\n template <typename T>\n struct MyTemplate<T*> {\n static const char* name() {\n return \"Partial specialization for pointers\";\n }\n };\n \n // Full specialization for int\n template <>\n struct MyTemplate<int> {\n static const char* name() {\n return \"Full specialization for int\";\n }\n };\n \n int main() {\n MyTemplate<double> t1; // General case\n MyTemplate<double*> t2; // Partial specialization for pointers\n MyTemplate<int> t3; // Full specialization for int\n \n std::cout << t1.name() << '\\n';\n std::cout << t2.name() << '\\n';\n std::cout << t3.name() << '\\n';\n \n return 0;\n }\n \n\nIn the example above, we have defined a primary template `MyTemplate` with a single type parameter `T`. We then provide a partial template specialization for pointer types by specifying `MyTemplate<T*>`. This means that the partial specialization will be chosen when the type argument is a pointer type.\n\nLastly, we provide a full specialization for the `int` type by specifying `MyTemplate<int>`. This will be chosen when the type argument is `int`.\n\nWhen running this example, the output will be:\n\n General case\n Partial specialization for pointers\n Full specialization for int\n \n\nThis demonstrates that the partial specialization works as expected, and is chosen for pointer types, while the full specialization is chosen for the `int` type.",
"links": []
},
"fb3bnfKXjSIjPAk4b95lg": {
@ -511,7 +511,7 @@
},
"O2Du5gHHxFxAI2u5uO8wu": {
"title": "Copy on Write",
"description": "The Copy-Write idiom, sometimes called the Copy-on-Write (CoW) or \"lazy copying\" idiom, is a technique used in programming to minimize the overhead of copying large objects. It helps in reducing the number of actual copy operations by using shared references to objects and only copying the data when it's required for modification.\n\nLet's understand this with a simple example:\n\n #include <iostream>\n #include <memory>\n \n class MyString {\n public:\n MyString(const std::string &str) : data(std::make_shared<std::string>(str)) {}\n \n // Use the same shared data for copying.\n MyString(const MyString &other) : data(other.data) { \n std::cout << \"Copied using the Copy-Write idiom.\" << std::endl;\n }\n \n // Make a copy only if we want to modify the data.\n void write(const std::string &str) {\n // Check if there's more than one reference.\n if (data.use_count() > 1) {\n data = std::make_shared<std::string>(*data);\n std::cout << \"Copy is actually made for writing.\" << std::endl;\n }\n *data = str;\n }\n \n private:\n std::shared_ptr<std::string> data;\n };\n \n int main() {\n MyString str1(\"Hello\");\n MyString str2 = str1; // No copy operation, just shared references.\n \n str1.write(\"Hello, World!\"); // This is where the actual duplication happens.\n return 0;\n }\n \n\nIn this example, we have a class `MyString` that simulates the Copy-Write idiom. When a `MyString` object is created, it constructs a `shared_ptr` pointing to a string. When a `MyString` object is copied, it does not perform any actual copy operation, but simply increases the reference count of the shared object. Finally, when the `write` function is called, it checks if there's more than one reference to the data and if so, it actually creates a new copy and updates the reference. This way, unnecessary copies can be avoided until they are actually needed for modification.",
"description": "The Copy-Write idiom, sometimes called the Copy-on-Write (CoW) or \"lazy copying\" idiom, is a technique used in programming to minimize the overhead of copying large objects. It helps in reducing the number of actual copy operations by using shared references to objects and only copying the data when it's required for modification.\n\nLet's understand this with a simple example:\n\n #include <iostream>\n #include <memory>\n \n class MyString {\n public:\n MyString(const std::string &str) : data(std::make_shared<std::string>(str)) {}\n \n // Use the same shared data for copying.\n MyString(const MyString &other) : data(other.data) { \n std::cout << \"Copied using the Copy-Write idiom.\\n\";\n }\n \n // Make a copy only if we want to modify the data.\n void write(const std::string &str) {\n // Check if there's more than one reference.\n if (data.use_count() > 1) {\n data = std::make_shared<std::string>(*data);\n std::cout << \"Copy is actually made for writing.\\n\";\n }\n *data = str;\n }\n \n private:\n std::shared_ptr<std::string> data;\n };\n \n int main() {\n MyString str1(\"Hello\");\n MyString str2 = str1; // No copy operation, just shared references.\n \n str1.write(\"Hello, World!\"); // This is where the actual duplication happens.\n return 0;\n }\n \n\nIn this example, we have a class `MyString` that simulates the Copy-Write idiom. When a `MyString` object is created, it constructs a `shared_ptr` pointing to a string. When a `MyString` object is copied, it does not perform any actual copy operation, but simply increases the reference count of the shared object. Finally, when the `write` function is called, it checks if there's more than one reference to the data and if so, it actually creates a new copy and updates the reference. This way, unnecessary copies can be avoided until they are actually needed for modification.",
"links": []
},
"OmHDlLxCnH8RDdu5vx9fl": {
@ -521,22 +521,22 @@
},
"MEoWt8NKjPLVTeGgYf3cR": {
"title": "Pimpl",
"description": "Pimpl (Pointer-to-Implementation) idiom, also known as a private class data, compiler firewall, or handle classes, is a technique used in C++ to hide the implementation details of a class by using a forward declaration to a private structure or class, keeping the public interface of the class clean, and reducing compile-time dependencies.\n\nImplementation\n--------------\n\nHere is a simple example illustrating the Pimpl idiom:\n\n**my\\_class.h**\n\n class MyClass_Impl; // forward declaration\n \n class MyClass\n {\n public:\n MyClass();\n ~MyClass();\n void some_method();\n \n private:\n MyClass_Impl *pimpl; // pointer to the implementation\n };\n \n\n**my\\_class.cpp**\n\n #include \"my_class.h\"\n #include <iostream>\n \n class MyClass_Impl // the actual implementation\n {\n public:\n void some_method()\n {\n std::cout << \"Implementation method called!\" << std::endl;\n }\n };\n \n MyClass::MyClass() : pimpl(new MyClass_Impl()) {} // constructor\n \n MyClass::~MyClass() { delete pimpl; } // destructor\n \n void MyClass::some_method()\n {\n pimpl->some_method(); // delegation to the implementation\n }\n \n\nNow, all the public methods of `MyClass` will delegate the calls to the corresponding methods of `MyClass_Impl`. By doing this, you can hide the details of class implementation, reduce the compile-time dependencies, and ease the maintenance of your code.",
"description": "Pimpl (Pointer-to-Implementation) idiom, also known as a private class data, compiler firewall, or handle classes, is a technique used in C++ to hide the implementation details of a class by using a forward declaration to a private structure or class, keeping the public interface of the class clean, and reducing compile-time dependencies.\n\nImplementation\n--------------\n\nHere is a simple example illustrating the Pimpl idiom:\n\n**my\\_class.h**\n\n class MyClass_Impl; // forward declaration\n \n class MyClass\n {\n public:\n MyClass();\n ~MyClass();\n void some_method();\n \n private:\n MyClass_Impl *pimpl; // pointer to the implementation\n };\n \n\n**my\\_class.cpp**\n\n #include \"my_class.h\"\n #include <iostream>\n \n class MyClass_Impl // the actual implementation\n {\n public:\n void some_method()\n {\n std::cout << \"Implementation method called!\\n\";\n }\n };\n \n MyClass::MyClass() : pimpl(new MyClass_Impl()) {} // constructor\n \n MyClass::~MyClass() { delete pimpl; } // destructor\n \n void MyClass::some_method()\n {\n pimpl->some_method(); // delegation to the implementation\n }\n \n\nNow, all the public methods of `MyClass` will delegate the calls to the corresponding methods of `MyClass_Impl`. By doing this, you can hide the details of class implementation, reduce the compile-time dependencies, and ease the maintenance of your code.",
"links": []
},
"ttt-yeIi4BPWrgvW324W7": {
"title": "CRTP",
"description": "**Curiously Recurring Template Pattern (CRTP)**\n\nThe Curiously Recurring Template Pattern (CRTP) is a C++ idiom that involves a class template being derived from its own specialization. This pattern allows for the creation of static polymorphism, which differs from regular runtime polymorphism that relies on virtual functions and inheritance.\n\nCRTP is usually employed when you want to customize certain behavior in the base class without adding the overhead of a virtual function call. In short, CRTP can be used for achieving compile-time polymorphism without the runtime performance cost.\n\nHere's an example demonstrating CRTP:\n\n template <typename Derived>\n class Base {\n public:\n void interface() {\n static_cast<Derived*>(this)->implementation();\n }\n \n void implementation() {\n std::cout << \"Default implementation in Base\" << std::endl;\n }\n };\n \n class Derived1 : public Base<Derived1> {\n public:\n void implementation() {\n std::cout << \"Custom implementation in Derived1\" << std::endl;\n }\n };\n \n class Derived2 : public Base<Derived2> {\n // No custom implementation, so Base::implementation will be used.\n };\n \n int main() {\n Derived1 d1;\n d1.interface(); // Output: \"Custom implementation in Derived1\"\n \n Derived2 d2;\n d2.interface(); // Output: \"Default implementation in Base\"\n \n return 0;\n }\n \n\nIn this example, the `Base` class is a template that takes a single type parameter. `Derived1` and `Derived2` are derived from their respective specialization of `Base`. CRTP is employed to allow custom implementations of the `implementation()` function in derived classes while providing a default behavior in the `Base` class. The `interface()` function in the `Base` class is a template for the derived class's behavior and calls the corresponding `implementation()` function based on the static type.\n\nThis pattern enables you to override certain behavior in derived classes with additional functionality, all while avoiding the overhead of virtual function calls and, in turn, achieving a higher degree of efficiency at runtime.",
"description": "**Curiously Recurring Template Pattern (CRTP)**\n\nThe Curiously Recurring Template Pattern (CRTP) is a C++ idiom that involves a class template being derived from its own specialization. This pattern allows for the creation of static polymorphism, which differs from regular runtime polymorphism that relies on virtual functions and inheritance.\n\nCRTP is usually employed when you want to customize certain behavior in the base class without adding the overhead of a virtual function call. In short, CRTP can be used for achieving compile-time polymorphism without the runtime performance cost.\n\nHere's an example demonstrating CRTP:\n\n template <typename Derived>\n class Base {\n public:\n void interface() {\n static_cast<Derived*>(this)->implementation();\n }\n \n void implementation() {\n std::cout << \"Default implementation in Base\\n\";\n }\n };\n \n class Derived1 : public Base<Derived1> {\n public:\n void implementation() {\n std::cout << \"Custom implementation in Derived1\\n\";\n }\n };\n \n class Derived2 : public Base<Derived2> {\n // No custom implementation, so Base::implementation will be used.\n };\n \n int main() {\n Derived1 d1;\n d1.interface(); // Output: \"Custom implementation in Derived1\"\n \n Derived2 d2;\n d2.interface(); // Output: \"Default implementation in Base\"\n \n return 0;\n }\n \n\nIn this example, the `Base` class is a template that takes a single type parameter. `Derived1` and `Derived2` are derived from their respective specialization of `Base`. CRTP is employed to allow custom implementations of the `implementation()` function in derived classes while providing a default behavior in the `Base` class. The `interface()` function in the `Base` class is a template for the derived class's behavior and calls the corresponding `implementation()` function based on the static type.\n\nThis pattern enables you to override certain behavior in derived classes with additional functionality, all while avoiding the overhead of virtual function calls and, in turn, achieving a higher degree of efficiency at runtime.",
"links": []
},
"vvE1aUsWbF1OFcmMUHbJa": {
"title": "Standardds",
"description": "C++ standards are a set of rules and guidelines that define the language's features, syntax, and semantics. The International Organization for Standardization (ISO) is responsible for maintaining and updating the C++ standards. The main purpose of the standards is to ensure consistency, efficiency, and maintainability across multiple platforms and compilers.\n\nHere's a brief summary of the different C++ standards released to date:\n\n* **C++98/C++03**: The first standardized version of C++, which introduced many features like templates, exceptions, and the Standard Template Library (STL). C++03 is a minor update to C++98 with some bug fixes and performance improvements.\n \n* **C++11**: A major upgrade to the language, which introduced features such as:\n \n * Lambda expressions:\n \n auto sum = [](int a, int b) -> int { return a + b; };\n \n \n * Range-based for loops:\n \n std::vector<int> numbers = {1, 2, 3, 4};\n for (int num : numbers) {\n std::cout << num << std::endl;\n }\n \n \n * Smart pointers like `std::shared_ptr` and `std::unique_ptr`.\n* **C++14**: A minor update to C++11, which added features such as:\n \n * Generic lambda expressions:\n \n auto generic_sum = [](auto a, auto b) { return a + b; };\n \n \n * Binary literals:\n \n int binary_number = 0b1010;\n \n \n* **C++17**: Another major update that introduced features such as:\n \n * `if` and `switch` with initializers:\n \n if (auto it = my_map.find(key); it != my_map.end()) {\n // use 'it' here\n }\n \n \n * Structured bindings:\n \n std::map<std::string, int> my_map = {{\"A\", 1}, {\"B\", 2}};\n for (const auto& [key, value] : my_map) {\n // use 'key' and 'value' here\n }\n \n \n* **C++20**: The latest major update to the language, with features such as:\n \n * Concepts:\n \n template<typename T>\n concept Addable = requires(T a, T b) {\n { a + b } -> std::same_as<T>;\n };\n \n \n * Ranges:\n \n std::vector<int> numbers = {1, 2, 3, 4};\n auto doubled = numbers | std::views::transform([](int n) { return n * 2; });\n \n \n * Coroutines and more.\n\nRemember that to use these language features, you might need to configure your compiler to use the specific C++ standard version. For example, with GCC or Clang, you can use the `-std=c++11`, `-std=c++14`, `-std=c++17`, or `-std=c++20` flags.",
"description": "C++ standards are a set of rules and guidelines that define the language's features, syntax, and semantics. The International Organization for Standardization (ISO) is responsible for maintaining and updating the C++ standards. The main purpose of the standards is to ensure consistency, efficiency, and maintainability across multiple platforms and compilers.\n\nHere's a brief summary of the different C++ standards released to date:\n\n* **C++98/C++03**: The first standardized version of C++, which introduced many features like templates, exceptions, and the Standard Template Library (STL). C++03 is a minor update to C++98 with some bug fixes and performance improvements.\n \n* **C++11**: A major upgrade to the language, which introduced features such as:\n \n * Lambda expressions:\n \n auto sum = [](int a, int b) -> int { return a + b; };\n \n \n * Range-based for loops:\n \n std::vector<int> numbers = {1, 2, 3, 4};\n for (int num : numbers) {\n std::cout << num << '\\n';\n }\n \n \n * Smart pointers like `std::shared_ptr` and `std::unique_ptr`.\n* **C++14**: A minor update to C++11, which added features such as:\n \n * Generic lambda expressions:\n \n auto generic_sum = [](auto a, auto b) { return a + b; };\n \n \n * Binary literals:\n \n int binary_number = 0b1010;\n \n \n* **C++17**: Another major update that introduced features such as:\n \n * `if` and `switch` with initializers:\n \n if (auto it = my_map.find(key); it != my_map.end()) {\n // use 'it' here\n }\n \n \n * Structured bindings:\n \n std::map<std::string, int> my_map = {{\"A\", 1}, {\"B\", 2}};\n for (const auto& [key, value] : my_map) {\n // use 'key' and 'value' here\n }\n \n \n* **C++20**: The latest major update to the language, with features such as:\n \n * Concepts:\n \n template<typename T>\n concept Addable = requires(T a, T b) {\n { a + b } -> std::same_as<T>;\n };\n \n \n * Ranges:\n \n std::vector<int> numbers = {1, 2, 3, 4};\n auto doubled = numbers | std::views::transform([](int n) { return n * 2; });\n \n \n * Coroutines and more.\n\nRemember that to use these language features, you might need to configure your compiler to use the specific C++ standard version. For example, with GCC or Clang, you can use the `-std=c++11`, `-std=c++14`, `-std=c++17`, or `-std=c++20` flags.",
"links": []
},
"T6rCTv9Dxkm-tEA-l9XEv": {
"title": "C++ 11 / 14",
"description": "**C++11** The C++11 standard, also known as C++0x, was officially released in September 2011. It introduced several new language features and improvements, including:\n\n* **Auto**: Allows compiler to infer the variable type based on its initializing expression.\n \n auto integer = 42; // integer is of int type\n auto floating = 3.14; // floating is of double type\n \n \n* **Range-Based for Loop**: Provides foreach-like semantics for iterating through a container or array.\n \n std::vector<int> numbers {1, 2, 3, 4};\n for (int number : numbers) {\n std::cout << number << std::endl;\n }\n \n \n* **Lambda Functions**: Anonymous functions that allow the creation of function objects more easily.\n \n auto add = [](int a, int b) -> int { return a + b; };\n int sum = add(42, 13); // sum is equal to 55\n \n \n* **nullptr**: A new keyword to represent null pointers, more type-safe than using a literal '0' or \"NULL\".\n \n int *ptr = nullptr;\n \n \n* **Thread Support Library**: Provides a standard way to work with threads and synchronize data access across threads.\n \n std::thread t([]() { std::cout << \"Hello from another thread\\n\"; });\n t.join();\n \n \n\n**C++14** The C++14 standard was officially released in December 2014 as a small extension over C++11, focusing more on fine-tuning language features and fixing issues. Some of the new features introduced:\n\n* **Generic Lambdas**: Allows lambda function parameters to be declared with 'auto' type placeholders.\n \n auto add = [](auto a, auto b) { return a + b; };\n auto sum_i = add(42, 13); // Still works with integers\n auto sum_f = add(3.14, 2.72); // Now works with doubles too\n \n \n* **Binary Literals**: Allow you to input integers as binary literals for better readability.\n \n int b = 0b110101; // Decimal value is 53\n \n \n* **decltype(auto)**: Deduces the type of variable to match that of the expression it is initialized with.\n \n auto func = [](auto a, auto b) { return a * b; };\n decltype(auto) result = func(5, 3.14); // decltype(auto) deduces to \"double\"\n \n \n* **Variable Templates**: Allows you to define variables with template parameters.\n \n template <typename T>\n constexpr T pi = T(3.1415926535897932385);\n float r = pi<float>; // Instantiated as a float\n double d = pi<double>; // Instantiated as a double",
"description": "**C++11** The C++11 standard, also known as C++0x, was officially released in September 2011. It introduced several new language features and improvements, including:\n\n* **Auto**: Allows compiler to infer the variable type based on its initializing expression.\n \n auto integer = 42; // integer is of int type\n auto floating = 3.14; // floating is of double type\n \n \n* **Range-Based for Loop**: Provides foreach-like semantics for iterating through a container or array.\n \n std::vector<int> numbers {1, 2, 3, 4};\n for (int number : numbers) {\n std::cout << number << '\\n';\n }\n \n \n* **Lambda Functions**: Anonymous functions that allow the creation of function objects more easily.\n \n auto add = [](int a, int b) -> int { return a + b; };\n int sum = add(42, 13); // sum is equal to 55\n \n \n* **nullptr**: A new keyword to represent null pointers, more type-safe than using a literal '0' or \"NULL\".\n \n int *ptr = nullptr;\n \n \n* **Thread Support Library**: Provides a standard way to work with threads and synchronize data access across threads.\n \n std::thread t([]() { std::cout << \"Hello from another thread\\n\"; });\n t.join();\n \n \n\n**C++14** The C++14 standard was officially released in December 2014 as a small extension over C++11, focusing more on fine-tuning language features and fixing issues. Some of the new features introduced:\n\n* **Generic Lambdas**: Allows lambda function parameters to be declared with 'auto' type placeholders.\n \n auto add = [](auto a, auto b) { return a + b; };\n auto sum_i = add(42, 13); // Still works with integers\n auto sum_f = add(3.14, 2.72); // Now works with doubles too\n \n \n* **Binary Literals**: Allow you to input integers as binary literals for better readability.\n \n int b = 0b110101; // Decimal value is 53\n \n \n* **decltype(auto)**: Deduces the type of variable to match that of the expression it is initialized with.\n \n auto func = [](auto a, auto b) { return a * b; };\n decltype(auto) result = func(5, 3.14); // decltype(auto) deduces to \"double\"\n \n \n* **Variable Templates**: Allows you to define variables with template parameters.\n \n template <typename T>\n constexpr T pi = T(3.1415926535897932385);\n float r = pi<float>; // Instantiated as a float\n double d = pi<double>; // Instantiated as a double",
"links": []
},
"R2-qWGUxsTOeSHRuUzhd2": {
@ -546,7 +546,7 @@
},
"o3no4a5_iMFzEAGs56-BJ": {
"title": "C++ 20",
"description": "C++20 is the latest standard of the C++ programming language, which brings significant improvements and new features to the language. This version is aimed at facilitating better software development practices and enabling developers to write more efficient, readable, and maintainable code.\n\nHere are some of the key features introduced in C++20:\n\nConcepts\n--------\n\nConcepts are a way to enforce specific requirements on template parameters, allowing you to write more expressive and understandable code. They improve the error messages when using templates and ensure that the template parameters fulfill specific criteria.\n\n template <typename T>\n concept Addable = requires (T a, T b) {\n { a + b } -> std::same_as<T>;\n };\n \n template <Addable T>\n T add(T a, T b) {\n return a + b;\n }\n \n\nRanges\n------\n\nRanges provide a new way to work with sequences of values, enhancing the power and expressiveness of the Standard Library algorithms. The range-based algorithms make it easier and more convenient to work with sequences.\n\n #include <algorithm>\n #include <iostream>\n #include <ranges>\n #include <vector>\n \n int main() {\n std::vector<int> numbers = { 1, 2, 3, 4, 5 };\n \n auto even_numbers = numbers | std::views::filter([](int n) { return n % 2 == 0; });\n \n for (int n : even_numbers) {\n std::cout << n << ' ';\n }\n }\n \n\nCoroutines\n----------\n\nCoroutines are a new way to write asynchronous and concurrent code with improved readability. They allow functions to be suspended and resumed, enabling you to write more efficient, non-blocking code.\n\n #include <coroutine>\n #include <iostream>\n #include <future>\n \n std::future<int> async_value(int value) {\n co_await std::chrono::seconds(1);\n co_return value * 2;\n }\n \n int main() {\n auto result = async_value(42);\n std::cout << \"Result: \" << result.get() << std::endl;\n }\n \n\nThe `constexpr` and `consteval` Keywords\n----------------------------------------\n\nBoth `constexpr` and `consteval` are related to compile-time evaluation. Functions marked with `constexpr` can be executed at compile-time or runtime, while functions marked with `consteval` can only be executed at compile-time.\n\n constexpr int add(int a, int b) {\n return a + b;\n }\n \n consteval int square(int x) {\n return x * x;\n }\n \n int main() {\n constexpr int result1 = add(3, 4); // evaluated at compile-time\n int result2 = add(5, 6); // evaluated at runtime\n constexpr int result3 = square(7); // evaluated at compile-time\n }\n \n\nThese are just some of the highlights of the C++20 standard. It also includes many other features and improvements, like structured bindings, improved lambdas, and new standard library components. Overall, C++20 makes it easier for developers to write clean, efficient, and expressive code.",
"description": "C++20 is the latest standard of the C++ programming language, which brings significant improvements and new features to the language. This version is aimed at facilitating better software development practices and enabling developers to write more efficient, readable, and maintainable code.\n\nHere are some of the key features introduced in C++20:\n\nConcepts\n--------\n\nConcepts are a way to enforce specific requirements on template parameters, allowing you to write more expressive and understandable code. They improve the error messages when using templates and ensure that the template parameters fulfill specific criteria.\n\n template <typename T>\n concept Addable = requires (T a, T b) {\n { a + b } -> std::same_as<T>;\n };\n \n template <Addable T>\n T add(T a, T b) {\n return a + b;\n }\n \n\nRanges\n------\n\nRanges provide a new way to work with sequences of values, enhancing the power and expressiveness of the Standard Library algorithms. The range-based algorithms make it easier and more convenient to work with sequences.\n\n #include <algorithm>\n #include <iostream>\n #include <ranges>\n #include <vector>\n \n int main() {\n std::vector<int> numbers = { 1, 2, 3, 4, 5 };\n \n auto even_numbers = numbers | std::views::filter([](int n) { return n % 2 == 0; });\n \n for (int n : even_numbers) {\n std::cout << n << ' ';\n }\n }\n \n\nCoroutines\n----------\n\nCoroutines are a new way to write asynchronous and concurrent code with improved readability. They allow functions to be suspended and resumed, enabling you to write more efficient, non-blocking code.\n\n #include <coroutine>\n #include <iostream>\n #include <future>\n \n std::future<int> async_value(int value) {\n co_await std::chrono::seconds(1);\n co_return value * 2;\n }\n \n int main() {\n auto result = async_value(42);\n std::cout << \"Result: \" << result.get() << '\\n';\n }\n \n\nThe `constexpr` and `consteval` Keywords\n----------------------------------------\n\nBoth `constexpr` and `consteval` are related to compile-time evaluation. Functions marked with `constexpr` can be executed at compile-time or runtime, while functions marked with `consteval` can only be executed at compile-time.\n\n constexpr int add(int a, int b) {\n return a + b;\n }\n \n consteval int square(int x) {\n return x * x;\n }\n \n int main() {\n constexpr int result1 = add(3, 4); // evaluated at compile-time\n int result2 = add(5, 6); // evaluated at runtime\n constexpr int result3 = square(7); // evaluated at compile-time\n }\n \n\nThese are just some of the highlights of the C++20 standard. It also includes many other features and improvements, like structured bindings, improved lambdas, and new standard library components. Overall, C++20 makes it easier for developers to write clean, efficient, and expressive code.",
"links": []
},
"sxbbKtg7kMNbkx7fXhjR9": {
@ -556,7 +556,7 @@
},
"PPg0V5EzGBeJsysg1215V": {
"title": "C++ 0x",
"description": "`cpp0x` refers to the working name for [C++11](https://en.cppreference.com/w/cpp/11), which was previously known as C++0x before its final release. C++11 is a major revision of the C++ language standard, published in 2011, and brought several new features and improvements to the language.\n\nSome of the notable features in C++11 include:\n\n* **Auto** keyword for automatic type inference.\n \n auto i = 42; // i is an int\n auto s = \"hello\"; // s is a const char*\n \n \n* **Range-based for loop** for easier iteration over containers.\n \n std::vector<int> vec = {1, 2, 3};\n for (int i : vec) {\n std::cout << i << std::endl;\n }\n \n \n* **Lambda functions** for creating anonymous functions.\n \n auto add = [](int a, int b) { return a + b; };\n int result = add(3, 4); // result is 7\n \n \n* **nullptr** for representing null pointer values, instead of using `NULL`.\n \n int* p = nullptr;\n \n \n* **Rvalue references and move semantics** to optimize the handling of temporary objects.\n \n std::string str1 = \"hello\";\n std::string str2 = std::move(str1); // move the content of str1 to str2\n \n \n* **Variadic templates** for creating templates that take a variable number of arguments.\n \n template <typename... Args>\n void printArgs(Args... args) {\n // function body\n }\n \n \n* **Static assertions** for compile-time assertions.\n \n static_assert(sizeof(int) == 4, \"This code requires int to be 4 bytes.\");\n \n \n* **Thread support** for multithreading programming.\n \n #include <thread>\n \n void my_function() {\n // thread function body\n }\n \n int main() {\n std::thread t(my_function);\n t.join();\n return 0;\n }\n \n \n\nThese are just a few examples of the many new features introduced in C++11. For a comprehensive list, you can refer to the [C++11 documentation](https://en.cppreference.com/w/cpp/11).",
"description": "`cpp0x` refers to the working name for [C++11](https://en.cppreference.com/w/cpp/11), which was previously known as C++0x before its final release. C++11 is a major revision of the C++ language standard, published in 2011, and brought several new features and improvements to the language.\n\nSome of the notable features in C++11 include:\n\n* **Auto** keyword for automatic type inference.\n \n auto i = 42; // i is an int\n auto s = \"hello\"; // s is a const char*\n \n \n* **Range-based for loop** for easier iteration over containers.\n \n std::vector<int> vec = {1, 2, 3};\n for (int i : vec) {\n std::cout << i << '\\n';\n }\n \n \n* **Lambda functions** for creating anonymous functions.\n \n auto add = [](int a, int b) { return a + b; };\n int result = add(3, 4); // result is 7\n \n \n* **nullptr** for representing null pointer values, instead of using `NULL`.\n \n int* p = nullptr;\n \n \n* **Rvalue references and move semantics** to optimize the handling of temporary objects.\n \n std::string str1 = \"hello\";\n std::string str2 = std::move(str1); // move the content of str1 to str2\n \n \n* **Variadic templates** for creating templates that take a variable number of arguments.\n \n template <typename... Args>\n void printArgs(Args... args) {\n // function body\n }\n \n \n* **Static assertions** for compile-time assertions.\n \n static_assert(sizeof(int) == 4, \"This code requires int to be 4 bytes.\");\n \n \n* **Thread support** for multithreading programming.\n \n #include <thread>\n \n void my_function() {\n // thread function body\n }\n \n int main() {\n std::thread t(my_function);\n t.join();\n return 0;\n }\n \n \n\nThese are just a few examples of the many new features introduced in C++11. For a comprehensive list, you can refer to the [C++11 documentation](https://en.cppreference.com/w/cpp/11).",
"links": []
},
"qmHs6_BzND_xpMmls5YUH": {
@ -566,7 +566,7 @@
},
"VtPb8-AJKzhTB0QbMtoU4": {
"title": "Understanding Debugger Messages",
"description": "Debugger messages are notifications or alerts provided by a debugger to help you identify problems or errors in your C++ code. These messages can be warnings or error messages and can provide helpful information about the state of your program and specific issues encountered during the debugging process.\n\nTypes of Debugger Messages\n--------------------------\n\n* **Error Messages:** Notify you about issues in the code that prevent the program from running or compiling correctly. These messages typically include information about the file and the line number where the error is detected, followed by a description of the issue.\n \n Example:\n \n test.cpp: In function 'int main()':\n test.cpp:6:5: error: 'cout' was not declared in this scope\n cout << \"Hello World!\";\n ^~~~\n \n \n* **Warning Messages:** Inform you about potential issues or risky programming practices that may not necessarily cause errors but could lead to problems later on. Like error messages, warning messages usually include information about the file and line number where the issue is found, along with a description of the problem.\n \n Example:\n \n test.cpp: In function 'int main()':\n test.cpp:6:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]\n if (a < size)\n ^\n \n \n* **Informational Messages:** Provide general information about the execution of the program, such as breakpoints, watchpoints, and variable values. These messages can also reveal the current state of the program, including the call stack and the list of active threads.\n \n Example (_assuming you are using GDB as debugger_):\n \n (gdb) break main\n Breakpoint 1 at 0x40055f: file test.cpp, line 5.\n (gdb) run\n Starting program: /path/to/test\n Breakpoint 1, main () at test.cpp:5\n 5 int a = 5;\n \n \n\nCode Examples\n-------------\n\nTo make use of debugger messages, you need to employ a debugger, such as GDB or Visual Studio Debugger, and include specific flags during the compilation process.\n\nExample using GDB:\n\n // test.cpp\n \n #include <iostream>\n \n int main() {\n int num1 = 10;\n int num2 = 0;\n int result = num1 / num2;\n \n std::cout << \"Result: \" << result << std::endl;\n \n return 0;\n }\n \n\n $ g++ -g -o test test.cpp // Compile with -g flag to include debugging information\n $ gdb ./test // Run the GDB debugger\n (gdb) run // Execute the program inside GDB\n \n\nAt this point, the debugger will show an error message triggered by the division by zero:\n\n Program received signal SIGFPE, Arithmetic exception.\n 0x00005555555546fb in main () at test.cpp:7\n 7 int result = num1 / num2;\n \n\nNow you can make appropriate changes to fix the issue in your C++ code.",
"description": "Debugger messages are notifications or alerts provided by a debugger to help you identify problems or errors in your C++ code. These messages can be warnings or error messages and can provide helpful information about the state of your program and specific issues encountered during the debugging process.\n\nTypes of Debugger Messages\n--------------------------\n\n* **Error Messages:** Notify you about issues in the code that prevent the program from running or compiling correctly. These messages typically include information about the file and the line number where the error is detected, followed by a description of the issue.\n \n Example:\n \n test.cpp: In function 'int main()':\n test.cpp:6:5: error: 'cout' was not declared in this scope\n cout << \"Hello World!\";\n ^~~~\n \n \n* **Warning Messages:** Inform you about potential issues or risky programming practices that may not necessarily cause errors but could lead to problems later on. Like error messages, warning messages usually include information about the file and line number where the issue is found, along with a description of the problem.\n \n Example:\n \n test.cpp: In function 'int main()':\n test.cpp:6:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]\n if (a < size)\n ^\n \n \n* **Informational Messages:** Provide general information about the execution of the program, such as breakpoints, watchpoints, and variable values. These messages can also reveal the current state of the program, including the call stack and the list of active threads.\n \n Example (_assuming you are using GDB as debugger_):\n \n (gdb) break main\n Breakpoint 1 at 0x40055f: file test.cpp, line 5.\n (gdb) run\n Starting program: /path/to/test\n Breakpoint 1, main () at test.cpp:5\n 5 int a = 5;\n \n \n\nCode Examples\n-------------\n\nTo make use of debugger messages, you need to employ a debugger, such as GDB or Visual Studio Debugger, and include specific flags during the compilation process.\n\nExample using GDB:\n\n // test.cpp\n \n #include <iostream>\n \n int main() {\n int num1 = 10;\n int num2 = 0;\n int result = num1 / num2;\n \n std::cout << \"Result: \" << result << '\\n';\n \n return 0;\n }\n \n\n $ g++ -g -o test test.cpp // Compile with -g flag to include debugging information\n $ gdb ./test // Run the GDB debugger\n (gdb) run // Execute the program inside GDB\n \n\nAt this point, the debugger will show an error message triggered by the division by zero:\n\n Program received signal SIGFPE, Arithmetic exception.\n 0x00005555555546fb in main () at test.cpp:7\n 7 int result = num1 / num2;\n \n\nNow you can make appropriate changes to fix the issue in your C++ code.",
"links": []
},
"sR_FxGZHoMCV9Iv7z2_SX": {
@ -581,17 +581,17 @@
},
"BmWsoL9c_Aag5nVlMsKm2": {
"title": "GDB",
"description": "GDB, or the GNU Project Debugger, is a powerful command-line debugger used primarily for C, C++, and other languages. It can help you find runtime errors, examine the program's execution state, and manipulate the flow to detect and fix bugs easily.\n\nGetting started with GDB\n------------------------\n\nTo start using GDB, you first need to compile your code with the `-g` flag, which includes debugging information in the executable:\n\n g++ -g myfile.cpp -o myfile\n \n\nNow, you can load your compiled program into GDB:\n\n gdb myfile\n \n\nBasic GDB Commands\n------------------\n\nHere are some common GDB commands you'll find useful when debugging:\n\n* `run`: Start your program.\n* `break [function/line number]`: Set a breakpoint at the specified function or line.\n* `continue`: Continue the program execution after stopping on a breakpoint.\n* `next`: Execute the next line of code, stepping over function calls.\n* `step`: Execute the next line of code, entering function calls.\n* `print [expression]`: Evaluate an expression in the current context and display its value.\n* `backtrace`: Show the current call stack.\n* `frame [frame-number]`: Switch to a different stack frame.\n* `quit`: Exit GDB.\n\nExample Usage\n-------------\n\nSuppose you have a simple `cpp` file called `example.cpp`:\n\n #include <iostream>\n \n void my_function(int i) {\n std::cout << \"In my_function with i = \" << i << std::endl;\n }\n \n int main() {\n for (int i = 0; i < 5; ++i) {\n my_function(i);\n }\n return 0;\n }\n \n\nFirst, compile the code with debugging symbols:\n\n g++ -g example.cpp -o example\n \n\nStart GDB and load the `example` program:\n\n gdb example\n \n\nSet a breakpoint in the `my_function` function and run the program:\n\n (gdb) break my_function\n (gdb) run\n \n\nOnce stopped at the breakpoint, use `next`, `print`, and `continue` to examine the program's state:\n\n (gdb) next\n (gdb) print i\n (gdb) continue\n \n\nFinally, exit GDB with the `quit` command.\n\nThis was just a brief summary of GDB; you can find more details in the [official GDB manual](https://sourceware.org/gdb/current/onlinedocs/gdb/).",
"description": "GDB, or the GNU Project Debugger, is a powerful command-line debugger used primarily for C, C++, and other languages. It can help you find runtime errors, examine the program's execution state, and manipulate the flow to detect and fix bugs easily.\n\nGetting started with GDB\n------------------------\n\nTo start using GDB, you first need to compile your code with the `-g` flag, which includes debugging information in the executable:\n\n g++ -g myfile.cpp -o myfile\n \n\nNow, you can load your compiled program into GDB:\n\n gdb myfile\n \n\nBasic GDB Commands\n------------------\n\nHere are some common GDB commands you'll find useful when debugging:\n\n* `run`: Start your program.\n* `break [function/line number]`: Set a breakpoint at the specified function or line.\n* `continue`: Continue the program execution after stopping on a breakpoint.\n* `next`: Execute the next line of code, stepping over function calls.\n* `step`: Execute the next line of code, entering function calls.\n* `print [expression]`: Evaluate an expression in the current context and display its value.\n* `backtrace`: Show the current call stack.\n* `frame [frame-number]`: Switch to a different stack frame.\n* `quit`: Exit GDB.\n\nExample Usage\n-------------\n\nSuppose you have a simple `cpp` file called `example.cpp`:\n\n #include <iostream>\n \n void my_function(int i) {\n std::cout << \"In my_function with i = \" << i << '\\n';\n }\n \n int main() {\n for (int i = 0; i < 5; ++i) {\n my_function(i);\n }\n return 0;\n }\n \n\nFirst, compile the code with debugging symbols:\n\n g++ -g example.cpp -o example\n \n\nStart GDB and load the `example` program:\n\n gdb example\n \n\nSet a breakpoint in the `my_function` function and run the program:\n\n (gdb) break my_function\n (gdb) run\n \n\nOnce stopped at the breakpoint, use `next`, `print`, and `continue` to examine the program's state:\n\n (gdb) next\n (gdb) print i\n (gdb) continue\n \n\nFinally, exit GDB with the `quit` command.\n\nThis was just a brief summary of GDB; you can find more details in the [official GDB manual](https://sourceware.org/gdb/current/onlinedocs/gdb/).",
"links": []
},
"FTMHsUiE8isD_OVZr62Xc": {
"title": "Compilers",
"description": "A compiler is a computer program that translates source code written in one programming language into a different language, usually machine code or assembly code, that can be executed directly by a computer's processor. In the context of C++, compilers take your written C++ source code and convert it into an executable program.\n\nPopular C++ Compilers\n---------------------\n\nThere are several popular C++ compilers available, here's a short list of some common ones:\n\n* **GNU Compiler Collection (GCC)**: Developed by the GNU Project, GCC is an open-source compiler that supports multiple programming languages, including C++.\n \n* **Clang**: As part of the LLVM project, Clang is another open-source compiler that supports C++ and is known for its fast compilation times and extensive diagnostics.\n \n* **Microsoft Visual C++ (MSVC)**: MSVC is a commercial compiler provided by Microsoft as part of Visual Studio, and it's widely used on Windows platforms.\n \n* **Intel C++ Compiler (ICC)**: ICC is a commercial compiler provided by Intel and is known for its ability to optimize code for the latest Intel processors.\n \n\nExample of a Simple C++ Compilation\n-----------------------------------\n\nLet's say you have a simple C++ program saved in a file called `hello.cpp`:\n\n #include <iostream>\n \n int main() {\n std::cout << \"Hello, World!\" << std::endl;\n return 0;\n }\n \n\nYou can compile this program using the GCC compiler by executing the following command in a command-line/terminal:\n\n g++ hello.cpp -o hello\n \n\nThis will generate an executable file called `hello` (or `hello.exe` on Windows) which you can run to see the output \"Hello, World!\".\n\nNote\n----\n\nWhen learning about compilers, it's essential to know that they work closely with the linker and the standard library. The linker takes care of combining compiled object files and libraries into a single executable, while the standard library provides implementations for common functionalities used in your code.",
"description": "A compiler is a computer program that translates source code written in one programming language into a different language, usually machine code or assembly code, that can be executed directly by a computer's processor. In the context of C++, compilers take your written C++ source code and convert it into an executable program.\n\nPopular C++ Compilers\n---------------------\n\nThere are several popular C++ compilers available, here's a short list of some common ones:\n\n* **GNU Compiler Collection (GCC)**: Developed by the GNU Project, GCC is an open-source compiler that supports multiple programming languages, including C++.\n \n* **Clang**: As part of the LLVM project, Clang is another open-source compiler that supports C++ and is known for its fast compilation times and extensive diagnostics.\n \n* **Microsoft Visual C++ (MSVC)**: MSVC is a commercial compiler provided by Microsoft as part of Visual Studio, and it's widely used on Windows platforms.\n \n* **Intel C++ Compiler (ICC)**: ICC is a commercial compiler provided by Intel and is known for its ability to optimize code for the latest Intel processors.\n \n\nExample of a Simple C++ Compilation\n-----------------------------------\n\nLet's say you have a simple C++ program saved in a file called `hello.cpp`:\n\n #include <iostream>\n \n int main() {\n std::cout << \"Hello, World!\\n\";\n return 0;\n }\n \n\nYou can compile this program using the GCC compiler by executing the following command in a command-line/terminal:\n\n g++ hello.cpp -o hello\n \n\nThis will generate an executable file called `hello` (or `hello.exe` on Windows) which you can run to see the output \"Hello, World!\".\n\nNote\n----\n\nWhen learning about compilers, it's essential to know that they work closely with the linker and the standard library. The linker takes care of combining compiled object files and libraries into a single executable, while the standard library provides implementations for common functionalities used in your code.",
"links": []
},
"DVckzBUMgk_lWThVkLyAT": {
"title": "Compiler Stages",
"description": "The process of compilation in C++ can be divided into four primary stages: Preprocessing, Compilation, Assembly, and Linking. Each stage performs a specific task, ultimately converting the source code into an executable program.\n\nPreprocessing\n-------------\n\nThe first stage is the preprocessing of the source code. Preprocessors modify the source code before the actual compilation process. They handle directives that start with a `#` (hash) symbol, like `#include`, `#define`, and `#if`. In this stage, included header files are expanded, macros are replaced, and conditional compilation statements are processed.\n\n**Code Example:**\n\n #include <iostream>\n #define PI 3.14\n \n int main() {\n std::cout << \"The value of PI is: \" << PI << std::endl;\n return 0;\n }\n \n\nCompilation\n-----------\n\nThe second stage is the actual compilation of the preprocessed source code. The compiler translates the modified source code into an intermediate representation, usually specific to the target processor architecture. This step also involves performing syntax checking, semantic analysis, and producing error messages for any issues encountered in the source code.\n\n**Code Example:**\n\n int main() {\n int a = 10;\n int b = 20;\n int sum = a + b;\n return 0;\n }\n \n\nAssembly\n--------\n\nThe third stage is converting the compiler's intermediate representation into assembly language. This stage generates assembly code using mnemonics and syntax that is specific to the target processor architecture. Assemblers then convert this assembly code into object code (machine code).\n\n**Code Example (x86 Assembly):**\n\n mov eax, 10\n mov ebx, 20\n add eax, ebx\n \n\nLinking\n-------\n\nThe final stage is the linking of the object code with the necessary libraries and other object files. In this stage, the linker merges multiple object files and libraries, resolves external references from other modules or libraries, allocates memory addresses for functions and variables, and generates an executable file that can be run on the target platform.\n\n**Code Example (linking objects and libraries):**\n\n $ g++ main.o -o main -lm\n \n\nIn summary, the compilation process in C++ involves four primary stages: preprocessing, compilation, assembly, and linking. Each stage plays a crucial role in transforming the source code into an executable program.",
"description": "The process of compilation in C++ can be divided into four primary stages: Preprocessing, Compilation, Assembly, and Linking. Each stage performs a specific task, ultimately converting the source code into an executable program.\n\nPreprocessing\n-------------\n\nThe first stage is the preprocessing of the source code. Preprocessors modify the source code before the actual compilation process. They handle directives that start with a `#` (hash) symbol, like `#include`, `#define`, and `#if`. In this stage, included header files are expanded, macros are replaced, and conditional compilation statements are processed.\n\n**Code Example:**\n\n #include <iostream>\n #define PI 3.14\n \n int main() {\n std::cout << \"The value of PI is: \" << PI << '\\n';\n return 0;\n }\n \n\nCompilation\n-----------\n\nThe second stage is the actual compilation of the preprocessed source code. The compiler translates the modified source code into an intermediate representation, usually specific to the target processor architecture. This step also involves performing syntax checking, semantic analysis, and producing error messages for any issues encountered in the source code.\n\n**Code Example:**\n\n int main() {\n int a = 10;\n int b = 20;\n int sum = a + b;\n return 0;\n }\n \n\nAssembly\n--------\n\nThe third stage is converting the compiler's intermediate representation into assembly language. This stage generates assembly code using mnemonics and syntax that is specific to the target processor architecture. Assemblers then convert this assembly code into object code (machine code).\n\n**Code Example (x86 Assembly):**\n\n mov eax, 10\n mov ebx, 20\n add eax, ebx\n \n\nLinking\n-------\n\nThe final stage is the linking of the object code with the necessary libraries and other object files. In this stage, the linker merges multiple object files and libraries, resolves external references from other modules or libraries, allocates memory addresses for functions and variables, and generates an executable file that can be run on the target platform.\n\n**Code Example (linking objects and libraries):**\n\n $ g++ main.o -o main -lm\n \n\nIn summary, the compilation process in C++ involves four primary stages: preprocessing, compilation, assembly, and linking. Each stage plays a crucial role in transforming the source code into an executable program.",
"links": []
},
"hSG6Aux39X0cXi6ADy2al": {
@ -636,7 +636,7 @@
},
"ky_UqizToTZHC_b77qFi2": {
"title": "Conan",
"description": "[Conan](https://conan.io/) is a popular package manager for C and C++ languages and is designed to be cross-platform, extensible, and easy to use. It allows developers to declare, manage, and fetch dependencies while automating the build process. Conan supports various build systems, such as CMake, Visual Studio, MSBuild, and more.\n\nInstallation\n------------\n\nTo install Conan, you can use pip, the Python package manager:\n\n pip install conan\n \n\nBasic Usage\n-----------\n\n* Create a `conanfile.txt` file in your project root directory, specifying dependencies you need for your project:\n\n [requires]\n boost/1.75.0\n \n [generators]\n cmake\n \n\n* Run the `conan install` command to fetch and build required dependencies:\n\n mkdir build && cd build\n conan install ..\n \n\n* Now build your project using your build system, for example CMake:\n\n cmake .. -DCMAKE_BUILD_TYPE=Release\n cmake --build .\n \n\nCreating Packages\n-----------------\n\nTo create a package in Conan, you need to write a `conanfile.py` file with package information and build instructions.\n\nHere's an example:\n\n from conans import ConanFile, CMake\n \n class MyLibraryConan(ConanFile):\n name = \"MyLibrary\"\n version = \"0.1\"\n license = \"MIT\"\n url = \"https://github.com/username/mylibrary\"\n description = \"A simple example library\"\n settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n generators = \"cmake\"\n \n def build(self):\n cmake = CMake(self)\n cmake.configure(source_folder=\"src\")\n cmake.build()\n \n def package(self):\n self.copy(\"*.hpp\", dst=\"include\", src=\"src/include\")\n self.copy(\"*.lib\", dst=\"lib\", keep_path=False)\n self.copy(\"*.dll\", dst=\"bin\", keep_path=False)\n self.copy(\"*.so\", dst=\"lib\", keep_path=False)\n self.copy(\"*.a\", dst=\"lib\", keep_path=False)\n \n def package_info(self):\n self.cpp_info.libs = [\"MyLibrary\"]\n \n\nWith that setup, you can create a package by running:\n\n conan create . username/channel\n \n\nThis will compile the package and store it in your Conan cache. You can now use this package as a dependency in other projects.",
"description": "[Conan](https://conan.io/) is a popular package manager for C and C++ languages and is designed to be cross-platform, extensible, and easy to use. It allows developers to declare, manage, and fetch dependencies while automating the build process. Conan supports various build systems, such as CMake, Visual Studio, MSBuild, and more.\n\nInstallation\n------------\n\nTo install Conan, you can use pip, the Python package manager:\n\n pip install conan\n \n\nBasic Usage\n-----------\n\n* Create a `conanfile.txt` file in your project root directory, specifying dependencies you need for your project:\n\n [requires]\n boost/1.75.0\n \n [generators]\n cmake\n \n\n* Run the `conan install` command to fetch and build required dependencies:\n\n mkdir build && cd build\n conan install ..\n \n\n* Now build your project using your build system, for example CMake:\n\n cmake .. -DCMAKE_BUILD_TYPE=Release\n cmake --build .\n \n\nCreating Packages\n-----------------\n\nTo create a package in Conan, you need to write a `conanfile.py` file with package information and build instructions.\n\nHere's an example:\n\n from conans import ConanFile, CMake\n \n \n class MyLibraryConan(ConanFile):\n name = \"MyLibrary\"\n version = \"0.1\"\n license = \"MIT\"\n url = \"https://github.com/username/mylibrary\"\n description = \"A simple example library\"\n settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n generators = \"cmake\"\n \n def build(self):\n cmake = CMake(self)\n cmake.configure(source_folder=\"src\")\n cmake.build()\n \n def package(self):\n self.copy(\"*.hpp\", dst=\"include\", src=\"src/include\")\n self.copy(\"*.lib\", dst=\"lib\", keep_path=False)\n self.copy(\"*.dll\", dst=\"bin\", keep_path=False)\n self.copy(\"*.so\", dst=\"lib\", keep_path=False)\n self.copy(\"*.a\", dst=\"lib\", keep_path=False)\n \n def package_info(self):\n self.cpp_info.libs = [\"MyLibrary\"]\n \n\nWith that setup, you can create a package by running:\n\n conan create . username/channel\n \n\nThis will compile the package and store it in your Conan cache. You can now use this package as a dependency in other projects.",
"links": []
},
"3ehBc2sKVlPj7dn4RVZCH": {

@ -3993,7 +3993,7 @@
"type": "article"
},
{
"title": "What is password praying?",
"title": "What is password spraying?",
"url": "https://www.techtarget.com/whatis/definition/password-spraying",
"type": "article"
},

@ -204,11 +204,6 @@
"url": "https://en.wikipedia.org/wiki/Operating_system",
"type": "article"
},
{
"title": "All you need to know about OS.",
"url": "https://www.javatpoint.com/operating-system",
"type": "article"
},
{
"title": "Learn Operating Systems",
"url": "https://www.tutorialspoint.com/operating_system/os_overview.htm",
@ -532,11 +527,6 @@
"url": "https://www.learnshell.org/en/Welcome",
"type": "article"
},
{
"title": "Bash Scripting Tutorial",
"url": "https://www.javatpoint.com/bash",
"type": "article"
},
{
"title": "Explore top posts about Bash",
"url": "https://app.daily.dev/tags/bash?ref=roadmapsh",

@ -7,6 +7,11 @@
"title": "Engineering Management Resources",
"url": "https://github.com/engineering-management/awesome-engineering-management",
"type": "article"
},
{
"title": "Software Engineering at Google: The Engineering Manager",
"url": "https://abseil.io/resources/swe-book/html/ch05.html#the_engineering_manager",
"type": "article"
}
]
},
@ -223,8 +228,14 @@
},
"n9gvPHn4c1U-l6v-W9v6r": {
"title": "Agile methodologies",
"description": "An Engineering Manager ensures smooth implementation of Agile methodologies within the team. The manager oversees sprint planning, backlog refinement, and retrospectives for consistent development flow. They have the key role in facilitating communication, fostering a high-performing environment, and encouraging adaptive planning.\n\nThe Engineering Manager faces the challenge of maintaining an Agile mindset even when facing pressures to deliver. They have to ensure team members are motivated, engaged, and productive. This can be handled by adopting feedback-friendly culture and regular knowledge-sharing sessions.\n\nSkills required for an Engineering Manager in handling Agile methodologies include strong leadership, excellent communication, and proficiency in risk management. The manager has to balance the opposing needs of flexibility and stability, always keeping customer satisfaction in perspective.",
"links": []
"description": "An Engineering Manager ensures smooth implementation of Agile methodologies within the team. The manager oversees sprint planning, backlog refinement, and retrospectives for consistent development flow. They have the key role in facilitating communication, fostering a high-performing environment, and encouraging adaptive planning.\n\nThe Engineering Manager faces the challenge of maintaining an Agile mindset even when facing pressures to deliver. They have to ensure team members are motivated, engaged, and productive. This can be handled by adopting feedback-friendly culture and regular knowledge-sharing sessions.\n\nSkills required for an Engineering Manager in handling Agile methodologies include strong leadership, excellent communication, and proficiency in risk management. The manager has to balance the opposing needs of flexibility and stability, always keeping customer satisfaction in perspective.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Scrum Guide",
"url": "https://scrumguides.org/",
"type": "article"
}
]
},
"SuT6q5lMMSyVkadlQp7iU": {
"title": "Project Tracking",

@ -1407,8 +1407,19 @@
},
"sC3omOmL2DOyTSvET5cDa": {
"title": "Infinite",
"description": "",
"links": []
"description": "Infinite refers to concept that deals with rendering scenes or objects that extend beyond the visible boundaries of the screen. This is crucial for creating immersive environments, as it allows developers to simulate vast landscapes or endless spaces without the need to render every detail at once. Techniques such as level of detail (LOD), culling, and procedural generation are often employed to manage performance while maintaining the illusion of infinity.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Unlocking Infinite Worlds In Gaming",
"url": "https://sdlccorp.com/post/procedural-generation-unlocking-infinite-worlds-in-gaming/",
"type": "article"
},
{
"title": "Creating Infinite Game Worlds",
"url": "https://medium.com/@lemapp09/beginning-game-development-creating-infinite-game-worlds-56f8a2ad5ae5",
"type": "article"
}
]
},
"OcxesFnB5wO6VXrHYnhz-": {
"title": "Visibility and Occlusion",

@ -89,11 +89,6 @@
"title": "What are Data Types & Variables?",
"url": "https://jenkov.com/tutorials/java/data-types.html",
"type": "article"
},
{
"title": "Java Variables",
"url": "https://www.javatpoint.com/java-variables",
"type": "article"
}
]
},
@ -106,11 +101,6 @@
"url": "https://www.educative.io/answers/what-are-conditional-statements-in-programming",
"type": "article"
},
{
"title": "Conditionals in Java",
"url": "https://www.javatpoint.com/java-if-else",
"type": "article"
},
{
"title": "Conditionals and Loops in Java",
"url": "https://youtu.be/ldYLYRNaucM",
@ -143,11 +133,6 @@
"title": "Loops",
"description": "In Java and other programming languages, loops are used to iterate a part of the program several times. There are four types of loops in Java, `for`, `forEach`, `while`, and `do...while`.\n\n* Syntax of `for` loop is `for(initialization;condition;increment/decrement){}`\n* Syntax of `forEach` loop is `for(data_type variable:array_name){}`\n\nVisit the following resources to learn more:",
"links": [
{
"title": "What are loops in Java?",
"url": "https://www.javatpoint.com/java-for-loop",
"type": "article"
},
{
"title": "Loops in Java.",
"url": "https://www.programiz.com/java-programming/for-loop",
@ -495,11 +480,6 @@
"title": "Packages in Java",
"url": "https://docs.oracle.com/javase/8/docs/api/java/lang/Package.html",
"type": "article"
},
{
"title": "Java Package",
"url": "https://www.javatpoint.com/package",
"type": "article"
}
]
},
@ -704,11 +684,6 @@
"url": "https://www.tutorialspoint.com/java/java_generics.htm",
"type": "article"
},
{
"title": "Generics in Java",
"url": "https://www.javatpoint.com/generics-in-java",
"type": "article"
},
{
"title": "Generics in Java",
"url": "https://www.youtube.com/watch?v=XMvznsY02Mk",
@ -876,11 +851,6 @@
"url": "https://gradle.org/",
"type": "article"
},
{
"title": "Gradle",
"url": "https://www.javatpoint.com/gradle",
"type": "article"
},
{
"title": "Building Spring Boot Projects with Gradle",
"url": "https://www.baeldung.com/spring-boot-gradle-plugin",
@ -960,11 +930,6 @@
"url": "https://www.marcobehler.com/guides/java-files",
"type": "article"
},
{
"title": "Java File Class",
"url": "https://www.javatpoint.com/java-file-class",
"type": "article"
},
{
"title": "(old) Java HttpURLConnection Example - Java HTTP Request GET, POST",
"url": "https://www.digitalocean.com/community/tutorials/java-httpurlconnection-example-java-http-request-get-post",
@ -1151,11 +1116,6 @@
"title": "Stream API",
"description": "Java provides a new additional package in Java 8 called java.util.stream. This package consists of classes, interfaces and enum to allows functional-style operations on the elements. You can use stream by importing java.util.stream package.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Java 8 Stream",
"url": "https://www.javatpoint.com/java-8-stream",
"type": "article"
},
{
"title": "The Java 8 Stream API Tutorial",
"url": "https://www.baeldung.com/java-8-streams",
@ -1245,11 +1205,6 @@
"url": "https://www.baeldung.com/the-persistence-layer-with-spring-data-jpa",
"type": "article"
},
{
"title": "Spring Data JPA Tutorial",
"url": "https://www.javatpoint.com/spring-and-jpa-integration",
"type": "article"
},
{
"title": "Explore top posts about Spring Framework",
"url": "https://app.daily.dev/tags/spring?ref=roadmapsh",
@ -1276,11 +1231,6 @@
"url": "https://hibernate.org/",
"type": "article"
},
{
"title": "Hibernate Tutorial",
"url": "https://www.javatpoint.com/hibernate-tutorial",
"type": "article"
},
{
"title": "Second-level caching explained",
"url": "https://hazelcast.com/glossary/hibernate-second-level-cache/",
@ -1318,11 +1268,6 @@
"url": "https://www.baeldung.com/java-logging-intro",
"type": "article"
},
{
"title": "Java Logger",
"url": "https://www.javatpoint.com/java-logger",
"type": "article"
},
{
"title": "Java Logging Frameworks",
"url": "https://en.wikipedia.org/wiki/Java_logging_framework",

@ -1568,7 +1568,7 @@
},
"s8wUJivWmetysJ8bt9FBC": {
"title": "Built-in Functions",
"description": "* A JavaScript **method** is a property containing a **function definition** . In other words, when the data stored on an object is a function we call that a method.\n* To differentiate between properties and methods, we can think of it this way: **A property is what an object has, while a method is what an object does.**\n* Since JavaScript methods are actions that can be performed on objects, we first need to have objects to start with. There are several objects built into JavaScript which we can use.\n\nVisit the following resources to learn more:",
"description": "JavaScript offers a variety of built-in functions that simplify common tasks, available globally or within specific objects without requiring explicit definition. Functions like parseInt(), setTimeout(), and Math.random() can be used directly, while objects like Array, String, and Date include built-in methods for efficient data manipulation. Understanding these functions enhances development by leveraging JavaScript’s core features without reinventing the wheel.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "JavaScript Built-in Functions",

@ -9,12 +9,12 @@
"description": "Python is an interpreted high-level general-purpose programming language. Its design philosophy emphasizes code readability with its significant use of indentation. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects. Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly, procedural), object-oriented and functional programming. Python is often described as a \"batteries included\" language due to its comprehensive standard library.\n\nLearn more from the following resources:",
"links": [
{
"title": "Python Roadmap",
"title": "Visit Dedicated Python Roadmap",
"url": "https://roadmap.sh/python",
"type": "article"
},
{
"title": "Python.org",
"title": "Python",
"url": "https://www.python.org/",
"type": "article"
},
@ -37,7 +37,7 @@
},
"vdVq3RQvQF3mF8PQc6DMg": {
"title": "Go",
"description": "Go, also known as Golang, is an open-source programming language developed by Google that emphasizes simplicity, efficiency, and strong concurrency support. Designed for modern software development, Go features a clean syntax, garbage collection, and built-in support for concurrent programming through goroutines and channels, making it well-suited for building scalable, high-performance applications, especially in cloud computing and microservices architectures. Go's robust standard library and tooling ecosystem, including a powerful package manager and testing framework, further streamline development processes, promoting rapid application development and deployment. Visit the following resources to learn more:",
"description": "Go, also known as Golang, is an open-source programming language developed by Google that emphasizes simplicity, efficiency, and strong concurrency support. Designed for modern software development, Go features a clean syntax, garbage collection, and built-in support for concurrent programming through goroutines and channels, making it well-suited for building scalable, high-performance applications, especially in cloud computing and microservices architectures. Go's robust standard library and tooling ecosystem, including a powerful package manager and testing framework, further streamline development processes, promoting rapid application development and deployment.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Visit Dedicated Go Roadmap",
@ -85,6 +85,11 @@
"url": "https://github.com/Idnan/bash-guide",
"type": "opensource"
},
{
"title": "Bash Reference Manual",
"url": "https://www.gnu.org/software/bash/manual/bashref.html",
"type": "article"
},
{
"title": "Bash Scripting Course",
"url": "https://www.youtube.com/watch?v=tK9Oc6AEnR4",
@ -105,6 +110,11 @@
"title": "What is Version Control?",
"url": "https://www.atlassian.com/git/tutorials/what-is-version-control",
"type": "article"
},
{
"title": "Explore top posts about Version Control",
"url": "https://app.daily.dev/tags/version-control?ref=roadmapsh",
"type": "article"
}
]
},
@ -113,7 +123,7 @@
"description": "Git is a distributed version control system used to track changes in source code during software development. It enables multiple developers to collaborate on a project by managing versions of code, allowing for branching, merging, and tracking of revisions. Git ensures that changes are recorded with a complete history, enabling rollback to previous versions if necessary. It supports distributed workflows, meaning each developer has a complete local copy of the project’s history, facilitating seamless collaboration, conflict resolution, and efficient management of code across different teams or environments.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Learn Git & GitHub",
"title": "Visit Dedicated Git & GitHub Roadmap",
"url": "https://roadmap.sh/git-github",
"type": "article"
},
@ -144,12 +154,12 @@
"description": "GitHub is a web-based platform built on top of Git that provides version control, collaboration tools, and project management features for software development. It enables developers to host Git repositories, collaborate on code through pull requests, and review and track changes. GitHub also offers additional features like issue tracking, continuous integration, automated workflows, and documentation hosting. With its social coding environment, GitHub fosters open-source contributions and team collaboration, making it a central hub for many software development projects.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Learn Git & GitHub",
"title": "Visit Dedicated Git & GitHub Roadmap",
"url": "https://roadmap.sh/git-github",
"type": "article"
},
{
"title": "GitHub Website",
"title": "GitHub",
"url": "https://github.com",
"type": "article"
},
@ -175,12 +185,17 @@
"description": "**Cloud Computing** refers to the delivery of computing services over the internet rather than using local servers or personal devices. These services include servers, storage, databases, networking, software, analytics, and intelligence. Cloud Computing enables faster innovation, flexible resources, and economies of scale. There are various types of cloud computing such as public clouds, private clouds, and hybrids clouds. Furthermore, it's divided into different services like Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS). These services differ mainly in the level of control an organization has over their data and infrastructures.\n\nLearn more from the following resources:",
"links": [
{
"title": "What is cloud computing?",
"title": "Cloud Computing - IBM",
"url": "https://www.ibm.com/think/topics/cloud-computing",
"type": "article"
},
{
"title": "What is Cloud Computing? - Azure",
"url": "https://azure.microsoft.com/en-gb/resources/cloud-computing-dictionary/what-is-cloud-computing",
"type": "article"
},
{
"title": "What is Cloud Computing? | Amazon Web Services",
"title": "What is Cloud Computing? - Amazon Web Services",
"url": "https://www.youtube.com/watch?v=mxT233EdY5c",
"type": "video"
}
@ -188,18 +203,23 @@
},
"u3E7FGW4Iwdsu61KYFxCX": {
"title": "AWS / Azure / GCP",
"description": "AWS (Amazon Web Services) Azure and GCP (Google Cloud Platform) are three leading providers of cloud computing services. AWS by Amazon is the oldest and the most established among the three, providing a breadth and depth of solutions ranging from infrastructure services like compute, storage, and databases to the machine and deep learning. Azure, by Microsoft, has integrated tools for DevOps, supports a large number of programming languages, and offers seamless integration with on-prem servers and Microsoft’s software. Google's GCP has strength in cost-effectiveness, live migration of virtual machines, and flexible computing options. All three have introduced various MLOps tools and services to boost capabilities for machine learning development and operations.\n\nVisit the following resources to learn more about AWS, Azure, and GCP:",
"description": "AWS (Amazon Web Services), Azure and GCP (Google Cloud Platform) are three leading providers of cloud computing services. AWS by Amazon is the oldest and the most established among the three, providing a breadth and depth of solutions ranging from infrastructure services like compute, storage, and databases to the machine and deep learning. Azure, by Microsoft, has integrated tools for DevOps, supports a large number of programming languages, and offers seamless integration with on-prem servers and Microsoft’s software. Google's GCP has strength in cost-effectiveness, live migration of virtual machines, and flexible computing options. All three have introduced various MLOps tools and services to boost capabilities for machine learning development and operations.\n\nVisit the following resources to learn more about AWS, Azure, and GCP:",
"links": [
{
"title": "AWS Roadmap",
"title": "Visit Dedicated AWS Roadmap",
"url": "https://roadmap.sh/aws",
"type": "article"
},
{
"title": "Azure Tutorials",
"title": "Microsoft Azure",
"url": "https://docs.microsoft.com/en-us/learn/azure/",
"type": "article"
},
{
"title": "Google Cloud Platform",
"url": "https://cloud.google.com/",
"type": "article"
},
{
"title": "GCP Learning Resources",
"url": "https://cloud.google.com/training",
@ -238,12 +258,12 @@
"description": "Containers are a construct in which cgroups, namespaces, and chroot are used to fully encapsulate and isolate a process. This encapsulated process, called a container image, shares the kernel of the host with other containers, allowing containers to be significantly smaller and faster than virtual machines.\n\nThese images are designed for portability, allowing for full local testing of a static image, and easy deployment to a container management platform.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "What are Containers?",
"title": "What are Containers? - Google Cloud",
"url": "https://cloud.google.com/learn/what-are-containers",
"type": "article"
},
{
"title": "What is a Container?",
"title": "What is a Container? - Docker",
"url": "https://www.docker.com/resources/what-container/",
"type": "article"
},
@ -268,6 +288,11 @@
"title": "Docker",
"description": "Docker is a platform for working with containerized applications. Among its features are a daemon and client for managing and interacting with containers, registries for storing images, and a desktop application to package all these features together.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Visit Dedicated Docker Roadmap",
"url": "https://roadmap.sh/docker",
"type": "article"
},
{
"title": "Docker Documentation",
"url": "https://docs.docker.com/",
@ -284,7 +309,7 @@
"type": "video"
},
{
"title": "Docker simplified in 55 seconds",
"title": "Docker Simplified in 55 Seconds",
"url": "https://youtu.be/vP_4DlOH1G4",
"type": "video"
}
@ -295,12 +320,12 @@
"description": "Kubernetes is an open source container management platform, and the dominant product in this space. Using Kubernetes, teams can deploy images across multiple underlying hosts, defining their desired availability, deployment logic, and scaling logic in YAML. Kubernetes evolved from Borg, an internal Google platform used to provision and allocate compute resources (similar to the Autopilot and Aquaman systems of Microsoft Azure). The popularity of Kubernetes has made it an increasingly important skill for the DevOps Engineer and has triggered the creation of Platform teams across the industry. These Platform engineering teams often exist with the sole purpose of making Kubernetes approachable and usable for their product development colleagues.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Kubernetes Roadmap",
"title": "Visit Dedicated Kubernetes Roadmap",
"url": "https://roadmap.sh/kubernetes",
"type": "article"
},
{
"title": "Kubernetes Website",
"title": "Kubernetes",
"url": "https://kubernetes.io/",
"type": "article"
},
@ -328,7 +353,7 @@
},
"ulka7VEVjz6ls5SnI6a6z": {
"title": "Machine Learning Fundamentals",
"description": "Machine learning fundamentals encompass the key concepts and techniques that enable systems to learn from data and make predictions or decisions without being explicitly programmed. At its core, machine learning involves algorithms that can identify patterns in data and improve over time with experience. Key areas include supervised learning (where models are trained on labeled data), unsupervised learning (where models identify patterns in unlabeled data), and reinforcement learning (where agents learn to make decisions based on feedback from their actions). Essential components also include data preprocessing, feature selection, model training, evaluation metrics, and the importance of avoiding overfitting. Understanding these fundamentals is crucial for developing effective machine learning applications across various domains. Learn more from the following resources:",
"description": "Machine learning fundamentals encompass the key concepts and techniques that enable systems to learn from data and make predictions or decisions without being explicitly programmed. At its core, machine learning involves algorithms that can identify patterns in data and improve over time with experience. Key areas include supervised learning (where models are trained on labeled data), unsupervised learning (where models identify patterns in unlabeled data), and reinforcement learning (where agents learn to make decisions based on feedback from their actions). Essential components also include data preprocessing, feature selection, model training, evaluation metrics, and the importance of avoiding overfitting. Understanding these fundamentals is crucial for developing effective machine learning applications across various domains.\n\nLearn more from the following resources:",
"links": [
{
"title": "Fundamentals of Machine Learning - Microsoft",
@ -368,12 +393,12 @@
"description": "Data pipelines are a series of automated processes that transport and transform data from various sources to a destination for analysis or storage. They typically involve steps like data extraction, cleaning, transformation, and loading (ETL) into databases, data lakes, or warehouses. Pipelines can handle batch or real-time data, ensuring that large-scale datasets are processed efficiently and consistently. They play a crucial role in ensuring data integrity and enabling businesses to derive insights from raw data for reporting, analytics, or machine learning.\n\nLearn more from the following resources:",
"links": [
{
"title": "What is a data pipeline?",
"title": "What is a Data Pipeline? - IBM",
"url": "https://www.ibm.com/topics/data-pipeline",
"type": "article"
},
{
"title": "What are data pipelines?",
"title": "What are Data Pipelines?",
"url": "https://www.youtube.com/watch?v=oKixNpz6jNo",
"type": "video"
}
@ -381,20 +406,20 @@
},
"wOogVDV4FIDLXVPwFqJ8C": {
"title": "Data Lakes & Warehouses",
"description": "\"**Data Lakes** are large-scale data repository systems that store raw, untransformed data, in various formats, from multiple sources. They're often used for big data and real-time analytics requirements. Data lakes preserve the original data format and schema which can be modified as necessary. On the other hand, **Data Warehouses** are data storage systems which are designed for analyzing, reporting and integrating with transactional systems. The data in a warehouse is clean, consistent, and often transformed to meet wide-range of business requirements. Hence, data warehouses provide structured data but require more processing and management compared to data lakes.\"\n\nLearn more from the following resources:",
"description": "**Data Lakes** are large-scale data repository systems that store raw, untransformed data, in various formats, from multiple sources. They're often used for big data and real-time analytics requirements. Data lakes preserve the original data format and schema which can be modified as necessary. On the other hand, **Data Warehouses** are data storage systems which are designed for analyzing, reporting and integrating with transactional systems. The data in a warehouse is clean, consistent, and often transformed to meet wide-range of business requirements. Hence, data warehouses provide structured data but require more processing and management compared to data lakes.\n\nLearn more from the following resources:",
"links": [
{
"title": "Data lake definition",
"title": "Data Lake Definition",
"url": "https://azure.microsoft.com/en-gb/resources/cloud-computing-dictionary/what-is-a-data-lake",
"type": "article"
},
{
"title": "What is a data lake?",
"title": "What is a Data Lake?",
"url": "https://www.youtube.com/watch?v=LxcH6z8TFpI",
"type": "video"
},
{
"title": "@hat is a data warehouse?",
"title": "@hat is a Data Warehouse?",
"url": "https://www.youtube.com/watch?v=k4tK2ttdSDg",
"type": "video"
}
@ -421,10 +446,15 @@
"description": "Airflow is a platform to programmatically author, schedule and monitor workflows. Use airflow to author workflows as directed acyclic graphs (DAGs) of tasks. The airflow scheduler executes your tasks on an array of workers while following the specified dependencies. Rich command line utilities make performing complex surgeries on DAGs a snap. The rich user interface makes it easy to visualize pipelines running in production, monitor progress, and troubleshoot issues when needed. When workflows are defined as code, they become more maintainable, versionable, testable, and collaborative.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Airflow website",
"title": "Airflow",
"url": "https://airflow.apache.org/",
"type": "article"
},
{
"title": "Airflow Documentation",
"url": "https://airflow.apache.org/docs",
"type": "article"
},
{
"title": "Explore top posts about Apache Airflow",
"url": "https://app.daily.dev/tags/apache-airflow?ref=roadmapsh",
@ -458,7 +488,7 @@
"description": "Apache Kafka is an open-source distributed event streaming platform used by thousands of companies for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Apache Kafka quickstart",
"title": "Apache Kafka Quickstart",
"url": "https://kafka.apache.org/quickstart",
"type": "article"
},
@ -484,26 +514,43 @@
"type": "article"
},
{
"title": "Explore top posts about Apache Flink",
"url": "https://app.daily.dev/tags/apache-flink?ref=roadmapsh",
"title": "Apache Flink",
"url": "https://www.tutorialspoint.com/apache_flink/apache_flink_introduction.htm",
"type": "article"
},
{
"title": "Apache Flink Tutorialpoint",
"url": "https://www.tutorialspoint.com/apache_flink/apache_flink_introduction.htm",
"title": "Explore top posts about Apache Flink",
"url": "https://app.daily.dev/tags/apache-flink?ref=roadmapsh",
"type": "article"
}
]
},
"iTsEHVCo6KGq7H2HMgy5S": {
"title": "MLOps Principles",
"description": "MLOps (Machine Learning Operations) principles focus on streamlining the deployment, monitoring, and management of machine learning models in production environments. Key principles include:\n\n1. **Collaboration**: Foster collaboration between data scientists, developers, and operations teams to ensure alignment on model goals, performance, and lifecycle management.\n \n2. **Automation**: Automate workflows for model training, testing, deployment, and monitoring to enhance efficiency, reduce errors, and speed up the development lifecycle.\n \n3. **Version Control**: Implement version control for both code and data to track changes, reproduce experiments, and maintain model lineage.\n \n4. **Continuous Integration and Deployment (CI/CD)**: Establish CI/CD pipelines tailored for machine learning to facilitate rapid model iteration and deployment.\n \n5. **Monitoring and Governance**: Continuously monitor model performance and data drift in production to ensure models remain effective and compliant with regulatory requirements.\n \n6. **Scalability**: Design systems that can scale to handle varying workloads and accommodate changes in data volume and complexity.\n \n7. **Reproducibility**: Ensure that experiments can be reliably reproduced by standardizing environments and workflows, making it easier to validate and iterate on models.\n \n\nThese principles help organizations efficiently manage the lifecycle of machine learning models, from development to deployment and beyond.",
"links": []
"description": "MLOps (Machine Learning Operations) principles focus on streamlining the deployment, monitoring, and management of machine learning models in production environments. Key principles include:\n\n1. **Collaboration**: Foster collaboration between data scientists, developers, and operations teams to ensure alignment on model goals, performance, and lifecycle management.\n \n2. **Automation**: Automate workflows for model training, testing, deployment, and monitoring to enhance efficiency, reduce errors, and speed up the development lifecycle.\n \n3. **Version Control**: Implement version control for both code and data to track changes, reproduce experiments, and maintain model lineage.\n \n4. **Continuous Integration and Deployment (CI/CD)**: Establish CI/CD pipelines tailored for machine learning to facilitate rapid model iteration and deployment.\n \n5. **Monitoring and Governance**: Continuously monitor model performance and data drift in production to ensure models remain effective and compliant with regulatory requirements.\n \n6. **Scalability**: Design systems that can scale to handle varying workloads and accommodate changes in data volume and complexity.\n \n7. **Reproducibility**: Ensure that experiments can be reliably reproduced by standardizing environments and workflows, making it easier to validate and iterate on models.\n \n\nThese principles help organizations efficiently manage the lifecycle of machine learning models, from development to deployment and beyond.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "MLOps Principles",
"url": "https://ml-ops.org/content/mlops-principles",
"type": "article"
}
]
},
"l1xasxQy2vAY34NWaqKEe": {
"title": "MLOps Components",
"description": "MLOps components can be broadly classified into three major categories: Development, Operations and Governance. The **Development** components include everything involved in the creation of machine learning models, such as data extraction, data analysis, feature engineering, and machine learning model training. The **Operations** category includes components involved in deploying, monitoring, and maintaining machine learning models in production. This may include release management, model serving, and performance monitoring. Lastly, the **Governance** category encompasses the policies and regulations related to machine learning models. This includes model audit and tracking, model explainability, and security & compliance regulations.",
"links": []
"description": "MLOps components can be broadly classified into three major categories: Development, Operations and Governance. The **Development** components include everything involved in the creation of machine learning models, such as data extraction, data analysis, feature engineering, and machine learning model training. The **Operations** category includes components involved in deploying, monitoring, and maintaining machine learning models in production. This may include release management, model serving, and performance monitoring. Lastly, the **Governance** category encompasses the policies and regulations related to machine learning models. This includes model audit and tracking, model explainability, and security & compliance regulations.\n\nLearn more from the following resources:",
"links": [
{
"title": "MLOps Workflow, Components, and Key Practices",
"url": "https://mlops.tv/p/understanding-ml-pipelines-through",
"type": "article"
},
{
"title": "MLOps Lifecycle",
"url": "https://www.moontechnolabs.com/blog/mlops-lifecycle/",
"type": "article"
}
]
},
"kHDSwlSq8WkLey4EJIQSR": {
"title": "Version Control",
@ -514,6 +561,11 @@
"url": "https://git-scm.com/",
"type": "article"
},
{
"title": "Git Documentation",
"url": "https://git-scm.com/docs",
"type": "article"
},
{
"title": "What is Version Control?",
"url": "https://www.atlassian.com/git/tutorials/what-is-version-control",
@ -531,7 +583,12 @@
"description": "CI/CD (Continuous Integration and Continuous Deployment/Delivery) is a software development practice that automates the process of integrating code changes, running tests, and deploying updates. Continuous Integration focuses on regularly merging code changes into a shared repository, followed by automated testing to ensure code quality. Continuous Deployment extends this by automatically releasing every validated change to production, while Continuous Delivery ensures code is always in a deployable state, but requires manual approval for production releases. CI/CD pipelines improve code reliability, reduce integration risks, and speed up the development lifecycle.\n\nLearn more from the following resources:",
"links": [
{
"title": "What is CI/CD?",
"title": "What is CI/CD? - Gitlab",
"url": "https://about.gitlab.com/topics/ci-cd/",
"type": "article"
},
{
"title": "What is CI/CD? - Redhat",
"url": "https://www.redhat.com/en/topics/devops/what-is-ci-cd",
"type": "article"
},
@ -579,7 +636,7 @@
"type": "article"
},
{
"title": "What is a feature store",
"title": "What is a Feature Store",
"url": "https://www.snowflake.com/guides/what-feature-store-machine-learning/",
"type": "article"
}
@ -587,8 +644,29 @@
},
"zsW1NRb0dMgS-KzWsI0QU": {
"title": "Model Training & Serving",
"description": "\"Model Training\" refers to the phase in the Machine Learning (ML) pipeline where we teach a machine learning model how to make predictions by providing it with data. This process begins with feeding the model a training dataset, which it uses to learn and understand patterns or perform computations. The model's performance is then evaluated by comparing its prediction outputs with the actual results. Various algorithms can be used in the model training process. The choice of algorithm usually depends on the task, the data available, and the requirements of the project. It is worth noting that the model training stage can be computationally expensive particularly when dealing with large datasets or complex models.\n\nDecisions depend on the organization's infrastructure.\n\n* **Repository Suggestion:** [ML Deployment k8s Fast API](https://github.com/sayakpaul/ml-deployment-k8s-fastapi/tree/main)\n* **Tutorial Suggestions:** [ML deployment with k8s FastAPI, Building an ML app with FastAPI](https://dev.to/bravinsimiyu/beginner-guide-on-how-to-build-a-machine-learning-app-with-fastapi-part-ii-deploying-the-fastapi-application-to-kubernetes-4j6g), [Basic Kubeflow pipeline](https://towardsdatascience.com/tutorial-basic-kubeflow-pipeline-from-scratch-5f0350dc1905), [Building and deploying ML pipelines](https://www.datacamp.com/tutorial/kubeflow-tutorial-building-and-deploying-machine-learning-pipelines?utm_source=google&utm_medium=paid_search&utm_campaignid=19589720818&utm_adgroupid=157156373991&utm_device=c&utm_keyword=&utm_matchtype=&utm_network=g&utm_adpostion=&utm_creative=683184494153&utm_targetid=dsa-2218886984380&utm_loc_interest_ms=&utm_loc_physical_ms=9064564&utm_content=&utm_campaign=230119_1-sea~dsa~tofu_2-b2c_3-eu_4-prc_5-na_6-na_7-le_8-pdsh-go_9-na_10-na_11-na-dec23&gad_source=1&gclid=Cj0KCQiA4Y-sBhC6ARIsAGXF1g7iSih9h2RGL27LwWY6dlPLhEss-e5Af8pnaBvdDynRh7IHIKi8sGgaApD-EALw_wcB), [KServe tutorial](https://towardsdatascience.com/kserve-highly-scalable-machine-learning-deployment-with-kubernetes-aa7af0b71202)",
"links": []
"description": "Model Training refers to the phase in the Machine Learning (ML) pipeline where we teach a machine learning model how to make predictions by providing it with data. This process begins with feeding the model a training dataset, which it uses to learn and understand patterns or perform computations. The model's performance is then evaluated by comparing its prediction outputs with the actual results. Various algorithms can be used in the model training process. The choice of algorithm usually depends on the task, the data available, and the requirements of the project. It is worth noting that the model training stage can be computationally expensive particularly when dealing with large datasets or complex models.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "ML Deployment k8s Fast API",
"url": "https://github.com/sayakpaul/ml-deployment-k8s-fastapi/",
"type": "opensource"
},
{
"title": "MLOps Principles",
"url": "https://ml-ops.org/content/mlops-principles",
"type": "article"
},
{
"title": "ML deployment with k8s FastAPI, Building an ML app with FastAPI",
"url": "https://dev.to/bravinsimiyu/beginner-guide-on-how-to-build-a-machine-learning-app-with-fastapi-part-ii-deploying-the-fastapi-application-to-kubernetes-4j6g",
"type": "article"
},
{
"title": "KServe Tutorial",
"url": "https://towardsdatascience.com/kserve-highly-scalable-machine-learning-deployment-with-kubernetes-aa7af0b71202",
"type": "article"
}
]
},
"r4fbUwD83uYumEO1X8f09": {
"title": "Monitoring & Observability",
@ -608,20 +686,25 @@
},
"sf67bSL7HAx6iN7S6MYKs": {
"title": "Infrastructure as Code",
"description": "Infrastructure as Code (IaC) is a modern approach to managing and provisioning IT infrastructure through machine-readable configuration files, rather than manual processes. It enables developers and operations teams to define and manage infrastructure resources—such as servers, networks, and databases—using code, which can be versioned, tested, and deployed like application code. IaC tools, like Terraform and AWS CloudFormation, allow for automated, repeatable deployments, reducing human error and increasing consistency across environments. This practice facilitates agile development, enhances collaboration between teams, and supports scalable and efficient infrastructure management.",
"description": "Infrastructure as Code (IaC) is a modern approach to managing and provisioning IT infrastructure through machine-readable configuration files, rather than manual processes. It enables developers and operations teams to define and manage infrastructure resources—such as servers, networks, and databases—using code, which can be versioned, tested, and deployed like application code. IaC tools, like Terraform and AWS CloudFormation, allow for automated, repeatable deployments, reducing human error and increasing consistency across environments. This practice facilitates agile development, enhances collaboration between teams, and supports scalable and efficient infrastructure management.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Visit Dedicated Terraform Roadmap",
"url": "https://roadmap.sh/terraform",
"type": "article"
},
{
"title": "What is Infrastructure as Code?",
"url": "https://www.redhat.com/en/topics/automation/what-is-infrastructure-as-code-iac",
"type": "article"
},
{
"title": "Terraform course for beginners",
"title": "Terraform Course for Beginners",
"url": "https://www.youtube.com/watch?v=SLB_c_ayRMo",
"type": "video"
},
{
"title": "8 Terraform best practices",
"title": "8 Terraform Best Practices",
"url": "https://www.youtube.com/watch?v=gxPykhPxRW0",
"type": "video"
}

@ -807,6 +807,11 @@
"url": "https://www.digitalocean.com/community/tutorials/how-to-work-with-files-using-the-fs-module-in-node-js",
"type": "article"
},
{
"title": "File system",
"url": "https://nodejs.org/docs/latest/api/fs.html",
"type": "article"
},
{
"title": "Explore top posts about Node.js",
"url": "https://app.daily.dev/tags/nodejs?ref=roadmapsh",

@ -780,8 +780,8 @@
"description": "Object-Relational Mapping (ORM) is a popular technique used with PHP to convert data between incompatible type systems using an object-oriented programming language. Essentially, it saves PHP developers time by enabling them to work with databases using OOP standards and avoid writing long SQL queries. One commonly used ORM in PHP is Doctrine. For instance, to save data into a products table, you don't use SQL but OOP-style code:\n\n $product = new Product();\n $product->setName('New Product');\n $entityManager->persist($product);\n $entityManager->flush();\n \n\nVisit the following resources to learn more:",
"links": [
{
"title": "Object Relational Mapping (ORM)",
"url": "https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/tutorials/getting-started.html",
"title": "What is an Object Relational Mapping (ORM)",
"url": "https://stackoverflow.com/questions/1279613/what-is-an-orm-how-does-it-work-and-how-should-i-use-one#answer-1279678",
"type": "article"
}
]

@ -126,7 +126,7 @@
},
"-DJgS6l2qngfwurExlmmT": {
"title": "Functions, Builtin Functions",
"description": "In programming, a function is a reusable block of code that executes a certain functionality when it is called. Functions are integral parts of every programming language because they help make your code more modular and reusable. In Python, we define a function with the `def` keyword, then write the function identifier (name) followed by parentheses and a colon.\n\nExample\n-------\n\n def greet(name):\n print(f\"Hello, {name}!\")\n \n greet(\"Roadmap.sh\") \n \n\nVisit the following resources to learn more:",
"description": "In programming, a function is a reusable block of code that executes a certain functionality when it is called. Functions are integral parts of every programming language because they help make your code more modular and reusable. In Python, we define a function with the `def` keyword, then write the function identifier (name) followed by parentheses and a colon.\n\nExample\n-------\n\n def greet(name):\n print(f\"Hello, {name}!\")\n \n \n greet(\"Roadmap.sh\")\n \n\nVisit the following resources to learn more:",
"links": [
{
"title": "Built-in Functions in Python",
@ -700,11 +700,6 @@
"title": "Python Inheritance",
"url": "https://www.w3schools.com/python/python_inheritance.asp",
"type": "article"
},
{
"title": "Inheritance in Python",
"url": "https://www.javatpoint.com/inheritance-in-python",
"type": "article"
}
]
},

@ -97,11 +97,6 @@
"title": "TestLink",
"url": "https://testlink.org/",
"type": "article"
},
{
"title": "TestLink Tutorial: A Complete Guide",
"url": "https://www.guru99.com/testlink-tutorial-complete-guide.html",
"type": "article"
}
]
},
@ -674,11 +669,6 @@
"url": "https://www.guru99.com/agile-scrum-extreme-testing.html",
"type": "article"
},
{
"title": "Agile Model",
"url": "https://www.javatpoint.com/software-engineering-agile-model",
"type": "article"
},
{
"title": "Manifesto for Agile Software Development",
"url": "https://agilemanifesto.org/",
@ -759,11 +749,6 @@
"url": "https://www.guru99.com/manual-testing.html",
"type": "article"
},
{
"title": "Manual Testing",
"url": "https://www.javatpoint.com/manual-testing",
"type": "article"
},
{
"title": "Explore top posts about QA",
"url": "https://app.daily.dev/tags/qa?ref=roadmapsh",
@ -1562,11 +1547,6 @@
"title": "Accessibility Tests",
"description": "In software QA, accessibility testing is the practice of confirming that an application is usable for as many people as possible, including people with disabilities such as vision impairment, hearing problems and cognitive conditions.\n\nVisit the following resources to learn more:",
"links": [
{
"title": "Accessibility Testing - Javatpoint",
"url": "https://www.javatpoint.com/accessibility-testing",
"type": "article"
},
{
"title": "Explore top posts about Accessibility",
"url": "https://app.daily.dev/tags/accessibility?ref=roadmapsh",

@ -21,12 +21,7 @@
"links": [
{
"title": "Advantages and Disadvantages of DBMS",
"url": "https://www.javatpoint.com/advantages-and-disadvantages-of-dbms",
"type": "article"
},
{
"title": "ACID Transactions in Databases",
"url": "https://www.databricks.com/glossary/acid-transactions",
"url": "https://cloud.google.com/learn/what-is-a-relational-database",
"type": "article"
}
]
@ -947,11 +942,6 @@
"title": "CEILING",
"description": "The `CEILING()` function in SQL returns the smallest integer greater than or equal to a given numeric value. It's useful when you need to round up a number to the nearest whole number, regardless of whether the number is already an integer or a decimal. For example, `CEILING(4.2)` would return `5`, and `CEILING(-4.7)` would return `-4`. This function is commonly used in scenarios where rounding up is necessary, such as calculating the number of pages needed to display a certain number of items when each page has a fixed capacity.\n\nLearn more from the following resources:",
"links": [
{
"title": "CEILING Function in SQL",
"url": "https://www.javatpoint.com/ceiling-function-in-sql",
"type": "article"
},
{
"title": "SQL CEILING",
"url": "https://www.w3schools.com/sql/func_sqlserver_ceiling.asp",

@ -670,7 +670,7 @@
},
"RNITLR1FUQWkRbSBXTD_z": {
"title": "Write-through",
"description": "The application uses the cache as the main data store, reading and writing data to it, while the cache is responsible for reading and writing to the database:\n\n* Application adds/updates entry in cache\n* Cache synchronously writes entry to data store\n* Return\n\nApplication code:\n\n set_user(12345, {\"foo\":\"bar\"})\n \n\nCache code:\n\n def set_user(user_id, values):\n user = db.query(\"UPDATE Users WHERE id = {0}\", user_id, values)\n cache.set(user_id, user)\n \n\nWrite-through is a slow overall operation due to the write operation, but subsequent reads of just written data are fast. Users are generally more tolerant of latency when updating data than reading data. Data in the cache is not stale.\n\nDisadvantages\n-------------\n\n* When a new node is created due to failure or scaling, the new node will not cache entries until the entry is updated in the database. Cache-aside in conjunction with write through can mitigate this issue.\n* Most data written might never be read, which can be minimized with a TTL.\n\n![Write through](https://i.imgur.com/Ujf0awN.png)\n\nHave a look at the following resources to learn more:",
"description": "The application uses the cache as the main data store, reading and writing data to it, while the cache is responsible for reading and writing to the database:\n\n* Application adds/updates entry in cache\n* Cache synchronously writes entry to data store\n* Return\n\nApplication code:\n\n set_user(12345, {\"foo\": \"bar\"})\n \n\nCache code:\n\n def set_user(user_id, values):\n user = db.query(\"UPDATE Users WHERE id = {0}\", user_id, values)\n cache.set(user_id, user)\n \n\nWrite-through is a slow overall operation due to the write operation, but subsequent reads of just written data are fast. Users are generally more tolerant of latency when updating data than reading data. Data in the cache is not stale.\n\nDisadvantages\n-------------\n\n* When a new node is created due to failure or scaling, the new node will not cache entries until the entry is updated in the database. Cache-aside in conjunction with write through can mitigate this issue.\n* Most data written might never be read, which can be minimized with a TTL.\n\n![Write through](https://i.imgur.com/Ujf0awN.png)\n\nHave a look at the following resources to learn more:",
"links": [
{
"title": "Scalability, availability, stability, patterns",
@ -1839,11 +1839,6 @@
"title": "Geode pattern",
"url": "https://learn.microsoft.com/en-us/azure/architecture/patterns/geodes",
"type": "article"
},
{
"title": "Geode Formation, Types & Appearance | What is a Geode?",
"url": "https://study.com/academy/lesson/geode-formation-types-appearance.html",
"type": "article"
}
]
},

@ -1027,11 +1027,6 @@
"title": "External Modules",
"description": "In TypeScript, external modules allow you to organize and share code across multiple files. External modules in TypeScript follow the CommonJS or ES modules standards.\n\nHere's an example of how you can use external modules in TypeScript:\n\n // myModule.ts\n export function doSomething() {\n console.log('Doing something...');\n }\n \n // main.ts\n import { doSomething } from './myModule';\n doSomething(); // Output: \"Doing something...\"\n \n\nIn this example, we use the \"export\" keyword in the \"myModule.ts\" file to export the \"doSomething\" function, making it available for other files to use.\n\nLearn more from the following links:",
"links": [
{
"title": "External Module",
"url": "https://www.javatpoint.com/typescript-module",
"type": "article"
},
{
"title": "TypeScript - External Module",
"url": "https://learncodeweb.com/typescript/modules-in-typescript-explain-with-an-example/",

Loading…
Cancel
Save