From 16e501b79121315874224e05c2aed3263739a0d2 Mon Sep 17 00:00:00 2001 From: Ajay-Dhangar Date: Fri, 26 Jul 2024 10:33:47 +0530 Subject: [PATCH 1/3] Debug code and deleted some folders and files --- .../Advance-level/Advanced-Forms/Dynamic.md | 60 --- .../Advanced-Forms/Form-Control.md | 55 --- .../Advanced-Forms/Form-arrays.md | 37 -- .../Advanced-Forms/Form-validation.md | 53 --- .../Advanced-Forms/_category_.json | 8 - .../Advanced-Routing/Custom-ROute.md | 54 --- .../Advanced-Routing/Nested-Routes.md | 34 -- .../Advanced-Routing/Route-Resolvers.md | 42 -- .../Advanced-Routing/Route-guards.md | 79 ---- .../Advanced-Routing/_category_.json | 8 - .../Angular-Universal/Introduction.md | 17 - .../Advance-level/Angular-Universal/SEO.md | 71 ---- .../Advance-level/Angular-Universal/Setup.md | 91 ---- .../Angular-Universal/_category_.json | 8 - .../Angular-Universal/pre-render.md | 34 -- .../Advance-level/GraphQL/Components.md | 94 ----- .../Advance-level/GraphQL/Introduction.md | 25 -- .../Angular/Advance-level/GraphQL/Queries.md | 39 -- .../Angular/Advance-level/GraphQL/Settings.md | 60 --- .../Advance-level/GraphQL/_category_.json | 8 - courses/Angular/Advance-level/RxJS/Async.md | 51 --- .../Advance-level/RxJS/Introduction.md | 15 - .../Angular/Advance-level/RxJS/Observable.md | 44 -- .../Angular/Advance-level/RxJS/Operators.md | 71 ---- .../Advance-level/RxJS/_category_.json | 8 - courses/Angular/Advance-level/_category_.json | 8 - courses/Angular/Overview.md | 118 ------ courses/Angular/_category_.json | 8 - .../begginer-level/Architecture/Components.md | 34 -- .../begginer-level/Architecture/Modules.md | 34 -- .../begginer-level/Architecture/Templates.md | 27 -- .../Architecture/_category_.json | 8 - .../begginer-level/Architecture/services.md | 63 --- .../Components/Component-Interaction.md | 134 ------ .../begginer-level/Components/Data-BInding.md | 59 --- .../begginer-level/Components/Hooks.md | 46 --- .../begginer-level/Components/Introduction.md | 78 ---- .../begginer-level/Components/_category_.json | 8 - .../Directives-and-Pipes/Custom-Directives.md | 87 ---- .../Directives-and-Pipes/Directives.md | 63 --- .../Directives-and-Pipes/_category_.json | 8 - .../Directives-and-Pipes/custom-pipe.md | 61 --- .../Directives-and-Pipes/pipe.md | 36 -- .../begginer-level/Forms/Form-validation.md | 50 --- .../begginer-level/Forms/Handling-form.md | 70 ---- .../begginer-level/Forms/Reactive-Forms.md | 77 ---- .../begginer-level/Forms/Template-driven.md | 65 --- .../begginer-level/Forms/_category_.json | 8 - .../HTTP-client/Error-handling.md | 107 ----- .../HTTP-client/Interceptors.md | 45 -- .../begginer-level/HTTP-client/Request.md | 93 ----- .../HTTP-client/_category_.json | 8 - .../begginer-level/HTTP-client/response.md | 47 --- .../begginer-level/Introduction/Installing.md | 79 ---- .../Introduction/Introduction.md | 23 -- .../Introduction/_category_.json | 8 - .../Routing-and-Navigation/Angular-Routes.md | 59 --- .../Routing-and-Navigation/Configure-ROute.md | 40 -- .../Routing-and-Navigation/Lazy-Loading.md | 57 --- .../Routing-and-Navigation/Route-parameter.md | 56 --- .../Routing-and-Navigation/_category_.json | 8 - .../Angular/begginer-level/_category_.json | 8 - .../Decorators.md | 88 ---- .../Dynamic-Component.md | 86 ---- .../Event-Emiters.md | 50 --- .../View-and-content-Child.md | 100 ----- .../_category_.json | 8 - .../intermediate/Angular-Modules/Featured.md | 59 --- .../Angular-Modules/_category_.json | 8 - .../Angular-Modules/core-module.md | 59 --- .../Angular-Modules/lazy-loading.md | 52 --- .../intermediate/Angular-Modules/shared.md | 68 --- .../intermediate/Animations/Introduction.md | 21 - .../intermediate/Animations/Keyframe.md | 63 --- .../intermediate/Animations/Transitions.md | 62 --- .../intermediate/Animations/Triggers.md | 86 ---- .../intermediate/Animations/_category_.json | 8 - .../intermediate/Testing/Component-Testing.md | 50 --- .../intermediate/Testing/End-to-end.md | 64 --- .../intermediate/Testing/Service-testing.md | 52 --- .../intermediate/Testing/Unit-Testing.md | 64 --- .../intermediate/Testing/_category_.json | 8 - courses/Angular/intermediate/_category_.json | 8 - .../state-management/Behaviour-Subject.md | 83 ---- .../intermediate/state-management/Concepts.md | 90 ---- .../state-management/Introduction.md | 20 - .../intermediate/state-management/NGRX.md | 124 ------ .../state-management/_category_.json | 8 - courses/C/_category_.json | 8 - .../Advance-File-Handling/File-Locking.md | 191 --------- .../Advance-File-Handling/_category_.json | 8 - .../working-memory-map.md | 64 --- .../advance-level/Algorithms/Introduction.md | 200 --------- courses/C/advance-level/Algorithms/Search.md | 169 -------- .../advance-level/Algorithms/_category_.json | 8 - .../C/advance-level/Data Structure/Graphs.md | 75 ---- .../Data Structure/Introduction.md | 387 ------------------ .../Data Structure/_Category_.json | 8 - .../advance-level/Multithreading/Deadlock.md | 28 -- .../Multithreading/_category_.json | 8 - .../Multithreading/introduction.md | 229 ----------- .../Network-programming/Introduction.md | 185 --------- .../Network-programming/_category_.json | 8 - .../Network-programming/tcp-id.md | 39 -- courses/C/advance-level/_category_.json | 8 - .../beginner-level/Array-and-Strings/Array.md | 123 ------ .../Array-and-Strings/String-Handling.md | 88 ---- .../Array-and-Strings/_category_.json | 8 - .../beginner-level/Basic Syntax/Structure.md | 115 ------ .../Basic Syntax/_category_.json | 8 - .../Basic Syntax/input-and-output.md | 64 --- .../C/beginner-level/Control-Flow/Loops.md | 202 --------- .../Control-Flow/_category_.json | 8 - .../beginner-level/Control-Flow/statement.md | 182 -------- .../beginner-level/Functions/Introduction.md | 72 ---- .../Functions/Scope-of-variable.md | 101 ----- .../beginner-level/Functions/_category_.json | 8 - .../Introduction/_category_.json | 8 - .../C/beginner-level/Introduction/intro.md | 21 - .../beginner-level/Introduction/setting-up.md | 65 --- .../C/beginner-level/Pointers/Introduction.md | 255 ------------ .../C/beginner-level/Pointers/_category_.json | 8 - .../Pointers/pointer-to-pointer.md | 72 ---- .../Structure-and-unions/Intro.md | 207 ---------- .../Structure-and-unions/Unions.md | 99 ----- .../Structure-and-unions/_category_.json | 8 - courses/C/beginner-level/_category_.json | 8 - .../operators-and-expression/Operators.md | 199 --------- .../operators-and-expression/_category_.json | 8 - .../ Preprocessor Directives/_category_.json | 8 - .../file-Inclusion.md | 75 ---- .../ Preprocessor Directives/intro.md | 141 ------- .../Advanced pointers/Function-pointer.md | 159 ------- .../Advanced pointers/_category_.json | 8 - .../dynamic-array-pointer.md | 102 ----- .../Bitwise-Operators/_category_.json | 8 - .../Dynamic-memory-allocation/Intro.md | 86 ---- .../Dynamic-memory-allocation/_category_.json | 8 - .../Dynamic-memory-allocation/memory.md | 61 --- .../Error-handling/_category_.json | 8 - .../Error-handling/file-operation.md | 50 --- .../Error-handling/types.md | 109 ----- .../File-Handling/_category_.json | 8 - .../File-Handling/binary-files.md | 50 --- .../intermediate-level/File-Handling/intro.md | 154 ------- courses/C/intermediate-level/_category_.json | 8 - courses/C/overview.md | 109 ----- courses/HTML/Overview.md | 111 ----- courses/HTML/_category_.json | 8 - .../HTML/advanced-level/Accessability/ARIA.md | 35 -- .../Accessability/Forms-and-Navigation.md | 82 ---- .../Accessability/Principles.md | 23 -- .../Accessability/_category_.json | 9 - .../HTML/advanced-level/HTML5-API/WebRTC.md | 117 ------ .../advanced-level/HTML5-API/WebSockets.md | 76 ---- .../advanced-level/HTML5-API/_category_.json | 9 - .../HTML5-API/server-send-events.md | 60 --- .../Integration-With-JS/Dyanamic-Concept.md | 69 ---- .../Integration-With-JS/Frameworks.md | 50 --- .../Integration-With-JS/JS-integration.md | 78 ---- .../Integration-With-JS/_category_.json | 9 - .../Performance/Lazy-Loading.md | 66 --- .../Performance/Optimization.md | 28 -- .../Performance/Reducing-render.md | 35 -- .../Performance/_category_.json | 9 - .../Progressive-web-apps/Application-shell.md | 54 --- .../Progressive-web-apps/Introduction.md | 17 - .../Progressive-web-apps/_category_.json | 9 - .../Progressive-web-apps/service.md | 88 ---- courses/HTML/advanced-level/SEO/Meta-tags.md | 55 --- courses/HTML/advanced-level/SEO/On-page.md | 44 -- .../advanced-level/SEO/Structured-Data.md | 62 --- .../HTML/advanced-level/SEO/_category_.json | 9 - .../Web-Components/Custom-Elements.md | 35 -- .../advanced-level/Web-Components/Imports.md | 40 -- .../Web-Components/Introduction.md | 16 - .../Web-Components/Shadow-DOM.md | 38 -- .../Web-Components/_category_.json | 9 - courses/HTML/advanced-level/_category_.json | 9 - .../Entities/Common-Entities.md | 31 -- .../Entities/Special-Characters.md | 60 --- .../begginer-level/Entities/_category_.json | 9 - .../Forms-and-Input/Creating-Forms.md | 35 -- .../Form-Attributes-and-Validation.md | 52 --- .../Forms-and-Input/Form-Elements.md | 70 ---- .../Forms-and-Input/_category_.json | 9 - .../Basic Structure-of-an-HTML-Document.md | 32 -- .../Doctype Declaration.md | 23 -- .../HTML-Tags-and-Attributes.md | 41 -- .../Introduction-to-HTML/What-is-HTML.md | 19 - .../Introduction-to-HTML/_category_.json | 9 - .../Links-and-Images/Creating-Hyperlinks.md | 29 -- .../Embedding-Images-Attributes.md | 52 --- .../Linking-to-Pages-and-Sections.md | 33 -- .../Links-and-Images/_category_.json | 9 - .../Multimedia/Audio-Video-tags.md | 30 -- .../Multimedia/Embedding-Audio-and-Video.md | 89 ---- .../begginer-level/Multimedia/_category_.json | 9 - .../Tables/Creating-Basic-Tables.md | 40 -- .../Tables/Table-Rows-and_columns.md | 80 ---- .../HTML/begginer-level/Tables/Table-Tags.md | 57 --- .../begginer-level/Tables/_category_.json | 9 - .../Text-formatting-and -Style/HeadingTags.md | 46 --- .../Text-formatting-and -Style/ListsTags.md | 47 --- .../Span-and-div.md | 34 -- .../_category_.json | 9 - courses/HTML/begginer-level/_category_.json | 8 - .../Advanced-Multimedia/Advanced-Audio.md | 156 ------- .../Advanced-Multimedia/Custom-Controls.md | 77 ---- .../Advanced-Multimedia/_category_.json | 9 - .../Canvas and SVG/Basic-Shapes.md | 56 --- .../Canvas and SVG/Drawing-Graphics.md | 24 -- .../intermidiate-level/Canvas and SVG/SVG .md | 55 --- .../Canvas and SVG/_category_.json | 9 - .../Forms and Advanced Inputs/ Input-Types.md | 83 ---- .../Accessable-Forms.md | 81 ---- .../Form-validation.md | 42 -- .../Forms and Advanced Inputs/_category_.json | 9 - .../Responsive-Design/Introduction.md | 22 - .../Responsive-Design/Media-Queries.md | 104 ----- .../Responsive-Design/Meta-Tags.md | 30 -- .../Responsive-Design/_category_.json | 9 - .../Semantic Elements/Semantic-Elements.md | 14 - .../Semantic Elements/Semantic-Tags.md | 143 ------- .../Semantic Elements/_category_.json | 9 - .../Web-Storage/Introduction.md | 17 - .../Web-Storage/Storages.md | 146 ------- .../Web-Storage/_category_.json | 9 - .../HTML/intermidiate-level/_category_.json | 8 - .../Backup-and-Restore/Cloud-Backup.md | 25 -- .../Backup-and-Restore/Introduction.md | 32 -- .../Backup-and-Restore/_category_.json | 8 - .../Backup-and-Restore/mongodump.md | 30 -- .../Data-Modeling/Introduction.md | 18 - .../Advanced Level/Data-Modeling/Patterns.md | 117 ------ .../Data-Modeling/_category_.json | 8 - .../Monitoring-and-Management/Atlas.md | 23 -- .../Monitoring-and-Management/Automated.md | 26 -- .../Monitoring-and-Management/Log-analysis.md | 32 -- .../Monitoring-and-Management/Monitoring.md | 30 -- .../Monitoring-and-Management/_category_.json | 8 - .../Advanced Level/Transactions/ACID.md | 18 - .../Advanced Level/Transactions/Example.md | 65 --- .../Transactions/_category_.json | 8 - .../Transactions/multi-documents.md | 26 -- .../MongoDB/Advanced Level/_categoty_.json | 8 - .../Advanced Level/microservices/Handling.md | 30 -- .../microservices/Integration.md | 43 -- .../microservices/_category_.json | 8 - .../microservices/event-Store.md | 40 -- courses/MongoDB/Overview.md | 108 ----- courses/MongoDB/_category_.json | 8 - courses/MongoDB/beginner-level/Basics/CRUD.md | 37 -- .../beginner-level/Basics/JSON-and-BSON.md | 19 - .../beginner-level/Basics/MongoDB-Compass.md | 36 -- .../beginner-level/Basics/UnderStanding.md | 23 -- .../beginner-level/Basics/_category_.json | 8 - .../MongoDB/beginner-level/Drivers/CRUD.md | 92 ----- .../beginner-level/Drivers/Introduction.md | 21 - .../beginner-level/Drivers/NodeJS-Driver.md | 50 --- .../beginner-level/Drivers/_category_.json | 8 - .../beginner-level/Framework/Introduction.md | 31 -- .../beginner-level/Framework/Operators.md | 94 ----- .../beginner-level/Framework/_category_.json | 8 - .../beginner-level/Indexes/Component-Index.md | 36 -- .../beginner-level/Indexes/Introduction.md | 22 - .../beginner-level/Indexes/_category_.json | 8 - .../beginner-level/Indexes/creating-index.md | 47 --- .../Introduction/Difference-SQL-&-NOSQL.md | 17 - .../Introduction/Introduction.md | 45 -- .../beginner-level/Introduction/Setup.md | 90 ---- .../Introduction/_category_.json | 8 - .../Schema-and-Modeling/Data-Types.md | 77 ---- .../Embedding-vs-refernce.md | 57 --- .../Schema-and-Modeling/Introductions.md | 22 - .../Schema-and-Modeling/Schema-Design.md | 30 -- .../Schema-and-Modeling/_category_.json | 8 - .../MongoDB/beginner-level/Shell/Commands.md | 102 ----- .../beginner-level/Shell/Introduction.md | 43 -- .../beginner-level/Shell/_category_.json | 8 - .../MongoDB/beginner-level/_category_.json | 8 - .../Advanced-Aggregation/Arrays.md | 30 -- .../Advanced-Aggregation/Operators.md | 58 --- .../Advanced-Aggregation/Transformation.md | 116 ------ .../Advanced-Aggregation/_category_.json | 0 .../Data-Validation/Schema-validation.md | 55 --- .../Data-Validation/Validation.md | 69 ---- .../Data-Validation/_category_.json | 8 - .../Data-Validation/schema-rules.md | 52 --- .../Replication/Failover.md | 30 -- .../Replication/Introduction.md | 53 --- .../Replication/_category_.json | 8 - .../intermediate-Level/Replication/roles.md | 19 - .../Security/Authentication.md | 56 --- .../intermediate-Level/Security/RBAC.md | 77 ---- .../Security/_category_.json | 8 - .../Sharding/Balancing-Data.md | 28 -- .../Sharding/Introduction.md | 87 ---- .../Sharding/Shared-Keys.md | 22 - .../Sharding/_category_.json | 8 - .../intermediate-Level/_category_.json | 8 - .../querying/QUery-concepts.md | 52 --- .../querying/Query-operators.md | 85 ---- .../querying/_category_.json | 8 - .../Authentication/Implement-Auth.md | 77 ---- .../Intermediate-level/Authentication/JWT.md | 53 --- .../Authentication/Role-based.md | 61 --- .../Authentication/_category_.json | 8 - .../Authentication/protection-Routes.md | 73 ---- .../Data-Fetching/GraphQl.md | 69 ---- .../Data-Fetching/Handling.md | 73 ---- .../Intermediate-level/Data-Fetching/SWR.md | 48 --- .../Data-Fetching/_category_.json | 8 - .../Data-Fetching/fetching-Data.md | 119 ------ .../Internationalization/Handling-dynamic.md | 60 --- .../Internationalization/Introduction.md | 72 ---- .../Loading-and-Managing.md | 79 ---- .../Internationalization/_category_.json | 8 - .../Middleware/Introduction.md | 86 ---- .../Middleware/Middleware-concept.md | 55 --- .../Middleware/_category_.json | 8 - .../Middleware/routing-tech.md | 42 -- .../Intermediate-level/_category_.json | 8 - courses/Next.Js/Overview.md | 80 ---- courses/Next.Js/_category_.json | 8 - .../Advance-Routing/Customizing.md | 136 ------ .../Advance-Routing/Dynamic-Route.md | 80 ---- .../Advance-Routing/_category_.json | 8 - .../Advance-data-fetching/_category_.json | 8 - .../dynamic-generation.md | 191 --------- .../static-generation.md | 100 ----- .../Advance-server-side-render/SSR.md | 160 -------- .../_category_.json | 8 - .../Advance-server-side-render/customize.md | 142 ------- .../advance-level/GraphQL/Introduction.md | 106 ----- .../advance-level/GraphQL/_category_.json | 8 - .../advance-level/GraphQL/apollo-client.md | 226 ---------- courses/Next.Js/advance-level/_category_.json | 8 - .../beginner-level/Introduction/Frameworks.md | 22 - .../Introduction/_category_.json | 8 - .../Introduction/introduction.md | 68 --- .../beginner-level/Introduction/settingUp.md | 64 --- .../Pages-and-routing/FIlebase-Routing.md | 91 ---- .../Pages-and-routing/_category_.json | 8 - .../Pages-and-routing/creating-pages.md | 45 -- .../Next.Js/beginner-level/Routes/Database.md | 140 ------- .../beginner-level/Routes/Introduction.md | 48 --- .../beginner-level/Routes/_category_.json | 8 - .../Started/Running-development.md | 66 --- .../beginner-level/Started/_category_.json | 8 - .../Started/creating-project.md | 67 --- .../beginner-level/Styling/Libraries.md | 80 ---- .../beginner-level/Styling/_category_.json | 8 - .../beginner-level/Styling/css-styling.md | 104 ----- .../Next.Js/beginner-level/_category_.json | 8 - .../static-and-serverSide/_category_.json | 8 - .../static-and-serverSide/concept.md | 170 -------- .../static-and-serverSide/introduction.md | 122 ------ courses/React Native/Overview.md | 87 ---- courses/React Native/_category_.json | 8 - .../Handling-background.md | 80 ---- .../Implement.md | 97 ----- .../Syncing-data.md | 67 --- .../_category_.json | 8 - .../Advanced Native/_category_.json | 8 - .../Advanced Native/complex-native-module.md | 159 ------- .../Advanced Native/library-sdk.md | 47 --- .../Advanced Native/platform-specific.md | 44 -- .../Building-deploying/CI-CD.md | 70 ---- .../Building-deploying/_category_.json | 8 - .../Building-deploying/build-android-ios.md | 53 --- .../Building-deploying/publish-stores.md | 58 --- .../updates-and-versions.md | 20 - .../Advanced-state-management.md | 210 ---------- .../Managing App State/Handling-app-state.md | 82 ---- .../Managing App State/_category_.json | 8 - .../advanced-level/_category_.json | 8 - .../Handling-user-input/TouchableOpacity.md | 164 -------- .../Handling-user-input/_category_.json | 8 - .../Handling-user-input/textInput.md | 90 ---- .../Introduction/_category_.json | 8 - .../beginner-level/Introduction/intro.md | 30 -- .../beginner-level/Introduction/setting-up.md | 134 ------ .../beginner-level/Navigation/Introduction.md | 202 --------- .../beginner-level/Navigation/_category_.json | 8 - .../Navigation/passing-parameter.md | 65 --- .../Network-Data-Fetching/Fetching.md | 170 -------- .../Network-Data-Fetching/_category_.json | 8 - .../Network-Data-Fetching/display-data.md | 123 ------ .../beginner-level/_category_.json | 8 - .../basic-component/_category_.json | 8 - .../basic-component/components.md | 150 ------- .../beginner-level/basic-component/styles.md | 103 ----- .../platform-specific/_category_.json | 8 - .../platform-specific/handling-screens.md | 146 ------- .../platform-specific/using-specific-code.md | 149 ------- .../state-management/Introduction.md | 83 ---- .../state-management/_category_.json | 8 - .../state-management/state-management.md | 65 --- .../Advanced-Components/_category_.json | 8 - .../creating-components.md | 177 -------- .../Advanced-Components/libraries.md | 116 ------ .../Advanced-Navigation/Handling-keep.md | 169 -------- .../Advanced-Navigation/Implement.md | 65 --- .../Advanced-Navigation/_category_.json | 8 - .../intermediate-level/Animations/Gesture.md | 81 ---- .../Animations/Introduction.md | 205 ---------- .../Animations/_category_.json | 8 - .../Native-modules/Introduction.md | 121 ------ .../Native-modules/_category_.json | 8 - .../Native-modules/custom-native-module.md | 130 ------ .../State-management/_category_.json | 8 - .../State-management/async-operation.md | 151 ------- .../State-management/introduction.md | 100 ----- .../Integration.md | 194 --------- .../Managing-lib.md | 70 ---- .../_category_.json | 8 - .../intermediate-level/_category_.json | 8 - courses/Ruby/Overview.md | 77 ---- courses/Ruby/_category_.json | 8 - .../Advance-File-Handling/_category_.json | 8 - .../Advance-File-Handling/large-Files.md | 57 --- .../Advance-File-Handling/memory-mapped.md | 79 ---- .../Advanced-metaprogramming/DSLs.md | 92 ----- .../Advanced-metaprogramming/Singleton.md | 86 ---- .../Advanced-metaprogramming/_category_.json | 8 - .../Concurrency and Parallelism/Intro.md | 91 ---- .../_category_.json | 8 - .../synchronization.md | 86 ---- .../Network-programming/_category_.json | 8 - .../Network-programming/client-server.md | 111 ----- .../Network-programming/into.md | 48 --- .../Ruby on Rails/Introduction.md | 36 -- .../Ruby on Rails/_category_.json | 8 - .../Ruby/advanced-level/Ruby on Rails/mvc.md | 97 ----- courses/Ruby/advanced-level/_category_.json | 8 - .../Arrays and Hashes/Arrays.md | 45 -- .../Arrays and Hashes/_category_.json | 8 - .../Arrays and Hashes/hashes.md | 94 ----- .../Basic-syntax/Basic-syntax.md | 90 ---- .../Basic-syntax/_category_.json | 8 - .../beginner-level/Basic-syntax/constants.md | 77 ---- .../beginner-level/Control-Strucutre/Loops.md | 214 ---------- .../Control-Strucutre/_category_.json | 8 - .../Control-Strucutre/statements.md | 79 ---- .../Function-and-methods/Category_.json | 8 - .../Function-and-methods/arguments.md | 90 ---- .../Function-and-methods/define-methods.md | 33 -- .../Introduction/_category_.json | 8 - .../Ruby/beginner-level/Introduction/setup.md | 58 --- .../Introduction/what-is-ruby.md | 24 -- .../beginner-level/Strings/_category_.json | 8 - .../Ruby/beginner-level/Strings/concepts.md | 133 ------ courses/Ruby/beginner-level/_category_.json | 8 - .../Enumerables-and-Iteration/_category_.json | 8 - .../custom-iterations.md | 59 --- .../working-with-Enumerables.md | 84 ---- .../Gems-and-builder/_category_.json | 8 - .../Gems-and-builder/intro.md | 49 --- .../Gems-and-builder/publishing.md | 92 ----- .../intermediate-level/OOPS/_category_.json | 8 - .../Ruby/intermediate-level/OOPS/concepts.md | 231 ----------- .../Ruby/intermediate-level/_category_.json | 8 - .../metaprogramming/Dynamic-method.md | 68 --- .../metaprogramming/_category_.json | 8 - .../metaprogramming/intro.md | 54 --- .../working-with-API/JSON-and-XML.md | 100 ----- .../working-with-API/_category_.json | 8 - .../working-with-API/http.md | 60 --- courses/php/Overview.md | 74 ---- courses/php/_category_.json | 8 - .../Advance-Database-iteration/NOSQL.md | 73 ---- .../Advance-Database-iteration/SQL.md | 210 ---------- .../_category_.json | 8 - .../Advanced-array/Advanced-array-fun.md | 178 -------- .../Advanced-array/_category_.json | 8 - .../Advanced-oops/Advance-opps.md | 173 -------- .../Advanced-oops/Static-topics.md | 97 ----- .../Advanced-oops/_category_.json | 8 - .../advance-level/Web-Services/Rest-Api.md | 90 ---- .../php/advance-level/Web-Services/SOAP.md | 106 ----- .../Web-Services/_category_.json | 8 - courses/php/advance-level/_category_.json | 8 - .../php/advance-level/php-framworks/Intro.md | 172 -------- .../php-framworks/_category_.json | 8 - .../php/advance-level/php-framworks/mvc.md | 44 -- .../beginner-level/Array-and-Strings/Array.md | 240 ----------- .../Array-and-Strings/String.md | 269 ------------ .../Array-and-Strings/_category_.json | 8 - .../Basic Syntax/_category_.json | 8 - .../beginner-level/Basic Syntax/operators.md | 150 ------- .../php/beginner-level/Basic Syntax/tags.md | 66 --- .../beginner-level/Control-Strucures/Loops.md | 204 --------- .../Control-Strucures/_category_.json | 8 - .../Control-Strucures/statements.md | 81 ---- .../beginner-level/Forms and Input/Forms.md | 65 --- .../Forms and Input/_category_.json | 8 - .../Forms and Input/validation.md | 157 ------- .../beginner-level/Functions/_category_.json | 8 - courses/php/beginner-level/Functions/intro.md | 69 ---- courses/php/beginner-level/Functions/scope.md | 113 ----- .../php/beginner-level/Introduction/Intro.md | 24 -- .../Introduction/_category_.json | 8 - .../beginner-level/Introduction/setting-up.md | 77 ---- courses/php/beginner-level/_category_.json | 8 - .../file-handling/_category_.json | 8 - .../file-handling/handling-function.md | 108 ----- .../file-handling/read-and-write.md | 109 ----- .../Error-Handling/_category_.json | 8 - .../Error-Handling/custom-error.md | 112 ----- .../Error-Handling/types.md | 40 -- .../intermediate-level/XML-and-JSON/JSON.md | 94 ----- .../intermediate-level/XML-and-JSON/XML.md | 128 ------ .../XML-and-JSON/_category_.json | 8 - .../php/intermediate-level/_category_.json | 8 - .../mail-handling/PHP-mailer.md | 85 ---- .../mail-handling/_category_.json | 8 - .../mail-handling/send-mail.md | 65 --- .../intermediate-level/oops/_category_.json | 8 - .../oops/intro-and-concepts.md | 247 ----------- .../session-and-cookies/Cookies.md | 96 ----- .../session-and-cookies/Intro.md | 67 --- .../session-and-cookies/_category_.json | 8 - courses/recommend.md | 2 +- courses/tailwindCSS/Overview.md | 111 ----- courses/tailwindCSS/_category_.json | 8 - .../Advanced-Animations/Complex-Animations.md | 48 --- .../KeyFrames-and-Animations.md | 50 --- .../Advanced-Animations/_category_.json | 0 .../animations-and-transitions.md | 50 --- .../Advance-Customizing.md | 61 --- .../Advanced-Configuration/Custom-Classes.md | 45 -- .../Advanced-Configuration/Deep-Divide.md | 36 -- .../Advanced-Configuration/_category_.json | 8 - .../Dynamic-States/Conditional-styling.md | 74 ---- .../Dynamic-States/Dynamic-class.md | 26 -- .../Dynamic-States/Integration-with-js.md | 31 -- .../Dynamic-States/_category_.json | 8 - .../advance-level/Frameworks/Angular.md | 52 --- .../advance-level/Frameworks/React.md | 57 --- .../advance-level/Frameworks/Vue.md | 55 --- .../advance-level/Frameworks/_category_.json | 8 - .../State-Varients/Sibiling-varients.md | 51 --- .../State-Varients/State-varients.md | 25 -- .../State-Varients/_category_.json | 8 - .../State-Varients/multiple-state-varient.md | 50 --- .../tailwindCSS/advance-level/_category_.json | 8 - .../begginner-level/Backgrounds/Borders.md | 33 -- .../begginner-level/Backgrounds/Cornors.md | 54 --- .../begginner-level/Backgrounds/Gradient.md | 19 - .../Backgrounds/_category_.json | 8 - .../Backgrounds/color-image.md | 25 -- .../Customizing/Custom-colors-and-fonts.md | 101 ----- .../Customizing/_category_.json | 8 - .../Customizing/configuration-file.md | 31 -- .../Customizing/default-theme.md | 56 --- .../Introduction/Basic-structure.md | 36 -- .../Introduction/Installing.md | 62 --- .../Introduction/_category_.json | 8 - .../Introduction/what-is-tailwindCss.md | 18 - .../begginner-level/Layouts/Flex-box.md | 85 ---- .../begginner-level/Layouts/_category_.json | 0 .../begginner-level/Layouts/grid.md | 78 ---- .../Responsive-Design/Layouts.md | 79 ---- .../Responsive-Design/_category_.json | 8 - .../Responsive-Design/mediaQueries.md | 22 - .../Spacing-and-sizing/_category_.json | 8 - .../Spacing-and-sizing/height-width.md | 84 ---- .../Spacing-and-sizing/margin-Padding.md | 69 ---- .../Text-And-Typography/Introduction.md | 10 - .../Text-And-Typography/Text-alignment.md | 39 -- .../Text-And-Typography/Text-line-height.md | 31 -- .../Text-And-Typography/Text.md | 45 -- .../Text-And-Typography/_category_.json | 8 - .../Utility-First-Concept/Combining.md | 47 --- .../Understanding-utility-classes.md | 72 ---- .../Utility-First-Concept/_category_.json | 8 - .../begginner-level/_category_.json | 8 - .../Component-Design/Accesible.md | 80 ---- .../Component-Design/_category_.json | 8 - .../Component-Design/libraries.md | 46 --- .../Component-Design/reusable-Component.md | 45 -- .../Custom-Directives/CSS-plugin.md | 36 -- .../Custom-Directives/Custom-plugin.md | 42 -- .../Custom-Directives/_category_.json | 8 - .../Custom-Directives/custom-Directives.md | 30 -- .../Dark-mode-theming/Dark-mode.md | 29 -- .../Dark-mode-theming/Switch-theme.md | 76 ---- .../Dark-mode-theming/_category_.json | 8 - .../Dark-mode-theming/custom-theme.md | 40 -- .../Forms-and-inputs/Customizing-Form.md | 49 --- .../Handling-Form-Validate.md | 64 --- .../Forms-and-inputs/_category_.json | 8 - .../Forms-and-inputs/styling-Form.md | 36 -- .../ActiveStates.md | 35 -- .../Animations.md | 73 ---- .../Transition.md | 39 -- .../_category_.json | 8 - .../intermediate-level/Layout/_category_.json | 8 - .../intermediate-level/Layout/flexBox.md | 77 ---- .../intermediate-level/Layout/grid.md | 76 ---- .../intermediate-level/Layout/position.md | 75 ---- .../intermediate-level/_category_.json | 8 - .../Easy problems/Lucky-Numbers.md | 2 +- .../Easy problems/Missing-In-Array.md | 220 ---------- ...> determine-if-two-trees-are-identical.md} | 1 - ...n-array => find-duplicates-in-an-array.md} | 0 ...-1587115620 => floor-in-a-sorted-array.md} | 4 - .../Easy problems/square-root.md | 20 +- .../0200-0299/0240-search-a-2d-matrix-ii.md | 354 ++++++++++++++-- .../0900-0999/0905-sort-array-by-parity.md | 229 +++++++---- .../0900-0999/0906-super-palindromes.md | 346 +++++++++------- src/data/courses/index.tsx | 191 ++++----- src/pages/index.tsx | 2 +- 614 files changed, 749 insertions(+), 33483 deletions(-) delete mode 100644 courses/Angular/Advance-level/Advanced-Forms/Dynamic.md delete mode 100644 courses/Angular/Advance-level/Advanced-Forms/Form-Control.md delete mode 100644 courses/Angular/Advance-level/Advanced-Forms/Form-arrays.md delete mode 100644 courses/Angular/Advance-level/Advanced-Forms/Form-validation.md delete mode 100644 courses/Angular/Advance-level/Advanced-Forms/_category_.json delete mode 100644 courses/Angular/Advance-level/Advanced-Routing/Custom-ROute.md delete mode 100644 courses/Angular/Advance-level/Advanced-Routing/Nested-Routes.md delete mode 100644 courses/Angular/Advance-level/Advanced-Routing/Route-Resolvers.md delete mode 100644 courses/Angular/Advance-level/Advanced-Routing/Route-guards.md delete mode 100644 courses/Angular/Advance-level/Advanced-Routing/_category_.json delete mode 100644 courses/Angular/Advance-level/Angular-Universal/Introduction.md delete mode 100644 courses/Angular/Advance-level/Angular-Universal/SEO.md delete mode 100644 courses/Angular/Advance-level/Angular-Universal/Setup.md delete mode 100644 courses/Angular/Advance-level/Angular-Universal/_category_.json delete mode 100644 courses/Angular/Advance-level/Angular-Universal/pre-render.md delete mode 100644 courses/Angular/Advance-level/GraphQL/Components.md delete mode 100644 courses/Angular/Advance-level/GraphQL/Introduction.md delete mode 100644 courses/Angular/Advance-level/GraphQL/Queries.md delete mode 100644 courses/Angular/Advance-level/GraphQL/Settings.md delete mode 100644 courses/Angular/Advance-level/GraphQL/_category_.json delete mode 100644 courses/Angular/Advance-level/RxJS/Async.md delete mode 100644 courses/Angular/Advance-level/RxJS/Introduction.md delete mode 100644 courses/Angular/Advance-level/RxJS/Observable.md delete mode 100644 courses/Angular/Advance-level/RxJS/Operators.md delete mode 100644 courses/Angular/Advance-level/RxJS/_category_.json delete mode 100644 courses/Angular/Advance-level/_category_.json delete mode 100644 courses/Angular/Overview.md delete mode 100644 courses/Angular/_category_.json delete mode 100644 courses/Angular/begginer-level/Architecture/Components.md delete mode 100644 courses/Angular/begginer-level/Architecture/Modules.md delete mode 100644 courses/Angular/begginer-level/Architecture/Templates.md delete mode 100644 courses/Angular/begginer-level/Architecture/_category_.json delete mode 100644 courses/Angular/begginer-level/Architecture/services.md delete mode 100644 courses/Angular/begginer-level/Components/Component-Interaction.md delete mode 100644 courses/Angular/begginer-level/Components/Data-BInding.md delete mode 100644 courses/Angular/begginer-level/Components/Hooks.md delete mode 100644 courses/Angular/begginer-level/Components/Introduction.md delete mode 100644 courses/Angular/begginer-level/Components/_category_.json delete mode 100644 courses/Angular/begginer-level/Directives-and-Pipes/Custom-Directives.md delete mode 100644 courses/Angular/begginer-level/Directives-and-Pipes/Directives.md delete mode 100644 courses/Angular/begginer-level/Directives-and-Pipes/_category_.json delete mode 100644 courses/Angular/begginer-level/Directives-and-Pipes/custom-pipe.md delete mode 100644 courses/Angular/begginer-level/Directives-and-Pipes/pipe.md delete mode 100644 courses/Angular/begginer-level/Forms/Form-validation.md delete mode 100644 courses/Angular/begginer-level/Forms/Handling-form.md delete mode 100644 courses/Angular/begginer-level/Forms/Reactive-Forms.md delete mode 100644 courses/Angular/begginer-level/Forms/Template-driven.md delete mode 100644 courses/Angular/begginer-level/Forms/_category_.json delete mode 100644 courses/Angular/begginer-level/HTTP-client/Error-handling.md delete mode 100644 courses/Angular/begginer-level/HTTP-client/Interceptors.md delete mode 100644 courses/Angular/begginer-level/HTTP-client/Request.md delete mode 100644 courses/Angular/begginer-level/HTTP-client/_category_.json delete mode 100644 courses/Angular/begginer-level/HTTP-client/response.md delete mode 100644 courses/Angular/begginer-level/Introduction/Installing.md delete mode 100644 courses/Angular/begginer-level/Introduction/Introduction.md delete mode 100644 courses/Angular/begginer-level/Introduction/_category_.json delete mode 100644 courses/Angular/begginer-level/Routing-and-Navigation/Angular-Routes.md delete mode 100644 courses/Angular/begginer-level/Routing-and-Navigation/Configure-ROute.md delete mode 100644 courses/Angular/begginer-level/Routing-and-Navigation/Lazy-Loading.md delete mode 100644 courses/Angular/begginer-level/Routing-and-Navigation/Route-parameter.md delete mode 100644 courses/Angular/begginer-level/Routing-and-Navigation/_category_.json delete mode 100644 courses/Angular/begginer-level/_category_.json delete mode 100644 courses/Angular/intermediate/Advanced Component Interaction/Decorators.md delete mode 100644 courses/Angular/intermediate/Advanced Component Interaction/Dynamic-Component.md delete mode 100644 courses/Angular/intermediate/Advanced Component Interaction/Event-Emiters.md delete mode 100644 courses/Angular/intermediate/Advanced Component Interaction/View-and-content-Child.md delete mode 100644 courses/Angular/intermediate/Advanced Component Interaction/_category_.json delete mode 100644 courses/Angular/intermediate/Angular-Modules/Featured.md delete mode 100644 courses/Angular/intermediate/Angular-Modules/_category_.json delete mode 100644 courses/Angular/intermediate/Angular-Modules/core-module.md delete mode 100644 courses/Angular/intermediate/Angular-Modules/lazy-loading.md delete mode 100644 courses/Angular/intermediate/Angular-Modules/shared.md delete mode 100644 courses/Angular/intermediate/Animations/Introduction.md delete mode 100644 courses/Angular/intermediate/Animations/Keyframe.md delete mode 100644 courses/Angular/intermediate/Animations/Transitions.md delete mode 100644 courses/Angular/intermediate/Animations/Triggers.md delete mode 100644 courses/Angular/intermediate/Animations/_category_.json delete mode 100644 courses/Angular/intermediate/Testing/Component-Testing.md delete mode 100644 courses/Angular/intermediate/Testing/End-to-end.md delete mode 100644 courses/Angular/intermediate/Testing/Service-testing.md delete mode 100644 courses/Angular/intermediate/Testing/Unit-Testing.md delete mode 100644 courses/Angular/intermediate/Testing/_category_.json delete mode 100644 courses/Angular/intermediate/_category_.json delete mode 100644 courses/Angular/intermediate/state-management/Behaviour-Subject.md delete mode 100644 courses/Angular/intermediate/state-management/Concepts.md delete mode 100644 courses/Angular/intermediate/state-management/Introduction.md delete mode 100644 courses/Angular/intermediate/state-management/NGRX.md delete mode 100644 courses/Angular/intermediate/state-management/_category_.json delete mode 100644 courses/C/_category_.json delete mode 100644 courses/C/advance-level/Advance-File-Handling/File-Locking.md delete mode 100644 courses/C/advance-level/Advance-File-Handling/_category_.json delete mode 100644 courses/C/advance-level/Advance-File-Handling/working-memory-map.md delete mode 100644 courses/C/advance-level/Algorithms/Introduction.md delete mode 100644 courses/C/advance-level/Algorithms/Search.md delete mode 100644 courses/C/advance-level/Algorithms/_category_.json delete mode 100644 courses/C/advance-level/Data Structure/Graphs.md delete mode 100644 courses/C/advance-level/Data Structure/Introduction.md delete mode 100644 courses/C/advance-level/Data Structure/_Category_.json delete mode 100644 courses/C/advance-level/Multithreading/Deadlock.md delete mode 100644 courses/C/advance-level/Multithreading/_category_.json delete mode 100644 courses/C/advance-level/Multithreading/introduction.md delete mode 100644 courses/C/advance-level/Network-programming/Introduction.md delete mode 100644 courses/C/advance-level/Network-programming/_category_.json delete mode 100644 courses/C/advance-level/Network-programming/tcp-id.md delete mode 100644 courses/C/advance-level/_category_.json delete mode 100644 courses/C/beginner-level/Array-and-Strings/Array.md delete mode 100644 courses/C/beginner-level/Array-and-Strings/String-Handling.md delete mode 100644 courses/C/beginner-level/Array-and-Strings/_category_.json delete mode 100644 courses/C/beginner-level/Basic Syntax/Structure.md delete mode 100644 courses/C/beginner-level/Basic Syntax/_category_.json delete mode 100644 courses/C/beginner-level/Basic Syntax/input-and-output.md delete mode 100644 courses/C/beginner-level/Control-Flow/Loops.md delete mode 100644 courses/C/beginner-level/Control-Flow/_category_.json delete mode 100644 courses/C/beginner-level/Control-Flow/statement.md delete mode 100644 courses/C/beginner-level/Functions/Introduction.md delete mode 100644 courses/C/beginner-level/Functions/Scope-of-variable.md delete mode 100644 courses/C/beginner-level/Functions/_category_.json delete mode 100644 courses/C/beginner-level/Introduction/_category_.json delete mode 100644 courses/C/beginner-level/Introduction/intro.md delete mode 100644 courses/C/beginner-level/Introduction/setting-up.md delete mode 100644 courses/C/beginner-level/Pointers/Introduction.md delete mode 100644 courses/C/beginner-level/Pointers/_category_.json delete mode 100644 courses/C/beginner-level/Pointers/pointer-to-pointer.md delete mode 100644 courses/C/beginner-level/Structure-and-unions/Intro.md delete mode 100644 courses/C/beginner-level/Structure-and-unions/Unions.md delete mode 100644 courses/C/beginner-level/Structure-and-unions/_category_.json delete mode 100644 courses/C/beginner-level/_category_.json delete mode 100644 courses/C/beginner-level/operators-and-expression/Operators.md delete mode 100644 courses/C/beginner-level/operators-and-expression/_category_.json delete mode 100644 courses/C/intermediate-level/ Preprocessor Directives/_category_.json delete mode 100644 courses/C/intermediate-level/ Preprocessor Directives/file-Inclusion.md delete mode 100644 courses/C/intermediate-level/ Preprocessor Directives/intro.md delete mode 100644 courses/C/intermediate-level/Advanced pointers/Function-pointer.md delete mode 100644 courses/C/intermediate-level/Advanced pointers/_category_.json delete mode 100644 courses/C/intermediate-level/Advanced pointers/dynamic-array-pointer.md delete mode 100644 courses/C/intermediate-level/Bitwise-Operators/_category_.json delete mode 100644 courses/C/intermediate-level/Dynamic-memory-allocation/Intro.md delete mode 100644 courses/C/intermediate-level/Dynamic-memory-allocation/_category_.json delete mode 100644 courses/C/intermediate-level/Dynamic-memory-allocation/memory.md delete mode 100644 courses/C/intermediate-level/Error-handling/_category_.json delete mode 100644 courses/C/intermediate-level/Error-handling/file-operation.md delete mode 100644 courses/C/intermediate-level/Error-handling/types.md delete mode 100644 courses/C/intermediate-level/File-Handling/_category_.json delete mode 100644 courses/C/intermediate-level/File-Handling/binary-files.md delete mode 100644 courses/C/intermediate-level/File-Handling/intro.md delete mode 100644 courses/C/intermediate-level/_category_.json delete mode 100644 courses/C/overview.md delete mode 100644 courses/HTML/Overview.md delete mode 100644 courses/HTML/_category_.json delete mode 100644 courses/HTML/advanced-level/Accessability/ARIA.md delete mode 100644 courses/HTML/advanced-level/Accessability/Forms-and-Navigation.md delete mode 100644 courses/HTML/advanced-level/Accessability/Principles.md delete mode 100644 courses/HTML/advanced-level/Accessability/_category_.json delete mode 100644 courses/HTML/advanced-level/HTML5-API/WebRTC.md delete mode 100644 courses/HTML/advanced-level/HTML5-API/WebSockets.md delete mode 100644 courses/HTML/advanced-level/HTML5-API/_category_.json delete mode 100644 courses/HTML/advanced-level/HTML5-API/server-send-events.md delete mode 100644 courses/HTML/advanced-level/Integration-With-JS/Dyanamic-Concept.md delete mode 100644 courses/HTML/advanced-level/Integration-With-JS/Frameworks.md delete mode 100644 courses/HTML/advanced-level/Integration-With-JS/JS-integration.md delete mode 100644 courses/HTML/advanced-level/Integration-With-JS/_category_.json delete mode 100644 courses/HTML/advanced-level/Performance/Lazy-Loading.md delete mode 100644 courses/HTML/advanced-level/Performance/Optimization.md delete mode 100644 courses/HTML/advanced-level/Performance/Reducing-render.md delete mode 100644 courses/HTML/advanced-level/Performance/_category_.json delete mode 100644 courses/HTML/advanced-level/Progressive-web-apps/Application-shell.md delete mode 100644 courses/HTML/advanced-level/Progressive-web-apps/Introduction.md delete mode 100644 courses/HTML/advanced-level/Progressive-web-apps/_category_.json delete mode 100644 courses/HTML/advanced-level/Progressive-web-apps/service.md delete mode 100644 courses/HTML/advanced-level/SEO/Meta-tags.md delete mode 100644 courses/HTML/advanced-level/SEO/On-page.md delete mode 100644 courses/HTML/advanced-level/SEO/Structured-Data.md delete mode 100644 courses/HTML/advanced-level/SEO/_category_.json delete mode 100644 courses/HTML/advanced-level/Web-Components/Custom-Elements.md delete mode 100644 courses/HTML/advanced-level/Web-Components/Imports.md delete mode 100644 courses/HTML/advanced-level/Web-Components/Introduction.md delete mode 100644 courses/HTML/advanced-level/Web-Components/Shadow-DOM.md delete mode 100644 courses/HTML/advanced-level/Web-Components/_category_.json delete mode 100644 courses/HTML/advanced-level/_category_.json delete mode 100644 courses/HTML/begginer-level/Entities/Common-Entities.md delete mode 100644 courses/HTML/begginer-level/Entities/Special-Characters.md delete mode 100644 courses/HTML/begginer-level/Entities/_category_.json delete mode 100644 courses/HTML/begginer-level/Forms-and-Input/Creating-Forms.md delete mode 100644 courses/HTML/begginer-level/Forms-and-Input/Form-Attributes-and-Validation.md delete mode 100644 courses/HTML/begginer-level/Forms-and-Input/Form-Elements.md delete mode 100644 courses/HTML/begginer-level/Forms-and-Input/_category_.json delete mode 100644 courses/HTML/begginer-level/Introduction-to-HTML/Basic Structure-of-an-HTML-Document.md delete mode 100644 courses/HTML/begginer-level/Introduction-to-HTML/Doctype Declaration.md delete mode 100644 courses/HTML/begginer-level/Introduction-to-HTML/HTML-Tags-and-Attributes.md delete mode 100644 courses/HTML/begginer-level/Introduction-to-HTML/What-is-HTML.md delete mode 100644 courses/HTML/begginer-level/Introduction-to-HTML/_category_.json delete mode 100644 courses/HTML/begginer-level/Links-and-Images/Creating-Hyperlinks.md delete mode 100644 courses/HTML/begginer-level/Links-and-Images/Embedding-Images-Attributes.md delete mode 100644 courses/HTML/begginer-level/Links-and-Images/Linking-to-Pages-and-Sections.md delete mode 100644 courses/HTML/begginer-level/Links-and-Images/_category_.json delete mode 100644 courses/HTML/begginer-level/Multimedia/Audio-Video-tags.md delete mode 100644 courses/HTML/begginer-level/Multimedia/Embedding-Audio-and-Video.md delete mode 100644 courses/HTML/begginer-level/Multimedia/_category_.json delete mode 100644 courses/HTML/begginer-level/Tables/Creating-Basic-Tables.md delete mode 100644 courses/HTML/begginer-level/Tables/Table-Rows-and_columns.md delete mode 100644 courses/HTML/begginer-level/Tables/Table-Tags.md delete mode 100644 courses/HTML/begginer-level/Tables/_category_.json delete mode 100644 courses/HTML/begginer-level/Text-formatting-and -Style/HeadingTags.md delete mode 100644 courses/HTML/begginer-level/Text-formatting-and -Style/ListsTags.md delete mode 100644 courses/HTML/begginer-level/Text-formatting-and -Style/Span-and-div.md delete mode 100644 courses/HTML/begginer-level/Text-formatting-and -Style/_category_.json delete mode 100644 courses/HTML/begginer-level/_category_.json delete mode 100644 courses/HTML/intermidiate-level/Advanced-Multimedia/Advanced-Audio.md delete mode 100644 courses/HTML/intermidiate-level/Advanced-Multimedia/Custom-Controls.md delete mode 100644 courses/HTML/intermidiate-level/Advanced-Multimedia/_category_.json delete mode 100644 courses/HTML/intermidiate-level/Canvas and SVG/Basic-Shapes.md delete mode 100644 courses/HTML/intermidiate-level/Canvas and SVG/Drawing-Graphics.md delete mode 100644 courses/HTML/intermidiate-level/Canvas and SVG/SVG .md delete mode 100644 courses/HTML/intermidiate-level/Canvas and SVG/_category_.json delete mode 100644 courses/HTML/intermidiate-level/Forms and Advanced Inputs/ Input-Types.md delete mode 100644 courses/HTML/intermidiate-level/Forms and Advanced Inputs/Accessable-Forms.md delete mode 100644 courses/HTML/intermidiate-level/Forms and Advanced Inputs/Form-validation.md delete mode 100644 courses/HTML/intermidiate-level/Forms and Advanced Inputs/_category_.json delete mode 100644 courses/HTML/intermidiate-level/Responsive-Design/Introduction.md delete mode 100644 courses/HTML/intermidiate-level/Responsive-Design/Media-Queries.md delete mode 100644 courses/HTML/intermidiate-level/Responsive-Design/Meta-Tags.md delete mode 100644 courses/HTML/intermidiate-level/Responsive-Design/_category_.json delete mode 100644 courses/HTML/intermidiate-level/Semantic Elements/Semantic-Elements.md delete mode 100644 courses/HTML/intermidiate-level/Semantic Elements/Semantic-Tags.md delete mode 100644 courses/HTML/intermidiate-level/Semantic Elements/_category_.json delete mode 100644 courses/HTML/intermidiate-level/Web-Storage/Introduction.md delete mode 100644 courses/HTML/intermidiate-level/Web-Storage/Storages.md delete mode 100644 courses/HTML/intermidiate-level/Web-Storage/_category_.json delete mode 100644 courses/HTML/intermidiate-level/_category_.json delete mode 100644 courses/MongoDB/Advanced Level/Backup-and-Restore/Cloud-Backup.md delete mode 100644 courses/MongoDB/Advanced Level/Backup-and-Restore/Introduction.md delete mode 100644 courses/MongoDB/Advanced Level/Backup-and-Restore/_category_.json delete mode 100644 courses/MongoDB/Advanced Level/Backup-and-Restore/mongodump.md delete mode 100644 courses/MongoDB/Advanced Level/Data-Modeling/Introduction.md delete mode 100644 courses/MongoDB/Advanced Level/Data-Modeling/Patterns.md delete mode 100644 courses/MongoDB/Advanced Level/Data-Modeling/_category_.json delete mode 100644 courses/MongoDB/Advanced Level/Monitoring-and-Management/Atlas.md delete mode 100644 courses/MongoDB/Advanced Level/Monitoring-and-Management/Automated.md delete mode 100644 courses/MongoDB/Advanced Level/Monitoring-and-Management/Log-analysis.md delete mode 100644 courses/MongoDB/Advanced Level/Monitoring-and-Management/Monitoring.md delete mode 100644 courses/MongoDB/Advanced Level/Monitoring-and-Management/_category_.json delete mode 100644 courses/MongoDB/Advanced Level/Transactions/ACID.md delete mode 100644 courses/MongoDB/Advanced Level/Transactions/Example.md delete mode 100644 courses/MongoDB/Advanced Level/Transactions/_category_.json delete mode 100644 courses/MongoDB/Advanced Level/Transactions/multi-documents.md delete mode 100644 courses/MongoDB/Advanced Level/_categoty_.json delete mode 100644 courses/MongoDB/Advanced Level/microservices/Handling.md delete mode 100644 courses/MongoDB/Advanced Level/microservices/Integration.md delete mode 100644 courses/MongoDB/Advanced Level/microservices/_category_.json delete mode 100644 courses/MongoDB/Advanced Level/microservices/event-Store.md delete mode 100644 courses/MongoDB/Overview.md delete mode 100644 courses/MongoDB/_category_.json delete mode 100644 courses/MongoDB/beginner-level/Basics/CRUD.md delete mode 100644 courses/MongoDB/beginner-level/Basics/JSON-and-BSON.md delete mode 100644 courses/MongoDB/beginner-level/Basics/MongoDB-Compass.md delete mode 100644 courses/MongoDB/beginner-level/Basics/UnderStanding.md delete mode 100644 courses/MongoDB/beginner-level/Basics/_category_.json delete mode 100644 courses/MongoDB/beginner-level/Drivers/CRUD.md delete mode 100644 courses/MongoDB/beginner-level/Drivers/Introduction.md delete mode 100644 courses/MongoDB/beginner-level/Drivers/NodeJS-Driver.md delete mode 100644 courses/MongoDB/beginner-level/Drivers/_category_.json delete mode 100644 courses/MongoDB/beginner-level/Framework/Introduction.md delete mode 100644 courses/MongoDB/beginner-level/Framework/Operators.md delete mode 100644 courses/MongoDB/beginner-level/Framework/_category_.json delete mode 100644 courses/MongoDB/beginner-level/Indexes/Component-Index.md delete mode 100644 courses/MongoDB/beginner-level/Indexes/Introduction.md delete mode 100644 courses/MongoDB/beginner-level/Indexes/_category_.json delete mode 100644 courses/MongoDB/beginner-level/Indexes/creating-index.md delete mode 100644 courses/MongoDB/beginner-level/Introduction/Difference-SQL-&-NOSQL.md delete mode 100644 courses/MongoDB/beginner-level/Introduction/Introduction.md delete mode 100644 courses/MongoDB/beginner-level/Introduction/Setup.md delete mode 100644 courses/MongoDB/beginner-level/Introduction/_category_.json delete mode 100644 courses/MongoDB/beginner-level/Schema-and-Modeling/Data-Types.md delete mode 100644 courses/MongoDB/beginner-level/Schema-and-Modeling/Embedding-vs-refernce.md delete mode 100644 courses/MongoDB/beginner-level/Schema-and-Modeling/Introductions.md delete mode 100644 courses/MongoDB/beginner-level/Schema-and-Modeling/Schema-Design.md delete mode 100644 courses/MongoDB/beginner-level/Schema-and-Modeling/_category_.json delete mode 100644 courses/MongoDB/beginner-level/Shell/Commands.md delete mode 100644 courses/MongoDB/beginner-level/Shell/Introduction.md delete mode 100644 courses/MongoDB/beginner-level/Shell/_category_.json delete mode 100644 courses/MongoDB/beginner-level/_category_.json delete mode 100644 courses/MongoDB/intermediate-Level/Advanced-Aggregation/Arrays.md delete mode 100644 courses/MongoDB/intermediate-Level/Advanced-Aggregation/Operators.md delete mode 100644 courses/MongoDB/intermediate-Level/Advanced-Aggregation/Transformation.md delete mode 100644 courses/MongoDB/intermediate-Level/Advanced-Aggregation/_category_.json delete mode 100644 courses/MongoDB/intermediate-Level/Data-Validation/Schema-validation.md delete mode 100644 courses/MongoDB/intermediate-Level/Data-Validation/Validation.md delete mode 100644 courses/MongoDB/intermediate-Level/Data-Validation/_category_.json delete mode 100644 courses/MongoDB/intermediate-Level/Data-Validation/schema-rules.md delete mode 100644 courses/MongoDB/intermediate-Level/Replication/Failover.md delete mode 100644 courses/MongoDB/intermediate-Level/Replication/Introduction.md delete mode 100644 courses/MongoDB/intermediate-Level/Replication/_category_.json delete mode 100644 courses/MongoDB/intermediate-Level/Replication/roles.md delete mode 100644 courses/MongoDB/intermediate-Level/Security/Authentication.md delete mode 100644 courses/MongoDB/intermediate-Level/Security/RBAC.md delete mode 100644 courses/MongoDB/intermediate-Level/Security/_category_.json delete mode 100644 courses/MongoDB/intermediate-Level/Sharding/Balancing-Data.md delete mode 100644 courses/MongoDB/intermediate-Level/Sharding/Introduction.md delete mode 100644 courses/MongoDB/intermediate-Level/Sharding/Shared-Keys.md delete mode 100644 courses/MongoDB/intermediate-Level/Sharding/_category_.json delete mode 100644 courses/MongoDB/intermediate-Level/_category_.json delete mode 100644 courses/MongoDB/intermediate-Level/querying/QUery-concepts.md delete mode 100644 courses/MongoDB/intermediate-Level/querying/Query-operators.md delete mode 100644 courses/MongoDB/intermediate-Level/querying/_category_.json delete mode 100644 courses/Next.Js/Intermediate-level/Authentication/Implement-Auth.md delete mode 100644 courses/Next.Js/Intermediate-level/Authentication/JWT.md delete mode 100644 courses/Next.Js/Intermediate-level/Authentication/Role-based.md delete mode 100644 courses/Next.Js/Intermediate-level/Authentication/_category_.json delete mode 100644 courses/Next.Js/Intermediate-level/Authentication/protection-Routes.md delete mode 100644 courses/Next.Js/Intermediate-level/Data-Fetching/GraphQl.md delete mode 100644 courses/Next.Js/Intermediate-level/Data-Fetching/Handling.md delete mode 100644 courses/Next.Js/Intermediate-level/Data-Fetching/SWR.md delete mode 100644 courses/Next.Js/Intermediate-level/Data-Fetching/_category_.json delete mode 100644 courses/Next.Js/Intermediate-level/Data-Fetching/fetching-Data.md delete mode 100644 courses/Next.Js/Intermediate-level/Internationalization/Handling-dynamic.md delete mode 100644 courses/Next.Js/Intermediate-level/Internationalization/Introduction.md delete mode 100644 courses/Next.Js/Intermediate-level/Internationalization/Loading-and-Managing.md delete mode 100644 courses/Next.Js/Intermediate-level/Internationalization/_category_.json delete mode 100644 courses/Next.Js/Intermediate-level/Middleware/Introduction.md delete mode 100644 courses/Next.Js/Intermediate-level/Middleware/Middleware-concept.md delete mode 100644 courses/Next.Js/Intermediate-level/Middleware/_category_.json delete mode 100644 courses/Next.Js/Intermediate-level/Middleware/routing-tech.md delete mode 100644 courses/Next.Js/Intermediate-level/_category_.json delete mode 100644 courses/Next.Js/Overview.md delete mode 100644 courses/Next.Js/_category_.json delete mode 100644 courses/Next.Js/advance-level/Advance-Routing/Customizing.md delete mode 100644 courses/Next.Js/advance-level/Advance-Routing/Dynamic-Route.md delete mode 100644 courses/Next.Js/advance-level/Advance-Routing/_category_.json delete mode 100644 courses/Next.Js/advance-level/Advance-data-fetching/_category_.json delete mode 100644 courses/Next.Js/advance-level/Advance-data-fetching/dynamic-generation.md delete mode 100644 courses/Next.Js/advance-level/Advance-data-fetching/static-generation.md delete mode 100644 courses/Next.Js/advance-level/Advance-server-side-render/SSR.md delete mode 100644 courses/Next.Js/advance-level/Advance-server-side-render/_category_.json delete mode 100644 courses/Next.Js/advance-level/Advance-server-side-render/customize.md delete mode 100644 courses/Next.Js/advance-level/GraphQL/Introduction.md delete mode 100644 courses/Next.Js/advance-level/GraphQL/_category_.json delete mode 100644 courses/Next.Js/advance-level/GraphQL/apollo-client.md delete mode 100644 courses/Next.Js/advance-level/_category_.json delete mode 100644 courses/Next.Js/beginner-level/Introduction/Frameworks.md delete mode 100644 courses/Next.Js/beginner-level/Introduction/_category_.json delete mode 100644 courses/Next.Js/beginner-level/Introduction/introduction.md delete mode 100644 courses/Next.Js/beginner-level/Introduction/settingUp.md delete mode 100644 courses/Next.Js/beginner-level/Pages-and-routing/FIlebase-Routing.md delete mode 100644 courses/Next.Js/beginner-level/Pages-and-routing/_category_.json delete mode 100644 courses/Next.Js/beginner-level/Pages-and-routing/creating-pages.md delete mode 100644 courses/Next.Js/beginner-level/Routes/Database.md delete mode 100644 courses/Next.Js/beginner-level/Routes/Introduction.md delete mode 100644 courses/Next.Js/beginner-level/Routes/_category_.json delete mode 100644 courses/Next.Js/beginner-level/Started/Running-development.md delete mode 100644 courses/Next.Js/beginner-level/Started/_category_.json delete mode 100644 courses/Next.Js/beginner-level/Started/creating-project.md delete mode 100644 courses/Next.Js/beginner-level/Styling/Libraries.md delete mode 100644 courses/Next.Js/beginner-level/Styling/_category_.json delete mode 100644 courses/Next.Js/beginner-level/Styling/css-styling.md delete mode 100644 courses/Next.Js/beginner-level/_category_.json delete mode 100644 courses/Next.Js/beginner-level/static-and-serverSide/_category_.json delete mode 100644 courses/Next.Js/beginner-level/static-and-serverSide/concept.md delete mode 100644 courses/Next.Js/beginner-level/static-and-serverSide/introduction.md delete mode 100644 courses/React Native/Overview.md delete mode 100644 courses/React Native/_category_.json delete mode 100644 courses/React Native/advanced-level/ Offline Capabilities and Data Storage/Handling-background.md delete mode 100644 courses/React Native/advanced-level/ Offline Capabilities and Data Storage/Implement.md delete mode 100644 courses/React Native/advanced-level/ Offline Capabilities and Data Storage/Syncing-data.md delete mode 100644 courses/React Native/advanced-level/ Offline Capabilities and Data Storage/_category_.json delete mode 100644 courses/React Native/advanced-level/Advanced Native/_category_.json delete mode 100644 courses/React Native/advanced-level/Advanced Native/complex-native-module.md delete mode 100644 courses/React Native/advanced-level/Advanced Native/library-sdk.md delete mode 100644 courses/React Native/advanced-level/Advanced Native/platform-specific.md delete mode 100644 courses/React Native/advanced-level/Building-deploying/CI-CD.md delete mode 100644 courses/React Native/advanced-level/Building-deploying/_category_.json delete mode 100644 courses/React Native/advanced-level/Building-deploying/build-android-ios.md delete mode 100644 courses/React Native/advanced-level/Building-deploying/publish-stores.md delete mode 100644 courses/React Native/advanced-level/Building-deploying/updates-and-versions.md delete mode 100644 courses/React Native/advanced-level/Managing App State/Advanced-state-management.md delete mode 100644 courses/React Native/advanced-level/Managing App State/Handling-app-state.md delete mode 100644 courses/React Native/advanced-level/Managing App State/_category_.json delete mode 100644 courses/React Native/advanced-level/_category_.json delete mode 100644 courses/React Native/beginner-level/Handling-user-input/TouchableOpacity.md delete mode 100644 courses/React Native/beginner-level/Handling-user-input/_category_.json delete mode 100644 courses/React Native/beginner-level/Handling-user-input/textInput.md delete mode 100644 courses/React Native/beginner-level/Introduction/_category_.json delete mode 100644 courses/React Native/beginner-level/Introduction/intro.md delete mode 100644 courses/React Native/beginner-level/Introduction/setting-up.md delete mode 100644 courses/React Native/beginner-level/Navigation/Introduction.md delete mode 100644 courses/React Native/beginner-level/Navigation/_category_.json delete mode 100644 courses/React Native/beginner-level/Navigation/passing-parameter.md delete mode 100644 courses/React Native/beginner-level/Network-Data-Fetching/Fetching.md delete mode 100644 courses/React Native/beginner-level/Network-Data-Fetching/_category_.json delete mode 100644 courses/React Native/beginner-level/Network-Data-Fetching/display-data.md delete mode 100644 courses/React Native/beginner-level/_category_.json delete mode 100644 courses/React Native/beginner-level/basic-component/_category_.json delete mode 100644 courses/React Native/beginner-level/basic-component/components.md delete mode 100644 courses/React Native/beginner-level/basic-component/styles.md delete mode 100644 courses/React Native/beginner-level/platform-specific/_category_.json delete mode 100644 courses/React Native/beginner-level/platform-specific/handling-screens.md delete mode 100644 courses/React Native/beginner-level/platform-specific/using-specific-code.md delete mode 100644 courses/React Native/beginner-level/state-management/Introduction.md delete mode 100644 courses/React Native/beginner-level/state-management/_category_.json delete mode 100644 courses/React Native/beginner-level/state-management/state-management.md delete mode 100644 courses/React Native/intermediate-level/Advanced-Components/_category_.json delete mode 100644 courses/React Native/intermediate-level/Advanced-Components/creating-components.md delete mode 100644 courses/React Native/intermediate-level/Advanced-Components/libraries.md delete mode 100644 courses/React Native/intermediate-level/Advanced-Navigation/Handling-keep.md delete mode 100644 courses/React Native/intermediate-level/Advanced-Navigation/Implement.md delete mode 100644 courses/React Native/intermediate-level/Advanced-Navigation/_category_.json delete mode 100644 courses/React Native/intermediate-level/Animations/Gesture.md delete mode 100644 courses/React Native/intermediate-level/Animations/Introduction.md delete mode 100644 courses/React Native/intermediate-level/Animations/_category_.json delete mode 100644 courses/React Native/intermediate-level/Native-modules/Introduction.md delete mode 100644 courses/React Native/intermediate-level/Native-modules/_category_.json delete mode 100644 courses/React Native/intermediate-level/Native-modules/custom-native-module.md delete mode 100644 courses/React Native/intermediate-level/State-management/_category_.json delete mode 100644 courses/React Native/intermediate-level/State-management/async-operation.md delete mode 100644 courses/React Native/intermediate-level/State-management/introduction.md delete mode 100644 courses/React Native/intermediate-level/Working with External Libraries/Integration.md delete mode 100644 courses/React Native/intermediate-level/Working with External Libraries/Managing-lib.md delete mode 100644 courses/React Native/intermediate-level/Working with External Libraries/_category_.json delete mode 100644 courses/React Native/intermediate-level/_category_.json delete mode 100644 courses/Ruby/Overview.md delete mode 100644 courses/Ruby/_category_.json delete mode 100644 courses/Ruby/advanced-level/Advance-File-Handling/_category_.json delete mode 100644 courses/Ruby/advanced-level/Advance-File-Handling/large-Files.md delete mode 100644 courses/Ruby/advanced-level/Advance-File-Handling/memory-mapped.md delete mode 100644 courses/Ruby/advanced-level/Advanced-metaprogramming/DSLs.md delete mode 100644 courses/Ruby/advanced-level/Advanced-metaprogramming/Singleton.md delete mode 100644 courses/Ruby/advanced-level/Advanced-metaprogramming/_category_.json delete mode 100644 courses/Ruby/advanced-level/Concurrency and Parallelism/Intro.md delete mode 100644 courses/Ruby/advanced-level/Concurrency and Parallelism/_category_.json delete mode 100644 courses/Ruby/advanced-level/Concurrency and Parallelism/synchronization.md delete mode 100644 courses/Ruby/advanced-level/Network-programming/_category_.json delete mode 100644 courses/Ruby/advanced-level/Network-programming/client-server.md delete mode 100644 courses/Ruby/advanced-level/Network-programming/into.md delete mode 100644 courses/Ruby/advanced-level/Ruby on Rails/Introduction.md delete mode 100644 courses/Ruby/advanced-level/Ruby on Rails/_category_.json delete mode 100644 courses/Ruby/advanced-level/Ruby on Rails/mvc.md delete mode 100644 courses/Ruby/advanced-level/_category_.json delete mode 100644 courses/Ruby/beginner-level/Arrays and Hashes/Arrays.md delete mode 100644 courses/Ruby/beginner-level/Arrays and Hashes/_category_.json delete mode 100644 courses/Ruby/beginner-level/Arrays and Hashes/hashes.md delete mode 100644 courses/Ruby/beginner-level/Basic-syntax/Basic-syntax.md delete mode 100644 courses/Ruby/beginner-level/Basic-syntax/_category_.json delete mode 100644 courses/Ruby/beginner-level/Basic-syntax/constants.md delete mode 100644 courses/Ruby/beginner-level/Control-Strucutre/Loops.md delete mode 100644 courses/Ruby/beginner-level/Control-Strucutre/_category_.json delete mode 100644 courses/Ruby/beginner-level/Control-Strucutre/statements.md delete mode 100644 courses/Ruby/beginner-level/Function-and-methods/Category_.json delete mode 100644 courses/Ruby/beginner-level/Function-and-methods/arguments.md delete mode 100644 courses/Ruby/beginner-level/Function-and-methods/define-methods.md delete mode 100644 courses/Ruby/beginner-level/Introduction/_category_.json delete mode 100644 courses/Ruby/beginner-level/Introduction/setup.md delete mode 100644 courses/Ruby/beginner-level/Introduction/what-is-ruby.md delete mode 100644 courses/Ruby/beginner-level/Strings/_category_.json delete mode 100644 courses/Ruby/beginner-level/Strings/concepts.md delete mode 100644 courses/Ruby/beginner-level/_category_.json delete mode 100644 courses/Ruby/intermediate-level/Enumerables-and-Iteration/_category_.json delete mode 100644 courses/Ruby/intermediate-level/Enumerables-and-Iteration/custom-iterations.md delete mode 100644 courses/Ruby/intermediate-level/Enumerables-and-Iteration/working-with-Enumerables.md delete mode 100644 courses/Ruby/intermediate-level/Gems-and-builder/_category_.json delete mode 100644 courses/Ruby/intermediate-level/Gems-and-builder/intro.md delete mode 100644 courses/Ruby/intermediate-level/Gems-and-builder/publishing.md delete mode 100644 courses/Ruby/intermediate-level/OOPS/_category_.json delete mode 100644 courses/Ruby/intermediate-level/OOPS/concepts.md delete mode 100644 courses/Ruby/intermediate-level/_category_.json delete mode 100644 courses/Ruby/intermediate-level/metaprogramming/Dynamic-method.md delete mode 100644 courses/Ruby/intermediate-level/metaprogramming/_category_.json delete mode 100644 courses/Ruby/intermediate-level/metaprogramming/intro.md delete mode 100644 courses/Ruby/intermediate-level/working-with-API/JSON-and-XML.md delete mode 100644 courses/Ruby/intermediate-level/working-with-API/_category_.json delete mode 100644 courses/Ruby/intermediate-level/working-with-API/http.md delete mode 100644 courses/php/Overview.md delete mode 100644 courses/php/_category_.json delete mode 100644 courses/php/advance-level/Advance-Database-iteration/NOSQL.md delete mode 100644 courses/php/advance-level/Advance-Database-iteration/SQL.md delete mode 100644 courses/php/advance-level/Advance-Database-iteration/_category_.json delete mode 100644 courses/php/advance-level/Advanced-array/Advanced-array-fun.md delete mode 100644 courses/php/advance-level/Advanced-array/_category_.json delete mode 100644 courses/php/advance-level/Advanced-oops/Advance-opps.md delete mode 100644 courses/php/advance-level/Advanced-oops/Static-topics.md delete mode 100644 courses/php/advance-level/Advanced-oops/_category_.json delete mode 100644 courses/php/advance-level/Web-Services/Rest-Api.md delete mode 100644 courses/php/advance-level/Web-Services/SOAP.md delete mode 100644 courses/php/advance-level/Web-Services/_category_.json delete mode 100644 courses/php/advance-level/_category_.json delete mode 100644 courses/php/advance-level/php-framworks/Intro.md delete mode 100644 courses/php/advance-level/php-framworks/_category_.json delete mode 100644 courses/php/advance-level/php-framworks/mvc.md delete mode 100644 courses/php/beginner-level/Array-and-Strings/Array.md delete mode 100644 courses/php/beginner-level/Array-and-Strings/String.md delete mode 100644 courses/php/beginner-level/Array-and-Strings/_category_.json delete mode 100644 courses/php/beginner-level/Basic Syntax/_category_.json delete mode 100644 courses/php/beginner-level/Basic Syntax/operators.md delete mode 100644 courses/php/beginner-level/Basic Syntax/tags.md delete mode 100644 courses/php/beginner-level/Control-Strucures/Loops.md delete mode 100644 courses/php/beginner-level/Control-Strucures/_category_.json delete mode 100644 courses/php/beginner-level/Control-Strucures/statements.md delete mode 100644 courses/php/beginner-level/Forms and Input/Forms.md delete mode 100644 courses/php/beginner-level/Forms and Input/_category_.json delete mode 100644 courses/php/beginner-level/Forms and Input/validation.md delete mode 100644 courses/php/beginner-level/Functions/_category_.json delete mode 100644 courses/php/beginner-level/Functions/intro.md delete mode 100644 courses/php/beginner-level/Functions/scope.md delete mode 100644 courses/php/beginner-level/Introduction/Intro.md delete mode 100644 courses/php/beginner-level/Introduction/_category_.json delete mode 100644 courses/php/beginner-level/Introduction/setting-up.md delete mode 100644 courses/php/beginner-level/_category_.json delete mode 100644 courses/php/beginner-level/file-handling/_category_.json delete mode 100644 courses/php/beginner-level/file-handling/handling-function.md delete mode 100644 courses/php/beginner-level/file-handling/read-and-write.md delete mode 100644 courses/php/intermediate-level/Error-Handling/_category_.json delete mode 100644 courses/php/intermediate-level/Error-Handling/custom-error.md delete mode 100644 courses/php/intermediate-level/Error-Handling/types.md delete mode 100644 courses/php/intermediate-level/XML-and-JSON/JSON.md delete mode 100644 courses/php/intermediate-level/XML-and-JSON/XML.md delete mode 100644 courses/php/intermediate-level/XML-and-JSON/_category_.json delete mode 100644 courses/php/intermediate-level/_category_.json delete mode 100644 courses/php/intermediate-level/mail-handling/PHP-mailer.md delete mode 100644 courses/php/intermediate-level/mail-handling/_category_.json delete mode 100644 courses/php/intermediate-level/mail-handling/send-mail.md delete mode 100644 courses/php/intermediate-level/oops/_category_.json delete mode 100644 courses/php/intermediate-level/oops/intro-and-concepts.md delete mode 100644 courses/php/intermediate-level/session-and-cookies/Cookies.md delete mode 100644 courses/php/intermediate-level/session-and-cookies/Intro.md delete mode 100644 courses/php/intermediate-level/session-and-cookies/_category_.json delete mode 100644 courses/tailwindCSS/Overview.md delete mode 100644 courses/tailwindCSS/_category_.json delete mode 100644 courses/tailwindCSS/advance-level/Advanced-Animations/Complex-Animations.md delete mode 100644 courses/tailwindCSS/advance-level/Advanced-Animations/KeyFrames-and-Animations.md delete mode 100644 courses/tailwindCSS/advance-level/Advanced-Animations/_category_.json delete mode 100644 courses/tailwindCSS/advance-level/Advanced-Animations/animations-and-transitions.md delete mode 100644 courses/tailwindCSS/advance-level/Advanced-Configuration/Advance-Customizing.md delete mode 100644 courses/tailwindCSS/advance-level/Advanced-Configuration/Custom-Classes.md delete mode 100644 courses/tailwindCSS/advance-level/Advanced-Configuration/Deep-Divide.md delete mode 100644 courses/tailwindCSS/advance-level/Advanced-Configuration/_category_.json delete mode 100644 courses/tailwindCSS/advance-level/Dynamic-States/Conditional-styling.md delete mode 100644 courses/tailwindCSS/advance-level/Dynamic-States/Dynamic-class.md delete mode 100644 courses/tailwindCSS/advance-level/Dynamic-States/Integration-with-js.md delete mode 100644 courses/tailwindCSS/advance-level/Dynamic-States/_category_.json delete mode 100644 courses/tailwindCSS/advance-level/Frameworks/Angular.md delete mode 100644 courses/tailwindCSS/advance-level/Frameworks/React.md delete mode 100644 courses/tailwindCSS/advance-level/Frameworks/Vue.md delete mode 100644 courses/tailwindCSS/advance-level/Frameworks/_category_.json delete mode 100644 courses/tailwindCSS/advance-level/State-Varients/Sibiling-varients.md delete mode 100644 courses/tailwindCSS/advance-level/State-Varients/State-varients.md delete mode 100644 courses/tailwindCSS/advance-level/State-Varients/_category_.json delete mode 100644 courses/tailwindCSS/advance-level/State-Varients/multiple-state-varient.md delete mode 100644 courses/tailwindCSS/advance-level/_category_.json delete mode 100644 courses/tailwindCSS/begginner-level/Backgrounds/Borders.md delete mode 100644 courses/tailwindCSS/begginner-level/Backgrounds/Cornors.md delete mode 100644 courses/tailwindCSS/begginner-level/Backgrounds/Gradient.md delete mode 100644 courses/tailwindCSS/begginner-level/Backgrounds/_category_.json delete mode 100644 courses/tailwindCSS/begginner-level/Backgrounds/color-image.md delete mode 100644 courses/tailwindCSS/begginner-level/Customizing/Custom-colors-and-fonts.md delete mode 100644 courses/tailwindCSS/begginner-level/Customizing/_category_.json delete mode 100644 courses/tailwindCSS/begginner-level/Customizing/configuration-file.md delete mode 100644 courses/tailwindCSS/begginner-level/Customizing/default-theme.md delete mode 100644 courses/tailwindCSS/begginner-level/Introduction/Basic-structure.md delete mode 100644 courses/tailwindCSS/begginner-level/Introduction/Installing.md delete mode 100644 courses/tailwindCSS/begginner-level/Introduction/_category_.json delete mode 100644 courses/tailwindCSS/begginner-level/Introduction/what-is-tailwindCss.md delete mode 100644 courses/tailwindCSS/begginner-level/Layouts/Flex-box.md delete mode 100644 courses/tailwindCSS/begginner-level/Layouts/_category_.json delete mode 100644 courses/tailwindCSS/begginner-level/Layouts/grid.md delete mode 100644 courses/tailwindCSS/begginner-level/Responsive-Design/Layouts.md delete mode 100644 courses/tailwindCSS/begginner-level/Responsive-Design/_category_.json delete mode 100644 courses/tailwindCSS/begginner-level/Responsive-Design/mediaQueries.md delete mode 100644 courses/tailwindCSS/begginner-level/Spacing-and-sizing/_category_.json delete mode 100644 courses/tailwindCSS/begginner-level/Spacing-and-sizing/height-width.md delete mode 100644 courses/tailwindCSS/begginner-level/Spacing-and-sizing/margin-Padding.md delete mode 100644 courses/tailwindCSS/begginner-level/Text-And-Typography/Introduction.md delete mode 100644 courses/tailwindCSS/begginner-level/Text-And-Typography/Text-alignment.md delete mode 100644 courses/tailwindCSS/begginner-level/Text-And-Typography/Text-line-height.md delete mode 100644 courses/tailwindCSS/begginner-level/Text-And-Typography/Text.md delete mode 100644 courses/tailwindCSS/begginner-level/Text-And-Typography/_category_.json delete mode 100644 courses/tailwindCSS/begginner-level/Utility-First-Concept/Combining.md delete mode 100644 courses/tailwindCSS/begginner-level/Utility-First-Concept/Understanding-utility-classes.md delete mode 100644 courses/tailwindCSS/begginner-level/Utility-First-Concept/_category_.json delete mode 100644 courses/tailwindCSS/begginner-level/_category_.json delete mode 100644 courses/tailwindCSS/intermediate-level/Component-Design/Accesible.md delete mode 100644 courses/tailwindCSS/intermediate-level/Component-Design/_category_.json delete mode 100644 courses/tailwindCSS/intermediate-level/Component-Design/libraries.md delete mode 100644 courses/tailwindCSS/intermediate-level/Component-Design/reusable-Component.md delete mode 100644 courses/tailwindCSS/intermediate-level/Custom-Directives/CSS-plugin.md delete mode 100644 courses/tailwindCSS/intermediate-level/Custom-Directives/Custom-plugin.md delete mode 100644 courses/tailwindCSS/intermediate-level/Custom-Directives/_category_.json delete mode 100644 courses/tailwindCSS/intermediate-level/Custom-Directives/custom-Directives.md delete mode 100644 courses/tailwindCSS/intermediate-level/Dark-mode-theming/Dark-mode.md delete mode 100644 courses/tailwindCSS/intermediate-level/Dark-mode-theming/Switch-theme.md delete mode 100644 courses/tailwindCSS/intermediate-level/Dark-mode-theming/_category_.json delete mode 100644 courses/tailwindCSS/intermediate-level/Dark-mode-theming/custom-theme.md delete mode 100644 courses/tailwindCSS/intermediate-level/Forms-and-inputs/Customizing-Form.md delete mode 100644 courses/tailwindCSS/intermediate-level/Forms-and-inputs/Handling-Form-Validate.md delete mode 100644 courses/tailwindCSS/intermediate-level/Forms-and-inputs/_category_.json delete mode 100644 courses/tailwindCSS/intermediate-level/Forms-and-inputs/styling-Form.md delete mode 100644 courses/tailwindCSS/intermediate-level/Interactivity-and-transitions/ActiveStates.md delete mode 100644 courses/tailwindCSS/intermediate-level/Interactivity-and-transitions/Animations.md delete mode 100644 courses/tailwindCSS/intermediate-level/Interactivity-and-transitions/Transition.md delete mode 100644 courses/tailwindCSS/intermediate-level/Interactivity-and-transitions/_category_.json delete mode 100644 courses/tailwindCSS/intermediate-level/Layout/_category_.json delete mode 100644 courses/tailwindCSS/intermediate-level/Layout/flexBox.md delete mode 100644 courses/tailwindCSS/intermediate-level/Layout/grid.md delete mode 100644 courses/tailwindCSS/intermediate-level/Layout/position.md delete mode 100644 courses/tailwindCSS/intermediate-level/_category_.json delete mode 100644 dsa-solutions/gfg-solutions/Easy problems/Missing-In-Array.md rename dsa-solutions/gfg-solutions/Easy problems/{determine-if-two-trees-are-identical => determine-if-two-trees-are-identical.md} (99%) rename dsa-solutions/gfg-solutions/Easy problems/{find-duplicates-in-an-array => find-duplicates-in-an-array.md} (100%) rename dsa-solutions/gfg-solutions/Easy problems/{floor-in-a-sorted-array-1587115620 => floor-in-a-sorted-array.md} (99%) diff --git a/courses/Angular/Advance-level/Advanced-Forms/Dynamic.md b/courses/Angular/Advance-level/Advanced-Forms/Dynamic.md deleted file mode 100644 index 716a62601..000000000 --- a/courses/Angular/Advance-level/Advanced-Forms/Dynamic.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -id: lesson-1 -title: "Advanced Forms in Angular" -sidebar_label: Advanced Forms -sidebar_position: 1 -description: "Advanced Forms in Angular" -tags: [courses,Advanced-level,Form,Introduction] ---- - -Angular's reactive forms provide powerful tools for creating complex form structures and handling user input efficiently. Here are some advanced concepts you can leverage in Angular forms. - -#### Dynamic Forms - -Dynamic forms allow you to create forms whose structure can change at runtime based on user actions or external data. - -1. **Creating Dynamic Forms**: - ```typescript - import { FormBuilder, FormGroup, FormArray } from '@angular/forms'; - import { Component } from '@angular/core'; - - @Component({ - selector: 'app-dynamic-form', - templateUrl: './dynamic-form.component.html', - }) - export class DynamicFormComponent { - form: FormGroup; - - constructor(private fb: FormBuilder) { - this.form = this.fb.group({ - items: this.fb.array([]) - }); - } - - get items(): FormArray { - return this.form.get('items') as FormArray; - } - - addItem() { - const item = this.fb.control(''); - this.items.push(item); - } - - removeItem(index: number) { - this.items.removeAt(index); - } - } - ``` - -2. **Dynamic Form Template**: - ```html -
-
-
- - -
-
- -
- ``` diff --git a/courses/Angular/Advance-level/Advanced-Forms/Form-Control.md b/courses/Angular/Advance-level/Advanced-Forms/Form-Control.md deleted file mode 100644 index b6959f7bb..000000000 --- a/courses/Angular/Advance-level/Advanced-Forms/Form-Control.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -id: lesson-2 -title: "Custom Form Controls" -sidebar_label: Form Controls -sidebar_position: 2 -description: "Custom Form Controls" -tags: [courses,Advanced-level,Form Controls,Introduction] ---- - - - -Creating custom form controls allows you to encapsulate complex form logic and UI in reusable components. - -1. **Creating a Custom Control**: - ```typescript - import { Component, forwardRef } from '@angular/core'; - import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; - - @Component({ - selector: 'app-custom-input', - template: ``, - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => CustomInputComponent), - multi: true - } - ] - }) - export class CustomInputComponent implements ControlValueAccessor { - value: string; - - onChange = (value: string) => {}; - onTouched = () => {}; - - writeValue(value: string): void { - this.value = value; - } - - registerOnChange(fn: any): void { - this.onChange = fn; - } - - registerOnTouched(fn: any): void { - this.onTouched = fn; - } - } - ``` - -2. **Using Custom Control in a Form**: - ```html -
- -
- ``` diff --git a/courses/Angular/Advance-level/Advanced-Forms/Form-arrays.md b/courses/Angular/Advance-level/Advanced-Forms/Form-arrays.md deleted file mode 100644 index 80b46b93b..000000000 --- a/courses/Angular/Advance-level/Advanced-Forms/Form-arrays.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -id: lesson-3 -title: "Form Arrays" -sidebar_label: Async -sidebar_position: 3 -description: "Form Arrays" -tags: [courses,Advanced-level,Form Arrays,Introduction] ---- - - -Form arrays are used to manage an array of form controls or groups, allowing you to build complex forms. - -1. **Creating a Form Array**: - ```typescript - import { FormArray, FormGroup, FormBuilder } from '@angular/forms'; - - this.form = this.fb.group({ - users: this.fb.array([ - this.fb.group({ name: '', age: '' }), - this.fb.group({ name: '', age: '' }) - ]) - }); - ``` - -2. **Template for Form Array**: - ```html -
-
-
-
- - -
-
-
-
- ``` diff --git a/courses/Angular/Advance-level/Advanced-Forms/Form-validation.md b/courses/Angular/Advance-level/Advanced-Forms/Form-validation.md deleted file mode 100644 index b2870f868..000000000 --- a/courses/Angular/Advance-level/Advanced-Forms/Form-validation.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -id: lesson-4 -title: "Advanced Form Validation" -sidebar_label: Form Validation -sidebar_position: 4 -description: "Advanced Form Validation" -tags: [courses,Advanced-level,Form Validation,Introduction] ---- - - - -Advanced validation techniques allow you to implement complex validation rules for your forms. - -1. **Custom Validators**: - ```typescript - import { AbstractControl, ValidatorFn } from '@angular/forms'; - - export function ageValidator(min: number): ValidatorFn { - return (control: AbstractControl): { [key: string]: any } | null => { - const valid = control.value >= min; - return valid ? null : { 'ageInvalid': { value: control.value } }; - }; - } - ``` - -2. **Using Custom Validators**: - ```typescript - this.form = this.fb.group({ - age: ['', [Validators.required, ageValidator(18)]] - }); - ``` - -3. **Asynchronous Validators**: - Asynchronous validators are useful for checking values against a remote server. - ```typescript - import { Observable, of } from 'rxjs'; - import { delay } from 'rxjs/operators'; - - export function usernameValidator(): AsyncValidatorFn { - return (control: AbstractControl): Observable => { - const forbidden = control.value === 'admin'; - return of(forbidden ? { 'usernameForbidden': { value: control.value } } : null).pipe(delay(1000)); - }; - } - ``` - -4. **Using Async Validators**: - ```typescript - this.form = this.fb.group({ - username: ['', { validators: [Validators.required], asyncValidators: [usernameValidator()] }] - }); - ``` - \ No newline at end of file diff --git a/courses/Angular/Advance-level/Advanced-Forms/_category_.json b/courses/Angular/Advance-level/Advanced-Forms/_category_.json deleted file mode 100644 index 6c16f8617..000000000 --- a/courses/Angular/Advance-level/Advanced-Forms/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Advanced Forms", - "position": 2, - "link": { - "type": "generated-index", - "description": "Learn to Advanced Forms." - } - } \ No newline at end of file diff --git a/courses/Angular/Advance-level/Advanced-Routing/Custom-ROute.md b/courses/Angular/Advance-level/Advanced-Routing/Custom-ROute.md deleted file mode 100644 index 03cc6fbaa..000000000 --- a/courses/Angular/Advance-level/Advanced-Routing/Custom-ROute.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -id: lesson-4 -title: "Custom Route Strategies" -sidebar_label: Custom Route -sidebar_position: 4 -description: "Custom Route Strategies" -tags: [courses,Advanced-level,Custom Route,Introduction] ---- - - -Custom route strategies allow you to implement advanced routing behaviors that suit specific application needs. - -1. **Creating a Custom Route Strategy**: - ```typescript - import { RouteReuseStrategy, DetachedRouteHandle } from '@angular/router'; - - export class CustomRouteReuseStrategy implements RouteReuseStrategy { - storedRouteHandles: { [key: string]: DetachedRouteHandle } = {}; - - shouldDetach(route: ActivatedRouteSnapshot): boolean { - return true; // Modify as needed - } - - store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle): void { - this.storedRouteHandles[route.routeConfig.path] = handle; - } - - shouldAttach(route: ActivatedRouteSnapshot): boolean { - return !!this.storedRouteHandles[route.routeConfig.path]; - } - - retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle { - return this.storedRouteHandles[route.routeConfig.path]; - } - - shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean { - return future.routeConfig === curr.routeConfig; - } - } - ``` - -2. **Providing the Custom Strategy**: - Update your `AppModule` to use the custom route strategy. - - ```typescript - import { NgModule } from '@angular/core'; - import { RouterModule, RouteReuseStrategy } from '@angular/router'; - - @NgModule({ - imports: [RouterModule.forRoot(routes)], - providers: [{ provide: RouteReuseStrategy, useClass: CustomRouteReuseStrategy }] - }) - export class AppRoutingModule {} - ``` \ No newline at end of file diff --git a/courses/Angular/Advance-level/Advanced-Routing/Nested-Routes.md b/courses/Angular/Advance-level/Advanced-Routing/Nested-Routes.md deleted file mode 100644 index 0264550a8..000000000 --- a/courses/Angular/Advance-level/Advanced-Routing/Nested-Routes.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: lesson-3 -title: "Nested Routes" -sidebar_label: Nested Routes -sidebar_position: 3 -description: "Nested Routes" -tags: [courses,Advanced-level,Nested Routes,Introduction] ---- - - - -Nested routes allow you to create hierarchical route structures, making your application more organized and maintainable. - -1. **Defining Nested Routes**: - ```typescript - const routes: Routes = [ - { - path: 'products', - component: ProductsComponent, - children: [ - { path: '', component: ProductListComponent }, - { path: ':id', component: ProductDetailComponent } - ] - } - ]; - ``` - -2. **Using Router Outlet**: - In the `ProductsComponent` template, include a `` for nested views. - - ```html -

Products

- - ``` diff --git a/courses/Angular/Advance-level/Advanced-Routing/Route-Resolvers.md b/courses/Angular/Advance-level/Advanced-Routing/Route-Resolvers.md deleted file mode 100644 index aac5cd47d..000000000 --- a/courses/Angular/Advance-level/Advanced-Routing/Route-Resolvers.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -id: lesson-2 -title: "Route Resolvers" -sidebar_label: Route Resolvers -sidebar_position: 2 -description: "Route Resolvers" -tags: [courses,Advanced-level,Route Resolvers,Introduction] ---- - -Route resolvers are a powerful way to fetch data before the route loads. This ensures the data is available when the component is initialized. - -1. **Using a Resolver**: - ```typescript - const routes: Routes = [ - { - path: 'dashboard', - component: DashboardComponent, - resolve: { - data: DataResolver - } - } - ]; - ``` - -2. **Accessing Resolved Data**: - ```typescript - import { ActivatedRoute } from '@angular/router'; - - @Component({ - selector: 'app-dashboard', - templateUrl: './dashboard.component.html', - }) - export class DashboardComponent { - data: any; - - constructor(private route: ActivatedRoute) { - this.route.data.subscribe(data => { - this.data = data['data']; - }); - } - } - ``` \ No newline at end of file diff --git a/courses/Angular/Advance-level/Advanced-Routing/Route-guards.md b/courses/Angular/Advance-level/Advanced-Routing/Route-guards.md deleted file mode 100644 index e5e730514..000000000 --- a/courses/Angular/Advance-level/Advanced-Routing/Route-guards.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -id: lesson-1 -title: "Advanced Routing Techniques in Angular" -sidebar_label: Advanced Routing -sidebar_position: 1 -description: "Advanced Routing Techniques in Angular" -tags: [courses,Advanced-level,Advanced Routing,Introduction] ---- - -Angular’s routing capabilities are powerful and flexible, enabling developers to create complex applications with ease. Here’s a look at advanced routing techniques including route guards, resolvers, nested routes, and custom route strategies. - -#### Route Guards - -Route guards are interfaces that allow you to control access to routes based on specific conditions. They help protect routes from unauthorized access or to prompt users before leaving a route. - -1. **CanActivate**: Prevents unauthorized users from activating a route. - ```typescript - import { Injectable } from '@angular/core'; - import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; - - @Injectable({ - providedIn: 'root', - }) - export class AuthGuard implements CanActivate { - constructor(private router: Router) {} - - canActivate( - next: ActivatedRouteSnapshot, - state: RouterStateSnapshot - ): boolean { - const isAuthenticated = false; // replace with real authentication check - if (!isAuthenticated) { - this.router.navigate(['/login']); - return false; - } - return true; - } - } - ``` - -2. **CanDeactivate**: Prevents users from leaving a route without confirmation. - ```typescript - import { Injectable } from '@angular/core'; - import { CanDeactivate } from '@angular/router'; - import { Observable } from 'rxjs'; - - export interface CanComponentDeactivate { - canDeactivate: () => Observable | Promise | boolean; - } - - @Injectable({ - providedIn: 'root', - }) - export class CanDeactivateGuard implements CanDeactivate { - canDeactivate( - component: CanComponentDeactivate - ): Observable | Promise | boolean { - return component.canDeactivate ? component.canDeactivate() : true; - } - } - ``` - -3. **Resolve**: Fetches data before a route is activated. - ```typescript - import { Injectable } from '@angular/core'; - import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; - import { DataService } from './data.service'; - - @Injectable({ - providedIn: 'root', - }) - export class DataResolver implements Resolve { - constructor(private dataService: DataService) {} - - resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { - return this.dataService.getData(); - } - } - ``` \ No newline at end of file diff --git a/courses/Angular/Advance-level/Advanced-Routing/_category_.json b/courses/Angular/Advance-level/Advanced-Routing/_category_.json deleted file mode 100644 index 629f46e86..000000000 --- a/courses/Angular/Advance-level/Advanced-Routing/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Advanced Routing", - "position": 4, - "link": { - "type": "generated-index", - "description": "Learn to Advanced Routing." - } - } \ No newline at end of file diff --git a/courses/Angular/Advance-level/Angular-Universal/Introduction.md b/courses/Angular/Advance-level/Angular-Universal/Introduction.md deleted file mode 100644 index 6686204e8..000000000 --- a/courses/Angular/Advance-level/Angular-Universal/Introduction.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -id: lesson-1 -title: "Angular Universal (Server-Side Rendering)" -sidebar_label: Introduction -sidebar_position: 1 -description: "Angular Universal (Server-Side Rendering)" -tags: [courses,Advanced-level,Angular Universal (Server-Side Rendering),Introduction] ---- - - - - -Angular Universal enables server-side rendering (SSR) for Angular applications, enhancing performance and improving SEO by generating HTML on the server. This section covers the essentials of Angular Universal, from setup to optimization. - -#### Introduction to Angular Universal - -Angular Universal is a technology that allows you to render Angular applications on the server rather than in the browser. This results in faster initial load times and better SEO since search engines can easily crawl the rendered HTML. \ No newline at end of file diff --git a/courses/Angular/Advance-level/Angular-Universal/SEO.md b/courses/Angular/Advance-level/Angular-Universal/SEO.md deleted file mode 100644 index cecc55ba3..000000000 --- a/courses/Angular/Advance-level/Angular-Universal/SEO.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -id: lesson-4 -title: "SEO Optimization with Angular Universal" -sidebar_label: SEO -sidebar_position: 4 -description: "SEO Optimization with Angular Universal" -tags: [courses,Advanced-level,Introduction] ---- - - -To improve the SEO performance of your application using Angular Universal, consider the following strategies: - -1. **Meta Tags and Title Management**: - Use Angular's `Meta` and `Title` services to manage metadata dynamically. - - ```typescript - import { Component } from '@angular/core'; - import { Meta, Title } from '@angular/platform-browser'; - - @Component({ - selector: 'app-home', - templateUrl: './home.component.html', - }) - export class HomeComponent { - constructor(private meta: Meta, private title: Title) { - this.title.setTitle('Home Page Title'); - this.meta.addTags([ - { name: 'description', content: 'Description of the home page' }, - { name: 'keywords', content: 'Angular, Universal, SSR' }, - ]); - } - } - ``` - -2. **Structured Data**: - Implement structured data using JSON-LD to enhance your site's presence in search results. - - ```html - - ``` - -3. **Handling 404 Pages**: - Create a custom 404 page to improve user experience and SEO. - - ```typescript - // 404.component.ts - import { Component } from '@angular/core'; - - @Component({ - selector: 'app-not-found', - templateUrl: './not-found.component.html', - }) - export class NotFoundComponent {} - ``` - - Update routing to handle 404 errors: - - ```typescript - const routes: Routes = [ - // your routes here - { path: '**', component: NotFoundComponent } - ]; - ``` - \ No newline at end of file diff --git a/courses/Angular/Advance-level/Angular-Universal/Setup.md b/courses/Angular/Advance-level/Angular-Universal/Setup.md deleted file mode 100644 index cf42e4bb6..000000000 --- a/courses/Angular/Advance-level/Angular-Universal/Setup.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -id: lesson-2 -title: "Setting Up Server-Side Rendering" -sidebar_label: Setting Up -sidebar_position: 2 -description: "Setting Up Server-Side Rendering" -tags: [courses,Advanced-level,Introduction] ---- - - - -1. **Installing Angular Universal**: - Use Angular CLI to add Universal support to your existing Angular application. - - ```bash - ng add @nguniversal/express-engine - ``` - - This command sets up the necessary files and dependencies for server-side rendering. - -2. **Updating App Module**: - Modify the `app.module.ts` to ensure your application can run in a server environment. - - ```typescript - import { AppServerModule } from './app/app.server.module'; - ``` - -3. **Creating Server Module**: - Generate a new module specifically for the server: - - ```typescript - // app.server.module.ts - import { NgModule } from '@angular/core'; - import { ServerModule } from '@angular/platform-server'; - import { AppModule } from './app.module'; - import { AppComponent } from './app.component'; - - @NgModule({ - imports: [ - AppModule, - ServerModule, - ], - bootstrap: [AppComponent], - }) - export class AppServerModule {} - ``` - -4. **Creating a Server File**: - Create an `server.ts` file to bootstrap your application. - - ```typescript - import 'zone.js/dist/zone-node'; - import { enableProdMode } from '@angular/core'; - import { ngExpressEngine } from '@nguniversal/express-engine'; - import * as express from 'express'; - import { join } from 'path'; - import { AppServerModule } from './dist/server/main'; - - enableProdMode(); - - const app = express(); - const PORT = process.env.PORT || 4000; - const DIST_FOLDER = join(process.cwd(), 'dist/browser'); - - app.engine('html', ngExpressEngine({ - bootstrap: AppServerModule, - })); - - app.set('view engine', 'html'); - app.set('views', DIST_FOLDER); - - app.get('*.*', express.static(DIST_FOLDER, { - maxAge: '1y' - })); - - app.get('*', (req, res) => { - res.render('index', { req }); - }); - - app.listen(PORT, () => { - console.log(`Node server listening on http://localhost:${PORT}`); - }); - ``` - -5. **Building and Running the Application**: - Build your application for server-side rendering. - - ```bash - npm run build:ssr - npm run serve:ssr - ``` diff --git a/courses/Angular/Advance-level/Angular-Universal/_category_.json b/courses/Angular/Advance-level/Angular-Universal/_category_.json deleted file mode 100644 index 33fc648f4..000000000 --- a/courses/Angular/Advance-level/Angular-Universal/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Angular Universal(server-side Rendering)", - "position": 3, - "link": { - "type": "generated-index", - "description": "How to server-side Rendering." - } - } \ No newline at end of file diff --git a/courses/Angular/Advance-level/Angular-Universal/pre-render.md b/courses/Angular/Advance-level/Angular-Universal/pre-render.md deleted file mode 100644 index 6b39637ea..000000000 --- a/courses/Angular/Advance-level/Angular-Universal/pre-render.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: lesson-3 -title: "Pre-rendering Angular Applications" -sidebar_label: Pre-rendering -sidebar_position: 3 -description: "Pre-rendering Angular Applications" -tags: [courses,Advanced-level,Pre-rendering,Introduction] ---- - - - -Pre-rendering generates static HTML pages for specific routes at build time, which can be beneficial for performance and SEO. - -1. **Using Angular Universal to Pre-render**: - You can use the Angular Universal command to pre-render specific routes. - - ```bash - npm run prerender - ``` - - This will generate static HTML files for your defined routes. - -2. **Configuring Pre-rendering**: - Update the `angular.json` file to define routes for pre-rendering: - - ```json - "prerender": { - "routes": [ - "/", - "/about", - "/contact" - ] - } - ``` \ No newline at end of file diff --git a/courses/Angular/Advance-level/GraphQL/Components.md b/courses/Angular/Advance-level/GraphQL/Components.md deleted file mode 100644 index 45ee5ae45..000000000 --- a/courses/Angular/Advance-level/GraphQL/Components.md +++ /dev/null @@ -1,94 +0,0 @@ ---- -id: lesson-4 -title: "Using GraphQL with Angular Components" -sidebar_label: GraphQL Components -sidebar_position: 4 -description: "Using GraphQL with Angular Components" -tags: [courses,Advanced-level,GraphQL Components,Introduction] ---- - - -1. **Querying Data**: - ```typescript - import { Component, OnInit } from '@angular/core'; - import { Apollo, QueryRef } from 'apollo-angular'; - import { GET_ITEMS } from './graphql/queries'; - - @Component({ - selector: 'app-item-list', - templateUrl: './item-list.component.html', - }) - export class ItemListComponent implements OnInit { - items: any[] = []; - loading = true; - error: any; - - constructor(private apollo: Apollo) {} - - ngOnInit() { - this.apollo.watchQuery({ - query: GET_ITEMS, - }).valueChanges.subscribe(({ data, loading, error }) => { - this.items = data.items; - this.loading = loading; - this.error = error; - }); - } - } - ``` - - **Template for Querying Data**: - ```html -
Loading...
-
Error: {{ error.message }}
-
    -
  • - {{ item.name }} - {{ item.description }} -
  • -
- ``` - -2. **Mutating Data**: - ```typescript - import { Component } from '@angular/core'; - import { Apollo } from 'apollo-angular'; - import { ADD_ITEM } from './graphql/mutations'; - - @Component({ - selector: 'app-add-item', - templateUrl: './add-item.component.html', - }) - export class AddItemComponent { - name = ''; - description = ''; - - constructor(private apollo: Apollo) {} - - addItem() { - this.apollo.mutate({ - mutation: ADD_ITEM, - variables: { - name: this.name, - description: this.description, - }, - }).subscribe(response => { - console.log('Item added:', response); - }); - } - } - ``` - - **Template for Mutating Data**: - ```html -
- - - -
- ``` \ No newline at end of file diff --git a/courses/Angular/Advance-level/GraphQL/Introduction.md b/courses/Angular/Advance-level/GraphQL/Introduction.md deleted file mode 100644 index 71a2e4822..000000000 --- a/courses/Angular/Advance-level/GraphQL/Introduction.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -id: lesson-1 -title: "Angular with GraphQL" -sidebar_label: GraphQL -sidebar_position: 1 -description: "Angular with GraphQL" -tags: [courses,Advanced-level,GraphQL Queries,Mutations,Introduction] ---- - - -GraphQL is a query language for APIs and a runtime for executing those queries by providing a complete and understandable description of the data in your API. It allows clients to request only the data they need and nothing more. - -#### Introduction - -GraphQL enables declarative data fetching, allowing clients to specify exactly what data they need from an API. It also provides strong typing, real-time updates, and the ability to combine multiple API calls into a single query. - -**Concepts:** -- **Schema**: Defines the types and structure of the data available in the API. -- **Query**: Requests specific data from the server. -- **Mutation**: Modifies data on the server. -- **Subscription**: Provides real-time updates from the server. - - - - \ No newline at end of file diff --git a/courses/Angular/Advance-level/GraphQL/Queries.md b/courses/Angular/Advance-level/GraphQL/Queries.md deleted file mode 100644 index c5a462984..000000000 --- a/courses/Angular/Advance-level/GraphQL/Queries.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: lesson-3 -title: "Writing GraphQL Queries and Mutations" -sidebar_label: GraphQL Queries and Mutations -sidebar_position: 3 -description: "Writing GraphQL Queries and Mutations" -tags: [courses,Advanced-level,GraphQL Queries,Mutations,Introduction] ---- - - -1. **Defining Queries**: - ```typescript - import { gql } from 'apollo-angular'; - - export const GET_ITEMS = gql` - query GetItems { - items { - id - name - description - } - } - `; - ``` - -2. **Defining Mutations**: - ```typescript - import { gql } from 'apollo-angular'; - - export const ADD_ITEM = gql` - mutation AddItem($name: String!, $description: String!) { - addItem(name: $name, description: $description) { - id - name - description - } - } - `; - ``` diff --git a/courses/Angular/Advance-level/GraphQL/Settings.md b/courses/Angular/Advance-level/GraphQL/Settings.md deleted file mode 100644 index 031e84663..000000000 --- a/courses/Angular/Advance-level/GraphQL/Settings.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -id: lesson-2 -title: "Setting Up Apollo Client in Angular" -sidebar_label: Setting Up -sidebar_position: 2 -description: "Setting Up Apollo Client in Angular" -tags: [courses,Advanced-level,GraphQL Queries,Mutations,Introduction] ---- - - -Apollo Client is a comprehensive state management library for JavaScript that enables you to manage both local and remote data with GraphQL. - -1. **Install Dependencies**: - ```bash - ng add apollo-angular - npm install @apollo/client graphql - ``` - -2. **Setting Up Apollo Client**: - Create a new service to configure the Apollo Client. - - ```typescript - // graphql.module.ts - import { NgModule } from '@angular/core'; - import { APOLLO_OPTIONS, ApolloModule } from 'apollo-angular'; - import { HttpLink } from 'apollo-angular/http'; - import { InMemoryCache } from '@apollo/client/core'; - - @NgModule({ - exports: [ApolloModule], - providers: [ - { - provide: APOLLO_OPTIONS, - useFactory: (httpLink: HttpLink) => { - return { - cache: new InMemoryCache(), - link: httpLink.create({ uri: 'https://your-graphql-endpoint' }), - }; - }, - deps: [HttpLink], - }, - ], - }) - export class GraphQLModule {} - ``` - - Add `GraphQLModule` to your `AppModule`: - - ```typescript - import { GraphQLModule } from './graphql.module'; - - @NgModule({ - imports: [ - // other imports... - GraphQLModule, - ], - }) - export class AppModule {} - ``` - diff --git a/courses/Angular/Advance-level/GraphQL/_category_.json b/courses/Angular/Advance-level/GraphQL/_category_.json deleted file mode 100644 index 0e4dca135..000000000 --- a/courses/Angular/Advance-level/GraphQL/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Angular with GraphQL", - "position": 5, - "link": { - "type": "generated-index", - "description": "Learn to GraphQL." - } - } \ No newline at end of file diff --git a/courses/Angular/Advance-level/RxJS/Async.md b/courses/Angular/Advance-level/RxJS/Async.md deleted file mode 100644 index 2945f7dc7..000000000 --- a/courses/Angular/Advance-level/RxJS/Async.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: lesson-4 -title: "Handling Asynchronous Operations" -sidebar_label: Async -sidebar_position: 4 -description: "Handling Asynchronous Operations" -tags: [courses,Advanced-level,Async,Introduction] ---- - - -RxJS is particularly useful for handling asynchronous operations, such as HTTP requests or user input events. - -1. **Using RxJS with HTTP Requests**: - ```javascript - import { HttpClient } from '@angular/common/http'; - import { Injectable } from '@angular/core'; - - @Injectable({ - providedIn: 'root' - }) - export class DataService { - constructor(private http: HttpClient) {} - - fetchData() { - return this.http.get('https://api.example.com/data'); - } - } - ``` - -2. **Using Operators with HTTP Requests**: - ```javascript - this.dataService.fetchData().pipe( - map(data => data['items']), - filter(item => item.active) - ).subscribe(items => console.log(items)); - ``` - -3. **Error Handling with `catchError`**: - ```javascript - import { catchError } from 'rxjs/operators'; - import { of } from 'rxjs'; - - this.dataService.fetchData().pipe( - catchError(error => { - console.error('Error fetching data', error); - return of([]); // Return an empty array on error - }) - ).subscribe(items => console.log(items)); - ``` - -By mastering RxJS and its powerful operators, you can effectively manage asynchronous operations and create highly reactive Angular applications. \ No newline at end of file diff --git a/courses/Angular/Advance-level/RxJS/Introduction.md b/courses/Angular/Advance-level/RxJS/Introduction.md deleted file mode 100644 index c3f7ecbd9..000000000 --- a/courses/Angular/Advance-level/RxJS/Introduction.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -id: lesson-1 -title: "Advanced RxJS" -sidebar_label: Introduction -sidebar_position: 1 -description: "Advanced RxJS" -tags: [courses,Advanced-level,Advanced RxJs,Introduction] ---- - - -RxJS (Reactive Extensions for JavaScript) is a powerful library for reactive programming using Observables, making it easy to work with asynchronous data streams in Angular and other JavaScript applications. - -#### Introduction to RxJS - -RxJS allows you to work with asynchronous data streams using the concept of Observables. An Observable is a representation of a stream of data that can emit values over time. RxJS provides a rich set of operators to manipulate these streams and handle complex asynchronous scenarios. diff --git a/courses/Angular/Advance-level/RxJS/Observable.md b/courses/Angular/Advance-level/RxJS/Observable.md deleted file mode 100644 index 89f0f398c..000000000 --- a/courses/Angular/Advance-level/RxJS/Observable.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: lesson-2 -title: "Observable Creation and Manipulation" -sidebar_label: Observable Creation -sidebar_position: 2 -description: "Observable Creation and Manipulation" -tags: [courses,Advanced-level,Observable Creation,Manipulation,Introduction] ---- - - -**Creating Observables:** - -1. **Using `of` to create an Observable:** - ```javascript - import { of } from 'rxjs'; - - const observable = of(1, 2, 3); - observable.subscribe(value => console.log(value)); - ``` - -2. **Using `from` to create an Observable from an array:** - ```javascript - import { from } from 'rxjs'; - - const observableFromArray = from([1, 2, 3]); - observableFromArray.subscribe(value => console.log(value)); - ``` - -3. **Using `new Observable` to create a custom Observable:** - ```javascript - import { Observable } from 'rxjs'; - - const customObservable = new Observable(subscriber => { - subscriber.next('Hello'); - subscriber.next('World'); - subscriber.complete(); - }); - - customObservable.subscribe({ - next: value => console.log(value), - complete: () => console.log('Completed'), - }); - ``` - diff --git a/courses/Angular/Advance-level/RxJS/Operators.md b/courses/Angular/Advance-level/RxJS/Operators.md deleted file mode 100644 index dea86a251..000000000 --- a/courses/Angular/Advance-level/RxJS/Operators.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -id: lesson-3 -title: "Operators in RxJS" -sidebar_label: Operators -sidebar_position: 3 -description: "Operators in RxJS" -tags: [courses,Advanced-level,Operators,Introduction] ---- - -Operators are functions that allow you to transform, filter, and combine Observables. They can be categorized into three types: creation, transformation, and utility operators. - -**Common Operators:** - -1. **`map`**: Transforms emitted values. - ```javascript - import { of } from 'rxjs'; - import { map } from 'rxjs/operators'; - - const observable = of(1, 2, 3).pipe( - map(value => value * 2) - ); - - observable.subscribe(value => console.log(value)); // Outputs: 2, 4, 6 - ``` - -2. **`filter`**: Filters emitted values based on a condition. - ```javascript - import { of } from 'rxjs'; - import { filter } from 'rxjs/operators'; - - const observable = of(1, 2, 3, 4).pipe( - filter(value => value % 2 === 0) - ); - - observable.subscribe(value => console.log(value)); // Outputs: 2, 4 - ``` - -3. **`mergeMap`**: Projects each source value to an Observable and merges the resulting Observables into one. - ```javascript - import { of } from 'rxjs'; - import { mergeMap } from 'rxjs/operators'; - - const observable = of(1, 2).pipe( - mergeMap(value => of(value * 2)) - ); - - observable.subscribe(value => console.log(value)); // Outputs: 2, 4 - ``` - -4. **`switchMap`**: Projects each source value to an Observable and emits values from the most recent Observable only. - ```javascript - import { of, interval } from 'rxjs'; - import { switchMap } from 'rxjs/operators'; - - const observable = interval(1000).pipe( - switchMap(value => of(`Current Value: ${value}`)) - ); - - observable.subscribe(value => console.log(value)); - ``` - -5. **`combineLatest`**: Combines the latest values from multiple Observables. - ```javascript - import { combineLatest, of } from 'rxjs'; - - const obs1 = of('Hello'); - const obs2 = of('World'); - - const combined = combineLatest([obs1, obs2]); - combined.subscribe(value => console.log(value)); // Outputs: ['Hello', 'World'] - ``` \ No newline at end of file diff --git a/courses/Angular/Advance-level/RxJS/_category_.json b/courses/Angular/Advance-level/RxJS/_category_.json deleted file mode 100644 index 8121c94af..000000000 --- a/courses/Angular/Advance-level/RxJS/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Advanced RxJs", - "position": 1, - "link": { - "type": "generated-index", - "description": "Learn to Advanced RxJs." - } - } \ No newline at end of file diff --git a/courses/Angular/Advance-level/_category_.json b/courses/Angular/Advance-level/_category_.json deleted file mode 100644 index 9df37f132..000000000 --- a/courses/Angular/Advance-level/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Advanced Level", - "position": 3, - "link": { - "type": "generated-index", - "description": "Learn to Advanced Technique Angular." - } - } \ No newline at end of file diff --git a/courses/Angular/Overview.md b/courses/Angular/Overview.md deleted file mode 100644 index a3804b75f..000000000 --- a/courses/Angular/Overview.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -title: Welcome to Learning Path -sidebar_label: Course Overview -sidebar_position: 1 -description: Tailwind CSS is a utility-first CSS framework that allows you to rapidly build custom user interfaces. -tags: [courses,Angular,Framework] -keywoards: [courses,Angular, web development, front-end development] -author: [CodeHarborHub, Ajay Dhangar] ---- - - -#### Beginner Level - -**1. Introduction to Angular** - - What is Angular? - - Setting up the development environment - -**2. Angular Architecture** - - Components - - Modules - - Templates - - Services and Dependency Injection - -**3. Angular Components** - - Creating components - - Component lifecycle hooks - - Data binding (interpolation, property binding, event binding) - - Component interaction and communication - -**4. Angular Directives and Pipes** - - Built-in directives (ngIf, ngFor, ngClass, ngStyle) - - Creating custom directives - - Using pipes for data transformation - - Creating custom pipes - -**5. Angular Forms** - - Template-driven forms - - Reactive forms - - Form validation - - Handling form submissions - -**6. Routing and Navigation** - - Setting up the Angular Router - - Configuring routes - - Route parameters - - Lazy loading modules - -**7. HTTP Client** - - Making HTTP requests - - Handling HTTP responses - - Interceptors - - Error handling - -#### Intermediate Level - -**1. Advanced Component Interaction** - - Input and Output decorators - - ViewChild and ContentChild - - Event emitters - - Dynamic components - -**2. State Management** - - Introduction to state management - - Using BehaviorSubject for state management - - NgRx (Redux for Angular) basics - - Actions, reducers, and effects - -**3. Angular Animations** - - Introduction to Angular animations - - Animation triggers and states - - Keyframe animations - - Animation transitions and sequences - -**4. Angular Modules** - - Feature modules - - Shared modules - - Core modules - - Module lazy loading - -**5. Testing in Angular** - - Unit testing with Jasmine and Karma - - Component testing - - Service testing - - End-to-end testing with Protractor - - -#### Advanced Level - -**1. Advanced RxJS** - - Introduction to RxJS - - Observable creation and manipulation - - Operators in RxJS (map, filter, mergeMap, switchMap, etc.) - - Handling asynchronous operations - -**2. Advanced Forms** - - Dynamic forms - - Custom form controls - - Form arrays - - Advanced form validation - -**3. Angular Universal (Server-Side Rendering)** - - Introduction to Angular Universal - - Setting up server-side rendering - - Pre-rendering Angular applications - - SEO optimization with Angular Universal - -**4. Advanced Routing Techniques** - - Route guards (CanActivate, CanDeactivate, Resolve, etc.) - - Route resolvers - - Nested routes - - Custom route strategies - -**5. Angular with GraphQL** - - Introduction to GraphQL - - Setting up Apollo Client in Angular - - Writing GraphQL queries and mutations - - Using GraphQL with Angular components - \ No newline at end of file diff --git a/courses/Angular/_category_.json b/courses/Angular/_category_.json deleted file mode 100644 index b74aac9ed..000000000 --- a/courses/Angular/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Angular", - "position": 8, - "link": { - "type": "generated-index", - "description": "Learn to Frontend Development framework Angular." - } - } \ No newline at end of file diff --git a/courses/Angular/begginer-level/Architecture/Components.md b/courses/Angular/begginer-level/Architecture/Components.md deleted file mode 100644 index 575d9d125..000000000 --- a/courses/Angular/begginer-level/Architecture/Components.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: lesson-1 -title: "Components" -sidebar_label: Components -sidebar_position: 1 -description: "Angular Components" -tags: [courses,beginner-level,Components,Introduction] ---- - -Components are the building blocks of an Angular application. Each component consists of: - -1. **A TypeScript class**: Contains the business logic and data for the component. -2. **An HTML template**: Defines the view (UI) for the component. -3. **CSS styles**: Specify the look and feel for the component. -4. **Metadata**: Defined using the `@Component` decorator, which provides additional information about the component. - -Example of a component: -```typescript -// app.component.ts -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] -}) -export class AppComponent { - title = 'My Angular App'; -} -``` -```html - -

{{ title }}

-``` diff --git a/courses/Angular/begginer-level/Architecture/Modules.md b/courses/Angular/begginer-level/Architecture/Modules.md deleted file mode 100644 index 9afb9b84b..000000000 --- a/courses/Angular/begginer-level/Architecture/Modules.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: lesson-2 -title: "Modules" -sidebar_label: Modules -sidebar_position: 2 -description: "Angular Modules" -tags: [courses,beginner-level,Basic Structure,Introduction] ---- - -Modules are used to group related components, directives, pipes, and services together. Every Angular application has at least one module, the root module, which is conventionally named `AppModule`. - -A module is defined using the `@NgModule` decorator: -```typescript -// app.module.ts -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; -import { AppComponent } from './app.component'; - -@NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule - ], - providers: [], - bootstrap: [AppComponent] -}) -export class AppModule { } -``` -- **declarations**: The components, directives, and pipes that belong to this module. -- **imports**: Other modules whose exported classes are needed by component templates declared in this module. -- **providers**: Services that are available to the entire application. -- **bootstrap**: The root component that Angular creates and inserts into the index.html host web page. diff --git a/courses/Angular/begginer-level/Architecture/Templates.md b/courses/Angular/begginer-level/Architecture/Templates.md deleted file mode 100644 index 937603546..000000000 --- a/courses/Angular/begginer-level/Architecture/Templates.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -id: lesson-3 -title: "Templates" -sidebar_label: Templates -sidebar_position: 3 -description: "Angular Templates" -tags: [courses,beginner-level,Templates,Introduction] ---- - - -Templates define the HTML structure and appearance of the view associated with a component. Angular templates are enhanced HTML with Angular directives and bindings. - -Common template syntax includes: -- **Interpolation**: `{{ expression }}` for embedding expressions in the template. -- **Directives**: Special markers in the template that tell Angular to do something to the DOM elements and components. Common directives include `*ngIf`, `*ngFor`, and `ngModel`. -- **Property Binding**: `[property]="expression"` for binding DOM properties to component properties. -- **Event Binding**: `(event)="handler"` for binding DOM events to component methods. - -Example of a template with directives: -```html - -

{{ title }}

-
    -
  • {{ item }}
  • -
- -``` diff --git a/courses/Angular/begginer-level/Architecture/_category_.json b/courses/Angular/begginer-level/Architecture/_category_.json deleted file mode 100644 index f160c45a2..000000000 --- a/courses/Angular/begginer-level/Architecture/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Angular Architecture", - "position": 2, - "link": { - "type": "generated-index", - "description": "Angular Architecture." - } - } \ No newline at end of file diff --git a/courses/Angular/begginer-level/Architecture/services.md b/courses/Angular/begginer-level/Architecture/services.md deleted file mode 100644 index ae9d28089..000000000 --- a/courses/Angular/begginer-level/Architecture/services.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -id: lesson-4 -title: "Services and Dependency Injection" -sidebar_label: Services -sidebar_position: 4 -description: "Services and Dependency Injection" -tags: [courses,beginner-level,Services,Introduction] ---- - - - -Services are classes that provide shared functionality across the application. They are typically used for business logic, data access, and other tasks that don't involve the view or user interface. - -Dependency Injection (DI) is a design pattern used to implement IoC (Inversion of Control). Angular's DI system allows you to inject services into components, directives, and other services. - -Creating a service: -```typescript -// data.service.ts -import { Injectable } from '@angular/core'; - -@Injectable({ - providedIn: 'root' -}) -export class DataService { - private items: string[] = []; - - addItem(item: string) { - this.items.push(item); - } - - getItems() { - return this.items; - } -} -``` - -Using a service in a component: -```typescript -// app.component.ts -import { Component } from '@angular/core'; -import { DataService } from './data.service'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] -}) -export class AppComponent { - title = 'My Angular App'; - items: string[]; - - constructor(private dataService: DataService) { - this.items = dataService.getItems(); - } - - addItem() { - this.dataService.addItem('New Item'); - this.items = this.dataService.getItems(); - } -} -``` - -In this example, the `DataService` is injected into the `AppComponent` through its constructor. The component then uses the service to manage a list of items. \ No newline at end of file diff --git a/courses/Angular/begginer-level/Components/Component-Interaction.md b/courses/Angular/begginer-level/Components/Component-Interaction.md deleted file mode 100644 index d24a22335..000000000 --- a/courses/Angular/begginer-level/Components/Component-Interaction.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -id: lesson-4 -title: "Component Interaction and Communication" -sidebar_label: Interaction and Communication -sidebar_position: 4 -description: "Component Interaction and Communication" -tags: [courses,beginner-level,Interaction ,Communication,Introduction] ---- - - -1. **Parent to Child**: Using `@Input` decorator. -2. **Child to Parent**: Using `@Output` decorator and `EventEmitter`. -3. **Sibling Components**: Using a shared service. - -**Parent to Child Communication**: -```typescript -// parent.component.html - - -// parent.component.ts -@Component({ - selector: 'app-parent', - templateUrl: './parent.component.html', - styleUrls: ['./parent.component.css'] -}) -export class ParentComponent { - parentData: string = 'Data from parent'; -} - -// child.component.ts -@Component({ - selector: 'app-child', - templateUrl: './child.component.html', - styleUrls: ['./child.component.css'] -}) -export class ChildComponent { - @Input() childData: string; -} -``` - -**Child to Parent Communication**: -```typescript -// child.component.ts -@Component({ - selector: 'app-child', - templateUrl: './child.component.html', - styleUrls: ['./child.component.css'] -}) -export class ChildComponent { - @Output() notifyParent: EventEmitter = new EventEmitter(); - - sendNotification() { - this.notifyParent.emit('Message from child'); - } -} - -// child.component.html - - -// parent.component.html - - -// parent.component.ts -@Component({ - selector: 'app-parent', - templateUrl: './parent.component.html', - styleUrls: ['./parent.component.css'] -}) -export class ParentComponent { - handleNotification(event: string) { - console.log(event); - } -} -``` - -**Sibling Components Communication via Service**: -1. **Create a Service**: - ```typescript - // message.service.ts - import { Injectable } from '@angular/core'; - import { Subject } from 'rxjs'; - - @Injectable({ - providedIn: 'root' - }) - export class MessageService { - private messageSource = new Subject(); - message$ = this.messageSource.asObservable(); - - sendMessage(message: string) { - this.messageSource.next(message); - } - } - ``` - -2. **Inject and Use the Service in Sibling Components**: - ```typescript - // sibling1.component.ts - import { Component } from '@angular/core'; - import { MessageService } from './message.service'; - - @Component({ - selector: 'app-sibling1', - template: '' - }) - export class Sibling1Component { - constructor(private messageService: MessageService) {} - - sendMessage() { - this.messageService.sendMessage('Hello from Sibling 1'); - } - } - - // sibling2.component.ts - import { Component, OnInit } from '@angular/core'; - import { MessageService } from './message.service'; - - @Component({ - selector: 'app-sibling2', - template: '

{{ message }}

' - }) - export class Sibling2Component implements OnInit { - message: string; - - constructor(private messageService: MessageService) {} - - ngOnInit() { - this.messageService.message$.subscribe(message => { - this.message = message; - }); - } - } - ``` - \ No newline at end of file diff --git a/courses/Angular/begginer-level/Components/Data-BInding.md b/courses/Angular/begginer-level/Components/Data-BInding.md deleted file mode 100644 index 7f953d4e6..000000000 --- a/courses/Angular/begginer-level/Components/Data-BInding.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -id: lesson-3 -title: "Data Binding" -sidebar_label: Data BindingHooks -sidebar_position: 3 -description: "Data Binding" -tags: [courses,beginner-level,Data Binding,Introduction] ---- - - -1. **Interpolation**: Used to bind data from the component to the template. - ```html -

{{ message }}

- ``` - -2. **Property Binding**: Used to bind property values in the template. - ```html - - ``` - -3. **Event Binding**: Used to bind events to methods in the component. - ```html - - ``` - -4. **Two-Way Binding**: Combines property and event binding using `ngModel`. - ```html - - ``` - -Example of data binding in a component: -```typescript -// data-binding.component.ts -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-data-binding', - templateUrl: './data-binding.component.html', - styleUrls: ['./data-binding.component.css'] -}) -export class DataBindingComponent { - message: string = 'Hello, Angular!'; - imageUrl: string = 'https://angular.io/assets/images/logos/angular/angular.png'; - name: string = ''; - - handleClick() { - alert('Button clicked!'); - } -} -``` - -`data-binding.component.html`: -```html -

{{ message }}

- - - -

Your name: {{ name }}

-``` \ No newline at end of file diff --git a/courses/Angular/begginer-level/Components/Hooks.md b/courses/Angular/begginer-level/Components/Hooks.md deleted file mode 100644 index 5fa67dbb5..000000000 --- a/courses/Angular/begginer-level/Components/Hooks.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -id: lesson-2 -title: "Component Lifecycle Hooks" -sidebar_label: Hooks -sidebar_position: 2 -description: "Component Lifecycle HooksAngular Modules" -tags: [courses,beginner-level,Hooks,Introduction] ---- - - - -Angular provides lifecycle hooks that give you visibility into key moments in a component's lifecycle. Some common hooks include: - -1. **ngOnInit**: Called once the component is initialized. -2. **ngOnChanges**: Called when any data-bound property of a directive changes. -3. **ngDoCheck**: Called for every change detection run. -4. **ngOnDestroy**: Called just before the component is destroyed. - -Example of using lifecycle hooks: -```typescript -import { Component, OnInit, OnChanges, OnDestroy, Input } from '@angular/core'; - -@Component({ - selector: 'app-lifecycle', - template: '

{{ data }}

' -}) -export class LifecycleComponent implements OnInit, OnChanges, OnDestroy { - @Input() data: string; - - constructor() { - console.log('Constructor called'); - } - - ngOnInit() { - console.log('ngOnInit called'); - } - - ngOnChanges() { - console.log('ngOnChanges called'); - } - - ngOnDestroy() { - console.log('ngOnDestroy called'); - } -} -``` \ No newline at end of file diff --git a/courses/Angular/begginer-level/Components/Introduction.md b/courses/Angular/begginer-level/Components/Introduction.md deleted file mode 100644 index 032c0ed71..000000000 --- a/courses/Angular/begginer-level/Components/Introduction.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -id: lesson-1 -title: "Angular Components" -sidebar_label: Components -sidebar_position: 1 -description: "Angular Components" -tags: [courses,beginner-level,Interaction ,Angular Components,Introduction] ---- - - - -#### Creating Components - -To create a new component in Angular, you can use Angular CLI or manually create the necessary files. - -**Using Angular CLI**: -```bash -ng generate component component-name -``` - -This command generates the following files: -- `component-name.component.ts`: The TypeScript class for the component. -- `component-name.component.html`: The HTML template for the component. -- `component-name.component.css`: The CSS styles for the component. -- `component-name.component.spec.ts`: The test file for the component. - -**Example**: -```bash -ng generate component hello-world -``` - -**Manual Creation**: -1. Create a new folder for the component. -2. Create the component's TypeScript class, HTML template, and CSS file. -3. Register the component in a module. - -Example of a manually created component: - -`hello-world.component.ts`: -```typescript -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-hello-world', - templateUrl: './hello-world.component.html', - styleUrls: ['./hello-world.component.css'] -}) -export class HelloWorldComponent { - message: string = 'Hello, World!'; -} -``` - -`hello-world.component.html`: -```html -

{{ message }}

-``` - -`hello-world.component.css`: -```css -p { - font-size: 20px; - color: blue; -} -``` - -`app.module.ts` (Registering the component): -```typescript -import { HelloWorldComponent } from './hello-world/hello-world.component'; - -@NgModule({ - declarations: [ - AppComponent, - HelloWorldComponent - ], - ... -}) -export class AppModule { } -``` \ No newline at end of file diff --git a/courses/Angular/begginer-level/Components/_category_.json b/courses/Angular/begginer-level/Components/_category_.json deleted file mode 100644 index 2a8e1c324..000000000 --- a/courses/Angular/begginer-level/Components/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Components", - "position": 3, - "link": { - "type": "generated-index", - "description": "Learn to Angular Components." - } - } \ No newline at end of file diff --git a/courses/Angular/begginer-level/Directives-and-Pipes/Custom-Directives.md b/courses/Angular/begginer-level/Directives-and-Pipes/Custom-Directives.md deleted file mode 100644 index 816bacd49..000000000 --- a/courses/Angular/begginer-level/Directives-and-Pipes/Custom-Directives.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -id: lesson-2 -title: "Creating Custom Directives" -sidebar_label: Custom Directives -sidebar_position: 2 -description: "Creating Custom Directives" -tags: [courses,beginner-level,Custom Directives,Introduction] ---- - - - -Custom directives are used to extend HTML by creating reusable components with custom behavior. There are two types of custom directives: attribute directives and structural directives. - -**Example: Attribute Directive**: -1. **Create the Directive**: - ```typescript - // highlight.directive.ts - import { Directive, ElementRef, Renderer2, HostListener } from '@angular/core'; - - @Directive({ - selector: '[appHighlight]' - }) - export class HighlightDirective { - constructor(private el: ElementRef, private renderer: Renderer2) {} - - @HostListener('mouseenter') onMouseEnter() { - this.renderer.setStyle(this.el.nativeElement, 'backgroundColor', 'yellow'); - } - - @HostListener('mouseleave') onMouseLeave() { - this.renderer.removeStyle(this.el.nativeElement, 'backgroundColor'); - } - } - ``` - -2. **Use the Directive**: - ```html - -

Hover over this text to see the highlight effect.

- ``` - -**Example: Structural Directive**: -1. **Create the Directive**: - ```typescript - // unless.directive.ts - import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core'; - - @Directive({ - selector: '[appUnless]' - }) - export class UnlessDirective { - private hasView = false; - - constructor(private templateRef: TemplateRef, private viewContainer: ViewContainerRef) {} - - @Input() set appUnless(condition: boolean) { - if (!condition && !this.hasView) { - this.viewContainer.createEmbeddedView(this.templateRef); - this.hasView = true; - } else if (condition && this.hasView) { - this.viewContainer.clear(); - this.hasView = false; - } - } - } - ``` - -2. **Use the Directive**: - ```html - -
This content is displayed when condition is false.
- ``` - -**Component**: -```typescript -// app.component.ts -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] -}) -export class AppComponent { - condition = false; -} -``` diff --git a/courses/Angular/begginer-level/Directives-and-Pipes/Directives.md b/courses/Angular/begginer-level/Directives-and-Pipes/Directives.md deleted file mode 100644 index b0a57a41a..000000000 --- a/courses/Angular/begginer-level/Directives-and-Pipes/Directives.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -id: lesson-1 -title: "Built-in Directives" -sidebar_label: Directives -sidebar_position: 1 -description: "Built-in Directives" -tags: [courses,beginner-level,Directives,Introduction] ---- - -**1. `ngIf`**: Conditionally includes or excludes an element in the DOM. -```html -
Content to display if condition is true
-``` - -**2. `ngFor`**: Repeats an element for each item in a collection. -```html -
    -
  • {{ item }}
  • -
-``` - -**3. `ngClass`**: Adds and removes CSS classes dynamically. -```html -
Content
-``` - -**4. `ngStyle`**: Adds and removes inline styles dynamically. -```html -
Content
-``` - -**Example**: -```html - -
This is conditionally visible.
- -
    -
  • {{ user.name }}
  • -
- -
Styled content
- -
Styled content
-``` - -**Component**: -```typescript -// app.component.ts -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] -}) -export class AppComponent { - isVisible = true; - users = [{ name: 'Alice' }, { name: 'Bob' }, { name: 'Charlie' }]; - isActive = true; - isBold = false; - isHighlighted = true; -} -``` diff --git a/courses/Angular/begginer-level/Directives-and-Pipes/_category_.json b/courses/Angular/begginer-level/Directives-and-Pipes/_category_.json deleted file mode 100644 index c5b5c8928..000000000 --- a/courses/Angular/begginer-level/Directives-and-Pipes/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Directives and Pipes", - "position": 4, - "link": { - "type": "generated-index", - "description": "Learn to Directives and Pipes." - } - } \ No newline at end of file diff --git a/courses/Angular/begginer-level/Directives-and-Pipes/custom-pipe.md b/courses/Angular/begginer-level/Directives-and-Pipes/custom-pipe.md deleted file mode 100644 index 7fa63dad5..000000000 --- a/courses/Angular/begginer-level/Directives-and-Pipes/custom-pipe.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -id: lesson-4 -title: "Creating Custom Pipes" -sidebar_label: Custom Pipes -sidebar_position: 4 -description: "Creating Custom Pipes" -tags: [courses,beginner-level,Custom Pipes,Introduction] ---- - - -Custom pipes are used to create custom data transformations. - -1. **Create the Pipe**: - ```typescript - // reverse.pipe.ts - import { Pipe, PipeTransform } from '@angular/core'; - - @Pipe({ - name: 'reverse' - }) - export class ReversePipe implements PipeTransform { - transform(value: string): string { - return value.split('').reverse().join(''); - } - } - ``` - -2. **Register the Pipe**: - ```typescript - // app.module.ts - import { ReversePipe } from './reverse.pipe'; - - @NgModule({ - declarations: [ - AppComponent, - ReversePipe - ], - ... - }) - export class AppModule { } - ``` - -3. **Use the Pipe**: - ```html - -

{{ 'Hello Angular' | reverse }}

- ``` - -**Component**: -```typescript -// app.component.ts -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] -}) -export class AppComponent {} -``` - \ No newline at end of file diff --git a/courses/Angular/begginer-level/Directives-and-Pipes/pipe.md b/courses/Angular/begginer-level/Directives-and-Pipes/pipe.md deleted file mode 100644 index 36fb0bae2..000000000 --- a/courses/Angular/begginer-level/Directives-and-Pipes/pipe.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: lesson-3 -title: "Using Pipes for Data Transformation" -sidebar_label: Pipes -sidebar_position: 3 -description: "Using Pipes for Data Transformation" -tags: [courses,beginner-level,Basic Structure,Introduction] ---- - - -Pipes are used to transform data in templates. Angular provides several built-in pipes like `DatePipe`, `UpperCasePipe`, `LowerCasePipe`, `CurrencyPipe`, and `DecimalPipe`. - -**Example**: -```html - -

{{ today | date:'fullDate' }}

-

{{ name | uppercase }}

-

{{ price | currency:'USD':true }}

-``` - -**Component**: -```typescript -// app.component.ts -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] -}) -export class AppComponent { - today = new Date(); - name = 'Angular'; - price = 123.45; -} -``` diff --git a/courses/Angular/begginer-level/Forms/Form-validation.md b/courses/Angular/begginer-level/Forms/Form-validation.md deleted file mode 100644 index 9de2587e3..000000000 --- a/courses/Angular/begginer-level/Forms/Form-validation.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: lesson-3 -title: "Form Validation" -sidebar_label: Form Validation -sidebar_position: 3 -description: "Learn to Angular Form Validation" -tags: [courses,beginner-level,Form Validation,Introduction] ---- - - - -Validation in Angular forms can be achieved using built-in validators or custom validators. - -**Built-in Validators**: -- `Validators.required` -- `Validators.email` -- `Validators.minLength` -- `Validators.maxLength` -- `Validators.pattern` - -**Example**: -```typescript -this.userForm = this.fb.group({ - name: ['', [Validators.required, Validators.minLength(3)]], - email: ['', [Validators.required, Validators.email]], - password: ['', [Validators.required, Validators.minLength(6)]] -}); -``` - -**Custom Validators**: -Custom validators can be created by implementing the `ValidatorFn` interface. - -**Example**: -```typescript -import { AbstractControl, ValidatorFn } from '@angular/forms'; - -export function forbiddenNameValidator(nameRe: RegExp): ValidatorFn { - return (control: AbstractControl): {[key: string]: any} | null => { - const forbidden = nameRe.test(control.value); - return forbidden ? {'forbiddenName': {value: control.value}} : null; - }; -} - -// Usage in FormBuilder -this.userForm = this.fb.group({ - name: ['', [Validators.required, forbiddenNameValidator(/admin/i)]], - email: ['', [Validators.required, Validators.email]], - password: ['', [Validators.required, Validators.minLength(6)]] -}); -``` diff --git a/courses/Angular/begginer-level/Forms/Handling-form.md b/courses/Angular/begginer-level/Forms/Handling-form.md deleted file mode 100644 index c4f94d4f8..000000000 --- a/courses/Angular/begginer-level/Forms/Handling-form.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -id: lesson-4 -title: "Handling Form Submissions" -sidebar_label: Form Submissions -sidebar_position: 4 -description: "Handling Form Submissions" -tags: [courses,beginner-level,Form Submissions,Introduction] ---- - - -Handling form submissions involves capturing the form data and performing actions such as sending data to a server or updating the UI. - -**Template-Driven Form Submission**: -```typescript -onSubmit(form: NgForm) { - console.log('Form Submitted!', form.value); -} -``` - -**Reactive Form Submission**: -```typescript -onSubmit() { - console.log('Form Submitted!', this.userForm.value); -} -``` - -**Example with HTTP Service**: -```typescript -// app.component.ts -import { HttpClient } from '@angular/common/http'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] -}) -export class AppComponent { - userForm: FormGroup; - - constructor(private fb: FormBuilder, private http: HttpClient) { - this.userForm = this.fb.group({ - name: ['', Validators.required], - email: ['', [Validators.required, Validators.email]] - }); - } - - onSubmit() { - if (this.userForm.valid) { - this.http.post('https://example.com/api/users', this.userForm.value) - .subscribe(response => { - console.log('User saved successfully', response); - }); - } - } -} -``` - -**Module**: -```typescript -import { HttpClientModule } from '@angular/common/http'; - -@NgModule({ - imports: [ - HttpClientModule - ], - ... -}) -export class AppModule { } -``` - \ No newline at end of file diff --git a/courses/Angular/begginer-level/Forms/Reactive-Forms.md b/courses/Angular/begginer-level/Forms/Reactive-Forms.md deleted file mode 100644 index 4802a3f4f..000000000 --- a/courses/Angular/begginer-level/Forms/Reactive-Forms.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -id: lesson-2 -title: "Reactive Forms" -sidebar_label: Reactive Forms -sidebar_position: 2 -description: "Reactive Forms" -tags: [courses,beginner-level,Reactive Forms,Introduction] ---- - - - -Reactive forms are more powerful and scalable, providing more control and flexibility. They are built around observable streams, allowing for more dynamic interactions. - -**Example**: - -1. **Component**: - ```typescript - // app.component.ts - import { Component } from '@angular/core'; - import { FormBuilder, FormGroup, Validators } from '@angular/forms'; - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] - }) - export class AppComponent { - userForm: FormGroup; - - constructor(private fb: FormBuilder) { - this.userForm = this.fb.group({ - name: ['', Validators.required], - email: ['', [Validators.required, Validators.email]] - }); - } - - onSubmit() { - console.log('Form Submitted!', this.userForm.value); - } - } - ``` - -2. **Template**: - ```html - -
-
- - -
- Name is required. -
-
-
- - -
- Enter a valid email. -
-
- -
- ``` - -3. **Module**: - ```typescript - // app.module.ts - import { ReactiveFormsModule } from '@angular/forms'; - - @NgModule({ - imports: [ - ReactiveFormsModule - ], - ... - }) - export class AppModule { } - ``` diff --git a/courses/Angular/begginer-level/Forms/Template-driven.md b/courses/Angular/begginer-level/Forms/Template-driven.md deleted file mode 100644 index 41a812c7d..000000000 --- a/courses/Angular/begginer-level/Forms/Template-driven.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -id: lesson-1 -title: "Angular Forms" -sidebar_label: Angular Forms -sidebar_position: 1 -description: "Angular Forms" -tags: [courses,beginner-level,Angular Forms,Introduction] ---- - - -Angular provides two approaches for working with forms: template-driven forms and reactive forms. Both approaches provide powerful ways to handle user inputs, validate data, and manage form submissions. - -#### Template-Driven Forms - -Template-driven forms rely on Angular's directives and are simpler to implement for basic scenarios. - -**Example**: - -1. **Template**: - ```html - -
-
- - -
-
- - -
- -
- ``` - -2. **Component**: - ```typescript - // app.component.ts - import { Component } from '@angular/core'; - import { NgForm } from '@angular/forms'; - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] - }) - export class AppComponent { - onSubmit(form: NgForm) { - console.log('Form Submitted!', form.value); - } - } - ``` - -3. **Module**: - ```typescript - // app.module.ts - import { FormsModule } from '@angular/forms'; - - @NgModule({ - imports: [ - FormsModule - ], - ... - }) - export class AppModule { } - ``` diff --git a/courses/Angular/begginer-level/Forms/_category_.json b/courses/Angular/begginer-level/Forms/_category_.json deleted file mode 100644 index b4d38182b..000000000 --- a/courses/Angular/begginer-level/Forms/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Forms", - "position": 6, - "link": { - "type": "generated-index", - "description": "Learn to Angular Forms." - } - } \ No newline at end of file diff --git a/courses/Angular/begginer-level/HTTP-client/Error-handling.md b/courses/Angular/begginer-level/HTTP-client/Error-handling.md deleted file mode 100644 index 045d03eb1..000000000 --- a/courses/Angular/begginer-level/HTTP-client/Error-handling.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -id: lesson-4 -title: "Error Handling" -sidebar_label: Error Handling -sidebar_position: 4 -description: "Error Handling" -tags: [courses,beginner-level,Error Handling,Introduction] ---- - - -Handling errors in HTTP requests ensures that your application can gracefully handle unexpected issues. - -1. **Error Handling in Service**: - ```typescript - // data.service.ts (updated) - import { Injectable } from '@angular/core'; - import { HttpClient, HttpErrorResponse } from '@angular/common/http'; - import { Observable, throwError } from 'rxjs'; - import { catchError } from 'rxjs/operators'; - - @Injectable({ - providedIn: 'root' - }) - export class DataService { - private apiUrl = 'https://api.example.com/data'; - - constructor(private http: HttpClient) {} - - getData(): Observable { - return this.http.get(this.apiUrl).pipe( - catchError(this.handleError) - ); - } - - postData(data: any): Observable { - return this.http.post(this.apiUrl, data).pipe( - catchError(this.handleError) - ); - } - - private handleError(error: HttpErrorResponse) { - let errorMessage = 'An unknown error occurred!'; - if (error.error instanceof ErrorEvent) { - // A client-side or network error occurred. - errorMessage = `Error: ${error.error.message}`; - } else { - // The backend returned an unsuccessful response code. - errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`; - } - return throwError(errorMessage); - } - } - ``` - -2. **Displaying Errors in Component**: - ```typescript - // app.component.ts (updated) - import { Component, OnInit } from '@angular/core'; - import { DataService } from './data.service'; - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] - }) - export class AppComponent implements OnInit { - data: any; - error: string; - - constructor(private dataService: DataService) {} - - ngOnInit(): void { - this.dataService.getData().subscribe( - response => { - this.data = response; - }, - error => { - this.error = error; - } - ); - } - - sendData(): void { - const newData = { name: 'Angular', value: 'Framework' }; - this.dataService.postData(newData).subscribe( - response => { - console.log('Data sent successfully', response); - }, - error => { - this.error = error; - } - ); - } - } - ``` - -3. **Template**: - ```html - -
-

Data from API:

-
{{ data | json }}
-

{{ error }}

- -
- ``` - \ No newline at end of file diff --git a/courses/Angular/begginer-level/HTTP-client/Interceptors.md b/courses/Angular/begginer-level/HTTP-client/Interceptors.md deleted file mode 100644 index 7de156203..000000000 --- a/courses/Angular/begginer-level/HTTP-client/Interceptors.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -id: lesson-3 -title: "Interceptors" -sidebar_label: Interceptors -sidebar_position: 3 -description: "Interceptors" -tags: [courses,beginner-level,Interceptors,Introduction] ---- - - -Interceptors are used to inspect and transform HTTP requests and responses. They are useful for adding headers, handling authentication, logging, etc. - -1. **Create an Interceptor**: - ```typescript - // auth.interceptor.ts - import { Injectable } from '@angular/core'; - import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http'; - import { Observable } from 'rxjs'; - - @Injectable() - export class AuthInterceptor implements HttpInterceptor { - intercept(req: HttpRequest, next: HttpHandler): Observable> { - const clonedRequest = req.clone({ - headers: req.headers.set('Authorization', 'Bearer YOUR_TOKEN_HERE') - }); - - return next.handle(clonedRequest); - } - } - ``` - -2. **Provide the Interceptor**: - ```typescript - // app.module.ts - import { HTTP_INTERCEPTORS } from '@angular/common/http'; - import { AuthInterceptor } from './auth.interceptor'; - - @NgModule({ - providers: [ - { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true } - ], - // other configurations - }) - export class AppModule { } - ``` diff --git a/courses/Angular/begginer-level/HTTP-client/Request.md b/courses/Angular/begginer-level/HTTP-client/Request.md deleted file mode 100644 index 72199d874..000000000 --- a/courses/Angular/begginer-level/HTTP-client/Request.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -id: lesson-1 -title: "Making HTTP Requests" -sidebar_label: HTTP Requests -sidebar_position: 1 -description: "Making HTTP Requests" -tags: [courses,beginner-level,HTTP Requests,Introduction] ---- - - -First, ensure that the `HttpClientModule` is imported in your app module. - -1. **Import `HttpClientModule`**: - ```typescript - // app.module.ts - import { HttpClientModule } from '@angular/common/http'; - - @NgModule({ - imports: [ - HttpClientModule, - // other imports - ], - // other configurations - }) - export class AppModule { } - ``` - -2. **Inject `HttpClient` in a Service**: - ```typescript - // data.service.ts - import { Injectable } from '@angular/core'; - import { HttpClient } from '@angular/common/http'; - import { Observable } from 'rxjs'; - - @Injectable({ - providedIn: 'root' - }) - export class DataService { - private apiUrl = 'https://api.example.com/data'; - - constructor(private http: HttpClient) {} - - getData(): Observable { - return this.http.get(this.apiUrl); - } - - postData(data: any): Observable { - return this.http.post(this.apiUrl, data); - } - } - ``` - -3. **Use the Service in a Component**: - ```typescript - // app.component.ts - import { Component, OnInit } from '@angular/core'; - import { DataService } from './data.service'; - - @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] - }) - export class AppComponent implements OnInit { - data: any; - - constructor(private dataService: DataService) {} - - ngOnInit(): void { - this.dataService.getData().subscribe(response => { - this.data = response; - }); - } - - sendData(): void { - const newData = { name: 'Angular', value: 'Framework' }; - this.dataService.postData(newData).subscribe(response => { - console.log('Data sent successfully', response); - }); - } - } - ``` - -4. **Template**: - ```html - -
-

Data from API:

-
{{ data | json }}
- -
- ``` - diff --git a/courses/Angular/begginer-level/HTTP-client/_category_.json b/courses/Angular/begginer-level/HTTP-client/_category_.json deleted file mode 100644 index 0b794df00..000000000 --- a/courses/Angular/begginer-level/HTTP-client/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "HTTP Client", - "position": 7, - "link": { - "type": "generated-index", - "description": "Learn to HTPP Client." - } - } \ No newline at end of file diff --git a/courses/Angular/begginer-level/HTTP-client/response.md b/courses/Angular/begginer-level/HTTP-client/response.md deleted file mode 100644 index 0b60860c7..000000000 --- a/courses/Angular/begginer-level/HTTP-client/response.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -id: lesson-2 -title: "Handling HTTP Responses" -sidebar_label: HTTP Response -sidebar_position: 2 -description: "Handling HTTP Responses" -tags: [courses,beginner-level,Response,Introduction] ---- - - -You can handle HTTP responses using RxJS operators to manipulate or transform the data. - -1. **Using RxJS Operators**: - ```typescript - // data.service.ts (updated) - import { Injectable } from '@angular/core'; - import { HttpClient } from '@angular/common/http'; - import { Observable } from 'rxjs'; - import { map } from 'rxjs/operators'; - - @Injectable({ - providedIn: 'root' - }) - export class DataService { - private apiUrl = 'https://api.example.com/data'; - - constructor(private http: HttpClient) {} - - getData(): Observable { - return this.http.get(this.apiUrl).pipe( - map(response => { - // transform the response if needed - return response; - }) - ); - } - - postData(data: any): Observable { - return this.http.post(this.apiUrl, data).pipe( - map(response => { - // transform the response if needed - return response; - }) - ); - } - } - ``` \ No newline at end of file diff --git a/courses/Angular/begginer-level/Introduction/Installing.md b/courses/Angular/begginer-level/Introduction/Installing.md deleted file mode 100644 index 75e91bbdf..000000000 --- a/courses/Angular/begginer-level/Introduction/Installing.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -id: lesson-2 -title: "Setting Up the Development Environment" -sidebar_label: Setup Environment -sidebar_position: 2 -description: "Setting Up the Development Environment" -tags: [courses,beginner-level,Basic Structure,Introduction] ---- - - - -To set up an Angular development environment, you need to install Node.js and Angular CLI (Command Line Interface). - -1. **Install Node.js**: Download and install Node.js from the [official website](https://nodejs.org/). Node.js includes npm (Node Package Manager), which you'll use to install Angular CLI. -2. **Install Angular CLI**: - ```bash - npm install -g @angular/cli - ``` - This command installs Angular CLI globally on your machine. - -#### Creating Your First Angular Application - -1. **Create a New Angular Project**: - ```bash - ng new my-first-app - ``` - - `ng new` creates a new Angular project. - - `my-first-app` is the name of your project. - - Follow the prompts to set up your project with desired features (e.g., routing, stylesheets). - -2. **Navigate to Your Project Directory**: - ```bash - cd my-first-app - ``` - -3. **Serve the Application**: - ```bash - ng serve - ``` - - This command compiles the application and starts a development server. - - Open a web browser and navigate to `http://localhost:4200/` to see your application running. - -4. **Explore the Project Structure**: - - `src/app`: Contains the main application code. - - `src/app/app.component.ts`: The main component file. - - `src/app/app.module.ts`: The root module of the application. - - `src/app/app.component.html`: The main component template. - -5. **Modify the App Component**: - Open `src/app/app.component.html` and replace its contents with: - ```html -

Welcome to My First Angular App!

- ``` - Save the file and see the changes reflected in your browser. - -#### Example of a Simple Component - -1. **Generate a New Component**: - ```bash - ng generate component hello-world - ``` - - This command creates a new component named `hello-world` with four files: TypeScript, HTML, CSS, and a spec file for testing. - -2. **Use the New Component**: - Open `src/app/app.component.html` and add the new component selector: - ```html -

Welcome to My First Angular App!

- - ``` - -3. **Edit the New Component**: - Open `src/app/hello-world/hello-world.component.html` and replace its contents with: - ```html -

Hello, World!

- ``` - -4. **View the Component in the Browser**: - Save the files and see the new component displayed in your application. - \ No newline at end of file diff --git a/courses/Angular/begginer-level/Introduction/Introduction.md b/courses/Angular/begginer-level/Introduction/Introduction.md deleted file mode 100644 index e134b66a9..000000000 --- a/courses/Angular/begginer-level/Introduction/Introduction.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -id: lesson-1 -title: "Introduction to Angular" -sidebar_label: Introduction -sidebar_position: 1 -description: "Introduction to Angular" -tags: [courses,beginner-level,Angular,Introduction] ---- - - -#### What is Angular? -Angular is a platform and framework for building single-page client applications using HTML and TypeScript. Developed and maintained by Google, Angular is an open-source framework that provides a robust set of tools and features to create dynamic and responsive web applications. - -#### Key Features and Benefits - -1. **Component-Based Architecture**: Angular applications are built using a modular approach where the UI is divided into reusable components. -2. **Two-Way Data Binding**: This allows automatic synchronization of data between the model (business logic) and the view (UI). -3. **Dependency Injection**: Angular has a built-in dependency injection framework that improves the modularity and testability of your application. -4. **Directives**: Extend HTML's capabilities by creating custom HTML tags and attributes. -5. **TypeScript**: Angular is built with TypeScript, a superset of JavaScript that provides strong typing and better tooling. -6. **Routing**: Angular provides a powerful router to manage navigation and state of application views. -7. **Forms**: Angular supports both template-driven and reactive forms, making it easier to handle user input and validation. -8. **Testing**: Built-in support for unit testing and end-to-end testing using tools like Jasmine and Protractor. diff --git a/courses/Angular/begginer-level/Introduction/_category_.json b/courses/Angular/begginer-level/Introduction/_category_.json deleted file mode 100644 index f80455aaa..000000000 --- a/courses/Angular/begginer-level/Introduction/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Introduction & Setup", - "position": 1, - "link": { - "type": "generated-index", - "description": "Introduction & Setup Enviornment." - } - } \ No newline at end of file diff --git a/courses/Angular/begginer-level/Routing-and-Navigation/Angular-Routes.md b/courses/Angular/begginer-level/Routing-and-Navigation/Angular-Routes.md deleted file mode 100644 index 89fb95719..000000000 --- a/courses/Angular/begginer-level/Routing-and-Navigation/Angular-Routes.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -id: lesson-1 -title: "Routing and Navigation in Angular" -sidebar_label: Routing and Navigation -sidebar_position: 1 -description: "Routing and Navigation in Angular" -tags: [courses,beginner-level,Routing and Navigation,Introduction] ---- - - -Angular's router enables navigation from one view to another as users perform application tasks. Below are the steps to set up the router, configure routes, use route parameters, and implement lazy loading. - -#### Setting up the Angular Router - -1. **Install Angular Router**: The router is included by default when you create a new Angular application using the Angular CLI. However, if you need to add it to an existing application, you can install it using npm: - ```bash - npm install @angular/router - ``` - -2. **Import RouterModule**: In your `AppModule`, import `RouterModule` and define routes. - ```typescript - // app.module.ts - import { NgModule } from '@angular/core'; - import { BrowserModule } from '@angular/platform-browser'; - import { RouterModule, Routes } from '@angular/router'; - import { AppComponent } from './app.component'; - import { HomeComponent } from './home/home.component'; - import { AboutComponent } from './about/about.component'; - - const routes: Routes = [ - { path: '', component: HomeComponent }, - { path: 'about', component: AboutComponent } - ]; - - @NgModule({ - declarations: [ - AppComponent, - HomeComponent, - AboutComponent - ], - imports: [ - BrowserModule, - RouterModule.forRoot(routes) - ], - providers: [], - bootstrap: [AppComponent] - }) - export class AppModule { } - ``` - -3. **Add RouterOutlet**: In your main component template, add `` to render the routed components. - ```html - - - - ``` \ No newline at end of file diff --git a/courses/Angular/begginer-level/Routing-and-Navigation/Configure-ROute.md b/courses/Angular/begginer-level/Routing-and-Navigation/Configure-ROute.md deleted file mode 100644 index 25ed25cc9..000000000 --- a/courses/Angular/begginer-level/Routing-and-Navigation/Configure-ROute.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: lesson-2 -title: "Configuring Routes" -sidebar_label: Configuring Routes -sidebar_position: 2 -description: "Configuring Routes" -tags: [courses,beginner-level,Configuring Routes,Introduction] ---- - - -Routes are defined in the `Routes` array, where each route maps a URL path to a component. - -**Example**: -```typescript -// app.module.ts (continued) -const routes: Routes = [ - { path: '', component: HomeComponent }, - { path: 'about', component: AboutComponent }, - { path: 'contact', component: ContactComponent } -]; -``` - -**Navigating Programmatically**: -```typescript -// some.component.ts -import { Component } from '@angular/core'; -import { Router } from '@angular/router'; - -@Component({ - selector: 'app-some', - template: '' -}) -export class SomeComponent { - constructor(private router: Router) {} - - goToAbout() { - this.router.navigate(['/about']); - } -} -``` \ No newline at end of file diff --git a/courses/Angular/begginer-level/Routing-and-Navigation/Lazy-Loading.md b/courses/Angular/begginer-level/Routing-and-Navigation/Lazy-Loading.md deleted file mode 100644 index 13ae607ec..000000000 --- a/courses/Angular/begginer-level/Routing-and-Navigation/Lazy-Loading.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -id: lesson-4 -title: "Lazy Loading Modules" -sidebar_label: Lazy Loading -sidebar_position: 4 -description: "Lazy Loading Modules" -tags: [courses,beginner-level,Angular Forms,Introduction] ---- - - -Lazy loading allows you to load feature modules only when they are needed, improving the performance of your application. - -1. **Create a Feature Module**: - ```typescript - // feature.module.ts - import { NgModule } from '@angular/core'; - import { CommonModule } from '@angular/common'; - import { RouterModule, Routes } from '@angular/router'; - import { FeatureComponent } from './feature/feature.component'; - - const routes: Routes = [ - { path: '', component: FeatureComponent } - ]; - - @NgModule({ - declarations: [FeatureComponent], - imports: [ - CommonModule, - RouterModule.forChild(routes) - ] - }) - export class FeatureModule { } - ``` - -2. **Update Main Routes to Lazy Load**: - ```typescript - // app.module.ts - const routes: Routes = [ - { path: '', component: HomeComponent }, - { path: 'about', component: AboutComponent }, - { path: 'feature', loadChildren: () => import('./feature/feature.module').then(m => m.FeatureModule) } - ]; - ``` - -3. **Ensure RouterModule Configuration in Feature Module**: - ```typescript - // feature.module.ts (continued) - @NgModule({ - imports: [ - CommonModule, - RouterModule.forChild(routes) - ], - declarations: [FeatureComponent] - }) - export class FeatureModule { } - ``` - \ No newline at end of file diff --git a/courses/Angular/begginer-level/Routing-and-Navigation/Route-parameter.md b/courses/Angular/begginer-level/Routing-and-Navigation/Route-parameter.md deleted file mode 100644 index ffd578d44..000000000 --- a/courses/Angular/begginer-level/Routing-and-Navigation/Route-parameter.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -id: lesson-3 -title: "Route Parameters" -sidebar_label: Route Parameters -sidebar_position: 3 -description: "Route Parameters" -tags: [courses,beginner-level,Route Parameters,Introduction] ---- - - -Route parameters allow you to capture values from the URL and use them in your components. - -**Example**: -1. **Define a Route with a Parameter**: - ```typescript - const routes: Routes = [ - { path: 'user/:id', component: UserComponent } - ]; - ``` - -2. **Access Route Parameters**: - ```typescript - // user.component.ts - import { Component, OnInit } from '@angular/core'; - import { ActivatedRoute } from '@angular/router'; - - @Component({ - selector: 'app-user', - templateUrl: './user.component.html', - styleUrls: ['./user.component.css'] - }) - export class UserComponent implements OnInit { - userId: string; - - constructor(private route: ActivatedRoute) {} - - ngOnInit(): void { - this.userId = this.route.snapshot.paramMap.get('id'); - } - } - ``` - -3. **Use the Parameter in Template**: - ```html - -

User ID: {{ userId }}

- ``` - -**Reacting to Parameter Changes**: -```typescript -ngOnInit(): void { - this.route.paramMap.subscribe(params => { - this.userId = params.get('id'); - }); -} -``` \ No newline at end of file diff --git a/courses/Angular/begginer-level/Routing-and-Navigation/_category_.json b/courses/Angular/begginer-level/Routing-and-Navigation/_category_.json deleted file mode 100644 index f6e8fc1c4..000000000 --- a/courses/Angular/begginer-level/Routing-and-Navigation/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Routing and Navigation", - "position": 6, - "link": { - "type": "generated-index", - "description": "Learn to Routing and Navigation." - } - } \ No newline at end of file diff --git a/courses/Angular/begginer-level/_category_.json b/courses/Angular/begginer-level/_category_.json deleted file mode 100644 index 0052d9766..000000000 --- a/courses/Angular/begginer-level/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Begginer Level", - "position": 1, - "link": { - "type": "generated-index", - "description": "Learn to Begginer Technique Angular." - } - } \ No newline at end of file diff --git a/courses/Angular/intermediate/Advanced Component Interaction/Decorators.md b/courses/Angular/intermediate/Advanced Component Interaction/Decorators.md deleted file mode 100644 index 3d77e3b5c..000000000 --- a/courses/Angular/intermediate/Advanced Component Interaction/Decorators.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -id: lesson-1 -title: "Advanced Component Interaction in Angular" -sidebar_label: Component Interaction -sidebar_position: 1 -description: "Advanced Component Interaction in Angular" -tags: [courses,intermediate-level,Basic Structure,Introduction] ---- - - -In Angular, components interact with each other in various ways. This includes passing data between parent and child components, accessing child component instances, emitting custom events, and dynamically loading components. Here’s a detailed guide on each of these advanced component interaction techniques. - -#### Input and Output Decorators - -The `@Input` and `@Output` decorators facilitate data binding between parent and child components. - -1. **@Input Decorator**: - - Used to pass data from parent to child component. - - **Parent Component**: - ```typescript - // parent.component.ts - import { Component } from '@angular/core'; - - @Component({ - selector: 'app-parent', - template: `` - }) - export class ParentComponent { - parentMessage = 'Hello from Parent'; - } - ``` - - **Child Component**: - ```typescript - // child.component.ts - import { Component, Input } from '@angular/core'; - - @Component({ - selector: 'app-child', - template: `

{{childMessage}}

` - }) - export class ChildComponent { - @Input() childMessage: string; - } - ``` - -2. **@Output Decorator**: - - Used to emit events from child to parent component. - - **Parent Component**: - ```typescript - // parent.component.ts - import { Component } from '@angular/core'; - - @Component({ - selector: 'app-parent', - template: ` - -

{{message}}

- ` - }) - export class ParentComponent { - message: string; - - receiveMessage($event: string) { - this.message = $event; - } - } - ``` - - **Child Component**: - ```typescript - // child.component.ts - import { Component, Output, EventEmitter } from '@angular/core'; - - @Component({ - selector: 'app-child', - template: `` - }) - export class ChildComponent { - @Output() messageEvent = new EventEmitter(); - - sendMessage() { - this.messageEvent.emit('Hello from Child'); - } - } - ``` diff --git a/courses/Angular/intermediate/Advanced Component Interaction/Dynamic-Component.md b/courses/Angular/intermediate/Advanced Component Interaction/Dynamic-Component.md deleted file mode 100644 index aee240951..000000000 --- a/courses/Angular/intermediate/Advanced Component Interaction/Dynamic-Component.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -id: lesson-4 -title: "Dynamic Components" -sidebar_label: Dynamic Components -sidebar_position: 4 -description: "Angular Dynamic Components" -tags: [courses,intermediate-level,Basic Structure,Introduction] ---- - - -Dynamic components allow you to load components at runtime. - -1. **Define Components**: - ```typescript - // dynamic.component.ts - import { Component } from '@angular/core'; - - @Component({ - selector: 'app-dynamic', - template: `

Dynamic Component Loaded

` - }) - export class DynamicComponent {} - ``` - -2. **Create a Directive for Dynamic Component Loading**: - ```typescript - // dynamic.directive.ts - import { Directive, ViewContainerRef } from '@angular/core'; - - @Directive({ - selector: '[appDynamicHost]' - }) - export class DynamicDirective { - constructor(public viewContainerRef: ViewContainerRef) {} - } - ``` - -3. **Load Dynamic Component in a Host Component**: - ```typescript - // host.component.ts - import { Component, ComponentFactoryResolver, ViewChild, OnInit } from '@angular/core'; - import { DynamicDirective } from './dynamic.directive'; - import { DynamicComponent } from './dynamic.component'; - - @Component({ - selector: 'app-host', - template: `` - }) - export class HostComponent implements OnInit { - @ViewChild(DynamicDirective, { static: true }) dynamicHost: DynamicDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - const componentFactory = this.componentFactoryResolver.resolveComponentFactory(DynamicComponent); - const viewContainerRef = this.dynamicHost.viewContainerRef; - viewContainerRef.clear(); - viewContainerRef.createComponent(componentFactory); - } - } - ``` - -4. **Include Components and Directives in Module**: - ```typescript - // app.module.ts - import { NgModule } from '@angular/core'; - import { BrowserModule } from '@angular/platform-browser'; - import { HostComponent } from './host.component'; - import { DynamicComponent } from './dynamic.component'; - import { DynamicDirective } from './dynamic.directive'; - - @NgModule({ - declarations: [ - HostComponent, - DynamicComponent, - DynamicDirective - ], - entryComponents: [DynamicComponent], // required for dynamic components - imports: [ - BrowserModule - ], - providers: [], - bootstrap: [HostComponent] - }) - export class AppModule { } - ``` \ No newline at end of file diff --git a/courses/Angular/intermediate/Advanced Component Interaction/Event-Emiters.md b/courses/Angular/intermediate/Advanced Component Interaction/Event-Emiters.md deleted file mode 100644 index a5c0dc078..000000000 --- a/courses/Angular/intermediate/Advanced Component Interaction/Event-Emiters.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: lesson-3 -title: "Event Emitters" -sidebar_label: Event Emitters -sidebar_position: 3 -description: "Event Emitters" -tags: [courses,intermediate-level,Basic Structure,Introduction] ---- - -Event emitters are used to emit custom events from child components to parent components. - -**Child Component**: -```typescript -// child.component.ts -import { Component, EventEmitter, Output } from '@angular/core'; - -@Component({ - selector: 'app-child', - template: `` -}) -export class ChildComponent { - @Output() messageEvent = new EventEmitter(); - - sendMessage() { - this.messageEvent.emit('Hello from Child'); - } -} -``` - -**Parent Component**: -```typescript -// parent.component.ts -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-parent', - template: ` - -

{{message}}

- ` -}) -export class ParentComponent { - message: string; - - receiveMessage($event: string) { - this.message = $event; - } -} -``` - diff --git a/courses/Angular/intermediate/Advanced Component Interaction/View-and-content-Child.md b/courses/Angular/intermediate/Advanced Component Interaction/View-and-content-Child.md deleted file mode 100644 index bf1ecef6f..000000000 --- a/courses/Angular/intermediate/Advanced Component Interaction/View-and-content-Child.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -id: lesson-2 -title: "ViewChild and ContentChild" -sidebar_label: ViewChild and ContentChild -sidebar_position: 2 -description: "ViewChild and ContentChild" -tags: [courses,intermediate-level,Basic Structure,Introduction] ---- - - -These decorators are used to access child components, directives, or DOM elements. - -1. **@ViewChild**: - - Access a child component, directive, or DOM element from the parent component. - - **Parent Component**: - ```typescript - // parent.component.ts - import { Component, AfterViewInit, ViewChild } from '@angular/core'; - import { ChildComponent } from './child.component'; - - @Component({ - selector: 'app-parent', - template: ` - - - ` - }) - export class ParentComponent implements AfterViewInit { - @ViewChild(ChildComponent) child: ChildComponent; - - ngAfterViewInit() { - console.log(this.child.childMessage); - } - - accessChild() { - this.child.childMessage = 'Message updated by Parent'; - } - } - ``` - - **Child Component**: - ```typescript - // child.component.ts - import { Component } from '@angular/core'; - - @Component({ - selector: 'app-child', - template: `

{{childMessage}}

` - }) - export class ChildComponent { - childMessage = 'Hello from Child'; - } - ``` - -2. **@ContentChild**: - - Access projected content (ng-content) in a component. - - **Parent Component**: - ```typescript - // parent.component.ts - import { Component } from '@angular/core'; - - @Component({ - selector: 'app-parent', - template: ` - -

Content projected from Parent

-
- ` - }) - export class ParentComponent {} - ``` - - **Child Component**: - ```typescript - // child.component.ts - import { Component, ContentChild, AfterContentInit } from '@angular/core'; - - @Component({ - selector: 'app-child', - template: `` - }) - export class ChildComponent implements AfterContentInit { - @ContentChild('projectedContent') content; - - ngAfterContentInit() { - console.log(this.content.nativeElement.textContent); - } - } - ``` - - **Template**: - ```html - - -

Content projected from Parent

-
- ``` - diff --git a/courses/Angular/intermediate/Advanced Component Interaction/_category_.json b/courses/Angular/intermediate/Advanced Component Interaction/_category_.json deleted file mode 100644 index 19f88ce6d..000000000 --- a/courses/Angular/intermediate/Advanced Component Interaction/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Advanced Component Interaction", - "position": 1, - "link": { - "type": "generated-index", - "description": "Learn to Advanced Component Interaction." - } - } \ No newline at end of file diff --git a/courses/Angular/intermediate/Angular-Modules/Featured.md b/courses/Angular/intermediate/Angular-Modules/Featured.md deleted file mode 100644 index 700d9011c..000000000 --- a/courses/Angular/intermediate/Angular-Modules/Featured.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -id: lesson-1 -title: "Angular Modules" -sidebar_label: Modules -sidebar_position: 1 -description: "Angular Modules" -tags: [courses,intermediate-level,Modules,Introduction] ---- - - -Angular modules are a fundamental concept that helps organize an application into cohesive blocks of functionality. They help in managing dependencies, optimizing load times, and promoting reusability. There are different types of modules in Angular, each serving a specific purpose. - -#### Feature Modules - -Feature modules are used to encapsulate a specific feature or functionality within an application. They help in organizing related components, services, and other code into a single, cohesive unit. - -1. **Creating a Feature Module**: - ```bash - ng generate module feature --route feature --module app.module - ``` - -2. **Feature Module Structure**: - ```typescript - // feature.module.ts - import { NgModule } from '@angular/core'; - import { CommonModule } from '@angular/common'; - import { RouterModule, Routes } from '@angular/router'; - import { FeatureComponent } from './feature.component'; - - const routes: Routes = [ - { path: '', component: FeatureComponent } - ]; - - @NgModule({ - declarations: [FeatureComponent], - imports: [ - CommonModule, - RouterModule.forChild(routes) - ] - }) - export class FeatureModule { } - ``` - -3. **Lazy Loading Feature Module**: - ```typescript - // app-routing.module.ts - import { NgModule } from '@angular/core'; - import { RouterModule, Routes } from '@angular/router'; - - const routes: Routes = [ - { path: 'feature', loadChildren: () => import('./feature/feature.module').then(m => m.FeatureModule) } - ]; - - @NgModule({ - imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] - }) - export class AppRoutingModule { } - ``` \ No newline at end of file diff --git a/courses/Angular/intermediate/Angular-Modules/_category_.json b/courses/Angular/intermediate/Angular-Modules/_category_.json deleted file mode 100644 index ff6780c58..000000000 --- a/courses/Angular/intermediate/Angular-Modules/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Modules", - "position": 4, - "link": { - "type": "generated-index", - "description": "Learn to Modules Avance Concept." - } - } \ No newline at end of file diff --git a/courses/Angular/intermediate/Angular-Modules/core-module.md b/courses/Angular/intermediate/Angular-Modules/core-module.md deleted file mode 100644 index 67dd57eec..000000000 --- a/courses/Angular/intermediate/Angular-Modules/core-module.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -id: lesson-3 -title: "Core Modules" -sidebar_label: Core Modules -sidebar_position: 3 -description: "Core Modules" -tags: [courses,intermediate-level,Core Modules,Introduction] ---- - - -Core modules are used to provide singleton services that are needed across the entire application. These services are typically provided in the root injector and should only be imported in the root AppModule to avoid multiple instances. - -1. **Creating a Core Module**: - ```bash - ng generate module core - ``` - -2. **Core Module Structure**: - ```typescript - // core.module.ts - import { NgModule, Optional, SkipSelf } from '@angular/core'; - import { CommonModule } from '@angular/common'; - import { CoreService } from './core.service'; - - @NgModule({ - declarations: [], - imports: [ - CommonModule - ], - providers: [CoreService] - }) - export class CoreModule { - constructor(@Optional() @SkipSelf() parentModule: CoreModule) { - if (parentModule) { - throw new Error('CoreModule is already loaded. Import it in the AppModule only.'); - } - } - } - ``` - -3. **Using Core Module in App Module**: - ```typescript - // app.module.ts - import { BrowserModule } from '@angular/platform-browser'; - import { NgModule } from '@angular/core'; - import { AppComponent } from './app.component'; - import { CoreModule } from './core/core.module'; - - @NgModule({ - declarations: [AppComponent], - imports: [ - BrowserModule, - CoreModule - ], - providers: [], - bootstrap: [AppComponent] - }) - export class AppModule { } - ``` diff --git a/courses/Angular/intermediate/Angular-Modules/lazy-loading.md b/courses/Angular/intermediate/Angular-Modules/lazy-loading.md deleted file mode 100644 index 7511ba505..000000000 --- a/courses/Angular/intermediate/Angular-Modules/lazy-loading.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -id: lesson-4 -title: "Module Lazy Loading" -sidebar_label: Module Lazy Loading -sidebar_position: 4 -description: "Module Lazy Loading" -tags: [courses,intermediate-level,Lazy Loading,Introduction] ---- - - -Lazy loading helps in improving the initial load time of the application by loading feature modules on demand rather than loading them upfront. - -1. **Configuring Lazy Loading in Routing**: - ```typescript - // app-routing.module.ts - import { NgModule } from '@angular/core'; - import { RouterModule, Routes } from '@angular/router'; - - const routes: Routes = [ - { path: 'feature', loadChildren: () => import('./feature/feature.module').then(m => m.FeatureModule) } - ]; - - @NgModule({ - imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] - }) - export class AppRoutingModule { } - ``` - -2. **Defining Routes in Feature Module**: - ```typescript - // feature.module.ts - import { NgModule } from '@angular/core'; - import { CommonModule } from '@angular/common'; - import { RouterModule, Routes } from '@angular/router'; - import { FeatureComponent } from './feature.component'; - - const routes: Routes = [ - { path: '', component: FeatureComponent } - ]; - - @NgModule({ - declarations: [FeatureComponent], - imports: [ - CommonModule, - RouterModule.forChild(routes) - ] - }) - export class FeatureModule { } - ``` - -By organizing your Angular application into feature modules, shared modules, core modules, and using lazy loading, you can create a scalable, maintainable, and performant application. \ No newline at end of file diff --git a/courses/Angular/intermediate/Angular-Modules/shared.md b/courses/Angular/intermediate/Angular-Modules/shared.md deleted file mode 100644 index 8280a143b..000000000 --- a/courses/Angular/intermediate/Angular-Modules/shared.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -id: lesson-2 -title: "Shared Modules" -sidebar_label: Shared Modules -sidebar_position: 2 -description: "Shared Modules" -tags: [courses,intermediate-level,Shared Modules,Introduction] ---- - - -Shared modules are used to encapsulate common components, directives, and pipes that will be used across multiple feature modules. They help in avoiding code duplication and centralizing reusable code. - -1. **Creating a Shared Module**: - ```bash - ng generate module shared - ``` - -2. **Shared Module Structure**: - ```typescript - // shared.module.ts - import { NgModule } from '@angular/core'; - import { CommonModule } from '@angular/common'; - import { SharedComponent } from './shared.component'; - import { SharedDirective } from './shared.directive'; - import { SharedPipe } from './shared.pipe'; - - @NgModule({ - declarations: [ - SharedComponent, - SharedDirective, - SharedPipe - ], - imports: [ - CommonModule - ], - exports: [ - SharedComponent, - SharedDirective, - SharedPipe, - CommonModule - ] - }) - export class SharedModule { } - ``` - -3. **Using Shared Module in Feature Module**: - ```typescript - // feature.module.ts - import { NgModule } from '@angular/core'; - import { CommonModule } from '@angular/common'; - import { RouterModule, Routes } from '@angular/router'; - import { FeatureComponent } from './feature.component'; - import { SharedModule } from '../shared/shared.module'; - - const routes: Routes = [ - { path: '', component: FeatureComponent } - ]; - - @NgModule({ - declarations: [FeatureComponent], - imports: [ - CommonModule, - SharedModule, - RouterModule.forChild(routes) - ] - }) - export class FeatureModule { } - ``` \ No newline at end of file diff --git a/courses/Angular/intermediate/Animations/Introduction.md b/courses/Angular/intermediate/Animations/Introduction.md deleted file mode 100644 index dcbfd88cc..000000000 --- a/courses/Angular/intermediate/Animations/Introduction.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: lesson-1 -title: "Introduction to Angular Animations" -sidebar_label: Introduction to Angular Animations -sidebar_position: 1 -description: "Introduction to Angular Animations" -tags: [courses,intermediate-level,Introduction] ---- - - -Angular animations provide a powerful way to create and manage animations within Angular applications. Angular uses the Web Animations API to implement animations, offering a robust and flexible API for defining animation sequences and transitions. - -#### Concepts - -Angular animations allow you to: -- Enhance the user experience with smooth and engaging animations. -- Animate the entry and exit of elements. -- Create sophisticated animation sequences. -- Define animations that are reusable across components. - -Angular animations are defined in the `@Component` decorator using the `animations` property and the `trigger`, `state`, `style`, `transition`, and `animate` functions from `@angular/animations`. diff --git a/courses/Angular/intermediate/Animations/Keyframe.md b/courses/Angular/intermediate/Animations/Keyframe.md deleted file mode 100644 index fdb50d708..000000000 --- a/courses/Angular/intermediate/Animations/Keyframe.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -id: lesson-3 -title: "Keyframe Animations" -sidebar_label: Keyframe -sidebar_position: 3 -description: "Keyframe Animations in Angular" -tags: [courses,intermediate-level,Basic Structure,Introduction] ---- - - -Keyframe animations allow you to define multiple intermediate steps in an animation. - -1. **Defining Keyframe Animations**: - ```typescript - import { keyframes } from '@angular/animations'; - - @Component({ - selector: 'app-root', - template: ` -
- Click me to animate with keyframes -
- `, - styles: [` - div { - width: 200px; - height: 200px; - background-color: lightblue; - margin: 100px auto; - text-align: center; - line-height: 200px; - } - `], - animations: [ - trigger('keyframeAnimation', [ - state('start', style({ - backgroundColor: 'lightblue', - transform: 'scale(1)' - })), - state('end', style({ - backgroundColor: 'lightgreen', - transform: 'scale(1.5)' - })), - transition('start <=> end', [ - animate('1000ms ease-in', keyframes([ - style({ transform: 'scale(1.1)', offset: 0.2 }), - style({ transform: 'scale(1.2)', offset: 0.4 }), - style({ transform: 'scale(1.3)', offset: 0.6 }), - style({ transform: 'scale(1.4)', offset: 0.8 }), - style({ transform: 'scale(1.5)', offset: 1 }) - ])) - ]) - ]) - ] - }) - export class AppComponent { - state = 'start'; - - toggleState() { - this.state = this.state === 'start' ? 'end' : 'start'; - } - } - ``` diff --git a/courses/Angular/intermediate/Animations/Transitions.md b/courses/Angular/intermediate/Animations/Transitions.md deleted file mode 100644 index bae388cc2..000000000 --- a/courses/Angular/intermediate/Animations/Transitions.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -id: lesson-4 -title: "Animation Transitions and Sequences" -sidebar_label: Transitions and Sequences -sidebar_position: 4 -description: "Animation Transitions and Sequences" -tags: [courses,intermediate-level,Basic Structure,Introduction] ---- - - - -Transitions define how to switch from one state to another, while sequences allow you to run animations in a specific order. - -1. **Defining Animation Transitions**: - ```typescript - @Component({ - selector: 'app-root', - template: ` -
- Click me for sequential animation -
- `, - styles: [` - div { - width: 200px; - height: 200px; - background-color: lightblue; - margin: 100px auto; - text-align: center; - line-height: 200px; - } - `], - animations: [ - trigger('sequenceAnimation', [ - state('start', style({ - backgroundColor: 'lightblue', - transform: 'translateX(0) scale(1)' - })), - state('end', style({ - backgroundColor: 'lightgreen', - transform: 'translateX(100px) scale(1.5)' - })), - transition('start => end', [ - animate('500ms ease-in', style({ transform: 'translateX(50px) scale(1.2)' })), - animate('500ms ease-in') - ]), - transition('end => start', [ - animate('500ms ease-out', style({ transform: 'translateX(-50px) scale(1.2)' })), - animate('500ms ease-out') - ]) - ]) - ] - }) - export class AppComponent { - state = 'start'; - - toggleState() { - this.state = this.state === 'start' ? 'end' : 'start'; - } - } - ``` - \ No newline at end of file diff --git a/courses/Angular/intermediate/Animations/Triggers.md b/courses/Angular/intermediate/Animations/Triggers.md deleted file mode 100644 index fab9a5e92..000000000 --- a/courses/Angular/intermediate/Animations/Triggers.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -id: lesson-2 -title: "Animation Triggers and States" -sidebar_label: Triggers and States -sidebar_position: 2 -description: "Animation Triggers and States" -tags: [courses,intermediate-level,Basic Structure,Introduction] ---- - - -Animation triggers are used to define named sets of animations, and states define the end styles of the animation. - -1. **Installing Angular Animations**: - ```bash - ng add @angular/animations - ``` - -2. **Setting Up Animations**: - ```typescript - // app.module.ts - import { BrowserModule } from '@angular/platform-browser'; - import { NgModule } from '@angular/core'; - import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; - import { AppComponent } from './app.component'; - - @NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - BrowserAnimationsModule - ], - providers: [], - bootstrap: [AppComponent] - }) - export class AppModule { } - ``` - -3. **Defining Animation Triggers and States**: - ```typescript - // app.component.ts - import { Component } from '@angular/core'; - import { trigger, state, style, transition, animate } from '@angular/animations'; - - @Component({ - selector: 'app-root', - template: ` -
- Click me to animate -
- `, - styles: [` - div { - width: 200px; - height: 200px; - background-color: lightblue; - margin: 100px auto; - text-align: center; - line-height: 200px; - } - `], - animations: [ - trigger('simpleAnimation', [ - state('start', style({ - backgroundColor: 'lightblue', - transform: 'scale(1)' - })), - state('end', style({ - backgroundColor: 'lightgreen', - transform: 'scale(1.5)' - })), - transition('start <=> end', [ - animate('300ms ease-in') - ]) - ]) - ] - }) - export class AppComponent { - state = 'start'; - - toggleState() { - this.state = this.state === 'start' ? 'end' : 'start'; - } - } - ``` diff --git a/courses/Angular/intermediate/Animations/_category_.json b/courses/Angular/intermediate/Animations/_category_.json deleted file mode 100644 index c0af07b07..000000000 --- a/courses/Angular/intermediate/Animations/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Animations", - "position": 3, - "link": { - "type": "generated-index", - "description": "Learn to Angular Animations." - } - } \ No newline at end of file diff --git a/courses/Angular/intermediate/Testing/Component-Testing.md b/courses/Angular/intermediate/Testing/Component-Testing.md deleted file mode 100644 index 878a7d056..000000000 --- a/courses/Angular/intermediate/Testing/Component-Testing.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: lesson-2 -title: "Component Testing" -sidebar_label: Component Testing -sidebar_position: 2 -description: "Component Testing" -tags: [courses,intermediate-level,Component Testing,Introduction] ---- - - -Component testing involves testing the component's template, bindings, and interactions. - -1. **Setting Up Component Testing**: - ```typescript - // app.component.spec.ts - import { ComponentFixture, TestBed } from '@angular/core/testing'; - import { AppComponent } from './app.component'; - - describe('AppComponent', () => { - let component: AppComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [AppComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(AppComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); - - it('should have a title', () => { - expect(component.title).toEqual('my-app'); - }); - - it('should render title in a h1 tag', () => { - const compiled = fixture.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('Welcome to my-app!'); - }); - }); - ``` - diff --git a/courses/Angular/intermediate/Testing/End-to-end.md b/courses/Angular/intermediate/Testing/End-to-end.md deleted file mode 100644 index 983828335..000000000 --- a/courses/Angular/intermediate/Testing/End-to-end.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: lesson-4 -title: "End-to-End Testing with Protractor" -sidebar_label: End-to-End Testing -sidebar_position: 4 -description: "End-to-End Testing with Protractor" -tags: [courses,intermediate-level,End-to-End Testing,Introduction] ---- - - -Protractor is an end-to-end test framework for Angular applications. It runs tests against your application in a real browser, simulating user interactions. - -1. **Setting Up Protractor**: - Angular CLI generates a basic Protractor configuration when you create a new Angular project. - - ```bash - ng e2e - ``` - - This command will start the Protractor test runner and execute the end-to-end tests. - -2. **Writing End-to-End Tests**: - End-to-end tests are written in `e2e/src/app.e2e-spec.ts`. - - ```typescript - // e2e/src/app.e2e-spec.ts - import { browser, by, element } from 'protractor'; - - describe('workspace-project App', () => { - it('should display welcome message', () => { - browser.get(browser.baseUrl); - expect(element(by.css('app-root h1')).getText()).toEqual('Welcome to my-app!'); - }); - }); - ``` - -3. **Protractor Configuration**: - The configuration for Protractor is located in `e2e/protractor.conf.js`. - - ```javascript - // e2e/protractor.conf.js - exports.config = { - allScriptsTimeout: 11000, - specs: [ - './src/**/*.e2e-spec.ts' - ], - capabilities: { - 'browserName': 'chrome' - }, - directConnect: true, - baseUrl: 'http://localhost:4200/', - framework: 'jasmine', - jasmineNodeOpts: { - showColors: true, - defaultTimeoutInterval: 30000, - print: function() {} - }, - onPrepare() { - require('ts-node').register({ - project: require('path').join(__dirname, './tsconfig.json') - }); - } - }; - ``` \ No newline at end of file diff --git a/courses/Angular/intermediate/Testing/Service-testing.md b/courses/Angular/intermediate/Testing/Service-testing.md deleted file mode 100644 index 0513f55f2..000000000 --- a/courses/Angular/intermediate/Testing/Service-testing.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -id: lesson-3 -title: "Service Testing" -sidebar_label: Service Testing -sidebar_position: 3 -description: "Service Testing" -tags: [courses,intermediate-level,Service Testing,Introduction] ---- - - -Service testing involves testing the business logic and data interactions provided by Angular services. - -1. **Setting Up Service Testing**: - ```typescript - // data.service.spec.ts - import { TestBed } from '@angular/core/testing'; - import { DataService } from './data.service'; - - describe('DataService', () => { - let service: DataService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(DataService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); - - it('should return data', () => { - const data = service.getData(); - expect(data).toEqual(['data1', 'data2', 'data3']); - }); - }); - ``` - - ```typescript - // data.service.ts - import { Injectable } from '@angular/core'; - - @Injectable({ - providedIn: 'root' - }) - export class DataService { - constructor() { } - - getData() { - return ['data1', 'data2', 'data3']; - } - } - ``` \ No newline at end of file diff --git a/courses/Angular/intermediate/Testing/Unit-Testing.md b/courses/Angular/intermediate/Testing/Unit-Testing.md deleted file mode 100644 index 30ea6bb64..000000000 --- a/courses/Angular/intermediate/Testing/Unit-Testing.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: lesson-1 -title: "Testing in Angular" -sidebar_label: Testing & Concept -sidebar_position: 1 -description: "Testing in Angular" -tags: [courses,intermediate-level,Testing,Introduction] ---- - - -Testing is an essential part of the development process, ensuring that your application works as expected. Angular provides built-in support for unit testing with Jasmine and Karma, as well as end-to-end testing with Protractor. - -#### Unit Testing with Jasmine and Karma - -Jasmine is a behavior-driven development framework for testing JavaScript code, and Karma is a test runner that allows you to run Jasmine tests in multiple browsers. - -1. **Setting Up Unit Testing**: - Angular CLI generates a test setup with Jasmine and Karma out of the box. When you create a new Angular project, the test configuration is already included. - - ```bash - ng new my-app - cd my-app - ng test - ``` - - This command will start the Karma test runner and execute the Jasmine tests. - -2. **Writing Unit Tests**: - Unit tests are written in `.spec.ts` files. The Angular CLI generates a spec file for each component, service, and other classes. - - ```typescript - // app.component.spec.ts - import { TestBed, async } from '@angular/core/testing'; - import { AppComponent } from './app.component'; - - describe('AppComponent', () => { - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ - AppComponent - ], - }).compileComponents(); - })); - - it('should create the app', () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app).toBeTruthy(); - }); - - it(`should have as title 'my-app'`, () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('my-app'); - }); - - it('should render title', () => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('.content span').textContent).toContain('my-app app is running!'); - }); - }); - ``` diff --git a/courses/Angular/intermediate/Testing/_category_.json b/courses/Angular/intermediate/Testing/_category_.json deleted file mode 100644 index 8f39c43a9..000000000 --- a/courses/Angular/intermediate/Testing/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Testing & Maintanance", - "position": 5, - "link": { - "type": "generated-index", - "description": "Testing & Maintanance" - } - } \ No newline at end of file diff --git a/courses/Angular/intermediate/_category_.json b/courses/Angular/intermediate/_category_.json deleted file mode 100644 index 74132d1cc..000000000 --- a/courses/Angular/intermediate/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Intermediate Level", - "position": 2, - "link": { - "type": "generated-index", - "description": "Learn to Intermediate Technique Angular." - } - } \ No newline at end of file diff --git a/courses/Angular/intermediate/state-management/Behaviour-Subject.md b/courses/Angular/intermediate/state-management/Behaviour-Subject.md deleted file mode 100644 index 9f81fe639..000000000 --- a/courses/Angular/intermediate/state-management/Behaviour-Subject.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -id: lesson-2 -title: "Using `BehaviorSubject` for State Management" -sidebar_label: BehaviorSubject -sidebar_position: 2 -description: "Using `BehaviorSubject` for State Management" -tags: [courses,intermediate-level,subject behaviour,Introduction] ---- - - -`BehaviorSubject` is a part of RxJS and is used to handle state management in a more straightforward way. It holds a value and emits it to new subscribers immediately upon subscription. - -1. **Creating a Service with `BehaviorSubject`**: - ```typescript - // state.service.ts - import { Injectable } from '@angular/core'; - import { BehaviorSubject } from 'rxjs'; - - @Injectable({ - providedIn: 'root' - }) - export class StateService { - private stateSubject = new BehaviorSubject('initial state'); - state$ = this.stateSubject.asObservable(); - - updateState(newState: string) { - this.stateSubject.next(newState); - } - } - ``` - -2. **Using the Service in Components**: - - **Component 1**: - ```typescript - // component1.component.ts - import { Component } from '@angular/core'; - import { StateService } from './state.service'; - - @Component({ - selector: 'app-component1', - template: ` -
-

Component 1

- -
- ` - }) - export class Component1 { - constructor(private stateService: StateService) {} - - updateState() { - this.stateService.updateState('new state from component 1'); - } - } - ``` - - - **Component 2**: - ```typescript - // component2.component.ts - import { Component, OnInit } from '@angular/core'; - import { StateService } from './state.service'; - - @Component({ - selector: 'app-component2', - template: ` -
-

Component 2

-

State: {{ state }}

-
- ` - }) - export class Component2 implements OnInit { - state: string; - - constructor(private stateService: StateService) {} - - ngOnInit() { - this.stateService.state$.subscribe(state => { - this.state = state; - }); - } - } - ``` \ No newline at end of file diff --git a/courses/Angular/intermediate/state-management/Concepts.md b/courses/Angular/intermediate/state-management/Concepts.md deleted file mode 100644 index 3be11db63..000000000 --- a/courses/Angular/intermediate/state-management/Concepts.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -id: lesson-4 -title: "NgRx Concept(Actions, Reducers, and Effects)" -sidebar_label: NgRx Concept -sidebar_position: 4 -description: "NgRx Concept" -tags: [courses,intermediate-level,NgRx concept,Introduction] ---- - -NgRx divides state management into three key concepts: Actions, Reducers, and Effects. - -1. **Actions**: - - Actions are payloads of information that send data from your application to your store. - - ```typescript - // actions.ts - import { createAction, props } from '@ngrx/store'; - - export const loadItems = createAction('[Items] Load Items'); - export const loadItemsSuccess = createAction('[Items] Load Items Success', props<{ items: any[] }>()); - export const loadItemsFailure = createAction('[Items] Load Items Failure', props<{ error: any }>()); - ``` - -2. **Reducers**: - - Reducers specify how the application's state changes in response to actions. - - ```typescript - // reducer.ts - import { createReducer, on } from '@ngrx/store'; - import { loadItemsSuccess, loadItemsFailure } from './actions'; - - export const initialState = { - items: [], - error: null - }; - - const _itemsReducer = createReducer(initialState, - on(loadItemsSuccess, (state, { items }) => ({ ...state, items, error: null })), - on(loadItemsFailure, (state, { error }) => ({ ...state, error })) - ); - - export function itemsReducer(state, action) { - return _itemsReducer(state, action); - } - ``` - -3. **Effects**: - - Effects handle side effects like data fetching, processing responses, and dispatching new actions. - - ```typescript - // effects.ts - import { Injectable } from '@angular/core'; - import { Actions, createEffect, ofType } from '@ngrx/effects'; - import { of } from 'rxjs'; - import { catchError, map, mergeMap } from 'rxjs/operators'; - import { ItemService } from './item.service'; - import { loadItems, loadItemsSuccess, loadItemsFailure } from './actions'; - - @Injectable() - export class ItemEffects { - loadItems$ = createEffect(() => this.actions$.pipe( - ofType(loadItems), - mergeMap(() => this.itemService.getAllItems().pipe( - map(items => loadItemsSuccess({ items })), - catchError(error => of(loadItemsFailure({ error }))) - )) - )); - - constructor( - private actions$: Actions, - private itemService: ItemService - ) {} - } - ``` - - - **Register Effects**: - ```typescript - // app.module.ts - import { EffectsModule } from '@ngrx/effects'; - import { ItemEffects } from './effects'; - - @NgModule({ - imports: [ - EffectsModule.forRoot([ItemEffects]) - ] - }) - export class AppModule { } - ``` - -By understanding and implementing these state management techniques, you can effectively manage the state of your Angular applications, ensuring data consistency and predictable behavior across your app. \ No newline at end of file diff --git a/courses/Angular/intermediate/state-management/Introduction.md b/courses/Angular/intermediate/state-management/Introduction.md deleted file mode 100644 index b013b9763..000000000 --- a/courses/Angular/intermediate/state-management/Introduction.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -id: lesson-1 -title: "Introduction to State Management" -sidebar_label: Introduction -sidebar_position: 1 -description: "Introduction to State Management" -tags: [courses,intermediate-level,Introduction] ---- - - -State management is crucial in large applications to ensure consistency and predictability of data across components. Angular provides several ways to manage state, ranging from simple services with `BehaviorSubject` to more complex state management libraries like NgRx, which follows the Redux pattern. - -#### Concepts -State management refers to the practice of managing and maintaining the state of an application in a predictable way. This includes: -- Keeping track of application data -- Ensuring data consistency across components -- Handling state changes predictably -- Simplifying debugging and testing - - diff --git a/courses/Angular/intermediate/state-management/NGRX.md b/courses/Angular/intermediate/state-management/NGRX.md deleted file mode 100644 index 260ddeb68..000000000 --- a/courses/Angular/intermediate/state-management/NGRX.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -id: lesson-3 -title: "NgRx (Redux for Angular) Basics" -sidebar_label: NgRx -sidebar_position: 3 -description: "NgRx (Redux for Angular) Basics" -tags: [courses,intermediate-level,Redux,Introduction] ---- - - - -NgRx is a state management library for Angular that implements the Redux pattern, providing a predictable state container for managing the state of Angular applications. - -1. **Installing NgRx**: - ```bash - ng add @ngrx/store - ng add @ngrx/effects - ``` - -2. **Setting Up NgRx Store**: - - **Define State and Actions**: - ```typescript - // state.ts - export interface AppState { - counter: number; - } - - export const initialState: AppState = { - counter: 0 - }; - ``` - - ```typescript - // actions.ts - import { createAction } from '@ngrx/store'; - - export const increment = createAction('[Counter] Increment'); - export const decrement = createAction('[Counter] Decrement'); - export const reset = createAction('[Counter] Reset'); - ``` - - - **Create Reducer**: - ```typescript - // reducer.ts - import { createReducer, on } from '@ngrx/store'; - import { increment, decrement, reset } from './actions'; - import { initialState } from './state'; - - const _counterReducer = createReducer(initialState, - on(increment, state => ({ ...state, counter: state.counter + 1 })), - on(decrement, state => ({ ...state, counter: state.counter - 1 })), - on(reset, state => ({ ...state, counter: 0 })) - ); - - export function counterReducer(state, action) { - return _counterReducer(state, action); - } - ``` - - - **Register Reducer in App Module**: - ```typescript - // app.module.ts - import { BrowserModule } from '@angular/platform-browser'; - import { NgModule } from '@angular/core'; - import { StoreModule } from '@ngrx/store'; - import { counterReducer } from './reducer'; - - import { AppComponent } from './app.component'; - - @NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - StoreModule.forRoot({ counter: counterReducer }) - ], - providers: [], - bootstrap: [AppComponent] - }) - export class AppModule { } - ``` - - - **Using the Store in Components**: - ```typescript - // app.component.ts - import { Component } from '@angular/core'; - import { Store } from '@ngrx/store'; - import { Observable } from 'rxjs'; - import { increment, decrement, reset } from './actions'; - import { AppState } from './state'; - - @Component({ - selector: 'app-root', - template: ` -
-

Counter: {{ counter$ | async }}

- - - -
- ` - }) - export class AppComponent { - counter$: Observable; - - constructor(private store: Store<{ counter: AppState }>) { - this.counter$ = store.select('counter').pipe(map(state => state.counter)); - } - - increment() { - this.store.dispatch(increment()); - } - - decrement() { - this.store.dispatch(decrement()); - } - - reset() { - this.store.dispatch(reset()); - } - } - ``` - diff --git a/courses/Angular/intermediate/state-management/_category_.json b/courses/Angular/intermediate/state-management/_category_.json deleted file mode 100644 index 0b91c58b2..000000000 --- a/courses/Angular/intermediate/state-management/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "State Management", - "position": 2, - "link": { - "type": "generated-index", - "description": "Learn to State Management." - } - } \ No newline at end of file diff --git a/courses/C/_category_.json b/courses/C/_category_.json deleted file mode 100644 index ef42c6664..000000000 --- a/courses/C/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "C Language", - "position": 11, - "link": { - "type": "generated-index", - "description": "Learn C Language." - } - } \ No newline at end of file diff --git a/courses/C/advance-level/Advance-File-Handling/File-Locking.md b/courses/C/advance-level/Advance-File-Handling/File-Locking.md deleted file mode 100644 index 35794dbd8..000000000 --- a/courses/C/advance-level/Advance-File-Handling/File-Locking.md +++ /dev/null @@ -1,191 +0,0 @@ ---- -id: lesson-1 -title: "Advanced File Handling in C" -sidebar_label: Advanced File Handling -sidebar_position: 1 -description: "Learn Advanced File Handling in C" -tags: [courses,Advance-level,Introduction] ---- - - -Advanced file handling techniques are essential for optimizing performance, ensuring data integrity, and working efficiently with large files. Here’s a detailed overview of advanced file handling topics in C: - -#### 1. File Locking Mechanisms - -File locking is used to control access to files when multiple processes or threads are involved. It helps in preventing data corruption or inconsistency. - -- **Types of Locks**: - - **Exclusive Lock**: Prevents other processes from reading or writing the file. - - **Shared Lock**: Allows other processes to read the file but not write to it. - -- **Using `flock()`**: - - **Description**: A POSIX function for file locking. - - **Example**: - ```c - #include - #include - #include - #include - #include - - int main() { - int fd = open("file.txt", O_RDWR | O_CREAT, 0666); - if (fd < 0) { - perror("open"); - exit(EXIT_FAILURE); - } - - // Acquire an exclusive lock - if (flock(fd, LOCK_EX) < 0) { - perror("flock"); - close(fd); - exit(EXIT_FAILURE); - } - - printf("File locked. Press Enter to release lock...\n"); - getchar(); // Wait for user input - - // Release the lock - if (flock(fd, LOCK_UN) < 0) { - perror("flock"); - close(fd); - exit(EXIT_FAILURE); - } - - close(fd); - printf("File unlocked.\n"); - return 0; - } - ``` - -- **Using `fcntl()`**: - - **Description**: Provides more control over file locking. - - **Example**: - ```c - #include - #include - #include - #include - - int main() { - int fd = open("file.txt", O_RDWR | O_CREAT, 0666); - if (fd < 0) { - perror("open"); - exit(EXIT_FAILURE); - } - - struct flock lock; - lock.l_type = F_WRLCK; // Write lock - lock.l_whence = SEEK_SET; - lock.l_start = 0; - lock.l_len = 0; // Lock the whole file - - if (fcntl(fd, F_SETLKW, &lock) < 0) { - perror("fcntl"); - close(fd); - exit(EXIT_FAILURE); - } - - printf("File locked. Press Enter to release lock...\n"); - getchar(); // Wait for user input - - lock.l_type = F_UNLCK; // Unlock - if (fcntl(fd, F_SETLK, &lock) < 0) { - perror("fcntl"); - close(fd); - exit(EXIT_FAILURE); - } - - close(fd); - printf("File unlocked.\n"); - return 0; - } - ``` - -#### 2. File I/O Performance Optimization - -To optimize file I/O performance, you can use techniques such as buffering, efficient file access, and reducing system calls. - -- **Buffered I/O**: - - **Description**: Reduces the number of I/O operations by using a buffer. - - **Example**: - ```c - #include - - int main() { - FILE *file = fopen("largefile.txt", "r"); - if (!file) { - perror("fopen"); - return 1; - } - - char buffer[1024]; - size_t bytesRead; - - while ((bytesRead = fread(buffer, 1, sizeof(buffer), file)) > 0) { - // Process data in buffer - } - - fclose(file); - return 0; - } - ``` - -- **Efficient File Access**: - - **Description**: Minimize the number of file open/close operations and use appropriate file modes. - -- **Reducing System Calls**: - - **Description**: Combine operations where possible to reduce the number of system calls. - -#### 3. Handling Large Files - -When working with large files, consider techniques for efficient reading, writing, and memory management. - -- **Reading Large Files**: - - **Description**: Use buffered reading to handle large files in chunks. - - **Example**: - ```c - #include - - int main() { - FILE *file = fopen("largefile.txt", "r"); - if (!file) { - perror("fopen"); - return 1; - } - - char buffer[1024]; - size_t bytesRead; - - while ((bytesRead = fread(buffer, 1, sizeof(buffer), file)) > 0) { - // Process data - } - - fclose(file); - return 0; - } - ``` - -- **Writing Large Files**: - - **Description**: Write data in chunks to avoid memory overflow. - - **Example**: - ```c - #include - - int main() { - FILE *file = fopen("largefile.txt", "w"); - if (!file) { - perror("fopen"); - return 1; - } - - char buffer[1024]; - for (int i = 0; i < sizeof(buffer); i++) { - buffer[i] = 'A'; // Example data - } - - fwrite(buffer, 1, sizeof(buffer), file); - fclose(file); - return 0; - } - ``` \ No newline at end of file diff --git a/courses/C/advance-level/Advance-File-Handling/_category_.json b/courses/C/advance-level/Advance-File-Handling/_category_.json deleted file mode 100644 index 93c8ad141..000000000 --- a/courses/C/advance-level/Advance-File-Handling/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Advanced File Handling", - "position": 3, - "link": { - "type": "generated-index", - "description": "Learn Advanced File Handling in C Language." - } - } \ No newline at end of file diff --git a/courses/C/advance-level/Advance-File-Handling/working-memory-map.md b/courses/C/advance-level/Advance-File-Handling/working-memory-map.md deleted file mode 100644 index b12300d26..000000000 --- a/courses/C/advance-level/Advance-File-Handling/working-memory-map.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: lesson-2 -title: "Working with Memory-Mapped Files" -sidebar_label: Working with Memory-Mapped Files -sidebar_position: 2 -description: "Learn Working with Memory-Mapped Files in C" -tags: [courses,Advance-level,Introduction] ---- - -Memory-mapped files allow you to map a file into memory and access it as if it were an array. This can be more efficient than traditional file I/O. - -- **Using `mmap()`**: - - **Description**: Maps a file or a portion of a file into memory. - - **Example**: - ```c - #include - #include - #include - #include - #include - #include - - int main() { - int fd = open("file.txt", O_RDWR | O_CREAT, 0666); - if (fd < 0) { - perror("open"); - exit(EXIT_FAILURE); - } - - // Resize file to 100 bytes - ftruncate(fd, 100); - - // Map file to memory - char *mapped = mmap(NULL, 100, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); - if (mapped == MAP_FAILED) { - perror("mmap"); - close(fd); - exit(EXIT_FAILURE); - } - - // Write data to the mapped memory - strcpy(mapped, "Hello, memory-mapped file!"); - - // Unmap and close - munmap(mapped, 100); - close(fd); - return 0; - } - ``` - -- **Advantages**: - - **Efficiency**: Direct access to file data without additional I/O calls. - - **Simplicity**: Treats file data like an array. - -- **Considerations**: - - **File Size**: Be cautious with very large files as mapping the entire file may not be feasible. - - **Concurrency**: Ensure proper synchronization if multiple processes or threads are accessing the memory-mapped file. - -### Summary - -- **File Locking Mechanisms**: Use `flock()` or `fcntl()` to manage file access in concurrent environments. -- **File I/O Performance Optimization**: Use buffering and efficient access patterns to enhance performance. -- **Handling Large Files**: Read/write in chunks and manage memory efficiently. -- **Memory-Mapped Files**: Map files into memory for efficient access and manipulation. diff --git a/courses/C/advance-level/Algorithms/Introduction.md b/courses/C/advance-level/Algorithms/Introduction.md deleted file mode 100644 index 67b874363..000000000 --- a/courses/C/advance-level/Algorithms/Introduction.md +++ /dev/null @@ -1,200 +0,0 @@ ---- -id: lesson-1 -title: "Algorithms in C" -sidebar_label: Algorithms -sidebar_position: 1 -description: "Learn Algorithms in C" -tags: [courses,Advance-level,Introduction] ---- - -Algorithms are step-by-step procedures or formulas for solving problems. Understanding different algorithms and their efficiencies is crucial for optimizing performance in software development. Here’s an overview of some common algorithms and their implementations in C: - -#### 1. Introduction to Algorithms - -- **Definition**: An algorithm is a finite set of well-defined instructions for solving a problem or performing a task. -- **Characteristics**: - - **Input**: It takes some input. - - **Output**: It produces output. - - **Definiteness**: Each step is clearly defined. - - **Finiteness**: It terminates after a finite number of steps. - - **Effectiveness**: Each step is basic enough to be executed. - -#### 2. Sorting Algorithms - -Sorting algorithms arrange elements of a list in a specific order. Here are a few common sorting algorithms: - -- **Bubble Sort** - - **Description**: Compares adjacent elements and swaps them if they are in the wrong order. Repeats this process until the list is sorted. - - **Complexity**: O(n²) - - **Example**: - ```c - #include - - void bubbleSort(int arr[], int n) { - for (int i = 0; i < n-1; i++) { - for (int j = 0; j < n-i-1; j++) { - if (arr[j] > arr[j+1]) { - int temp = arr[j]; - arr[j] = arr[j+1]; - arr[j+1] = temp; - } - } - } - } - - void printArray(int arr[], int size) { - for (int i = 0; i < size; i++) - printf("%d ", arr[i]); - printf("\n"); - } - - int main() { - int arr[] = {64, 34, 25, 12, 22, 11, 90}; - int n = sizeof(arr)/sizeof(arr[0]); - bubbleSort(arr, n); - printf("Sorted array: \n"); - printArray(arr, n); - return 0; - } - ``` - - **Output**: - ``` - Sorted array: - 11 12 22 25 34 64 90 - ``` - -- **Quicksort** - - **Description**: Divides the array into smaller sub-arrays based on a pivot element and sorts the sub-arrays independently. - - **Complexity**: O(n log n) on average - - **Example**: - ```c - #include - - int partition(int arr[], int low, int high) { - int pivot = arr[high]; - int i = (low - 1); - for (int j = low; j < high; j++) { - if (arr[j] < pivot) { - i++; - int temp = arr[i]; - arr[i] = arr[j]; - arr[j] = temp; - } - } - int temp = arr[i + 1]; - arr[i + 1] = arr[high]; - arr[high] = temp; - return (i + 1); - } - - void quickSort(int arr[], int low, int high) { - if (low < high) { - int pi = partition(arr, low, high); - quickSort(arr, low, pi - 1); - quickSort(arr, pi + 1, high); - } - } - - void printArray(int arr[], int size) { - for (int i = 0; i < size; i++) - printf("%d ", arr[i]); - printf("\n"); - } - - int main() { - int arr[] = {10, 7, 8, 9, 1, 5}; - int n = sizeof(arr) / sizeof(arr[0]); - quickSort(arr, 0, n - 1); - printf("Sorted array: \n"); - printArray(arr, n); - return 0; - } - ``` - - **Output**: - ``` - Sorted array: - 1 5 7 8 9 10 - ``` - -- **Merge Sort** - - **Description**: Divides the array into two halves, recursively sorts them, and then merges the sorted halves. - - **Complexity**: O(n log n) - - **Example**: - ```c - #include - #include - - void merge(int arr[], int l, int m, int r) { - int n1 = m - l + 1; - int n2 = r - m; - - int* L = (int*)malloc(n1 * sizeof(int)); - int* R = (int*)malloc(n2 * sizeof(int)); - - for (int i = 0; i < n1; i++) - L[i] = arr[l + i]; - for (int j = 0; j < n2; j++) - R[j] = arr[m + 1 + j]; - - int i = 0; - int j = 0; - int k = l; - while (i < n1 && j < n2) { - if (L[i] <= R[j]) { - arr[k] = L[i]; - i++; - } else { - arr[k] = R[j]; - j++; - } - k++; - } - - while (i < n1) { - arr[k] = L[i]; - i++; - k++; - } - - while (j < n2) { - arr[k] = R[j]; - j++; - k++; - } - - free(L); - free(R); - } - - void mergeSort(int arr[], int l, int r) { - if (l < r) { - int m = l + (r - l) / 2; - mergeSort(arr, l, m); - mergeSort(arr, m + 1, r); - merge(arr, l, m, r); - } - } - - void printArray(int arr[], int size) { - for (int i = 0; i < size; i++) - printf("%d ", arr[i]); - printf("\n"); - } - - int main() { - int arr[] = {12, 11, 13, 5, 6, 7}; - int n = sizeof(arr) / sizeof(arr[0]); - mergeSort(arr, 0, n - 1); - printf("Sorted array: \n"); - printArray(arr, n); - return 0; - } - ``` - - **Output**: - ``` - Sorted array: - 5 6 7 11 12 13 - ``` diff --git a/courses/C/advance-level/Algorithms/Search.md b/courses/C/advance-level/Algorithms/Search.md deleted file mode 100644 index ab3ebfb3d..000000000 --- a/courses/C/advance-level/Algorithms/Search.md +++ /dev/null @@ -1,169 +0,0 @@ ---- -id: lesson-2 -title: "Searching Algorithms" -sidebar_label: Searching Algorithms -sidebar_position: 2 -description: "Learn Searching Algorithms in C" -tags: [courses,Advance-level,Introduction] ---- - -Searching algorithms find the position of an element within a list. - -- **Linear Search** - - **Description**: Sequentially checks each element until the target element is found. - - **Complexity**: O(n) - - **Example**: - ```c - #include - - int linearSearch(int arr[], int size, int target) { - for (int i = 0; i < size; i++) { - if (arr[i] == target) - return i; - } - return -1; - } - - int main() { - int arr[] = {2, 4, 6, 8, 10}; - int size = sizeof(arr) / sizeof(arr[0]); - int target = 8; - int result = linearSearch(arr, size, target); - if (result != -1) - printf("Element found at index %d\n", result); - else - printf("Element not found\n"); - return 0; - } - ``` - - **Output**: - ``` - Element found at index 3 - ``` - -- **Binary Search** - - **Description**: Efficiently finds an element in a sorted array by repeatedly dividing the search interval in half. - - **Complexity**: O(log n) - - **Example**: - ```c - #include - - int binarySearch(int arr[], int size, int target) { - int left = 0; - int right = size - 1; - - while (left <= right) { - int mid = left + (right - left) / 2; - - if (arr[mid] == target) - return mid; - if (arr[mid] < target) - left = mid + 1; - else - right = mid - 1; - } - return -1; - } - - int main() { - int arr[] = {1, 3, 5, 7, 9, 11}; - int size = sizeof(arr) / sizeof(arr[0]); - int target = 7; - int result = binarySearch(arr, size, target); - if (result != -1) - printf("Element found at index %d\n", result); - else - printf("Element not found\n"); - return 0; - } - ``` - - **Output**: - ``` - Element found at index 3 - ``` - -#### 4. Hashing and Hash Tables - -Hashing is used to map data to a fixed-size table using a hash function. It allows for fast data retrieval. - -- **Hash Table** - - **Description**: A data structure that implements an associative array abstract data type, a structure that can map keys to values. - - **Operations**: Insertion, deletion, lookup. - - **Example**: - ```c - #include - #include - - #define TABLE_SIZE 10 - - typedef struct Node { - int key; - int value; - struct Node* next; - } Node; - - Node* hashTable[TABLE_SIZE] = {NULL}; - - int hashFunction(int key) { - return key % TABLE_SIZE; - } - - void insert(int key, int value) { - int index = hashFunction(key); - Node* newNode = (Node*)malloc(sizeof(Node)); - newNode->key = key; - newNode->value = value; - newNode->next = hashTable[index]; - hashTable[index] = newNode; - } - - int search(int key) { - int index = hashFunction(key); - Node* temp = hashTable[index]; - while (temp != NULL) { - if (temp->key == key) - return temp->value; - temp = temp->next; - } - return -1; // Not found - } - - int main() { - insert(1, 100); - insert(11, 200); - insert(21, 300); - - printf("Value for key 1: %d\n", search(1)); - printf("Value for key 11: %d\n", search(11)); - printf("Value for key 21: %d\n", search(21)); - return 0; - } - ``` - - **Output**: - ``` - Value for key 1: 100 - Value for key 11: 200 - Value for key 21: 300 - ``` - -#### 5. Algorithm Complexity and Big O Notation - -- **Definition**: Big O notation is a mathematical notation used to describe the upper bound of the runtime complexity of an algorithm. It provides an asymptotic analysis of an algorithm's performance. -- **Common Complexities**: - - **O(1)**: Constant time - - **O(log n)**: Logarithmic time - - **O(n)**: Linear time - - **O(n log n)**: Linearithmic time - - **O(n²)**: Quadratic time - -Understanding the complexity helps in choosing the right algorithm for a problem, especially when dealing with large datasets. - -### Summary - -- **Sorting Algorithms**: Methods to order elements. Examples: Bubble Sort, Quick Sort, Merge Sort. -- **Searching Algorithms**: Methods to find elements. Examples: Linear Search, Binary Search. -- **Hashing**: Technique for fast data retrieval using hash tables. -- **Algorithm Complexity**: Big O notation describes the performance and efficiency of algorithms. diff --git a/courses/C/advance-level/Algorithms/_category_.json b/courses/C/advance-level/Algorithms/_category_.json deleted file mode 100644 index 713d7890b..000000000 --- a/courses/C/advance-level/Algorithms/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Algorithms", - "position": 2, - "link": { - "type": "generated-index", - "description": "Learn Algorithms in C Language." - } - } \ No newline at end of file diff --git a/courses/C/advance-level/Data Structure/Graphs.md b/courses/C/advance-level/Data Structure/Graphs.md deleted file mode 100644 index cf76b3966..000000000 --- a/courses/C/advance-level/Data Structure/Graphs.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: lesson-2 -title: "Graphs and Graph Algorithms" -sidebar_label: Graphs and Graph Algorithms -sidebar_position: 2 -description: "Graphs and Graph Algorithms" -tags: [courses,Advance-level,Introduction] ---- - - - -:::note -- **Graph** - - **Definition**: A graph is a non-linear data structure consisting of nodes (vertices) and edges connecting pairs of nodes. - - **Representation**: Adjacency matrix, adjacency list. - -- **Graph Algorithms** - - **Depth-First Search (DFS)** - - **Breadth-First Search (BFS)** - ::: - - **Example (BFS)**: - ```c - #include - #include - #include - - #define V 5 - - void BFS(int graph[V][V], int start) { - bool visited[V] = {false}; - int queue[V], front = 0, rear = 0; - visited[start] = true; - queue[rear++] = start; - - while (front < rear) { - int node = queue[front++]; - printf("%d ", node); - - for (int i = 0; i < V; i++) { - if (graph[node][i] && !visited[i]) { - visited[i] = true; - queue[rear++] = i; - } - } - } - } - - int main() { - int graph[V][V] = { - {0, 1, 1, 0, 0}, - {1, 0, 1, 1, 0}, - {1, 1, 0, 1, 1}, - {0, 1, 1, 0, 1}, - {0, 0, 1, 1, 0} - }; - - printf("Breadth-First Search starting from node 0: "); - BFS(graph, 0); - printf("\n"); - - return 0; - } - ``` - - **Output**: - ``` - Breadth-First Search starting from node 0: 0 1 2 3 4 - ``` - -### Summary - -- **Linked Lists**: A sequence of nodes where each node points to the next (and possibly previous) node. -- **Stacks and Queues**: Linear data structures for LIFO (stack) and FIFO (queue) operations. -- **Trees**: Hierarchical structures with nodes connected by edges. Includes binary trees and binary search trees. -- **Graphs**: Non-linear structures with nodes connected by edges. Includes algorithms like BFS and DFS. diff --git a/courses/C/advance-level/Data Structure/Introduction.md b/courses/C/advance-level/Data Structure/Introduction.md deleted file mode 100644 index faa2aebc0..000000000 --- a/courses/C/advance-level/Data Structure/Introduction.md +++ /dev/null @@ -1,387 +0,0 @@ ---- -id: lesson-1 -title: "Data Structures in C" -sidebar_label: Data Structures -sidebar_position: 1 -description: "Learn Data Structures in C" -tags: [courses,Advance-level,Introduction] ---- - - -Data structures are essential for organizing and managing data efficiently. They provide ways to store and retrieve data, and different data structures are suitable for different tasks. Here’s an overview of some fundamental data structures in C: - -#### 1. Introduction to Data Structures - -- **Definition**: A data structure is a specialized format for organizing and storing data. It enables efficient data manipulation and access. -- **Types**: Linear (arrays, linked lists), Non-linear (trees, graphs), and Hash-based structures. - -#### 2. Linked Lists - -A linked list is a linear data structure where elements are stored in nodes, and each node points to the next node in the sequence. - -- **Singly Linked List** - - **Definition**: Each node has a single pointer to the next node. - - **Operations**: Insertion, deletion, traversal. - - **Example**: - ```c - #include - #include - - typedef struct Node { - int data; - struct Node* next; - } Node; - - void printList(Node* head) { - Node* temp = head; - while (temp != NULL) { - printf("%d -> ", temp->data); - temp = temp->next; - } - printf("NULL\n"); - } - - int main() { - Node* head = (Node*)malloc(sizeof(Node)); - head->data = 1; - head->next = (Node*)malloc(sizeof(Node)); - head->next->data = 2; - head->next->next = NULL; - - printList(head); - - // Free allocated memory - free(head->next); - free(head); - - return 0; - } - ``` - - **Output**: - ``` - 1 -> 2 -> NULL - ``` - -- **Doubly Linked List** - - **Definition**: Each node has two pointers, one to the next node and one to the previous node. - - **Operations**: Insertion, deletion, traversal (both directions). - - **Example**: - ```c - #include - #include - - typedef struct Node { - int data; - struct Node* next; - struct Node* prev; - } Node; - - void printList(Node* head) { - Node* temp = head; - while (temp != NULL) { - printf("%d <-> ", temp->data); - temp = temp->next; - } - printf("NULL\n"); - } - - int main() { - Node* head = (Node*)malloc(sizeof(Node)); - head->data = 1; - head->next = (Node*)malloc(sizeof(Node)); - head->next->data = 2; - head->next->prev = head; - head->next->next = NULL; - - printList(head); - - // Free allocated memory - free(head->next); - free(head); - - return 0; - } - ``` - - **Output**: - ``` - 1 <-> 2 <-> NULL - ``` - -- **Circular Linked List** - - **Definition**: The last node points back to the first node, forming a circle. - - **Operations**: Insertion, deletion, traversal (until you reach the starting node again). - - **Example**: - ```c - #include - #include - - typedef struct Node { - int data; - struct Node* next; - } Node; - - void printList(Node* head) { - Node* temp = head; - if (head != NULL) { - do { - printf("%d -> ", temp->data); - temp = temp->next; - } while (temp != head); - } - printf("NULL\n"); - } - - int main() { - Node* head = (Node*)malloc(sizeof(Node)); - head->data = 1; - head->next = (Node*)malloc(sizeof(Node)); - head->next->data = 2; - head->next->next = head; - - printList(head); - - // Free allocated memory - free(head->next); - free(head); - - return 0; - } - ``` - - **Output**: - ``` - 1 -> 2 -> NULL - ``` - -#### 3. Stacks and Queues - -- **Stack** - - **Definition**: A stack is a linear data structure that follows Last In First Out (LIFO) principle. - - **Operations**: Push (add), Pop (remove), Peek (top item). - - **Example**: - ```c - #include - #include - - #define MAX 100 - - typedef struct { - int arr[MAX]; - int top; - } Stack; - - void push(Stack* s, int value) { - if (s->top == MAX - 1) { - printf("Stack Overflow\n"); - return; - } - s->arr[++(s->top)] = value; - } - - int pop(Stack* s) { - if (s->top == -1) { - printf("Stack Underflow\n"); - return -1; - } - return s->arr[(s->top)--]; - } - - int peek(Stack* s) { - if (s->top == -1) { - printf("Stack is Empty\n"); - return -1; - } - return s->arr[s->top]; - } - - int main() { - Stack s; - s.top = -1; - - push(&s, 10); - push(&s, 20); - printf("Top element is %d\n", peek(&s)); - printf("Popped element is %d\n", pop(&s)); - - return 0; - } - ``` - - **Output**: - ``` - Top element is 20 - Popped element is 20 - ``` - -- **Queue** - - **Definition**: A queue is a linear data structure that follows First In First Out (FIFO) principle. - - **Operations**: Enqueue (add), Dequeue (remove), Peek (front item). - - **Example**: - ```c - #include - #include - - #define MAX 100 - - typedef struct { - int arr[MAX]; - int front, rear; - } Queue; - - void enqueue(Queue* q, int value) { - if (q->rear == MAX - 1) { - printf("Queue Overflow\n"); - return; - } - q->arr[++(q->rear)] = value; - } - - int dequeue(Queue* q) { - if (q->front > q->rear) { - printf("Queue Underflow\n"); - return -1; - } - return q->arr[(q->front)++]; - } - - int peek(Queue* q) { - if (q->front > q->rear) { - printf("Queue is Empty\n"); - return -1; - } - return q->arr[q->front]; - } - - int main() { - Queue q; - q.front = 0; - q.rear = -1; - - enqueue(&q, 10); - enqueue(&q, 20); - printf("Front element is %d\n", peek(&q)); - printf("Dequeued element is %d\n", dequeue(&q)); - - return 0; - } - ``` - - **Output**: - ``` - Front element is 10 - Dequeued element is 10 - ``` - -#### 4. Trees - -- **Binary Tree** - - **Definition**: A tree data structure where each node has at most two children (left and right). - - **Operations**: Insertion, traversal (in-order, pre-order, post-order). - - **Example**: - ```c - #include - #include - - typedef struct Node { - int data; - struct Node* left; - struct Node* right; - } Node; - - void inorder(Node* root) { - if (root != NULL) { - inorder(root->left); - printf("%d ", root->data); - inorder(root->right); - } - } - - Node* createNode(int data) { - Node* newNode = (Node*)malloc(sizeof(Node)); - newNode->data = data; - newNode->left = newNode->right = NULL; - return newNode; - } - - int main() { - Node* root = createNode(1); - root->left = createNode(2); - root->right = createNode(3); - root->left->left = createNode(4); - root->left->right = createNode(5); - - printf("Inorder Traversal: "); - inorder(root); - printf("\n"); - - return 0; - } - ``` - - **Output**: - ``` - Inorder Traversal: 4 2 5 1 3 - ``` - -- **Binary Search Tree (BST)** - - **Definition**: A binary tree where the left child of a node is less than the node and the right child is greater. - - **Operations**: Insertion, searching, traversal. - - ```c - #include - #include - - typedef struct Node { - int data; - struct Node* left; - struct Node* right; - } Node; - - Node* insert(Node* root, int data) { - if (root == NULL) { - Node* newNode = (Node*)malloc(sizeof(Node)); - newNode->data = data; - - newNode->left = newNode->right = NULL; - return newNode; - } - if (data < root->data) - root->left = insert(root->left, data); - else - root->right = insert(root->right, data); - return root; - } - - void inorder(Node* root) { - if (root != NULL) { - inorder(root->left); - printf("%d ", root->data); - inorder(root->right); - } - } - - int main() { - Node* root = NULL; - root = insert(root, 50); - insert(root, 30); - insert(root, 70); - insert(root, 20); - insert(root, 40); - insert(root, 60); - insert(root, 80); - - printf("Inorder Traversal: "); - inorder(root); - printf("\n"); - - return 0; - } -``` - - **Output**: - ``` - Inorder Traversal: 20 30 40 50 60 70 80 - ``` - \ No newline at end of file diff --git a/courses/C/advance-level/Data Structure/_Category_.json b/courses/C/advance-level/Data Structure/_Category_.json deleted file mode 100644 index 895e4542f..000000000 --- a/courses/C/advance-level/Data Structure/_Category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Data Structures", - "position": 1, - "link": { - "type": "generated-index", - "description": "Learn Data Structures in C Language." - } - } \ No newline at end of file diff --git a/courses/C/advance-level/Multithreading/Deadlock.md b/courses/C/advance-level/Multithreading/Deadlock.md deleted file mode 100644 index 5229859df..000000000 --- a/courses/C/advance-level/Multithreading/Deadlock.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -id: lesson-2 -title: "Deadlocks" -sidebar_label: Deadlocks -sidebar_position: 2 -description: "Learn Deadlocks in C" -tags: [courses,Advance-level,Introduction] ---- - - -#### Avoiding Race Conditions and Deadlocks - -- **Race Conditions**: Occur when multiple threads access shared data concurrently, leading to unpredictable results. Use synchronization techniques to prevent race conditions. - -- **Deadlocks**: Occur when two or more threads are blocked forever, waiting for each other to release resources. Avoid deadlocks by using a consistent order for locking resources. - -**Tips**: -- Always acquire locks in a consistent order. -- Use timeout mechanisms to avoid waiting indefinitely. -- Apply the principle of minimal locking. - -### Summary - -- **Multithreading**: Allows multiple threads to run concurrently within a single process. -- **Thread Management**: Involves creating, managing, and synchronizing threads. -- **Synchronization**: Essential to avoid data corruption and manage concurrent access. -- **Thread Communication**: Use shared memory and condition variables for inter-thread communication. -- **Concurrency Issues**: Be aware of race conditions and deadlocks and apply best practices to avoid them. diff --git a/courses/C/advance-level/Multithreading/_category_.json b/courses/C/advance-level/Multithreading/_category_.json deleted file mode 100644 index 8ca029408..000000000 --- a/courses/C/advance-level/Multithreading/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Multithreading and Concurrency", - "position": 5, - "link": { - "type": "generated-index", - "description": "Learn Multithreading and Concurrency in C Language." - } - } \ No newline at end of file diff --git a/courses/C/advance-level/Multithreading/introduction.md b/courses/C/advance-level/Multithreading/introduction.md deleted file mode 100644 index bc6651eeb..000000000 --- a/courses/C/advance-level/Multithreading/introduction.md +++ /dev/null @@ -1,229 +0,0 @@ ---- -id: lesson-1 -title: "Multithreading and Concurrency in C" -sidebar_label: Multithreading and Concurrency -sidebar_position: 1 -description: "Learn Multithreading and Concurrency in C" -tags: [courses,Advance-level,Introduction] ---- - - -Multithreading and concurrency are key concepts in modern programming that allow programs to perform multiple tasks simultaneously. This section covers the basics of multithreading, thread management, synchronization techniques, and handling concurrency issues in C. - -#### 1. Introduction to Multithreading - -- **Multithreading**: A technique where multiple threads execute within the same process, allowing for concurrent execution of tasks. -- **Thread**: The smallest unit of execution within a process. Each thread runs independently but shares the same memory space with other threads in the process. -- **Concurrency**: The ability of a program to handle multiple tasks at the same time, which can be achieved through multithreading or parallel processing. - -#### 2. Creating and Managing Threads - -In C, multithreading is typically handled using the POSIX Threads (pthreads) library. Below is an example of how to create and manage threads. - -**Example of Creating and Managing Threads**: - -```c -#include -#include -#include - -// Function to be executed by threads -void* thread_function(void* arg) { - printf("Hello from thread %d\n", *((int*)arg)); - pthread_exit(NULL); -} - -int main() { - pthread_t threads[2]; - int thread_args[2]; - int rc; - - // Create two threads - for (int i = 0; i < 2; i++) { - thread_args[i] = i; - rc = pthread_create(&threads[i], NULL, thread_function, (void*)&thread_args[i]); - if (rc) { - printf("Error: Unable to create thread %d\n", rc); - exit(-1); - } - } - - // Wait for threads to complete - for (int i = 0; i < 2; i++) { - pthread_join(threads[i], NULL); - } - - printf("All threads completed.\n"); - return 0; -} -``` - -**Output**: -``` -Hello from thread 0 -Hello from thread 1 -All threads completed. -``` - -**Explanation**: -- `pthread_create()` is used to create a new thread. It takes four arguments: the thread identifier, thread attributes, the function to execute, and the argument for that function. -- `pthread_join()` is used to wait for the thread to finish executing. - -#### 3. Synchronization Techniques - -Synchronization is crucial to prevent data corruption when multiple threads access shared resources. Common synchronization techniques include mutexes and semaphores. - -- **Mutexes (Mutual Exclusion)**: Used to protect shared resources by ensuring only one thread accesses the resource at a time. - -**Example of Using Mutexes**: - -```c -#include -#include -#include - -pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -int shared_variable = 0; - -void* thread_function(void* arg) { - pthread_mutex_lock(&mutex); // Lock the mutex - shared_variable++; - printf("Shared variable incremented to %d\n", shared_variable); - pthread_mutex_unlock(&mutex); // Unlock the mutex - pthread_exit(NULL); -} - -int main() { - pthread_t threads[2]; - int rc; - - for (int i = 0; i < 2; i++) { - rc = pthread_create(&threads[i], NULL, thread_function, NULL); - if (rc) { - printf("Error: Unable to create thread %d\n", rc); - exit(-1); - } - } - - for (int i = 0; i < 2; i++) { - pthread_join(threads[i], NULL); - } - - printf("Final shared variable value: %d\n", shared_variable); - return 0; -} -``` - -**Output**: -``` -Shared variable incremented to 1 -Shared variable incremented to 2 -Final shared variable value: 2 -``` - -- **Semaphores**: Used to control access to a common resource by multiple threads. - -**Example of Using Semaphores**: - -```c -#include -#include -#include -#include - -sem_t semaphore; - -void* thread_function(void* arg) { - sem_wait(&semaphore); // Decrement the semaphore - printf("Thread %d entering critical section\n", *((int*)arg)); - sleep(1); // Simulate work - printf("Thread %d leaving critical section\n", *((int*)arg)); - sem_post(&semaphore); // Increment the semaphore - pthread_exit(NULL); -} - -int main() { - pthread_t threads[2]; - int thread_args[2]; - int rc; - - sem_init(&semaphore, 0, 1); // Initialize semaphore with value 1 - - for (int i = 0; i < 2; i++) { - thread_args[i] = i; - rc = pthread_create(&threads[i], NULL, thread_function, (void*)&thread_args[i]); - if (rc) { - printf("Error: Unable to create thread %d\n", rc); - exit(-1); - } - } - - for (int i = 0; i < 2; i++) { - pthread_join(threads[i], NULL); - } - - sem_destroy(&semaphore); // Destroy semaphore - return 0; -} -``` - -**Output**: -``` -Thread 0 entering critical section -Thread 1 entering critical section -Thread 0 leaving critical section -Thread 1 leaving critical section -``` - -#### 4. Thread Communication - -Threads within the same process can communicate via shared memory. For more complex communication, techniques like condition variables and message passing are used. - -- **Condition Variables**: Allow threads to wait for certain conditions to be met before continuing execution. - -**Example of Using Condition Variables**: - -```c -#include -#include -#include - -pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t cond = PTHREAD_COND_INITIALIZER; -int ready = 0; - -void* producer(void* arg) { - pthread_mutex_lock(&mutex); - ready = 1; // Set condition - pthread_cond_signal(&cond); // Signal consumer - pthread_mutex_unlock(&mutex); - pthread_exit(NULL); -} - -void* consumer(void* arg) { - pthread_mutex_lock(&mutex); - while (!ready) { - pthread_cond_wait(&cond, &mutex); // Wait for condition - } - printf("Consumer received signal\n"); - pthread_mutex_unlock(&mutex); - pthread_exit(NULL); -} - -int main() { - pthread_t producer_thread, consumer_thread; - - pthread_create(&consumer_thread, NULL, consumer, NULL); - pthread_create(&producer_thread, NULL, producer, NULL); - - pthread_join(producer_thread, NULL); - pthread_join(consumer_thread, NULL); - - return 0; -} -``` - -**Output**: -``` -Consumer received signal -``` \ No newline at end of file diff --git a/courses/C/advance-level/Network-programming/Introduction.md b/courses/C/advance-level/Network-programming/Introduction.md deleted file mode 100644 index 7ca198024..000000000 --- a/courses/C/advance-level/Network-programming/Introduction.md +++ /dev/null @@ -1,185 +0,0 @@ ---- -id: lesson-1 -title: "Network Programming in C" -sidebar_label: Network Programming -sidebar_position: 1 -description: "Learn Network Programming in C" -tags: [courses,Advance-level,Introduction] ---- - -Network programming involves creating applications that communicate over a network, such as the internet or a local network. This section covers the basics of network programming, including sockets, the client-server model, and TCP/IP communication. - -#### 1. Introduction to Network Programming - -- **Network Programming**: Involves creating software that communicates over a network. It is essential for developing applications that rely on data exchange between different systems. - -- **Protocols**: Standard rules for data communication. Common protocols include TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). - -- **Sockets**: Endpoints for sending or receiving data across a network. They are fundamental to network programming. - -#### 2. Sockets and Socket Programming - -- **Socket**: A software abstraction that allows programs to communicate over a network. Sockets provide a programming interface for network communication. - -- **Socket Programming Basics**: - - **Creating a Socket**: Use `socket()` function. - - **Binding**: Associate a socket with a specific address and port using `bind()`. - - **Listening**: Prepare a socket to accept incoming connections using `listen()`. - - **Accepting Connections**: Accept connections from clients using `accept()`. - - **Sending and Receiving Data**: Use `send()` and `recv()` for data transmission. - - **Closing a Socket**: Close a socket with `close()`. - -**Example of a Basic TCP Server and Client in C** - -- **TCP Server Example**: - ```c - // server.c - #include - #include - #include - #include - #include - - #define PORT 8080 - - int main() { - int server_fd, new_socket; - struct sockaddr_in address; - int addrlen = sizeof(address); - char buffer[1024] = {0}; - const char *hello = "Hello from server"; - - // Create socket file descriptor - if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) == 0) { - perror("socket failed"); - exit(EXIT_FAILURE); - } - - // Set socket options - int opt = 1; - if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT, &opt, sizeof(opt))) { - perror("setsockopt"); - exit(EXIT_FAILURE); - } - - address.sin_family = AF_INET; - address.sin_addr.s_addr = INADDR_ANY; - address.sin_port = htons(PORT); - - // Bind the socket - if (bind(server_fd, (struct sockaddr *)&address, sizeof(address)) < 0) { - perror("bind failed"); - exit(EXIT_FAILURE); - } - - // Listen for incoming connections - if (listen(server_fd, 3) < 0) { - perror("listen"); - exit(EXIT_FAILURE); - } - - // Accept incoming connection - if ((new_socket = accept(server_fd, (struct sockaddr *)&address, (socklen_t*)&addrlen)) < 0) { - perror("accept"); - exit(EXIT_FAILURE); - } - - // Read data from client - read(new_socket, buffer, 1024); - printf("Message from client: %s\n", buffer); - - // Send response to client - send(new_socket, hello, strlen(hello), 0); - printf("Hello message sent\n"); - - // Close socket - close(new_socket); - close(server_fd); - - return 0; - } - ``` - -- **TCP Client Example**: - ```c - // client.c - #include - #include - #include - #include - #include - - #define PORT 8080 - - int main() { - int sock = 0; - struct sockaddr_in serv_addr; - char *hello = "Hello from client"; - char buffer[1024] = {0}; - - // Create socket file descriptor - if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - perror("Socket creation error"); - exit(EXIT_FAILURE); - } - - serv_addr.sin_family = AF_INET; - serv_addr.sin_port = htons(PORT); - - // Convert IPv4 and IPv6 addresses from text to binary form - if (inet_pton(AF_INET, "127.0.0.1", &serv_addr.sin_addr) <= 0) { - perror("Invalid address/ Address not supported"); - exit(EXIT_FAILURE); - } - - // Connect to server - if (connect(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) { - perror("Connection failed"); - exit(EXIT_FAILURE); - } - - // Send data to server - send(sock, hello, strlen(hello), 0); - printf("Hello message sent\n"); - - // Read response from server - read(sock, buffer, 1024); - printf("Message from server: %s\n", buffer); - - // Close socket - close(sock); - - return 0; - } - ``` - -**Output**: - -- **Server Output**: - ``` - Message from client: Hello from client - Hello message sent - ``` - -- **Client Output**: - ``` - Hello message sent - Message from server: Hello from server - ``` - -#### 3. Client-Server Model - -- **Client**: Initiates the connection to the server and requests services. -- **Server**: Waits for incoming connections from clients, processes requests, and sends responses. - -**Steps**: -1. **Server**: - - Creates a socket. - - Binds to an address and port. - - Listens for incoming connections. - - Accepts connections and processes client requests. - -2. **Client**: - - Creates a socket. - - Connects to the server’s address and port. - - Sends requests and receives responses. diff --git a/courses/C/advance-level/Network-programming/_category_.json b/courses/C/advance-level/Network-programming/_category_.json deleted file mode 100644 index 222942820..000000000 --- a/courses/C/advance-level/Network-programming/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Network Programming", - "position": 4, - "link": { - "type": "generated-index", - "description": "Learn Network Programming in C Language." - } - } \ No newline at end of file diff --git a/courses/C/advance-level/Network-programming/tcp-id.md b/courses/C/advance-level/Network-programming/tcp-id.md deleted file mode 100644 index c411b4106..000000000 --- a/courses/C/advance-level/Network-programming/tcp-id.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: lesson-2 -title: "Basic TCP/IP Communication" -sidebar_label: Basic TCP/IP Communication -sidebar_position: 2 -description: "Learn Basic TCP/IP Communication in C" -tags: [courses,Advance-level,Introduction] ---- - - -- **TCP**: A connection-oriented protocol that ensures reliable data delivery. It establishes a connection between client and server before data transmission. - -- **IP**: Handles addressing and routing of data packets across networks. - -:::note -**Key Functions**: -- `socket()`: Creates a new socket. -- `bind()`: Binds the socket to an address and port. -- `listen()`: Puts the socket in listening mode. -- `accept()`: Accepts incoming connections. -- `connect()`: Connects to a remote socket. -- `send()`: Sends data through the socket. -- `recv()`: Receives data from the socket. -- `close()`: Closes the socket. -::: - -#### Simple Network Applications - -- **Chat Application**: A simple application where multiple clients can chat with each other via a server. -- **File Transfer**: An application to send and receive files over a network. -- **HTTP Server**: A basic web server that handles HTTP requests and serves web pages. - -### Summary - -- **Network Programming**: Creating software to communicate over a network. -- **Sockets**: Essential for network communication, used to send and receive data. -- **Client-Server Model**: Server provides services, client requests services. -- **TCP/IP Communication**: Ensures reliable data transfer between networked systems. -- **Examples**: Basic TCP server and client to demonstrate network communication. diff --git a/courses/C/advance-level/_category_.json b/courses/C/advance-level/_category_.json deleted file mode 100644 index 6933163a0..000000000 --- a/courses/C/advance-level/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Advanced Level", - "position": 4, - "link": { - "type": "generated-index", - "description": "Learn C Language." - } - } \ No newline at end of file diff --git a/courses/C/beginner-level/Array-and-Strings/Array.md b/courses/C/beginner-level/Array-and-Strings/Array.md deleted file mode 100644 index 232b022f2..000000000 --- a/courses/C/beginner-level/Array-and-Strings/Array.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -id: lesson-1 -title: "Arrays and Strings in C" -sidebar_label: Arrays and Strings -sidebar_position: 1 -description: "Learn Arrays and Strings in C" -tags: [courses,beginner-level,C,Introduction] ---- - -Arrays and strings are fundamental concepts in C programming. They allow you to store and manipulate collections of data efficiently. - -#### Introduction to Arrays - -An array is a collection of variables of the same type, stored in contiguous memory locations. Arrays are used to store multiple values in a single variable. - -**Declaration and Initialization of an Array:** - -```c -#include - -int main() { - // Declaration - int numbers[5]; - - // Initialization - numbers[0] = 10; - numbers[1] = 20; - numbers[2] = 30; - numbers[3] = 40; - numbers[4] = 50; - - // Printing array elements - for (int i = 0; i < 5; i++) { - printf("numbers[%d] = %d\n", i, numbers[i]); - } - - return 0; -} -``` - -**Output:** - -``` -numbers[0] = 10 -numbers[1] = 20 -numbers[2] = 30 -numbers[3] = 40 -numbers[4] = 50 -``` - -#### Single-Dimensional Arrays - -A single-dimensional array is a list of elements of the same type stored in contiguous memory locations. - -**Example: Single-Dimensional Array** - -```c -#include - -int main() { - // Declaration and initialization - int numbers[5] = {10, 20, 30, 40, 50}; - - // Printing array elements - for (int i = 0; i < 5; i++) { - printf("numbers[%d] = %d\n", i, numbers[i]); - } - - return 0; -} -``` - -**Output:** - -``` -numbers[0] = 10 -numbers[1] = 20 -numbers[2] = 30 -numbers[3] = 40 -numbers[4] = 50 -``` - -#### Multidimensional Arrays - -A multidimensional array is an array of arrays. The most common multidimensional array is the two-dimensional array (matrix). - -**Example: Two-Dimensional Array** - -```c -#include - -int main() { - // Declaration and initialization - int matrix[3][3] = { - {1, 2, 3}, - {4, 5, 6}, - {7, 8, 9} - }; - - // Printing array elements - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 3; j++) { - printf("matrix[%d][%d] = %d\n", i, j, matrix[i][j]); - } - } - - return 0; -} -``` - -**Output:** - -``` -matrix[0][0] = 1 -matrix[0][1] = 2 -matrix[0][2] = 3 -matrix[1][0] = 4 -matrix[1][1] = 5 -matrix[1][2] = 6 -matrix[2][0] = 7 -matrix[2][1] = 8 -matrix[2][2] = 9 -``` \ No newline at end of file diff --git a/courses/C/beginner-level/Array-and-Strings/String-Handling.md b/courses/C/beginner-level/Array-and-Strings/String-Handling.md deleted file mode 100644 index 51ef83040..000000000 --- a/courses/C/beginner-level/Array-and-Strings/String-Handling.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -id: lesson-2 -title: "String Handling and Manipulation" -sidebar_label: String Handling and Manipulation -sidebar_position: 2 -description: "Learn String Handling and Manipulation" -tags: [courses,beginner-level,C,Introduction] ---- - - -Strings in C are arrays of characters terminated by a null character (`'\0'`). The C standard library provides several functions to handle and manipulate strings. - -**Example: String Declaration and Initialization** - -```c -#include - -int main() { - // Declaration and initialization - char str[20] = "Hello, World!"; - - // Printing string - printf("%s\n", str); - - return 0; -} -``` - -**Output:** - -``` -Hello, World! -``` - -:::note -**String Handling Functions:** - -1. **`strlen`**: Returns the length of the string. -2. **`strcpy`**: Copies one string to another. -3. **`strcat`**: Concatenates two strings. -4. **`strcmp`**: Compares two strings. -::: - -**Example: Using String Functions** - -```c -#include -#include - -int main() { - char str1[20] = "Hello"; - char str2[20] = "World"; - char str3[40]; - - // String length - printf("Length of str1: %lu\n", strlen(str1)); - - // String copy - strcpy(str3, str1); - printf("str3 after copying str1: %s\n", str3); - - // String concatenation - strcat(str3, str2); - printf("str3 after concatenation: %s\n", str3); - - // String comparison - int cmp = strcmp(str1, str2); - if (cmp == 0) { - printf("str1 and str2 are equal\n"); - } else if (cmp < 0) { - printf("str1 is less than str2\n"); - } else { - printf("str1 is greater than str2\n"); - } - - return 0; -} -``` - -**Output:** - -``` -Length of str1: 5 -str3 after copying str1: Hello -str3 after concatenation: HelloWorld -str1 is less than str2 -``` - \ No newline at end of file diff --git a/courses/C/beginner-level/Array-and-Strings/_category_.json b/courses/C/beginner-level/Array-and-Strings/_category_.json deleted file mode 100644 index 1f51505ed..000000000 --- a/courses/C/beginner-level/Array-and-Strings/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Arrays and Strings", - "position": 6, - "link": { - "type": "generated-index", - "description": "Learn C Language." - } - } \ No newline at end of file diff --git a/courses/C/beginner-level/Basic Syntax/Structure.md b/courses/C/beginner-level/Basic Syntax/Structure.md deleted file mode 100644 index 72d918cc4..000000000 --- a/courses/C/beginner-level/Basic Syntax/Structure.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -id: lesson-1 -title: "Basic Syntax and Structure" -sidebar_label: Basic Syntax and Structure -sidebar_position: 1 -description: "Learn Basic Syntax and Structure" -tags: [courses,beginner-level,C,Introduction] ---- - - -#### Structure of a C Program - -A typical C program consists of the following components: - -1. **Preprocessor Directives**: These are commands that give instructions to the compiler to preprocess the source code before actual compilation starts. They usually begin with `#`. For example, `#include ` is a preprocessor directive that includes the Standard Input Output library. - -2. **Main Function**: This is the entry point of every C program. The execution of the program starts from the `main` function. - -3. **Statements and Expressions**: These form the body of the `main` function and other functions. They include variable declarations, expressions, and function calls. - -Here is an example of the basic structure of a C program: - -```c -#include // Preprocessor directive - -int main() { // Main function - // Statements - printf("Hello, World!\n"); - return 0; // Return statement -} -``` - -**Output:** -``` -Hello, World! -``` - -#### Data Types and Variables - -C provides various data types that can be used to define variables. The primary data types in C are: - -:::note -- **int**: Used to store integers. -- **float**: Used to store floating-point numbers. -- **double**: Used to store double-precision floating-point numbers. -- **char**: Used to store single characters. -::: - -Variables are used to store data that can be manipulated by the program. Here is how you declare and initialize variables in C: - -```c -int main() { - int age = 25; // Integer variable - float salary = 55000.5; // Floating-point variable - double pi = 3.14159; // Double-precision floating-point variable - char grade = 'A'; // Character variable - - // Output the values of the variables - printf("Age: %d\n", age); - printf("Salary: %.2f\n", salary); - printf("Pi: %.5f\n", pi); - printf("Grade: %c\n", grade); - - return 0; -} -``` - - -**Output:** -``` -Age: 25 -Salary: 55000.50 -Pi: 3.14159 -Grade: A -``` - - -#### Constants and Literals - -Constants are fixed values that do not change during the execution of a program. C supports several types of constants: - -- **Integer Constants**: `10`, `-100`, `0` -- **Floating-point Constants**: `3.14`, `-0.001` -- **Character Constants**: `'A'`, `'9'` -- **String Literals**: `"Hello, World!"` - -Constants can be defined using the `const` keyword or the `#define` preprocessor directive: - -```c -#include - -#define PI 3.14159 // Constant using #define - -int main() { - const int MAX_AGE = 100; // Constant using const keyword - - printf("Pi: %.5f\n", PI); - printf("Max Age: %d\n", MAX_AGE); - - return 0; -} -``` - -**Output:** -``` -Pi: 3.14159 -Max Age: 100 -``` - - - - - - - \ No newline at end of file diff --git a/courses/C/beginner-level/Basic Syntax/_category_.json b/courses/C/beginner-level/Basic Syntax/_category_.json deleted file mode 100644 index afcbf4496..000000000 --- a/courses/C/beginner-level/Basic Syntax/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Basic Syntax", - "position": 2, - "link": { - "type": "generated-index", - "description": "Learn C Language." - } - } \ No newline at end of file diff --git a/courses/C/beginner-level/Basic Syntax/input-and-output.md b/courses/C/beginner-level/Basic Syntax/input-and-output.md deleted file mode 100644 index 9e8979558..000000000 --- a/courses/C/beginner-level/Basic Syntax/input-and-output.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: lesson-2 -title: "Input and Output Operations" -sidebar_label: Input and Output Operations -sidebar_position: 2 -description: "Learn Input and Output Operations" -tags: [courses,beginner-level,C,Introduction] ---- - - -C provides standard input and output functions through the `stdio.h` library. The most commonly used functions are: - -- **printf**: Used to print output to the console. -- **scanf**: Used to read input from the console. - -Example of using `printf` and `scanf`: - -```c -#include - -int main() { - int age; - float salary; - char name[50]; - - // Input - printf("Enter your age: "); - scanf("%d", &age); - printf("Enter your salary: "); - scanf("%f", &salary); - printf("Enter your name: "); - scanf("%s", name); // Note: %s reads a single word - - // Output - printf("Age: %d\n", age); - printf("Salary: %.2f\n", salary); - printf("Name: %s\n", name); - - return 0; -} -``` - -In this program: -- `scanf("%d", &age);` reads an integer input and stores it in the variable `age`. -- `scanf("%f", &salary);` reads a floating-point input and stores it in the variable `salary`. -- `scanf("%s", name);` reads a string input and stores it in the character array `name`. - -**Sample Output:** - -Assuming the user inputs: -- Age: `30` -- Salary: `75000.75` -- Name: `Alice` - -``` -Enter your age: 30 -Enter your salary: 75000.75 -Enter your name: Alice -Age: 30 -Salary: 75000.75 -Name: Alice -``` - -By understanding the basic syntax and structure of C, you can start writing simple programs and gradually move to more complex programming tasks. \ No newline at end of file diff --git a/courses/C/beginner-level/Control-Flow/Loops.md b/courses/C/beginner-level/Control-Flow/Loops.md deleted file mode 100644 index c1310c745..000000000 --- a/courses/C/beginner-level/Control-Flow/Loops.md +++ /dev/null @@ -1,202 +0,0 @@ ---- -title: Loops in c -sidebar_label: Loops -sidebar_position: 2 -description: Learn Loops in C. -tags: [courses,C] ---- - - - -Loops are used to execute a block of code repeatedly. - -##### 1. for Loop - -**Flowchart:** - -```mermaid -flowchart TD - A[Init] --> B[Condition] - B -->|True| C[Statements] - C --> D[Next] - B -->|False| E[Update] - E --> F[Statements] - F --> D - -``` -**Example:** - -```c -#include - -int main() { - for (int i = 1; i <= 5; i++) { - printf("i = %d\n", i); - } - return 0; -} -``` - -**Output:** -``` -i = 1 -i = 2 -i = 3 -i = 4 -i = 5 -``` - -##### 2. while Loop - -**Flowchart:** - -```mermaid -flowchart TD - A[Condition] -->|True| B[Statements] - A -->|False| C[Update] - B --> D[Update] - C --> E[Next] - D --> E -``` - -**Example:** - -```c -#include - -int main() { - int i = 1; - while (i <= 5) { - printf("i = %d\n", i); - i++; - } - return 0; -} -``` - -**Output:** -``` -i = 1 -i = 2 -i = 3 -i = 4 -i = 5 -``` - -##### 3. do-while Loop - -**Flowchart:** - -```mermaid -flowchart TD - A[Statements] --> B[Update] - B --> C[Condition] - C -->|True| D[True] - C -->|False| E[False] - E --> F[Next] - D --> F -``` - - -**Example:** - -```c -#include - -int main() { - int i = 1; - do { - printf("i = %d\n", i); - i++; - } while (i <= 5); - return 0; -} -``` - -**Output:** -``` -i = 1 -i = 2 -i = 3 -i = 4 -i = 5 -``` - -#### Break and Continue Statements - -##### Example: break Statement - -**Flowchart:** - - -```mermaid -flowchart TD - A[Loop Start] --> B[Condition] - B -->|True| C[Statements] - B -->|False| D[Break] - C --> E[Break] - D --> F[Next] - E --> F -``` - -**Example:** - -```c -#include - -int main() { - for (int i = 1; i <= 5; i++) { - if (i == 3) { - break; - } - printf("i = %d\n", i); - } - return 0; -} -``` - -**Output:** -``` -i = 1 -i = 2 -``` - -##### Example: continue Statement - -**Flowchart:** - -```mermaid -flowchart TD - A[Loop Start] --> B[Condition] - B -->|True| C[Continue] - B -->|False| F[Next] - C --> D[Statements] - D --> E[Update] - E --> G[Next Iteration] - F --> G -``` - - -**Example:** - -```c -#include - -int main() { - for (int i = 1; i <= 5; i++) { - if (i == 3) { - continue; - } - printf("i = %d\n", i); - } - return 0; -} -``` - -**Output:** -``` -i = 1 -i = 2 -i = 4 -i = 5 -``` diff --git a/courses/C/beginner-level/Control-Flow/_category_.json b/courses/C/beginner-level/Control-Flow/_category_.json deleted file mode 100644 index 1046bb5d9..000000000 --- a/courses/C/beginner-level/Control-Flow/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Control Flow", - "position": 4, - "link": { - "type": "generated-index", - "description": "Learn Control Flow." - } - } \ No newline at end of file diff --git a/courses/C/beginner-level/Control-Flow/statement.md b/courses/C/beginner-level/Control-Flow/statement.md deleted file mode 100644 index 04ad902f9..000000000 --- a/courses/C/beginner-level/Control-Flow/statement.md +++ /dev/null @@ -1,182 +0,0 @@ ---- -title: Control Flow in c -sidebar_label: Control Flow -sidebar_position: 1 -description: Learn Conditional Statements in C. -tags: [courses,C] ---- - - -Control flow statements are used to determine the flow of execution of a program. The primary control flow constructs in C include conditional statements, switch-case statements, loops, and break and continue statements. - -#### Conditional Statements - -Conditional statements are used to execute different blocks of code based on certain conditions. - -##### 1. if Statement - -**Flowchart:** - -```mermaid -flowchart TD - A[Condition] -->|True| B[Statements] - A -->|False| C[Skip] - B --> D[Next] - C --> D -``` - - -**Example:** - -```c -#include - -int main() { - int a = 10, b = 20; - if (a < b) { - printf("a is less than b\n"); - } - return 0; -} -``` - -**Output:** -``` -a is less than b -``` - -##### 2. if-else Statement - -**Flowchart:** - - -```mermaid -flowchart TD - A[Condition] -->|True| B[Statements1] - A -->|False| C[Statements2] - B --> D[Next] - C --> D -``` - - -**Example:** - -```c -#include - -int main() { - int a = 10, b = 20; - if (a > b) { - printf("a is greater than b\n"); - } else { - printf("a is not greater than b\n"); - } - return 0; -} -``` - -**Output:** -``` -a is not greater than b -``` - -##### 3. Nested if Statement - -**Flowchart:** - -```mermaid -flowchart TD - A[Condition1] -->|True| B[Condition2] - A -->|False| E[Skip] - B -->|True| C[Stat1] - B -->|False| E - C --> D[Next] - E --> D -``` - - -**Example:** - -```c -#include - -int main() { - int a = 10, b = 20; - if (a < b) { - if (a < 15) { - printf("a is less than 15\n"); - } - } - return 0; -} -``` - -**Output:** -``` -a is less than 15 -``` - -#### Switch-case Statement - -Switch-case statements allow multi-way branching based on the value of an expression. - -**Flowchart:** - -```mermaid -flowchart TD - A[Switch expr] --> B[case 1] - A --> C[case 2] - A --> D[default] - B --> E[Stat1] - C --> F[Stat2] - D --> G[StatN] - E --> H[Break] - F --> I[Break] - G --> J[Break] - H --> K[Next] - I --> K - J --> K -``` - -**Example:** - -```c -#include - -int main() { - int day = 3; - - switch (day) { - case 1: - printf("Monday\n"); - break; - case 2: - printf("Tuesday\n"); - break; - case 3: - printf("Wednesday\n"); - break; - case 4: - printf("Thursday\n"); - break; - case 5: - printf("Friday\n"); - break; - case 6: - printf("Saturday\n"); - break; - case 7: - printf("Sunday\n"); - break; - default: - printf("Invalid day\n"); - } - - return 0; -} -``` - -**Output:** -``` -Wednesday -``` \ No newline at end of file diff --git a/courses/C/beginner-level/Functions/Introduction.md b/courses/C/beginner-level/Functions/Introduction.md deleted file mode 100644 index 7d313358f..000000000 --- a/courses/C/beginner-level/Functions/Introduction.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: Functions in C -sidebar_label: Functions -sidebar_position: 1 -description: Learn Functions in C. -tags: [courses,C] ---- - -Functions are a fundamental aspect of C programming, allowing code to be modular, reusable, and easier to understand. Functions help in breaking down a complex problem into smaller, manageable parts. Here are key concepts related to functions in C: - -#### Defining and Declaring Functions - -- **Function Declaration (Prototype)**: Declares the function's name, return type, and parameters. It must be done before the function can be used. -- **Function Definition**: Contains the actual body of the function where the logic is implemented. -- **Function Call**: Invokes the function to perform its task. - -**Example: Function Declaration and Definition** - -```c -#include - -// Function declaration -void greet(); - -// Main function -int main() { - // Function call - greet(); - return 0; -} - -// Function definition -void greet() { - printf("Hello, World!\n"); -} -``` - -**Output:** -``` -Hello, World! -``` - -#### Function Arguments and Return Values - -Functions can take arguments (parameters) and return values. This allows for more flexible and reusable code. - -**Example: Function with Arguments and Return Value** - -```c -#include - -// Function declaration -int add(int a, int b); - -// Main function -int main() { - int result; - result = add(5, 3); // Function call with arguments - printf("Result: %d\n", result); - return 0; -} - -// Function definition -int add(int a, int b) { - return a + b; // Function with return value -} -``` - -**Output:** -``` -Result: 8 -``` diff --git a/courses/C/beginner-level/Functions/Scope-of-variable.md b/courses/C/beginner-level/Functions/Scope-of-variable.md deleted file mode 100644 index 1e9cf6bd6..000000000 --- a/courses/C/beginner-level/Functions/Scope-of-variable.md +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: Recursion & Scope and lifetime of variables -sidebar_label: Recursion & Scope variable -sidebar_position: 2 -description: Learn Recursion & Scope and lifetime of variables. -tags: [courses,C] ---- - -#### Recursion - -Recursion is a process where a function calls itself. It's useful for problems that can be divided into similar sub-problems. - -**Example: Recursive Function for Factorial** - -```c -#include - -// Function declaration -int factorial(int n); - -// Main function -int main() { - int num = 5; - printf("Factorial of %d is %d\n", num, factorial(num)); - return 0; -} - -// Function definition -int factorial(int n) { - if (n == 0) { - return 1; - } else { - return n * factorial(n - 1); - } -} -``` - -**Output:** -``` -Factorial of 5 is 120 -``` - -#### Scope and Lifetime of Variables - -- **Scope**: The region of the program where a variable can be accessed. - - **Local Scope**: Variables declared inside a function or block are local to that function/block. - - **Global Scope**: Variables declared outside any function are accessible throughout the program. -- **Lifetime**: The duration for which a variable exists in memory. - - **Local Variables**: Exist only during the execution of the function/block. - - **Global Variables**: Exist for the entire lifetime of the program. - -**Example: Scope and Lifetime of Variables** - -```c -#include - -// Global variable -int globalVar = 10; - -// Function declaration -void display(); - -int main() { - // Local variable - int localVar = 20; - printf("In main: globalVar = %d, localVar = %d\n", globalVar, localVar); - display(); - return 0; -} - -// Function definition -void display() { - // Accessing global variable - printf("In display: globalVar = %d\n", globalVar); - // Uncommenting the following line will cause a compilation error - // printf("localVar = %d\n", localVar); -} -``` - -**Output:** -``` -In main: globalVar = 10, localVar = 20 -In display: globalVar = 10 -``` - -#### Flowchart for Function Execution - -1. **Function Declaration**: Declare the function's prototype if the function is defined after the `main` function. -2. **Function Call**: Call the function from the `main` function or another function. -3. **Function Definition**: Define the function with its logic and return value. - - -```mermaid -flowchart TD - A[Function Declaration] --> B[Main Function] - B --> C[Function Call] - C --> D[Function Definition] - D --> E[Function Return] - E --> F[Continue Execution] -``` - diff --git a/courses/C/beginner-level/Functions/_category_.json b/courses/C/beginner-level/Functions/_category_.json deleted file mode 100644 index 69f36cef6..000000000 --- a/courses/C/beginner-level/Functions/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Functions", - "position": 5, - "link": { - "type": "generated-index", - "description": "Learn Functions in C." - } - } \ No newline at end of file diff --git a/courses/C/beginner-level/Introduction/_category_.json b/courses/C/beginner-level/Introduction/_category_.json deleted file mode 100644 index f79ca07e2..000000000 --- a/courses/C/beginner-level/Introduction/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Introduction", - "position": 1, - "link": { - "type": "generated-index", - "description": "Learn C Language." - } - } \ No newline at end of file diff --git a/courses/C/beginner-level/Introduction/intro.md b/courses/C/beginner-level/Introduction/intro.md deleted file mode 100644 index c1ce14b3b..000000000 --- a/courses/C/beginner-level/Introduction/intro.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: lesson-1 -title: "Introduction to C Programming" -sidebar_label: Get Started -sidebar_position: 1 -description: "Introduction to C Programming" -tags: [courses, beginner-level, C, Introduction] ---- - -## History of C - -C is a general-purpose programming language that was developed in the early 1970s by Dennis Ritchie at Bell Labs. It was created as an evolution of the B programming language and was designed for system programming and developing operating systems. C's development was closely tied to the Unix operating system, with most of Unix's kernel and system utilities written in C. Its powerful features, portability, and performance have made it one of the most widely used and influential programming languages in history. - -## Features and Benefits of C - -- **Efficiency and Performance**: C is known for its efficiency and performance, making it suitable for system-level programming and applications that require high-speed execution. -- **Portability**: C programs can be easily ported to different platforms with minimal changes, making it a versatile language for cross-platform development. -- **Low-level Access**: C provides low-level access to memory and hardware, allowing developers to write programs that interact directly with the system hardware. -- **Rich Library**: C has a rich standard library that provides numerous built-in functions for performing common tasks. -- **Modularity**: C supports modular programming, allowing developers to split their code into smaller, manageable functions and modules. -- **Widely Used**: C is widely used in various domains, including system programming, embedded systems, game development, and application development. diff --git a/courses/C/beginner-level/Introduction/setting-up.md b/courses/C/beginner-level/Introduction/setting-up.md deleted file mode 100644 index 17b61cd27..000000000 --- a/courses/C/beginner-level/Introduction/setting-up.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -id: lesson-2 -title: "Setting up the Development Environment" -sidebar_label: Setting up -sidebar_position: 2 -description: "Setting up the Development Environment" -tags: [courses, beginner-level, C, Introduction] ---- - -To write and compile C programs, you need a C compiler and a text editor or an integrated development environment (IDE). Here’s how you can set up a C development environment: - -1. **Install a C Compiler**: - - - **Windows**: Install MinGW (Minimalist GNU for Windows) which includes the GCC compiler. - - **Linux**: GCC (GNU Compiler Collection) is typically pre-installed. If not, you can install it using your package manager (e.g., `sudo apt install gcc` on Ubuntu). - - **macOS**: Install Xcode Command Line Tools which include the GCC compiler (`xcode-select --install`). - -2. **Install a Text Editor or IDE**: - - **Text Editors**: Notepad++, Sublime Text, Visual Studio Code. - - **IDEs**: Code::Blocks, Eclipse CDT, CLion. - -#### Writing and Compiling Your First C Program - -1. **Writing Your First C Program**: - - - Open your text editor or IDE and write the following C program: - - ```c title="hello.c" - #include - - int main() { - printf("Hello, World!\n"); - return 0; - } - ``` - - - Save the file with a `.c` extension, for example, `hello.c`. - -2. **Compiling Your C Program**: - - - Open your terminal or command prompt. - - Navigate to the directory where you saved your `hello.c` file. - - Compile the program using the C compiler. For GCC, you can use the following command: - - ```sh - gcc hello.c -o hello - ``` - - - This command compiles `hello.c` and creates an executable file named `hello`. - -3. **Running Your C Program**: - - - After compiling, run the executable file by typing the following command in your terminal or command prompt: - - ```sh - ./hello - ``` - -4. **Output**: - - - You should see the output `Hello, World!` printed on the screen. - - ``` - Hello, World! - ``` diff --git a/courses/C/beginner-level/Pointers/Introduction.md b/courses/C/beginner-level/Pointers/Introduction.md deleted file mode 100644 index 5cc85b96b..000000000 --- a/courses/C/beginner-level/Pointers/Introduction.md +++ /dev/null @@ -1,255 +0,0 @@ ---- -id: lesson-1 -title: "Pointers in C" -sidebar_label: Pointers -sidebar_position: 1 -description: "Learn Pointers in C" -tags: [courses,beginner-level,C,Introduction] ---- - - - -Pointers are a powerful feature in C that allow you to directly manipulate memory addresses. Understanding pointers is crucial for effective memory management and efficient programming in C. - -#### Introduction to Pointers - -A pointer is a variable that stores the memory address of another variable. Pointers enable various operations, such as dynamic memory allocation, array manipulation, and efficient function calls. - -### Flowchart for Pointers - -1. **Declare a pointer**: Declare a variable to store the address of another variable. -2. **Initialize the pointer**: Assign the address of the variable to the pointer. -3. **Dereference the pointer**: Access or modify the value stored at the pointer's address. - - -```mermaid -flowchart TD - A[Declare a pointer] --> B[Initialize the pointer] - B --> C[Dereference the pointer] - C --> D[Access/Modify the value] -``` - - -**Declaration and Initialization of Pointers:** - -```c -#include - -int main() { - int var = 10; - int *ptr; // Pointer declaration - - ptr = &var; // Pointer initialization - - printf("Value of var: %d\n", var); - printf("Address of var: %p\n", &var); - printf("Value of ptr: %p\n", ptr); - printf("Value pointed to by ptr: %d\n", *ptr); - - return 0; -} -``` - -**Output:** - -``` -Value of var: 10 -Address of var: 0x7ffc12345678 -Value of ptr: 0x7ffc12345678 -Value pointed to by ptr: 10 -``` - -#### Pointer Arithmetic - -Pointer arithmetic involves operations on pointers. You can perform addition and subtraction on pointers to navigate through memory. - -**Example: Pointer Arithmetic** - -```c -#include - -int main() { - int arr[5] = {10, 20, 30, 40, 50}; - int *ptr = arr; // Pointer to the first element of the array - - for (int i = 0; i < 5; i++) { - printf("Value at arr[%d]: %d\n", i, *(ptr + i)); // Pointer arithmetic - } - - return 0; -} -``` - -**Output:** - -``` -Value at arr[0]: 10 -Value at arr[1]: 20 -Value at arr[2]: 30 -Value at arr[3]: 40 -Value at arr[4]: 50 -``` - -#### Pointers and Arrays - -Pointers and arrays are closely related in C. The name of an array acts as a pointer to the first element of the array. - -**Example: Pointers and Arrays** - -```c -#include - -int main() { - int arr[3] = {10, 20, 30}; - int *ptr = arr; - - // Accessing array elements using pointer - for (int i = 0; i < 3; i++) { - printf("arr[%d] = %d\n", i, *(ptr + i)); - } - - return 0; -} -``` - -**Output:** - -``` -arr[0] = 10 -arr[1] = 20 -arr[2] = 30 -``` - -#### Pointers and Functions - -Pointers can be used to pass arguments to functions by reference, allowing the function to modify the original variables. - -**Example: Pointers and Functions** - -```c -#include - -// Function declaration -void swap(int *a, int *b); - -int main() { - int x = 5, y = 10; - - printf("Before swap: x = %d, y = %d\n", x, y); - swap(&x, &y); - printf("After swap: x = %d, y = %d\n", x, y); - - return 0; -} - -// Function definition -void swap(int *a, int *b) { - int temp; - temp = *a; - *a = *b; - *b = temp; -} -``` - -**Output:** - -``` -Before swap: x = 5, y = 10 -After swap: x = 10, y = 5 -``` - -#### Example 1: Pointer Declaration and Initialization - -```c -#include - -int main() { - int var = 10; - int *ptr; // Pointer declaration - - ptr = &var; // Pointer initialization - - printf("Value of var: %d\n", var); - printf("Address of var: %p\n", &var); - printf("Value of ptr: %p\n", ptr); - printf("Value pointed to by ptr: %d\n", *ptr); - - return 0; -} -``` - -**Explanation**: This program demonstrates the declaration, initialization, and dereferencing of a pointer. The pointer `ptr` is initialized with the address of `var`, and the value stored at that address is accessed using `*ptr`. - -**Output:** - -``` -Value of var: 10 -Address of var: 0x7ffc12345678 -Value of ptr: 0x7ffc12345678 -Value pointed to by ptr: 10 -``` - -#### Example 2: Pointer Arithmetic - -```c -#include - -int main() { - int arr[5] = {10, 20, 30, 40, 50}; - int *ptr = arr; // Pointer to the first element of the array - - for (int i = 0; i < 5; i++) { - printf("Value at arr[%d]: %d\n", i, *(ptr + i)); // Pointer arithmetic - } - - return 0; -} -``` - -**Explanation**: This program shows how to use pointer arithmetic to iterate through an array. The pointer `ptr` is used to access the elements of the array `arr` by incrementing the pointer. - -**Output:** - -``` -Value at arr[0]: 10 -Value at arr[1]: 20 -Value at arr[2]: 30 -Value at arr[3]: 40 -Value at arr[4]: 50 -``` - -#### Example 3: Pointers and Functions - -```c -#include - -// Function declaration -void swap(int *a, int *b); - -int main() { - int x = 5, y = 10; - - printf("Before swap: x = %d, y = %d\n", x, y); - swap(&x, &y); - printf("After swap: x = %d, y = %d\n", x, y); - - return 0; -} - -// Function definition -void swap(int *a, int *b) { - int temp; - temp = *a; - *a = *b; - *b = temp; -} -``` - -**Explanation**: This program demonstrates passing arguments to functions by reference using pointers. The `swap` function swaps the values of `x` and `y` by modifying the values directly through their pointers. - -**Output:** - -``` -Before swap: x = 5, y = 10 -After swap: x = 10, y = 5 -``` diff --git a/courses/C/beginner-level/Pointers/_category_.json b/courses/C/beginner-level/Pointers/_category_.json deleted file mode 100644 index 3bab4ff66..000000000 --- a/courses/C/beginner-level/Pointers/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Pointers", - "position": 7, - "link": { - "type": "generated-index", - "description": "Learn C Language." - } - } \ No newline at end of file diff --git a/courses/C/beginner-level/Pointers/pointer-to-pointer.md b/courses/C/beginner-level/Pointers/pointer-to-pointer.md deleted file mode 100644 index f461ccd8f..000000000 --- a/courses/C/beginner-level/Pointers/pointer-to-pointer.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -id: lesson-2 -title: "Pointer to Pointer" -sidebar_label: Pointer to Pointer -sidebar_position: 2 -description: "Learn Pointer to Pointer" -tags: [courses,beginner-level,Pointer to Pointer,C,Introduction] ---- - -A pointer to a pointer (double pointer) is a pointer that stores the address of another pointer. - -**Example: Pointer to Pointer** - -```c -#include - -int main() { - int var = 10; - int *ptr; - int **pptr; - - ptr = &var; // Pointer to int - pptr = &ptr; // Pointer to pointer to int - - printf("Value of var: %d\n", var); - printf("Value pointed to by ptr: %d\n", *ptr); - printf("Value pointed to by pptr: %d\n", **pptr); - - return 0; -} -``` - -**Output:** - -``` -Value of var: 10 -Value pointed to by ptr: 10 -Value pointed to by pptr: 10 -``` - - - -#### Example : Pointer to Pointer - -```c -#include - -int main() { - int var = 10; - int *ptr; - int **pptr; - - ptr = &var; // Pointer to int - pptr = &ptr; // Pointer to pointer to int - - printf("Value of var: %d\n", var); - printf("Value pointed to by ptr: %d\n", *ptr); - printf("Value pointed to by pptr: %d\n", **pptr); - - return 0; -} -``` - -**Explanation**: This program illustrates the concept of a pointer to a pointer. The `pptr` is a pointer that stores the address of the pointer `ptr`, which in turn stores the address of the variable `var`. - -**Output:** - -``` -Value of var: 10 -Value pointed to by ptr: 10 -Value pointed to by pptr: 10 -``` diff --git a/courses/C/beginner-level/Structure-and-unions/Intro.md b/courses/C/beginner-level/Structure-and-unions/Intro.md deleted file mode 100644 index 048ff3eb4..000000000 --- a/courses/C/beginner-level/Structure-and-unions/Intro.md +++ /dev/null @@ -1,207 +0,0 @@ ---- -id: lesson-1 -title: "Structures and Unions in C" -sidebar_label: Structures and Unions -sidebar_position: 1 -description: "Learn Structures and Unions in C" -tags: [courses, beginner-level, C, Structures, Unions, Introduction] ---- - -Structures and unions are user-defined data types that allow the grouping of variables of different types. They provide a way to model complex data structures in a single unit. - -### Defining and Using Structures - -A structure is a collection of variables, possibly of different types, grouped together under a single name. - -### Flowchart for Using Structures - -:::note - -1. **Define a structure**: Define the structure with the required members. -2. **Declare structure variables**: Declare variables of the structure type. -3. **Assign values to structure members**: Use the dot operator to assign values. -4. **Access and use structure members**: Access values using the dot operator. - ::: - -```mermaid -flowchart TD - A[Define a structure] --> B[Declare structure variables] - B --> C[Assign values to structure members] - C --> D[Access and use structure members] -``` - -**Defining a Structure:** - -```c title="filename.c" -#include - -// Define a structure -struct Person { - char name[50]; - int age; - float salary; -}; - -int main() { - // Declare a structure variable - struct Person person1; - - // Assign values to the members of the structure - strcpy(person1.name, "Alice"); - person1.age = 30; - person1.salary = 55000.50; - - // Access and print the values - printf("Name: %s\n", person1.name); - printf("Age: %d\n", person1.age); - printf("Salary: %.2f\n", person1.salary); - - return 0; -} -``` - -**Output:** - -``` -Name: Alice -Age: 30 -Salary: 55000.50 -``` - -#### Array of Structures - -An array of structures allows storing multiple records of the same structure type. - -**Example: Array of Structures** - -```c -#include - -// Define a structure -struct Person { - char name[50]; - int age; - float salary; -}; - -int main() { - // Declare an array of structures - struct Person people[3]; - - // Assign values to the array elements - strcpy(people[0].name, "Alice"); - people[0].age = 30; - people[0].salary = 55000.50; - - strcpy(people[1].name, "Bob"); - people[1].age = 25; - people[1].salary = 45000.75; - - strcpy(people[2].name, "Charlie"); - people[2].age = 28; - people[2].salary = 50000.60; - - // Access and print the values - for (int i = 0; i < 3; i++) { - printf("Name: %s, Age: %d, Salary: %.2f\n", people[i].name, people[i].age, people[i].salary); - } - - return 0; -} -``` - -**Output:** - -``` -Name: Alice, Age: 30, Salary: 55000.50 -Name: Bob, Age: 25, Salary: 45000.75 -Name: Charlie, Age: 28, Salary: 50000.60 -``` - -#### Nested Structures - -Nested structures are structures within structures, allowing you to create more complex data models. - -**Example: Nested Structures** - -```c -#include - -// Define a nested structure -struct Date { - int day; - int month; - int year; -}; - -struct Person { - char name[50]; - struct Date birthdate; // Nested structure - float salary; -}; - -int main() { - // Declare a structure variable - struct Person person1; - - // Assign values to the members of the structure - strcpy(person1.name, "Alice"); - person1.birthdate.day = 15; - person1.birthdate.month = 5; - person1.birthdate.year = 1990; - person1.salary = 55000.50; - - // Access and print the values - printf("Name: %s\n", person1.name); - printf("Birthdate: %02d-%02d-%04d\n", person1.birthdate.day, person1.birthdate.month, person1.birthdate.year); - printf("Salary: %.2f\n", person1.salary); - - return 0; -} -``` - -**Output:** - -``` -Name: Alice -Birthdate: 15-05-1990 -Salary: 55000.50 -``` - -#### Example : Using Structures - -```c -#include - -// Define a structure -struct Person { - char name[50]; - int age; - float salary; -}; - -int main() { - // Declare a structure variable - struct Person person1; - - // Assign values to the members of the structure - strcpy(person1.name, "Alice"); - person1.age = 30; - person1.salary = 55000.50; - - // Access and print the values - printf("Name: %s\n", person1.name); - printf("Age: %d\n", person1.age); - printf("Salary: %.2f\n", person1.salary); - - return 0; -} -``` - -**Output:** - -``` -Name: Alice -Age: 30 -Salary: 55000.50 -``` diff --git a/courses/C/beginner-level/Structure-and-unions/Unions.md b/courses/C/beginner-level/Structure-and-unions/Unions.md deleted file mode 100644 index 8765a1a3a..000000000 --- a/courses/C/beginner-level/Structure-and-unions/Unions.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -id: lesson-2 -title: "Introduction to Unions" -sidebar_label: Introduction to Unions -sidebar_position: 2 -description: "Learn Introduction to Unions" -tags: [courses,beginner-level,C,Unions,Introduction] ---- - -A union is similar to a structure, but its members share the same memory location. This means that only one member can contain a value at any given time. - -**Defining a Union:** - -```c -#include - -// Define a union -union Data { - int i; - float f; - char str[20]; -}; - -int main() { - // Declare a union variable - union Data data; - - // Assign values to the members of the union - data.i = 10; - printf("data.i: %d\n", data.i); - - data.f = 220.5; - printf("data.f: %.2f\n", data.f); - - strcpy(data.str, "Hello"); - printf("data.str: %s\n", data.str); - - return 0; -} -``` - -**Output:** - -``` -data.i: 10 -data.f: 220.50 -data.str: Hello -``` - -#### Differences Between Structures and Unions - -1. **Memory Allocation**: - - **Structure**: Allocates separate memory for each member. - - **Union**: Shares the same memory location for all its members. - -2. **Usage**: - - **Structure**: Used when you need to store different types of data together. - - **Union**: Used when you need to store different types of data but only one at a time. - - - -#### Example : Using Unions - -```c -#include - -// Define a union -union Data { - int i; - float f; - char str[20]; -}; - -int main() { - // Declare a union variable - union Data data; - - // Assign values to the members of the union - data.i = 10; - printf("data.i: %d\n", data.i); - - data.f = 220.5; - printf("data.f: %.2f\n", data.f); - - strcpy(data.str, "Hello"); - printf("data.str: %s\n", data.str); - - return 0; -} -``` - - -**Output:** - -``` -data.i: 10 -data.f: 220.50 -data.str: Hello -``` diff --git a/courses/C/beginner-level/Structure-and-unions/_category_.json b/courses/C/beginner-level/Structure-and-unions/_category_.json deleted file mode 100644 index bc9cf1816..000000000 --- a/courses/C/beginner-level/Structure-and-unions/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Structures and Unions in C", - "position": 8, - "link": { - "type": "generated-index", - "description": "Learn Structures and Unions in C Language." - } - } \ No newline at end of file diff --git a/courses/C/beginner-level/_category_.json b/courses/C/beginner-level/_category_.json deleted file mode 100644 index 1dc221e3d..000000000 --- a/courses/C/beginner-level/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Beginner Level", - "position": 2, - "link": { - "type": "generated-index", - "description": "Learn C Language." - } - } \ No newline at end of file diff --git a/courses/C/beginner-level/operators-and-expression/Operators.md b/courses/C/beginner-level/operators-and-expression/Operators.md deleted file mode 100644 index 22987d661..000000000 --- a/courses/C/beginner-level/operators-and-expression/Operators.md +++ /dev/null @@ -1,199 +0,0 @@ ---- -title: Operators and Expressions in c -sidebar_label: Operators and Expressions -sidebar_position: 1 -description: Learn Operators and Expressions in C program. -tags: [courses] ---- - - -Operators are special symbols that perform operations on variables and values. In C, operators are used to manipulate data and variables to form expressions. Here are some of the commonly used operators in C: - -#### Arithmetic Operators - -Arithmetic operators are used to perform mathematical operations such as addition, subtraction, multiplication, and division. - -| Operator | Description | Example | Output | -|----------|----------------------|-------------|---------| -| `+` | Addition | `a + b` | Sum of a and b | -| `-` | Subtraction | `a - b` | Difference of a and b | -| `*` | Multiplication | `a * b` | Product of a and b | -| `/` | Division | `a / b` | Quotient of a divided by b | -| `%` | Modulus (remainder) | `a % b` | Remainder of a divided by b | - -Example: - -```c -#include - -int main() { - int a = 10, b = 3; - printf("a + b = %d\n", a + b); - printf("a - b = %d\n", a - b); - printf("a * b = %d\n", a * b); - printf("a / b = %d\n", a / b); - printf("a %% b = %d\n", a % b); - - return 0; -} -``` - -**Output:** -``` -a + b = 13 -a - b = 7 -a * b = 30 -a / b = 3 -a % b = 1 -``` - -#### Relational Operators - -Relational operators are used to compare two values. They return either true (1) or false (0). - -| Operator | Description | Example | Output | -|----------|----------------------|-------------|---------| -| `==` | Equal to | `a == b` | 0 (false) | -| `!=` | Not equal to | `a != b` | 1 (true) | -| `>` | Greater than | `a > b` | 1 (true) | -| `<` | Less than | `a < b` | 0 (false) | -| `>=` | Greater than or equal to | `a >= b` | 1 (true) | -| `<=` | Less than or equal to | `a <= b` | 0 (false) | - -Example: - -```c -#include - -int main() { - int a = 10, b = 3; - printf("a == b: %d\n", a == b); - printf("a != b: %d\n", a != b); - printf("a > b: %d\n", a > b); - printf("a < b: %d\n", a < b); - printf("a >= b: %d\n", a >= b); - printf("a <= b: %d\n", a <= b); - - return 0; -} -``` - -**Output:** -``` -a == b: 0 -a != b: 1 -a > b: 1 -a < b: 0 -a >= b: 1 -a <= b: 0 -``` - -#### Logical Operators - -Logical operators are used to combine multiple conditions. - -| Operator | Description | Example | Output | -|----------|----------------------|-----------------|---------| -| `&&` | Logical AND | `(a > b) && (a < 20)` | 1 (true) | -| `\|\|` | Logical OR | `(a > b) \|\| (a < 5)` | 1 (true) | -| `!` | Logical NOT | `!(a == b)` | 1 (true) | - -Example: - -```c -#include - -int main() { - int a = 10, b = 3; - printf("(a > b) && (a < 20): %d\n", (a > b) && (a < 20)); - printf("(a > b) || (a < 5): %d\n", (a > b) || (a < 5)); - printf("!(a == b): %d\n", !(a == b)); - - return 0; -} -``` - -**Output:** -``` -(a > b) && (a < 20): 1 -(a > b) || (a < 5): 1 -!(a == b): 1 -``` - -#### Assignment Operators - -Assignment operators are used to assign values to variables. - -| Operator | Description | Example | Equivalent | -|----------|----------------------|-----------|-------------| -| `=` | Assign | `a = b` | `a = b` | -| `+=` | Add and assign | `a += b` | `a = a + b` | -| `-=` | Subtract and assign | `a -= b` | `a = a - b` | -| `*=` | Multiply and assign | `a *= b` | `a = a * b` | -| `/=` | Divide and assign | `a /= b` | `a = a / b` | -| `%=` | Modulus and assign | `a %= b` | `a = a % b` | - -Example: - -```c -#include - -int main() { - int a = 10, b = 3; - a += b; // a = a + b - printf("a += b: %d\n", a); - a -= b; // a = a - b - printf("a -= b: %d\n", a); - a *= b; // a = a * b - printf("a *= b: %d\n", a); - a /= b; // a = a / b - printf("a /= b: %d\n", a); - a %= b; // a = a % b - printf("a %%= b: %d\n", a); - - return 0; -} -``` - -**Output:** -``` -a += b: 13 -a -= b: 10 -a *= b: 30 -a /= b: 10 -a %= b: 1 -``` - -#### Increment and Decrement Operators - -Increment and decrement operators are used to increase or decrease the value of a variable by 1. - -| Operator | Description | Example | Output | -|----------|----------------------|-----------|--------| -| `++` | Increment by 1 | `a++` | a is increased by 1 | -| `--` | Decrement by 1 | `a--` | a is decreased by 1 | - -Example: - -```c -#include - -int main() { - int a = 10; - printf("Initial value of a: %d\n", a); - a++; - printf("After a++: %d\n", a); - a--; - printf("After a--: %d\n", a); - - return 0; -} -``` - -**Output:** -``` -Initial value of a: 10 -After a++: 11 -After a--: 10 -``` - \ No newline at end of file diff --git a/courses/C/beginner-level/operators-and-expression/_category_.json b/courses/C/beginner-level/operators-and-expression/_category_.json deleted file mode 100644 index b42845cf3..000000000 --- a/courses/C/beginner-level/operators-and-expression/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Operators and Expressions", - "position": 3, - "link": { - "type": "generated-index", - "description": "Learn C Language." - } - } \ No newline at end of file diff --git a/courses/C/intermediate-level/ Preprocessor Directives/_category_.json b/courses/C/intermediate-level/ Preprocessor Directives/_category_.json deleted file mode 100644 index 617768739..000000000 --- a/courses/C/intermediate-level/ Preprocessor Directives/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": " Preprocessor Directives", - "position": 5, - "link": { - "type": "generated-index", - "description": "Learn Preprocessor Directives in C Language." - } - } \ No newline at end of file diff --git a/courses/C/intermediate-level/ Preprocessor Directives/file-Inclusion.md b/courses/C/intermediate-level/ Preprocessor Directives/file-Inclusion.md deleted file mode 100644 index 94edb7e46..000000000 --- a/courses/C/intermediate-level/ Preprocessor Directives/file-Inclusion.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: lesson-2 -title: "File Inclusion" -sidebar_label: File Inclusion -sidebar_position: 2 -description: "Learn File Inclusion in C" -tags: [courses,intermediate-level,File Inclusion,Introduction] ---- - - - File inclusion allows you to include the contents of one file into another. This is often used to include header files that contain function declarations, macros, or type definitions. - - - **`#include`**: Used to include header files. - ```c - #include // Standard library header - #include "myheader.h" // User-defined header - ``` - - - **Include Guards**: Prevent multiple inclusions of the same header file. - ```c - #ifndef MYHEADER_H - #define MYHEADER_H - - void myFunction(); - - #endif - ``` - - - -#### Example: File Inclusion and Include Guards - -**Header File (myheader.h)**: -```c -#ifndef MYHEADER_H -#define MYHEADER_H - -void printMessage(); - -#endif -``` - -**Source File (myheader.c)**: -```c -#include -#include "myheader.h" - -void printMessage() { - printf("Hello from myheader!\n"); -} -``` - -**Main File (main.c)**: -```c -#include -#include "myheader.h" - -int main() { - printMessage(); - return 0; -} -``` - -**Output**: -``` -Hello from myheader! -``` - - -### Summary - -- **Macros**: Allow you to define constants and inline code snippets. -- **Function-like Macros**: Enable you to define reusable code patterns. -- **Conditional Compilation**: Controls which parts of the code are compiled based on certain conditions. -- **File Inclusion**: Facilitates modular programming and code reuse with include files and guards. diff --git a/courses/C/intermediate-level/ Preprocessor Directives/intro.md b/courses/C/intermediate-level/ Preprocessor Directives/intro.md deleted file mode 100644 index 656c24471..000000000 --- a/courses/C/intermediate-level/ Preprocessor Directives/intro.md +++ /dev/null @@ -1,141 +0,0 @@ ---- -id: lesson-1 -title: "Preprocessor Directives" -sidebar_label: Preprocessor Directives -sidebar_position: 1 -description: "Learn Preprocessor Directives in C" -tags: [courses,intermediate-level,File Inclusion,Introduction] ---- - - -Preprocessor directives in C are instructions that are processed by the preprocessor before the actual compilation of the code begins. They are used to control the compilation process, define constants, include files, and more. - -#### Introduction to the C Preprocessor - -The C preprocessor is a tool that performs textual substitutions on the source code before it is compiled. It handles directives that are introduced with a `#` symbol and processes them to prepare the code for compilation. - - -#### Flowchart: Conditional Compilation -:::note -1. **Start** -2. **Check if macro is defined (`#ifdef`)** - - If defined, include the code between `#ifdef` and `#endif` - - If not, skip the code between `#ifdef` and `#endif` -3. **Check additional conditions using `#elif`, `#else` if applicable** -4. **End** -::: - - -```mermaid -flowchart TD - A[Start] --> B[Check if macro is defined #ifdef`] - B -->|Yes| C[Include code between #ifdef and #endif] - B -->|No| D[Skip code between #ifdef and #endif] - C --> E[Check additional conditions with #elif, #else if applicable] - D --> E - E --> F[End] -``` - - -#### Key Preprocessor Directives - -1. **Macros and Macro Functions** - - - **Object-like Macros**: These are simple replacements where a name is replaced with a value or a piece of code. - ```c - #define PI 3.14 - ``` - - - **Function-like Macros**: These are more complex and can take arguments. - ```c - #define SQUARE(x) ((x) * (x)) - ``` - - - **Example Usage**: - ```c - #include - - #define PI 3.14 - #define SQUARE(x) ((x) * (x)) - - int main() { - printf("PI: %f\n", PI); - printf("Square of 5: %d\n", SQUARE(5)); - return 0; - } - ``` - - **Output**: - ``` - PI: 3.140000 - Square of 5: 25 - ``` - -2. **Conditional Compilation** - - Conditional compilation allows you to include or exclude parts of code based on certain conditions. This is useful for including platform-specific code or debugging. - - - **`#ifdef` and `#ifndef`**: Check if a macro is defined or not. - ```c - #ifdef DEBUG - printf("Debug mode is enabled\n"); - #endif - ``` - - - **`#if`, `#elif`, `#else`, and `#endif`**: Provides more complex conditions. - ```c - #define VERSION 2 - - #if VERSION >= 2 - printf("Version is 2 or higher\n"); - #else - printf("Version is less than 2\n"); - #endif - ``` - - -#### Example 1: Macros and Macro Functions - -```c -#include - -#define PI 3.14159 -#define CIRCLE_AREA(radius) (PI * (radius) * (radius)) - -int main() { - double radius = 5.0; - printf("Area of circle with radius %.2f: %.2f\n", radius, CIRCLE_AREA(radius)); - return 0; -} -``` - -**Output**: -``` -Area of circle with radius 5.00: 78.54 -``` - -#### Example : Conditional Compilation - -```c -#include - -#define DEBUG - -int main() { - #ifdef DEBUG - printf("Debug mode is enabled\n"); - #endif - - #ifndef RELEASE - printf("Release mode is not defined\n"); - #endif - - return 0; -} -``` - -**Output**: -``` -Debug mode is enabled -Release mode is not defined -``` diff --git a/courses/C/intermediate-level/Advanced pointers/Function-pointer.md b/courses/C/intermediate-level/Advanced pointers/Function-pointer.md deleted file mode 100644 index 1287324d4..000000000 --- a/courses/C/intermediate-level/Advanced pointers/Function-pointer.md +++ /dev/null @@ -1,159 +0,0 @@ ---- -id: lesson-1 -title: "Advanced Pointers in C" -sidebar_label: Advanced Pointers -sidebar_position: 1 -description: "Learn Advanced Pointers in C" -tags: [courses,intermediate-level,File Handling,Introduction] ---- - - -Understanding advanced concepts of pointers is crucial for writing efficient and flexible C programs. This section covers function pointers, pointers to arrays and structures, pointer arrays, and dynamic arrays using pointers. - -#### Function Pointers - -Function pointers are pointers that point to the address of a function. They are used to pass functions as arguments to other functions, create callback functions, and more. - -1. **Declaring and Using Function Pointers**: - - ```c - void (*fptr)(int); - - void myFunction(int a) { - printf("Value: %d\n", a); - } - - int main() { - fptr = myFunction; // Assign function address to pointer - fptr(10); // Call function using pointer - return 0; - } - ``` - -2. **Function Pointer as Arguments**: - - ```c - void executeFunction(void (*fptr)(int), int value) { - fptr(value); // Call the function via pointer - } - - void display(int a) { - printf("Display: %d\n", a); - } - - int main() { - executeFunction(display, 5); - return 0; - } - ``` - -#### Pointers to Arrays and Structures - -1. **Pointers to Arrays**: - - ```c - int arr[5] = {1, 2, 3, 4, 5}; - int *p = arr; // Pointer to array - - for (int i = 0; i < 5; i++) { - printf("%d ", *(p + i)); // Access array elements using pointer - } - ``` - -2. **Pointers to Structures**: - - ```c - struct Point { - int x, y; - }; - - int main() { - struct Point p1 = {10, 20}; - struct Point *ptr = &p1; - - printf("x: %d, y: %d\n", ptr->x, ptr->y); // Access structure members using pointer - return 0; - } - ``` - -#### Pointer Arrays - -Pointer arrays are arrays of pointers, which can be used to point to multiple variables or arrays. - -1. **Array of Pointers**: - - ```c - int a = 1, b = 2, c = 3; - int *arr[3] = {&a, &b, &c}; - - for (int i = 0; i < 3; i++) { - printf("%d ", *arr[i]); // Access values using array of pointers - } - ``` - -2. **Pointer to Pointer (Double Pointer)**: - - ```c - int a = 10; - int *p1 = &a; - int **p2 = &p1; - - printf("Value: %d\n", **p2); // Access value using double pointer - ``` - - -#### Example 1: Function Pointers - -```c -#include - -void printMessage() { - printf("Hello, World!\n"); -} - -void execute(void (*funcPtr)()) { - funcPtr(); // Call the function via pointer -} - -int main() { - void (*fptr)() = printMessage; // Function pointer assignment - execute(fptr); // Pass function pointer as argument - return 0; -} -``` - -**Output**: -``` -Hello, World! -``` - -#### Example 2: Pointers to Arrays and Structures - -```c -#include - -struct Point { - int x, y; -}; - -int main() { - struct Point p = {5, 10}; - struct Point *ptr = &p; - - printf("x: %d, y: %d\n", ptr->x, ptr->y); // Access structure members using pointer - - int arr[3] = {1, 2, 3}; - int *pArr = arr; - - for (int i = 0; i < 3; i++) { - printf("%d ", *(pArr + i)); // Access array elements using pointer - } - return 0; -} -``` - -**Output**: -``` -x: 5, y: 10 -1 2 3 -``` diff --git a/courses/C/intermediate-level/Advanced pointers/_category_.json b/courses/C/intermediate-level/Advanced pointers/_category_.json deleted file mode 100644 index 63e469f69..000000000 --- a/courses/C/intermediate-level/Advanced pointers/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Advanced Pointers", - "position": 3, - "link": { - "type": "generated-index", - "description": "Learn Advanced Pointers in C Language." - } - } \ No newline at end of file diff --git a/courses/C/intermediate-level/Advanced pointers/dynamic-array-pointer.md b/courses/C/intermediate-level/Advanced pointers/dynamic-array-pointer.md deleted file mode 100644 index 0bde45c0e..000000000 --- a/courses/C/intermediate-level/Advanced pointers/dynamic-array-pointer.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -id: lesson-2 -title: "Dynamic Arrays Using Pointers" -sidebar_label: Dynamic Arrays Using Pointers -sidebar_position: 2 -description: "Learn Dynamic Arrays Using Pointers" -tags: [courses,intermediate-level,File Handling,Introduction] ---- - - -Dynamic arrays allow you to allocate memory at runtime, making it possible to handle arrays whose size can change during program execution. - -1. **Creating Dynamic Arrays**: - - ```c - int *arr; - int n; - - printf("Enter number of elements: "); - scanf("%d", &n); - - arr = (int *)malloc(n * sizeof(int)); // Allocate memory dynamically - if (arr == NULL) { - printf("Memory allocation failed\n"); - return 1; - } - - for (int i = 0; i < n; i++) { - arr[i] = i + 1; // Initialize array - } - - for (int i = 0; i < n; i++) { - printf("%d ", arr[i]); // Access array elements - } - - free(arr); // Deallocate memory - ``` - -2. **Resizing Dynamic Arrays**: - - ```c - int *arr; - int n, new_n; - - printf("Enter number of elements: "); - scanf("%d", &n); - - arr = (int *)malloc(n * sizeof(int)); - if (arr == NULL) { - printf("Memory allocation failed\n"); - return 1; - } - - for (int i = 0; i < n; i++) { - arr[i] = i + 1; - } - - printf("\nEnter new size: "); - scanf("%d", &new_n); - - arr = (int *)realloc(arr, new_n * sizeof(int)); // Resize array - if (arr == NULL) { - printf("Memory reallocation failed\n"); - return 1; - } - - for (int i = 0; i < new_n; i++) { - printf("%d ", arr[i]); - } - - free(arr); - ``` - - -#### Flowchart: Dynamic Arrays - -:::note -1. **Start** -2. **Input number of elements (n)** -3. **Allocate memory using `malloc`** -4. **Check if allocation was successful** - - If successful, proceed to the next step - - If not, print an error message and **exit** -5. **Initialize and use the array** -6. **Reallocate memory using `realloc` if needed** -7. **Free the allocated memory** -8. **End** -::: - -```mermaid -flowchart TD - A[Start] --> B[Input number of elements ] - B --> C[Allocate memory using malloc] - C --> D{Check if allocation was successful} - D -->|Yes| E[Initialize and use the array] - D -->|No| F[Print error message and exit] - E --> G[Reallocate memory using realloc if needed] - F --> G - G --> H[Free the allocated memory using free] - H --> I[End] -``` - diff --git a/courses/C/intermediate-level/Bitwise-Operators/_category_.json b/courses/C/intermediate-level/Bitwise-Operators/_category_.json deleted file mode 100644 index da3559f73..000000000 --- a/courses/C/intermediate-level/Bitwise-Operators/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Bitwise Operations", - "position": 4, - "link": { - "type": "generated-index", - "description": "Learn Bitwise Operations in C Language." - } - } \ No newline at end of file diff --git a/courses/C/intermediate-level/Dynamic-memory-allocation/Intro.md b/courses/C/intermediate-level/Dynamic-memory-allocation/Intro.md deleted file mode 100644 index aabbdca92..000000000 --- a/courses/C/intermediate-level/Dynamic-memory-allocation/Intro.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -id: lesson-1 -title: "Dynamic Memory Allocation in C" -sidebar_label: Dynamic Memory Allocation -sidebar_position: 1 -description: "Dynamic Memory Allocation in C" -tags: [courses,intermediate-level,Dynamic Memory Allocation,Introduction] ---- - - -Dynamic memory allocation allows programs to allocate memory at runtime, which is useful for creating flexible and efficient programs. The C Standard Library provides several functions for dynamic memory management. - -#### Introduction to Dynamic Memory Allocation - -Dynamic memory allocation is the process of allocating memory storage during the execution of a program. This is done using pointers to manage memory blocks of varying sizes. - -#### Flowchart: Dynamic Memory Allocation -:::note -1. **Start** -2. **Allocate memory** using `malloc` or `calloc` -3. **Check if allocation was successful** - - If successful, proceed to the next step - - If not, print an error message and **exit** -4. **Use the allocated memory** (assign values, process data) -5. **Free the allocated memory** using `free` -6. **End** -::: - - -```mermaid -flowchart TD - A[Start] --> B[Allocate memory using malloc or calloc] - B --> C{Check if allocation was successful} - C -->|Yes| D[Use the allocated memory] - C -->|No| E[Print error message and exit] - D --> F[Free the allocated memory using free] - F --> G[End] -``` - - - -#### `malloc`, `calloc`, `realloc`, and `free` - -1. **`malloc` (Memory Allocation)**: - - Allocates a specified number of bytes of memory. - - Returns a pointer to the allocated memory. - - Memory is not initialized. - - ```c - int *ptr; - ptr = (int *)malloc(sizeof(int) * n); // Allocate memory for n integers - if (ptr == NULL) { - printf("Memory allocation failed\n"); - } - ``` - -2. **`calloc` (Contiguous Allocation)**: - - Allocates memory for an array of elements, initializes all bytes to zero. - - Returns a pointer to the allocated memory. - - ```c - int *ptr; - ptr = (int *)calloc(n, sizeof(int)); // Allocate memory for n integers and initialize to 0 - if (ptr == NULL) { - printf("Memory allocation failed\n"); - } - ``` - -3. **`realloc` (Reallocation)**: - - Resizes a previously allocated memory block. - - Returns a pointer to the newly allocated memory. - - ```c - int *ptr; - ptr = (int *)realloc(ptr, sizeof(int) * new_size); // Resize the memory block - if (ptr == NULL) { - printf("Memory reallocation failed\n"); - } - ``` - -4. **`free` (Deallocation)**: - - Frees previously allocated memory. - - ```c - free(ptr); // Deallocate the memory - ``` diff --git a/courses/C/intermediate-level/Dynamic-memory-allocation/_category_.json b/courses/C/intermediate-level/Dynamic-memory-allocation/_category_.json deleted file mode 100644 index 149437a51..000000000 --- a/courses/C/intermediate-level/Dynamic-memory-allocation/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Dynamic Memory Allocation", - "position": 1, - "link": { - "type": "generated-index", - "description": "Learn Dynamic Memory Allocation in C Language." - } - } \ No newline at end of file diff --git a/courses/C/intermediate-level/Dynamic-memory-allocation/memory.md b/courses/C/intermediate-level/Dynamic-memory-allocation/memory.md deleted file mode 100644 index 7cfdf2f23..000000000 --- a/courses/C/intermediate-level/Dynamic-memory-allocation/memory.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -id: lesson-2 -title: "Memory Management Techniques" -sidebar_label: Memory Management -sidebar_position: 2 -description: "Memory Management Techniques" -tags: [courses,intermediate-level,Memory Management,Introduction] ---- - - -1. **Allocating Memory**: - - Use `malloc` or `calloc` to allocate memory dynamically based on the program's needs. - -2. **Resizing Memory**: - - Use `realloc` to adjust the size of an existing memory block. - -3. **Deallocating Memory**: - - Use `free` to release memory that is no longer needed to avoid memory leaks. - -4. **Error Handling**: - - Always check the return value of memory allocation functions to ensure they are not `NULL`. - -#### Common Memory-Related Issues - -1. **Memory Leaks**: - - Occur when dynamically allocated memory is not freed. - - Can cause a program to consume more memory over time. - - **Example**: - - ```c - int *ptr = (int *)malloc(sizeof(int) * 100); - // Use the allocated memory - free(ptr); // Prevent memory leak - ``` - -2. **Dangling Pointers**: - - Pointers that refer to memory that has been freed. - - Can cause undefined behavior when dereferenced. - - **Example**: - - ```c - int *ptr = (int *)malloc(sizeof(int)); - free(ptr); - ptr = NULL; // Avoid dangling pointer - ``` - -3. **Double Free**: - - Occurs when trying to free the same memory block more than once. - - Can lead to undefined behavior or program crashes. - - **Example**: - - ```c - int *ptr = (int *)malloc(sizeof(int)); - free(ptr); - // free(ptr); // Double free - should be avoided - ``` - - \ No newline at end of file diff --git a/courses/C/intermediate-level/Error-handling/_category_.json b/courses/C/intermediate-level/Error-handling/_category_.json deleted file mode 100644 index 2b6693515..000000000 --- a/courses/C/intermediate-level/Error-handling/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Error Handling", - "position": 6, - "link": { - "type": "generated-index", - "description": "Learn Error Handling in C Language." - } - } \ No newline at end of file diff --git a/courses/C/intermediate-level/Error-handling/file-operation.md b/courses/C/intermediate-level/Error-handling/file-operation.md deleted file mode 100644 index 76e8179dc..000000000 --- a/courses/C/intermediate-level/Error-handling/file-operation.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: lesson-2 -title: "Error Handling in File Operations" -sidebar_label: Error Handling in File Operations -sidebar_position: 2 -description: "Learn Error Handling in File Operations" -tags: [courses,intermediate-level,File Handling,Introduction] ---- - - - **Checking Return Values**: Many functions used in file operations return a value indicating success or failure. Always check these return values to handle errors properly. - - - **Example**: - ```c - #include - #include - - int main() { - FILE *file = fopen("example.txt", "w"); - if (file == NULL) { - perror("Error opening file"); - exit(EXIT_FAILURE); - } - - if (fprintf(file, "Hello, world!") < 0) { - perror("Error writing to file"); - fclose(file); - exit(EXIT_FAILURE); - } - - if (fclose(file) != 0) { - perror("Error closing file"); - exit(EXIT_FAILURE); - } - - return 0; - } - ``` - - **Output**: - - If the file operations succeed, there will be no error messages. - - If an error occurs, `perror` will print an appropriate message. - - -### Summary - -- **Syntax Errors**: Detected at compile-time due to incorrect code syntax. -- **Runtime Errors**: Occur during program execution and need careful handling. -- **Logical Errors**: Result in incorrect behavior due to flawed logic. -- **`errno` and `perror`**: Useful tools for diagnosing and reporting errors in C programs. -- **File Operations**: Always check return values to handle errors appropriately. \ No newline at end of file diff --git a/courses/C/intermediate-level/Error-handling/types.md b/courses/C/intermediate-level/Error-handling/types.md deleted file mode 100644 index d569a9f37..000000000 --- a/courses/C/intermediate-level/Error-handling/types.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -id: lesson-1 -title: "Error Handling in C" -sidebar_label: Introduction -sidebar_position: 1 -description: "Learn Error Handling in C" -tags: [courses,intermediate-level,File Handling,Introduction] ---- - - -Error handling is an essential aspect of programming that helps manage and respond to issues that arise during the execution of a program. In C, errors can be categorized into several types, and there are specific techniques and tools for handling them. - -#### Types of Errors - -1. **Syntax Errors** - - **Definition**: Errors that occur due to incorrect use of the C language syntax. These are typically caught by the compiler. - - **Examples**: - ```c - int main() { - int x = 5 - return 0; - } - ``` - *Missing semicolon after `int x = 5`.* - -2. **Runtime Errors** - - **Definition**: Errors that occur during the execution of the program. These errors are not detected during compilation. - - **Examples**: - ```c - int main() { - int *p = NULL; - *p = 10; // Dereferencing a null pointer - return 0; - } - ``` - *Dereferencing a null pointer.* - -3. **Logical Errors** - - **Definition**: Errors that occur when the program runs but produces incorrect results due to flawed logic. - - **Examples**: - ```c - int main() { - int a = 5, b = 10; - int sum = a - b; // Incorrect operation - printf("Sum: %d\n", sum); - return 0; - } - ``` - *Incorrect calculation of sum.* - - -#### Flowchart for Error Handling -:::note -1. **Start** -2. **Perform Operation (e.g., file operation)** -3. **Check Return Value** - - If the operation fails: - - Use `errno` to identify the error. - - Use `perror` to print the error message. - - Handle the error (e.g., clean up resources, exit program). - - If the operation succeeds, proceed with the next step. -4. **End** -::: - - -```mermaid -flowchart TD - A[Start] --> B[Perform Operation] - B --> C[Check Return Value] - C -->|Fail| D[Use errno to identify the error] - C -->|Success| E[Continue with the program] - D --> F[Use perror to print error message and handle error] - E --> F - F --> G[End] -``` - - - -#### Error Handling Techniques - -1. **Using `errno` and `perror`** - - - **`errno`**: A global variable set by system calls and some library functions in the event of an error to indicate what went wrong. It is defined in ``. - - - **`perror`**: A function that prints a descriptive error message to `stderr` based on the current value of `errno`. - - - **Example**: - ```c - #include - #include - #include - - int main() { - FILE *file = fopen("nonexistentfile.txt", "r"); - if (file == NULL) { - perror("Error opening file"); - printf("Error code: %d\n", errno); - } else { - fclose(file); - } - return 0; - } - ``` - - **Output**: - ``` - Error opening file: No such file or directory - Error code: 2 - ``` diff --git a/courses/C/intermediate-level/File-Handling/_category_.json b/courses/C/intermediate-level/File-Handling/_category_.json deleted file mode 100644 index 0c103dd1a..000000000 --- a/courses/C/intermediate-level/File-Handling/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "File Handling", - "position": 2, - "link": { - "type": "generated-index", - "description": "Learn File Handling in C Language." - } - } \ No newline at end of file diff --git a/courses/C/intermediate-level/File-Handling/binary-files.md b/courses/C/intermediate-level/File-Handling/binary-files.md deleted file mode 100644 index 92d53ae1f..000000000 --- a/courses/C/intermediate-level/File-Handling/binary-files.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: lesson-2 -title: "Working with Binary Files" -sidebar_label: Working with Binary Files -sidebar_position: 2 -description: "Learn Working with Binary Files in C" -tags: [courses,intermediate-level,File Handling,Introduction] ---- - -#### Example : Working with Binary Files - -```c -#include -#include - -int main() { - FILE *fptr; - int numbers[] = {1, 2, 3, 4, 5}; - int n; - - // Writing to a binary file - fptr = fopen("data.bin", "wb"); - if (fptr == NULL) { - printf("Cannot open file \n"); - return 1; - } - fwrite(numbers, sizeof(int), 5, fptr); - fclose(fptr); - - // Reading from a binary file - fptr = fopen("data.bin", "rb"); - if (fptr == NULL) { - printf("Cannot open file \n"); - return 1; - } - fread(&n, sizeof(int), 1, fptr); - while (!feof(fptr)) { - printf("%d ", n); - fread(&n, sizeof(int), 1, fptr); - } - fclose(fptr); - - return 0; -} -``` - -**Output**: -``` -1 2 3 4 5 -``` \ No newline at end of file diff --git a/courses/C/intermediate-level/File-Handling/intro.md b/courses/C/intermediate-level/File-Handling/intro.md deleted file mode 100644 index 12a7b5503..000000000 --- a/courses/C/intermediate-level/File-Handling/intro.md +++ /dev/null @@ -1,154 +0,0 @@ ---- -id: lesson-1 -title: "File Handling in C" -sidebar_label: File Handling -sidebar_position: 1 -description: "Learn File Handling in C" -tags: [courses,intermediate-level,File Handling,Introduction] ---- - - - -File handling in C allows you to perform operations on files such as creating, reading, writing, and closing files. It provides a mechanism to store and retrieve data in a persistent manner. - -#### Introduction to File Handling - -Files are used to store data permanently on a storage device. In C, file handling is achieved using the functions provided by the standard library in `stdio.h`. - - -#### Flowchart: File Handling -:::note -1. **Start** -2. **Open file** using `fopen` -3. **Check if file opened successfully** - - If successful, proceed to the next step - - If not, print an error message and **exit** -4. **Perform file operations** (read, write) -5. **Close the file** using `fclose` -6. **End** -::: - - -```mermaid -flowchart TD - A[Start] --> B[Open file using fopen] - B --> C{Check if file opened successfully} - C -->|Yes| D[Perform file operations] - C -->|No| E[Print error message and exit] - D --> F[Close the file using fclose] - E --> F - F --> G[End] -``` - - -#### File Operations - -1. **Opening a File**: - - Files must be opened before performing any operation on them. - - The `fopen` function is used to open a file. - - ```c - FILE *fptr; - fptr = fopen("filename.txt", "mode"); - ``` - :::note - - **Modes**: - - `"r"`: Opens a file for reading. - - `"w"`: Opens a file for writing (creates a new file or truncates an existing file). - - `"a"`: Opens a file for appending (writes data at the end of the file). - - `"r+"`: Opens a file for reading and writing. - - `"w+"`: Opens a file for reading and writing (creates a new file or truncates an existing file). - - `"a+"`: Opens a file for reading and appending. - ::: - -2. **Closing a File**: - - Use `fclose` to close a file after all operations are done. - - ```c - fclose(fptr); - ``` - -3. **Reading from a File**: - - Use functions like `fgetc`, `fgets`, `fread` to read data from a file. - - ```c - char ch; - ch = fgetc(fptr); // Reads a character from the file - ``` - -4. **Writing to a File**: - - Use functions like `fputc`, `fputs`, `fwrite` to write data to a file. - - ```c - fputc('A', fptr); // Writes a character to the file - ``` - -#### File Pointers and File Modes - -- **File Pointer**: A file pointer is a pointer to the structure `FILE`. It is used to keep track of the file being accessed. -- **File Modes**: Different modes define the purpose of opening a file (read, write, append, etc.). - -#### Working with Binary Files - -- Binary files store data in binary format, which is efficient and faster to read and write compared to text files. -- Use `"rb"`, `"wb"`, `"ab"`, `"rb+"`, `"wb+"`, `"ab+"` modes for binary files. - - - -#### Example : Reading and Writing Text Files - -```c -#include -#include - -int main() { - FILE *fptr; - char filename[100], c; - - // Reading a file - printf("Enter the filename to read: "); - scanf("%s", filename); - - fptr = fopen(filename, "r"); - if (fptr == NULL) { - printf("Cannot open file %s \n", filename); - return 1; - } - - // Reading file contents and displaying on console - c = fgetc(fptr); - while (c != EOF) { - printf("%c", c); - c = fgetc(fptr); - } - - fclose(fptr); - - // Writing to a file - printf("\nEnter the filename to write: "); - scanf("%s", filename); - - fptr = fopen(filename, "w"); - if (fptr == NULL) { - printf("Cannot open file %s \n", filename); - return 1; - } - - printf("Enter content to write (Ctrl+D to end):\n"); - while ((c = getchar()) != EOF) { - fputc(c, fptr); - } - - fclose(fptr); - return 0; -} -``` - -**Output**: -``` -Enter the filename to read: input.txt - -Enter the filename to write: output.txt -Enter content to write (Ctrl+D to end): - -``` diff --git a/courses/C/intermediate-level/_category_.json b/courses/C/intermediate-level/_category_.json deleted file mode 100644 index 08ed78ba5..000000000 --- a/courses/C/intermediate-level/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Intermediate Level", - "position": 3, - "link": { - "type": "generated-index", - "description": "Learn C Language." - } - } \ No newline at end of file diff --git a/courses/C/overview.md b/courses/C/overview.md deleted file mode 100644 index a809ab575..000000000 --- a/courses/C/overview.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -title: Welcome to Learning Path -sidebar_label: Course Outline -sidebar_position: 1 -description: C Language Course Outline. -tags: [courses, C] -keywoards: [courses, C, Language] -author: [CodeHarborHub, Ajay Dhangar] ---- - -### Beginner Level - -**1. Introduction to C Programming** - -- History of C -- Setting up the development environment - -**2. Basic Syntax and Structure** - -- Structure of a C program -- Input and output operations - -**3. Operators and Expressions** - -- operators - -**4. Control Flow** - -- Conditional statements (if, if-else, nested if,switch) -- Loops (for, while, do-while) - -**5. Functions** - -- Defining and declaring functions -- Recursion & Scope and lifetime of variables - -**6. Arrays and Strings** - -- Introduction to arrays -- String handling and manipulation - -**7. Pointers** - -- Introduction to pointers -- Pointer to pointer - -**8. Structures and Unions** - -- Defining and using structures -- Introduction to unions - -### Intermediate Level - -**1. Dynamic Memory Allocation** - -- Introduction to dynamic memory allocation -- Memory management techniques & Issue - -**2. File Handling** - -- Introduction to file handling -- Working with binary files - -**3. Advanced Pointers** - -- Function pointers -- Dynamic arrays using pointers - -**4. Bitwise Operations** - -- Introduction to bitwise operators -- Applications of bitwise operations - -**5. Preprocessor Directives** - -- Introduction to the C preprocessor -- File inclusion - -**6. Error Handling** - -- Types of errors (syntax, runtime, logical) -- Error handling in file operations - -### Advanced Level - -**1. Data Structures** - -- Introduction to data structures -- Graphs and graph algorithms - -**2. Algorithms** - -- Sorting algorithms (bubble sort, quicksort, mergesort) -- Searching algorithms (linear search, binary search) - -**3. Advanced File Handling** - -- File locking mechanisms -- Working with memory-mapped files - -**4. Network Programming** - -- Introduction to network programming -- Basic TCP/IP communication - -**5. Multithreading and Concurrency** - -- Introduction to multithreading -- Deadlocks diff --git a/courses/HTML/Overview.md b/courses/HTML/Overview.md deleted file mode 100644 index 0c8f58f83..000000000 --- a/courses/HTML/Overview.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -id: html-learning-path -title: Welcome to HTML Learning Path -sidebar_label: HTML Crash Course -sidebar_position: 1 -description: "Welcome to the HTML Learning path! In this path share to the concepts and understand how they work on web pages. Gain skills to structure content effectively and enhance your web development capabilities." -tags: [courses, HTML, web development, front-end development] -keywoards: [courses, HTML, web development, front-end development] -author: [CodeHarborHub, Ajay Dhangar] ---- - -### Beginner Level -1. **Introduction to HTML** - - What is HTML? - - Basic Structure of an HTML Document - - Doctype Declaration - - HTML Tags and Attributes - -2. **Text Formatting and Styles** - - Headings, Paragraphs, and Text Formatting Tags - - Lists (Ordered, Unordered, and Description Lists) - - Text Styling with `` and `
` - -3. **Links and Images** - - Creating Hyperlinks - - Linking to Different Pages and Sections - - Embedding Images and Image Attributes - -4. **Tables** - - Creating Basic Tables - - Table Headers, Rows, and Cells - - Spanning Rows and Columns - -5. **Forms and Input** - - Creating Forms - - Form Elements: Input, Textarea, Select - - Form Attributes and Validation - -6. **Multimedia** - - Embedding Audio and Video - - Using the `