├── .gitignore ├── DynamicType.html ├── FP.html ├── FPDemo.fsx ├── FirstClassFunction.html ├── GoTo ├── GoTo.cpp ├── Hello.class ├── Hello.html ├── Hello.java ├── Pragmatics.html ├── Semantics ├── Semantics.cpp ├── Semantics.html ├── StaticType.cpp ├── Strict.html ├── StringLiteral.html ├── Type.js ├── Type.ts ├── TypeInference.jar ├── TypeInference.kt ├── ValueModel ├── ValueModel.cpp ├── WeaklyType.html ├── backend ├── .gitignore ├── app.js ├── bin │ └── www ├── config │ ├── Config.js │ └── database.js ├── model │ ├── movies.js │ ├── review.js │ └── user.js ├── notes.txt ├── package-lock.json ├── package.json ├── postman │ └── Backend.postman_collection.json ├── public │ └── stylesheets │ │ └── style.css ├── routes │ ├── index.js │ ├── movies.js │ ├── review.js │ └── users.js └── views │ ├── error.jade │ ├── index.jade │ └── layout.jade ├── chapter10 ├── Module.html ├── UseModule.html ├── module.js ├── module2.js ├── our_module.js ├── use_es6_module.js └── use_node_module.js ├── chapter11 ├── Console.html ├── Date.html ├── Error.html ├── Intl.html ├── Map.html ├── Map2.html ├── Memory.html ├── RegEx4.html ├── RegExp10.html ├── RegExp11.html ├── RegExp2.html ├── RegExp3.html ├── RegExp5.html ├── RegExp6.html ├── RegExp7.html ├── RegExp8.html ├── RegExp9.html ├── RegExpression.html ├── RegUnicode.html ├── Set.html ├── Split.html ├── StackFrame.html ├── Timer.html ├── TypeArray.html └── Url.html ├── chapter12 ├── CustomIterator.html ├── CustomIterator2.html ├── Generator.html ├── Generator2.html ├── Generator4.html └── Iterator.html ├── chapter13 ├── AsynAwait.html ├── AsyncAwait2.html ├── Asynchronous.html ├── BuildYourOwnFetch.html ├── Event.html ├── FetchWithPromise.html ├── FetchWithXHR.html ├── For_Await.html ├── ParallelPromise.html ├── PromiseAsyncComput.html ├── PromiseDiv.html ├── SeqPromise.html ├── ThreadDemo.class ├── ThreadDemo.java ├── async.js ├── event_loop.js ├── fetch_demo.js ├── fetch_promise.js ├── for_await.js ├── read_promise.js ├── single_thread.js ├── sync.js ├── tempCodeRunnerFile.java └── tempCodeRunnerFile.js ├── chapter14 ├── Meta2.html ├── MetaProgramming.html ├── Object.html ├── Prototype.html ├── Proxy.html ├── Reflect.html ├── Symbol.html ├── Template.html └── UIFramework.html ├── chapter15 ├── Attribute.html ├── CapureOrBubble.html ├── ChangeTheme.html ├── Clock.html ├── Closest.html ├── CustomEvent.html ├── DomInsert.html ├── DynamicallyLoad.html ├── ElementContent.html ├── EventPerformance.html ├── EventPropagation.html ├── EventPropagation2.html ├── Form.html ├── GetElement.html ├── LiveDom.html ├── Location.html ├── OnLoad.html ├── PreSelected.html ├── PreventDefault.html ├── Scripting.html ├── Scroll.html ├── Storage.html ├── Style.html ├── StyleSheet.html ├── TableEventBind.html ├── Text.html ├── Traverse.html ├── WorkerThread.html ├── XSS.html ├── api.js ├── theme │ ├── one.css │ └── two.css └── worker.js ├── chapter16 ├── buffer.js ├── emitter.js ├── events.js ├── fetch.js ├── file.js ├── hello_word.js ├── http-server.js ├── numbers.txt ├── one.html ├── os.js ├── tempCodeRunnerFile.js ├── two.html ├── type_script.js ├── type_script.ts └── write.js ├── chapter2 ├── Hello.js ├── Hello.py ├── Identifier.html ├── IdentifierReservedWord.html └── Literal.html ├── chapter3 ├── Arithmetic.html ├── BlockScope.html ├── Boolean.html ├── BooleanConversion.html ├── Bound.html ├── CoversionTest.html ├── Date.html ├── Destructuring.html ├── DynamicPlaceHolder.html ├── Equality.html ├── ExplicitConversion.html ├── FunctionScope.html ├── GlobalObject.html ├── Hoisting.html ├── IEE754.html ├── ImmutableMutable.html ├── IndexOf.html ├── JsonPlaceHolder.html ├── Negation.html ├── NullAndUndefined.html ├── Number.html ├── NumberConversion.html ├── NumberProblem.html ├── Object.html ├── ObjectToString.html ├── PatternMatching.html ├── PrimitiveObject.html ├── PrimitiveVsRef.html ├── Replace.html ├── Scope.html ├── Scope4.html ├── ScopeResolution.html ├── ScopeResolution2.html ├── ScopeResolution3.html ├── Slice.html ├── Split.html ├── StartWithEndWith.html ├── StrictMode.html ├── String.html ├── StringComparison.html ├── StringConversion.html ├── StringEquality.html ├── StringOperation.html ├── StringOperation2.html ├── TemplateLiteral.html ├── TurthyFalsethy.html ├── Type.html ├── TypeConversion.html ├── TypeConversion2.html ├── Value.html ├── VarDeclarationAssignment.html ├── Variable.html ├── VariableSize.html ├── Zero.html ├── script3.js └── scriptOne.js ├── chapter4 ├── Addition.html ├── Addition2.html ├── AdditionDateArray.html ├── AndUsage.html ├── AndUseCase.html ├── Arithmetic.html ├── Assignment.html ├── Assignment3.html ├── Associativity.html ├── BinaryAnd.html ├── Comma.html ├── Comma2.html ├── Comparison.html ├── Conditional.html ├── ConditionalInvocation.html ├── ConditionalProperty.html ├── DefinedOperator.html ├── Delete.html ├── Equality.html ├── Eval.html ├── Expression.html ├── FunctionDefinitionExpression.html ├── HintTypeObjToPrimitive.html ├── IfFunction.html ├── InOperator.html ├── IncreDec.html ├── InstanceOf.html ├── InvocationExpression.html ├── LogicalAnd.html ├── LogicalAnd2.html ├── LogicalOp.html ├── LogicalOr.html ├── LooseEquality.html ├── Lvalue.html ├── NegOp.html ├── NumOfOperand.html ├── NumberConversion.html ├── ObjectCreation.html ├── ObjectToPrimitive.html ├── ObjectToPrimitive2.html ├── OrUseCase.html ├── OrUseCase2.html ├── OrUseCase3.html ├── PlusPlus.html ├── Precedence.html ├── PropertyAccess.html ├── RefAssignment.html ├── ShiftOperator.html ├── SideEffect.html ├── TypeOf.html ├── Unary.html ├── Void.html └── XOr.html ├── chapter5 ├── BreakDemo.html ├── ConditionalIf.html ├── ConditionalIf2.html ├── Continue.html ├── CounterControlLoop.html ├── DoWhile.html ├── Fact.fsx ├── ForEntries.html ├── ForFlowDemo.html ├── ForIn.html ├── ForLoop.html ├── ForOfLoop.html ├── ForOfSet.html ├── ForOptional.html ├── If3.html ├── If4.html ├── If5.html ├── If6.html ├── LabelBreak.html ├── Loop.rb ├── NestedLooop.html ├── Return.html ├── Return2.html ├── Statement.html ├── Switch.html ├── Switch2.html ├── Swtich3.html ├── Triangle.html ├── Try2.html ├── TryStatement.html ├── While.html └── WithStatement.html ├── chapter6 ├── Aeroplane.class ├── AssociateArray.html ├── Bird.class ├── ComputeProperty.html ├── ControlAbstraction.rb ├── DeleteOp.html ├── Doctor.class ├── DuckTyping.html ├── Encapsulation.html ├── Engineer.class ├── Enscapsulation1.html ├── Enumeration.html ├── Extend.html ├── Flyable.class ├── Getter.html ├── GetterSetter.html ├── Human.class ├── Inheritance.html ├── Inheritance2.html ├── InheritedProperty.html ├── NewObject.html ├── NonEnumerable.html ├── Object.html ├── ObjectAsMapping.html ├── ObjectAssign.html ├── ObjectLiteral.html ├── ObjectLiteral2.html ├── Polymorphism.class ├── Polymorphism.java ├── Prototype.html ├── Prototype2.html ├── SaSaYaKa.html ├── Seralization.html ├── ShortLiteral.html ├── ShorthandMethod.html ├── SpreadOp.html ├── Symbol.html ├── ToString.html ├── UnStructure.go └── ValueOf.html ├── chapter7 ├── ArrToString.html ├── ArrayCont.html ├── ArrayFrom.html ├── ArrayMethod.html ├── BooleanCount.html ├── EverySome.html ├── Filter.html ├── FindAll.html ├── FindAndFindIndex.html ├── Flat.html ├── Iteration.html ├── Iteration2.html ├── MultidimensionalArray.html ├── Queue.html ├── Reduce.html ├── Reduce2.html ├── ReduceRight.html ├── array.html ├── array2.html ├── array3.html ├── array_acces.html ├── array_add_remove.html ├── array_like.html ├── compare.html ├── concat.html ├── copyWithin.html ├── duplicate.html ├── fill.html ├── include.html ├── indexOf.html ├── reverse.html ├── slice.html ├── sort.html ├── sort2.html ├── sort_issue.html ├── sort_object.html ├── sort_unicode.html ├── splice.html ├── spread.html ├── stack.html ├── stack_frame.html ├── static_method.html └── string_as_array.html ├── chapter8 ├── Func_constructor.html ├── Func_prop.html ├── Module.js ├── Multiple.class ├── Multiple.java ├── ObjDesUsage.html ├── ObjDestructuring.html ├── Overwrite.html ├── ParameterPassing.html ├── apply.html ├── array_des2.html ├── array_destruct.html ├── arrow_func.html ├── bind.html ├── cache.html ├── call.html ├── call_module.html ├── colsure.html ├── colsure_private.html ├── constructor_invo.html ├── default_param.html ├── first_class.html ├── fp │ ├── Demo.class │ ├── Demo.java │ ├── Either.html │ ├── Either.js │ ├── FetchExampe.html │ ├── Indeity_Of.html │ ├── Lens.html │ ├── Lense2.html │ ├── Lense3.html │ ├── MayBe.html │ ├── Monad.html │ ├── PrivateData.class │ ├── Promise.html │ ├── auth_gurad.html │ ├── cache.html │ ├── closure.html │ ├── compose.html │ ├── curr3.html │ ├── curr4.html │ ├── curry.fsx │ ├── curry2.html │ ├── curry_with_ramda.html │ ├── currying.html │ ├── functor.html │ ├── higherOrderFunction.html │ ├── hof.html │ ├── invoke.html │ ├── map_filter.html │ ├── mapping.html │ ├── once.html │ ├── pipe.fsx │ ├── pipeliable.html │ ├── pure.html │ ├── tap.html │ ├── tap2.html │ ├── unary.html │ └── unary_fuc.html ├── fun_var.html ├── function1.html ├── function_property.html ├── implicit.html ├── max.html ├── method.html ├── mul_return.html ├── multi_return.go ├── multipleParam.html ├── name_par.py ├── nested.html ├── parameter-check.html ├── parameter.html ├── primitive_ref.html ├── recursive.html ├── rest_param.html ├── return_fun.html ├── swap.html └── trace.html ├── chapter9 ├── Class.html ├── ClassExpression.html ├── Composition.html ├── Doctor.class ├── Field.html ├── Human.class ├── Human.java ├── Prototype.html ├── SetterGetter.html ├── SettingPrototype.html ├── Static.html ├── Subclasses.html ├── constructor.html └── tempCodeRunnerFile.java ├── frontend ├── .gitignore ├── .idea │ ├── .gitignore │ ├── frontend.iml │ ├── inspectionProfiles │ │ └── Project_Default.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt ├── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── TimeDisplay.js │ ├── components │ │ ├── ConditionalRendering.js │ │ ├── Counter.js │ │ ├── Hello.js │ │ ├── ListDemo.js │ │ ├── ListOfWord.js │ │ ├── Post.js │ │ ├── PureCounter.js │ │ ├── VirutalDomConcept.js │ │ ├── classcomponent │ │ │ └── ClassComp.js │ │ ├── context │ │ │ ├── DataContext.js │ │ │ ├── Level1Child.js │ │ │ ├── Level2Child.js │ │ │ ├── Level2Child2.js │ │ │ └── Parent.js │ │ ├── errorboundary │ │ │ ├── ErrorBoundary.js │ │ │ └── ErrorComponent.js │ │ ├── form │ │ │ ├── FormDemo.js │ │ │ └── FormikDemo.js │ │ ├── fragment │ │ │ └── TableDemo.js │ │ ├── function │ │ │ └── FunctionComponentDemo.js │ │ ├── hoc │ │ │ ├── HocDemo.js │ │ │ ├── Page.js │ │ │ └── loadingSpinner.js │ │ ├── hook │ │ │ ├── APICallDemo.js │ │ │ ├── CleanUpDemo.js │ │ │ ├── HookCounter.js │ │ │ ├── UseCallBackDemo.js │ │ │ ├── UseEffectDemo.js │ │ │ ├── UseRefDemo.js │ │ │ └── redux │ │ │ │ ├── ReduxCounter.js │ │ │ │ └── ToDoRedux.js │ │ ├── importdemo │ │ │ └── ImportDemo.js │ │ ├── jsx │ │ │ ├── JSXElement.js │ │ │ └── Mapper.js │ │ ├── pattern │ │ │ └── composition │ │ │ │ ├── FanyBorder.js │ │ │ │ └── Tab.js │ │ ├── pointerevent │ │ │ └── PointerEvent.js │ │ ├── portal │ │ │ └── PortalComponent.js │ │ ├── ref │ │ │ ├── DomRef.js │ │ │ └── ForwardRef.js │ │ ├── render-props │ │ │ └── MouseTracker.js │ │ ├── routes │ │ │ └── PrivateRoute.js │ │ └── thirdparty │ │ │ └── ThridParty.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── pages │ │ ├── AboutPage.js │ │ ├── HomePage.js │ │ ├── LoginPage.js │ │ ├── MoviePage.js │ │ ├── PageNotFound.js │ │ ├── ProtectedPage.js │ │ ├── SubUser.js │ │ ├── UserPage.js │ │ └── auth.js │ ├── post.css │ ├── reportWebVitals.js │ └── setupTests.js └── yarn.lock ├── mogodb └── command.txt ├── redux-concept └── reduce.js ├── redux ├── .gitignore ├── .idea │ ├── .gitignore │ ├── misc.xml │ ├── modules.xml │ ├── redux.iml │ └── vcs.xml ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt ├── src │ ├── App.css │ ├── App.test.tsx │ ├── App.tsx │ ├── app │ │ ├── hooks.ts │ │ └── store.ts │ ├── components │ │ └── routes │ │ │ └── PrivateRoute.tsx │ ├── features │ │ ├── auth │ │ │ ├── authApi.ts │ │ │ └── authSlice.ts │ │ ├── counter │ │ │ ├── Counter.module.css │ │ │ ├── Counter.tsx │ │ │ ├── counterAPI.ts │ │ │ ├── counterSlice.spec.ts │ │ │ └── counterSlice.ts │ │ ├── movie │ │ │ ├── Movie.module.css │ │ │ ├── MovieList.tsx │ │ │ ├── MovieUi.tsx │ │ │ ├── NewOrUpdateMovieDialog.tsx │ │ │ ├── movieApi.ts │ │ │ └── movieSlice.ts │ │ ├── review │ │ │ ├── ReviewUI.tsx │ │ │ ├── reviewApi.ts │ │ │ └── reviewSlice.ts │ │ └── todo │ │ │ ├── TodoListUI.tsx │ │ │ ├── todoAPI.ts │ │ │ └── todoSlice.ts │ ├── index.css │ ├── index.tsx │ ├── logo.svg │ ├── pages │ │ ├── HomePage.tsx │ │ ├── LoginPage.tsx │ │ ├── LogoutPage.tsx │ │ └── MovieDetailPage.tsx │ ├── react-app-env.d.ts │ ├── serviceWorker.ts │ ├── services │ │ └── authService.ts │ ├── setting │ │ ├── API.ts │ │ └── our_axios.ts │ └── setupTests.ts ├── tsconfig.json └── yarn.lock ├── tempCodeRunnerFile.cpp └── typescript ├── CounterState.js ├── CounterState.ts ├── action_creator.js ├── demo.js └── demo.ts /DynamicType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /FP.html: -------------------------------------------------------------------------------- 1 | 2 | 27 | -------------------------------------------------------------------------------- /FPDemo.fsx: -------------------------------------------------------------------------------- 1 | open System 2 | 3 | [] 4 | let main argv = 5 | printfn "Hello World from F#!!" 6 | let data = 20 7 | printfn "Hello World from F#!!" 8 | //data = 120 9 | 0 // return an integer exit code 10 | -------------------------------------------------------------------------------- /GoTo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/GoTo -------------------------------------------------------------------------------- /GoTo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | 6 | int main() 7 | { 8 | int a = 1; 9 | 10 | loop: 11 | cout<<"A is "<< a< 2 | 4 | 16 | -------------------------------------------------------------------------------- /Hello.java: -------------------------------------------------------------------------------- 1 | class Hello 2 | { 3 | public static void main(String[]args) 4 | { 5 | System.out.println("Hello"); 6 | } 7 | } -------------------------------------------------------------------------------- /Pragmatics.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | -------------------------------------------------------------------------------- /Semantics: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/Semantics -------------------------------------------------------------------------------- /Semantics.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | 6 | int main() 7 | { 8 | int a = 20; 9 | int *ptr = &a; 10 | cout<<"Ptr is "<< ptr< 2 | 3 | using namespace std; 4 | 5 | 6 | int main() 7 | { 8 | int a = "Hello"; 9 | cout<<"A is "< 2 | 6 | -------------------------------------------------------------------------------- /StringLiteral.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | -------------------------------------------------------------------------------- /Type.js: -------------------------------------------------------------------------------- 1 | var a = "Hello"; 2 | a++; 3 | console.log("A is ", a); 4 | -------------------------------------------------------------------------------- /Type.ts: -------------------------------------------------------------------------------- 1 | var a:any = "Hello"; 2 | a++; 3 | console.log("A is " ,a); -------------------------------------------------------------------------------- /TypeInference.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/TypeInference.jar -------------------------------------------------------------------------------- /TypeInference.kt: -------------------------------------------------------------------------------- 1 | fun main( ) 2 | { 3 | var data = "Hello" 4 | //var data :String = "Hello" 5 | data = 100 6 | println("data is "+data ) 7 | } -------------------------------------------------------------------------------- /ValueModel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/ValueModel -------------------------------------------------------------------------------- /ValueModel.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Human 6 | { 7 | public: 8 | string name; 9 | int age; 10 | }; 11 | 12 | int main() 13 | { 14 | Human h; 15 | h.name = "TK"; 16 | h.age = 20; 17 | 18 | Human h2; 19 | h2 = h; 20 | h.name = "Change"; 21 | 22 | cout<< "H "< 2 | 3 | 8 | -------------------------------------------------------------------------------- /backend/config/Config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | config:{ 3 | TOKEN_SECRET : "!&#^&!^#!722!@@(!" //should be store in env file, 4 | } 5 | } -------------------------------------------------------------------------------- /backend/config/database.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | db: 'mongodb://localhost:27017/react_second_batch' 3 | } -------------------------------------------------------------------------------- /backend/model/movies.js: -------------------------------------------------------------------------------- 1 | //Filename: Posts.js 2 | const mongoose = require('mongoose'); 3 | const Schema = mongoose.Schema; 4 | const MovieSchema = new Schema({ 5 | title: { 6 | type: String, 7 | required: true, 8 | }, 9 | director: { 10 | name:{ 11 | type: String, 12 | required: true, 13 | }, 14 | phoneNo:{ 15 | type: String 16 | } 17 | }, 18 | year: { 19 | type: Number 20 | } 21 | }); 22 | module.exports = mongoose.model('Movies', MovieSchema); -------------------------------------------------------------------------------- /backend/model/review.js: -------------------------------------------------------------------------------- 1 | //Filename: Posts.js 2 | const mongoose = require('mongoose'); 3 | const Schema = mongoose.Schema; 4 | const ReviewSchema = new Schema({ 5 | movie: { 6 | type: Schema.Types.ObjectId, 7 | ref: "Movies" 8 | }, 9 | rating: { 10 | type: Number, 11 | required: true, 12 | }, 13 | review: { 14 | type: String, 15 | required: true, 16 | }, 17 | 18 | }); 19 | module.exports = mongoose.model('Reviews', ReviewSchema); -------------------------------------------------------------------------------- /backend/model/user.js: -------------------------------------------------------------------------------- 1 | //Filename: Posts.js 2 | const mongoose = require('mongoose'); 3 | const Schema = mongoose.Schema; 4 | const UserSchema = new Schema({ 5 | username: { 6 | type: 'String', 7 | required: true, 8 | trim: true, 9 | unique: true 10 | }, 11 | password: { 12 | type: 'String', 13 | required: true, 14 | trim: true 15 | } 16 | }); 17 | module.exports = mongoose.model('User', UserSchema) -------------------------------------------------------------------------------- /backend/notes.txt: -------------------------------------------------------------------------------- 1 | cd project folder 2 | npm install 3 | npm start 4 | http://localhost:3000 -------------------------------------------------------------------------------- /backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backend", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www" 7 | }, 8 | "dependencies": { 9 | "bcrypt": "^5.0.1", 10 | "cookie-parser": "~1.4.4", 11 | "cors": "^2.8.5", 12 | "debug": "~2.6.9", 13 | "express": "~4.16.1", 14 | "http-errors": "~1.6.3", 15 | "jade": "~1.11.0", 16 | "jsonwebtoken": "^8.5.1", 17 | "mongoose": "^6.0.8", 18 | "morgan": "~1.9.1" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /backend/public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } 9 | -------------------------------------------------------------------------------- /backend/routes/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | /* GET home page. */ 5 | router.get('/', function(req, res, next) { 6 | console.log("Index / Controller"); 7 | res.render('index', { title: 'Express' }); 8 | }); 9 | 10 | module.exports = router; 11 | -------------------------------------------------------------------------------- /backend/views/error.jade: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= message 5 | h2= error.status 6 | pre #{error.stack} 7 | -------------------------------------------------------------------------------- /backend/views/index.jade: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= title 5 | h2 Here is h2 6 | p Welcome to #{title} 7 | -------------------------------------------------------------------------------- /backend/views/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | link(rel='stylesheet', href='/stylesheets/style.css') 6 | body 7 | block content 8 | -------------------------------------------------------------------------------- /chapter10/Module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /chapter10/UseModule.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 11 | -------------------------------------------------------------------------------- /chapter10/module.js: -------------------------------------------------------------------------------- 1 | function Module() 2 | { 3 | function internalAPI() 4 | { 5 | console.log("Internal API method 1"); 6 | } 7 | function method1() 8 | { 9 | internalAPI(); 10 | console.log("Module method 1"); 11 | } 12 | return { 13 | api : method1 14 | } 15 | } -------------------------------------------------------------------------------- /chapter10/module2.js: -------------------------------------------------------------------------------- 1 | function another() 2 | { 3 | console.log("Another"); 4 | } 5 | export function hello() 6 | { 7 | console.log("Hello "); 8 | } -------------------------------------------------------------------------------- /chapter10/our_module.js: -------------------------------------------------------------------------------- 1 | const sum= (x,y) => x+y; 2 | const square = x=> x* x; 3 | 4 | exports.sum = sum; 5 | exports.square = square; 6 | -------------------------------------------------------------------------------- /chapter10/use_es6_module.js: -------------------------------------------------------------------------------- 1 | import hello from 'module2.js'; 2 | hello(); -------------------------------------------------------------------------------- /chapter10/use_node_module.js: -------------------------------------------------------------------------------- 1 | const m = require("./our_module"); 2 | console.log("Sum ",m.sum(10,20)); 3 | console.log("Square ",m.square(20)); -------------------------------------------------------------------------------- /chapter11/Date.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /chapter11/Error.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter11/Intl.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /chapter11/Map2.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /chapter11/Memory.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /chapter11/RegEx4.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter11/RegExp10.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /chapter11/RegExp11.html: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /chapter11/RegExp3.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /chapter11/RegExp5.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | -------------------------------------------------------------------------------- /chapter11/RegExp6.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter11/RegExp7.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /chapter11/RegExp8.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter11/RegExp9.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /chapter11/RegExpression.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter11/RegUnicode.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /chapter11/Split.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | -------------------------------------------------------------------------------- /chapter11/Timer.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /chapter12/Generator.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /chapter12/Generator2.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter12/Generator4.html: -------------------------------------------------------------------------------- 1 | 2 | 23 | -------------------------------------------------------------------------------- /chapter13/Asynchronous.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /chapter13/Event.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | -------------------------------------------------------------------------------- /chapter13/SeqPromise.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 22 | -------------------------------------------------------------------------------- /chapter13/ThreadDemo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter13/ThreadDemo.class -------------------------------------------------------------------------------- /chapter13/async.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | console.log("Before file read"); 4 | fs.readFile('async.js', 'utf8' , (err, data) => { 5 | if (err) { 6 | console.error(err) 7 | return 8 | } 9 | console.log("File read completed>>>",data ,"<<<"); 10 | }) 11 | console.log("After file read"); -------------------------------------------------------------------------------- /chapter13/event_loop.js: -------------------------------------------------------------------------------- 1 | console.log("Before"); 2 | setTimeout(()=>{ 3 | 4 | console.log("First timer"); 5 | },0); 6 | setTimeout(()=>{ 7 | console.log("Second timer"); 8 | },0); 9 | console.log("After"); -------------------------------------------------------------------------------- /chapter13/fetch_promise.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | let url = "http://www.google.com" 3 | fetch("url") 4 | .then(response=>{ 5 | console.log("Response ",response); 6 | }) -------------------------------------------------------------------------------- /chapter13/for_await.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | async function parseFile(filename) { 3 | let stream = fs.createReadStream(filename, { encoding: 4 | "utf-8"}); 5 | for await (let chunk of stream) { 6 | console.log("Chunk>> ",chunk ,"<<"); // Assume parseChunk() is defined elsewhere 7 | } 8 | } 9 | console.log("Before parse"); 10 | parseFile("./ParallelPromise.html"); 11 | console.log("After parse"); -------------------------------------------------------------------------------- /chapter13/read_promise.js: -------------------------------------------------------------------------------- 1 | const { fail } = require("assert"); 2 | const {promises: {readFile}} = require("fs"); 3 | 4 | console.log("Before file read"); 5 | 6 | readFile("async.js") 7 | .then(fileBuffer => { 8 | console.log("Data>> ",fileBuffer.toString()); 9 | return fileBuffer.toString(); 10 | },failure=>{ 11 | console.log("got error ",failure); 12 | //throw new Error("Something worng") 13 | }) 14 | .catch(error => { 15 | console.error("Errror=>",error.message); 16 | process.exit(1); 17 | }).then(res=>{ 18 | console.log("Res ",res.length); 19 | }); 20 | console.log("After file read"); -------------------------------------------------------------------------------- /chapter13/single_thread.js: -------------------------------------------------------------------------------- 1 | console.log("Before"); 2 | setTimeout(()=>{ 3 | 4 | while(true) 5 | { 6 | console.log("First timer"); 7 | } 8 | },1000); 9 | setTimeout(()=>{ 10 | 11 | while(true) 12 | { 13 | console.log("Second timer"); 14 | } 15 | },1000); 16 | console.log("After"); -------------------------------------------------------------------------------- /chapter13/sync.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | 3 | console.log("Before read"); 4 | try { 5 | const data = fs.readFileSync('sync.js', 'utf8') 6 | console.log(">>",data ,"<<") 7 | } catch (err) { 8 | console.error(err) 9 | } 10 | console.log("After read"); -------------------------------------------------------------------------------- /chapter13/tempCodeRunnerFile.java: -------------------------------------------------------------------------------- 1 | for(int i=0;i< 10;i++) 2 | { 3 | System.out.println("Thread "+this.name+" i "+i); 4 | } -------------------------------------------------------------------------------- /chapter13/tempCodeRunnerFile.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | console.log("Before file read"); 4 | fs.readFile('async.js', 'utf8' , (err, data) => { 5 | if (err) { 6 | console.error(err) 7 | return 8 | } 9 | console.log("File read completed>>>",data ,"<<<"); 10 | }) 11 | console.log("After file read"); -------------------------------------------------------------------------------- /chapter14/Object.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 25 | -------------------------------------------------------------------------------- /chapter14/Prototype.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /chapter14/Reflect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /chapter14/Symbol.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | -------------------------------------------------------------------------------- /chapter15/Clock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Time
It is clock
4 | 5 | 20 | -------------------------------------------------------------------------------- /chapter15/Closest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Time 4 | 5 | Link One 6 | 7 | 8 | 9 | 10 | 18 | -------------------------------------------------------------------------------- /chapter15/DomInsert.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 |

8 | This is 1st paragarph 9 |

10 |

11 | This is 2st paragarph 12 |

13 | 14 | 15 | 25 | -------------------------------------------------------------------------------- /chapter15/DynamicallyLoad.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Time
It is clock
4 | 5 | 23 | -------------------------------------------------------------------------------- /chapter15/PreSelected.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 | 10 | -------------------------------------------------------------------------------- /chapter15/PreventDefault.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Text 7 | 8 | 9 | 10 | This is a link 11 | 12 | 13 | 26 | -------------------------------------------------------------------------------- /chapter15/Style.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 |

8 | This is 1st paragarph 9 |

10 |

11 | This is 2st paragarph 12 |

13 | 14 | 15 | 22 | -------------------------------------------------------------------------------- /chapter15/WorkerThread.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 14 | 15 | Worker Thread Demo 16 | 17 | 18 | 19 | 27 | -------------------------------------------------------------------------------- /chapter15/XSS.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Time
It is clock
4 | 5 | 10 | -------------------------------------------------------------------------------- /chapter15/api.js: -------------------------------------------------------------------------------- 1 | console.log("our API dynamically loaded"); -------------------------------------------------------------------------------- /chapter15/theme/one.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background: blue; 3 | } -------------------------------------------------------------------------------- /chapter15/theme/two.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background: gray; 3 | } -------------------------------------------------------------------------------- /chapter15/worker.js: -------------------------------------------------------------------------------- 1 | console.log("Worker run"); 2 | self.onmessage=msg=>{ 3 | console.log("Worker got message ",msg.data); 4 | self.postMessage("Reply from woker "+msg.data.toUpperCase()) 5 | }; -------------------------------------------------------------------------------- /chapter16/buffer.js: -------------------------------------------------------------------------------- 1 | let b = Buffer.from([0x41,0x42,0x43,0x42]); 2 | console.log("B toString ",b.toString() ); -------------------------------------------------------------------------------- /chapter16/emitter.js: -------------------------------------------------------------------------------- 1 | const EventEmitter = require("events"); 2 | const eventEmitter = new EventEmitter(); 3 | 4 | eventEmitter.on("start",(event)=>{ 5 | console.log("Start event ",event); 6 | }); 7 | 8 | eventEmitter.emit("start",{ 9 | data : "This is data to event" 10 | }); -------------------------------------------------------------------------------- /chapter16/events.js: -------------------------------------------------------------------------------- 1 | const EventEmitter = require("events"); 2 | const net = require("net"); 3 | //console.log("Event Emitter ",EventEmitter); 4 | 5 | let server = net.createServer(); 6 | server.on("connection",socket=>{ 7 | //console.log("Socket on ",socket); 8 | console.log("Got connection "); 9 | socket.end("Hello world frm node.js ","utf-8"); 10 | }); 11 | server.on("eror",(e)=>{ 12 | console.log("Server error ",e); 13 | }); 14 | server.listen(8080,()=>{ 15 | console.log("Server listened") 16 | }); -------------------------------------------------------------------------------- /chapter16/fetch.js: -------------------------------------------------------------------------------- 1 | const https = require("https"); 2 | const axios = require("axios"); 3 | https.get("https://jsonplaceholder.typicode.com/todos/1",(response)=>{ 4 | //console.log("Got data ",response); 5 | response.on("data",(data)=>{ 6 | console.log("Data is ",data.toString()); 7 | }); 8 | }); 9 | //console.log("Response ",response); 10 | axios.get("https://jsonplaceholder.typicode.com/todos/1") 11 | .then(response=>{ 12 | console.log("Response ",response.data); 13 | }); -------------------------------------------------------------------------------- /chapter16/file.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | fileName = __filename; 3 | console.log("File name ",__filename); 4 | console.log("Dir name ",__dirname); 5 | 6 | console.log("Basenane ",path.basename(fileName)); 7 | console.log("Ext ",path.extname(fileName)); 8 | console.log("Dir ",path.dirname(fileName)); 9 | 10 | console.log("Normalized " , path.normalize("a/b/c/../d")); -------------------------------------------------------------------------------- /chapter16/hello_word.js: -------------------------------------------------------------------------------- 1 | console.log("Process argv ",process.argv) -------------------------------------------------------------------------------- /chapter16/one.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Update One.html

4 | 5 | -------------------------------------------------------------------------------- /chapter16/os.js: -------------------------------------------------------------------------------- 1 | console.log("Archi",process.arch ); 2 | console.log("cwd",process.cwd() ); 3 | console.log("cpu usage",process.cpuUsage() ); 4 | console.log("env",process.env); 5 | console.log("execPath ",process.execPath); 6 | //process.exit(); 7 | console.log("Does not reach "); 8 | console.log("Process version ",process.version); -------------------------------------------------------------------------------- /chapter16/tempCodeRunnerFile.js: -------------------------------------------------------------------------------- 1 | response -------------------------------------------------------------------------------- /chapter16/two.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Two.html

4 | 5 | -------------------------------------------------------------------------------- /chapter16/type_script.js: -------------------------------------------------------------------------------- 1 | var total = 0; 2 | total = 12; 3 | console.log("Total ", total); 4 | -------------------------------------------------------------------------------- /chapter16/type_script.ts: -------------------------------------------------------------------------------- 1 | let total:number = 0; 2 | total = 12; 3 | console.log("Total ",total) -------------------------------------------------------------------------------- /chapter16/write.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | let output = fs.createWriteStream("numbers.txt"); 3 | for(let i=0;i<100;i++) 4 | { 5 | output.write(`${i}\n`); 6 | } 7 | output.end(); -------------------------------------------------------------------------------- /chapter2/Hello.js: -------------------------------------------------------------------------------- 1 | console.log("Hello from Node.js or browser"); -------------------------------------------------------------------------------- /chapter2/Hello.py: -------------------------------------------------------------------------------- 1 | print("Hello World") 2 | 3 | def hello(): 4 | print "Hello" 5 | print "How are you" 6 | 7 | #hello() -------------------------------------------------------------------------------- /chapter2/Identifier.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | -------------------------------------------------------------------------------- /chapter2/IdentifierReservedWord.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /chapter2/Literal.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | -------------------------------------------------------------------------------- /chapter3/Arithmetic.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter3/Boolean.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /chapter3/BooleanConversion.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /chapter3/Bound.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /chapter3/CoversionTest.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /chapter3/Date.html: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /chapter3/Destructuring.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | -------------------------------------------------------------------------------- /chapter3/DynamicPlaceHolder.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /chapter3/Equality.html: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /chapter3/ExplicitConversion.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /chapter3/FunctionScope.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | -------------------------------------------------------------------------------- /chapter3/GlobalObject.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 19 | -------------------------------------------------------------------------------- /chapter3/Hoisting.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | -------------------------------------------------------------------------------- /chapter3/IEE754.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /chapter3/ImmutableMutable.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter3/IndexOf.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter3/JsonPlaceHolder.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter3/Negation.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter3/NullAndUndefined.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter3/Number.html: -------------------------------------------------------------------------------- 1 | 2 | 21 | -------------------------------------------------------------------------------- /chapter3/NumberConversion.html: -------------------------------------------------------------------------------- 1 | 2 | 25 | -------------------------------------------------------------------------------- /chapter3/NumberProblem.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | -------------------------------------------------------------------------------- /chapter3/Object.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter3/ObjectToString.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /chapter3/PatternMatching.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /chapter3/PrimitiveObject.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /chapter3/PrimitiveVsRef.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 20 | 21 | -------------------------------------------------------------------------------- /chapter3/Replace.html: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /chapter3/Scope4.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | -------------------------------------------------------------------------------- /chapter3/ScopeResolution.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | -------------------------------------------------------------------------------- /chapter3/ScopeResolution2.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | -------------------------------------------------------------------------------- /chapter3/ScopeResolution3.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | -------------------------------------------------------------------------------- /chapter3/Slice.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /chapter3/Split.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /chapter3/StartWithEndWith.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /chapter3/StrictMode.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /chapter3/StringComparison.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /chapter3/StringConversion.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter3/StringEquality.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 18 | 19 | -------------------------------------------------------------------------------- /chapter3/StringOperation.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | -------------------------------------------------------------------------------- /chapter3/StringOperation2.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /chapter3/TemplateLiteral.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter3/TurthyFalsethy.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /chapter3/Type.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter3/TypeConversion.html: -------------------------------------------------------------------------------- 1 | 2 | 25 | -------------------------------------------------------------------------------- /chapter3/TypeConversion2.html: -------------------------------------------------------------------------------- 1 | 2 | 23 | -------------------------------------------------------------------------------- /chapter3/Value.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /chapter3/VarDeclarationAssignment.html: -------------------------------------------------------------------------------- 1 | 2 | 21 | -------------------------------------------------------------------------------- /chapter3/Variable.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter3/VariableSize.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | -------------------------------------------------------------------------------- /chapter3/Zero.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | -------------------------------------------------------------------------------- /chapter3/script3.js: -------------------------------------------------------------------------------- 1 | console.log("Script 3 ",a); 2 | console.log("Script 3 ",b); 3 | console.log("Script 3 c",c); -------------------------------------------------------------------------------- /chapter3/scriptOne.js: -------------------------------------------------------------------------------- 1 | var varOne = "This is varone"; 2 | -------------------------------------------------------------------------------- /chapter4/Addition.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | -------------------------------------------------------------------------------- /chapter4/AdditionDateArray.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | -------------------------------------------------------------------------------- /chapter4/AndUsage.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | -------------------------------------------------------------------------------- /chapter4/AndUseCase.html: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | -------------------------------------------------------------------------------- /chapter4/Arithmetic.html: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | -------------------------------------------------------------------------------- /chapter4/Assignment.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | -------------------------------------------------------------------------------- /chapter4/Assignment3.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | -------------------------------------------------------------------------------- /chapter4/Associativity.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | -------------------------------------------------------------------------------- /chapter4/BinaryAnd.html: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | -------------------------------------------------------------------------------- /chapter4/Comma.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | -------------------------------------------------------------------------------- /chapter4/Comma2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /chapter4/Comparison.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | -------------------------------------------------------------------------------- /chapter4/Conditional.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | -------------------------------------------------------------------------------- /chapter4/ConditionalInvocation.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | -------------------------------------------------------------------------------- /chapter4/ConditionalProperty.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | -------------------------------------------------------------------------------- /chapter4/DefinedOperator.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | -------------------------------------------------------------------------------- /chapter4/Delete.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | -------------------------------------------------------------------------------- /chapter4/Equality.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | -------------------------------------------------------------------------------- /chapter4/Eval.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /chapter4/Expression.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | -------------------------------------------------------------------------------- /chapter4/FunctionDefinitionExpression.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | -------------------------------------------------------------------------------- /chapter4/IfFunction.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | -------------------------------------------------------------------------------- /chapter4/IncreDec.html: -------------------------------------------------------------------------------- 1 | 2 | 32 | 33 | -------------------------------------------------------------------------------- /chapter4/InstanceOf.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | -------------------------------------------------------------------------------- /chapter4/InvocationExpression.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | -------------------------------------------------------------------------------- /chapter4/LogicalAnd.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | -------------------------------------------------------------------------------- /chapter4/LogicalOp.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | -------------------------------------------------------------------------------- /chapter4/Lvalue.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | -------------------------------------------------------------------------------- /chapter4/NegOp.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | -------------------------------------------------------------------------------- /chapter4/NumOfOperand.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | -------------------------------------------------------------------------------- /chapter4/NumberConversion.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | -------------------------------------------------------------------------------- /chapter4/ObjectCreation.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /chapter4/ObjectToPrimitive2.html: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | -------------------------------------------------------------------------------- /chapter4/OrUseCase.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | -------------------------------------------------------------------------------- /chapter4/OrUseCase2.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | -------------------------------------------------------------------------------- /chapter4/OrUseCase3.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | -------------------------------------------------------------------------------- /chapter4/Precedence.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /chapter4/PropertyAccess.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | -------------------------------------------------------------------------------- /chapter4/ShiftOperator.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | -------------------------------------------------------------------------------- /chapter4/SideEffect.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | -------------------------------------------------------------------------------- /chapter4/TypeOf.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | -------------------------------------------------------------------------------- /chapter4/Unary.html: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /chapter4/Void.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Click me 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /chapter4/XOr.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | -------------------------------------------------------------------------------- /chapter5/ConditionalIf.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /chapter5/ConditionalIf2.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter5/Continue.html: -------------------------------------------------------------------------------- 1 | 2 | 26 | -------------------------------------------------------------------------------- /chapter5/CounterControlLoop.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | -------------------------------------------------------------------------------- /chapter5/DoWhile.html: -------------------------------------------------------------------------------- 1 | 2 | 23 | -------------------------------------------------------------------------------- /chapter5/Fact.fsx: -------------------------------------------------------------------------------- 1 | let factorial n = 2 | let rec factorial' n acc = 3 | match n with 4 | | 0 -> acc 5 | | _ -> factorial' (n – 1) (acc * n) 6 | factorial' n 1 7 | 8 | println factorial 4 -------------------------------------------------------------------------------- /chapter5/ForEntries.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter5/ForFlowDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter5/ForIn.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /chapter5/ForLoop.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /chapter5/ForOfLoop.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /chapter5/ForOfSet.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /chapter5/ForOptional.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter5/If3.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /chapter5/If4.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | -------------------------------------------------------------------------------- /chapter5/If5.html: -------------------------------------------------------------------------------- 1 | 2 | 35 | 36 | -------------------------------------------------------------------------------- /chapter5/If6.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | -------------------------------------------------------------------------------- /chapter5/LabelBreak.html: -------------------------------------------------------------------------------- 1 | 2 | 23 | -------------------------------------------------------------------------------- /chapter5/Loop.rb: -------------------------------------------------------------------------------- 1 | 5.times{ 2 | puts "Hello" 3 | } 4 | 5 | 6 | -------------------------------------------------------------------------------- /chapter5/NestedLooop.html: -------------------------------------------------------------------------------- 1 | 2 | 25 | -------------------------------------------------------------------------------- /chapter5/Return.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /chapter5/Return2.html: -------------------------------------------------------------------------------- 1 | 2 | 23 | -------------------------------------------------------------------------------- /chapter5/Statement.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter5/Triangle.html: -------------------------------------------------------------------------------- 1 | 2 | 23 | -------------------------------------------------------------------------------- /chapter5/TryStatement.html: -------------------------------------------------------------------------------- 1 | 2 | 28 | -------------------------------------------------------------------------------- /chapter5/While.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /chapter5/WithStatement.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /chapter6/Aeroplane.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter6/Aeroplane.class -------------------------------------------------------------------------------- /chapter6/AssociateArray.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter6/Bird.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter6/Bird.class -------------------------------------------------------------------------------- /chapter6/ComputeProperty.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter6/ControlAbstraction.rb: -------------------------------------------------------------------------------- 1 | def custom_while(condition) 2 | loop do 3 | break unless condition.() 4 | yield 5 | end 6 | end 7 | 8 | i = 0 9 | custom_while -> { i < 5 } do 10 | puts i 11 | i += 1 12 | end -------------------------------------------------------------------------------- /chapter6/DeleteOp.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter6/Doctor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter6/Doctor.class -------------------------------------------------------------------------------- /chapter6/DuckTyping.html: -------------------------------------------------------------------------------- 1 | 2 | 21 | -------------------------------------------------------------------------------- /chapter6/Engineer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter6/Engineer.class -------------------------------------------------------------------------------- /chapter6/Enumeration.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter6/Flyable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter6/Flyable.class -------------------------------------------------------------------------------- /chapter6/Getter.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter6/GetterSetter.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | -------------------------------------------------------------------------------- /chapter6/Human.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter6/Human.class -------------------------------------------------------------------------------- /chapter6/InheritedProperty.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter6/NewObject.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /chapter6/NonEnumerable.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /chapter6/Object.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter6/ObjectAsMapping.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /chapter6/ObjectAssign.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter6/ObjectLiteral.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /chapter6/Polymorphism.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter6/Polymorphism.class -------------------------------------------------------------------------------- /chapter6/Prototype.html: -------------------------------------------------------------------------------- 1 | 2 | 25 | -------------------------------------------------------------------------------- /chapter6/Prototype2.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /chapter6/SaSaYaKa.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | Hello 4 | Hello1 5 | Hello2 6 | Hello3 7 |
8 | 9 | 20 | -------------------------------------------------------------------------------- /chapter6/ShortLiteral.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter6/ShorthandMethod.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | -------------------------------------------------------------------------------- /chapter6/SpreadOp.html: -------------------------------------------------------------------------------- 1 | 2 | 21 | -------------------------------------------------------------------------------- /chapter6/Symbol.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter6/ToString.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /chapter6/UnStructure.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | i := 0 7 | 8 | label: 9 | i++ 10 | fmt.Println("Loop ") 11 | if i < 5 { 12 | goto label 13 | } 14 | goto another 15 | fmt.Println("That will never be print") 16 | another: 17 | fmt.Println("End of program") 18 | } 19 | -------------------------------------------------------------------------------- /chapter6/ValueOf.html: -------------------------------------------------------------------------------- 1 | 2 | 21 | -------------------------------------------------------------------------------- /chapter7/ArrToString.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /chapter7/ArrayCont.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter7/ArrayFrom.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter7/BooleanCount.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /chapter7/EverySome.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | -------------------------------------------------------------------------------- /chapter7/Flat.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter7/Iteration2.html: -------------------------------------------------------------------------------- 1 | 2 | 23 | -------------------------------------------------------------------------------- /chapter7/Queue.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /chapter7/Reduce.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | -------------------------------------------------------------------------------- /chapter7/ReduceRight.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | -------------------------------------------------------------------------------- /chapter7/array.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /chapter7/array2.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter7/array3.html: -------------------------------------------------------------------------------- 1 | 2 | 21 | -------------------------------------------------------------------------------- /chapter7/array_acces.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter7/array_add_remove.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter7/array_like.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter7/compare.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter7/concat.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /chapter7/copyWithin.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter7/fill.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter7/include.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /chapter7/indexOf.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter7/reverse.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /chapter7/slice.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /chapter7/sort2.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | -------------------------------------------------------------------------------- /chapter7/sort_unicode.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /chapter7/splice.html: -------------------------------------------------------------------------------- 1 | 2 | 21 | -------------------------------------------------------------------------------- /chapter7/spread.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter7/stack.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter7/stack_frame.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /chapter7/static_method.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /chapter7/string_as_array.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /chapter8/Func_constructor.html: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /chapter8/Func_prop.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | -------------------------------------------------------------------------------- /chapter8/Module.js: -------------------------------------------------------------------------------- 1 | +function MyModule() 2 | { 3 | console.log("Module invoked"); 4 | }(); 5 | //IIFE -------------------------------------------------------------------------------- /chapter8/Multiple.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter8/Multiple.class -------------------------------------------------------------------------------- /chapter8/Multiple.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | class Multiple 3 | { 4 | public static void method(HashMap params) 5 | { 6 | System.out.println("Parm color "+params.get("color")); 7 | System.out.println("Parm background "+params.get("background")); 8 | } 9 | public static void main(String[]args) 10 | { 11 | HashMap map = new HashMap(); 12 | map.put("color","red"); 13 | map.put("background",1); 14 | method(map); 15 | } 16 | } -------------------------------------------------------------------------------- /chapter8/ObjDesUsage.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /chapter8/ObjDestructuring.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | -------------------------------------------------------------------------------- /chapter8/Overwrite.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /chapter8/apply.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | -------------------------------------------------------------------------------- /chapter8/array_des2.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter8/array_destruct.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter8/arrow_func.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter8/bind.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | -------------------------------------------------------------------------------- /chapter8/cache.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | -------------------------------------------------------------------------------- /chapter8/call.html: -------------------------------------------------------------------------------- 1 | 2 | 27 | -------------------------------------------------------------------------------- /chapter8/call_module.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | 28 | -------------------------------------------------------------------------------- /chapter8/colsure.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | -------------------------------------------------------------------------------- /chapter8/constructor_invo.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /chapter8/default_param.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /chapter8/fp/Demo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter8/fp/Demo.class -------------------------------------------------------------------------------- /chapter8/fp/Demo.java: -------------------------------------------------------------------------------- 1 | class PrivateData 2 | { 3 | private int data; 4 | 5 | public void method() 6 | { 7 | System.out.println("Method called"); 8 | } 9 | } 10 | public class Demo{ 11 | public static void main(String args[]) 12 | { 13 | PrivateData obj = new PrivateData(); 14 | //obj.data = 122; 15 | obj.method(); 16 | } 17 | } -------------------------------------------------------------------------------- /chapter8/fp/FetchExampe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | -------------------------------------------------------------------------------- /chapter8/fp/Indeity_Of.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /chapter8/fp/Lens.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 24 | -------------------------------------------------------------------------------- /chapter8/fp/Monad.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | -------------------------------------------------------------------------------- /chapter8/fp/PrivateData.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter8/fp/PrivateData.class -------------------------------------------------------------------------------- /chapter8/fp/Promise.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /chapter8/fp/auth_gurad.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | -------------------------------------------------------------------------------- /chapter8/fp/closure.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /chapter8/fp/curry.fsx: -------------------------------------------------------------------------------- 1 | let add x y = x + y 2 | let add2 = add 2 3 | printfn "Result %A " add2 4 | 5 | let result = add2 4 6 | printfn "Result %A" result -------------------------------------------------------------------------------- /chapter8/fp/curry_with_ramda.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | -------------------------------------------------------------------------------- /chapter8/fp/currying.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | -------------------------------------------------------------------------------- /chapter8/fp/higherOrderFunction.html: -------------------------------------------------------------------------------- 1 | 2 | 25 | -------------------------------------------------------------------------------- /chapter8/fp/hof.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter8/fp/invoke.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /chapter8/fp/map_filter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | -------------------------------------------------------------------------------- /chapter8/fp/mapping.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /chapter8/fp/once.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 25 | -------------------------------------------------------------------------------- /chapter8/fp/pipe.fsx: -------------------------------------------------------------------------------- 1 | let double x = x* 2; 2 | let tripple x = x * 3; 3 | let data = 2 |> double |>tripple; 4 | printfn "Data is %d " data -------------------------------------------------------------------------------- /chapter8/fp/unary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 24 | -------------------------------------------------------------------------------- /chapter8/fp/unary_fuc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /chapter8/fun_var.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter8/function1.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /chapter8/function_property.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter8/implicit.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter8/max.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter8/method.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /chapter8/mul_return.html: -------------------------------------------------------------------------------- 1 | 2 | 25 | -------------------------------------------------------------------------------- /chapter8/multi_return.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func hello() (int, int) { 6 | return 10, 20 7 | } 8 | func fileRead() (int, error) { 9 | return 10, fmt.Errorf("Error") 10 | } 11 | func main() { 12 | var a int 13 | var b int 14 | a, b = hello() 15 | fmt.Println("A ", a, " b ", b) 16 | 17 | c, err := fileRead() 18 | if err != nil { 19 | fmt.Print("Have error ", c) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /chapter8/multipleParam.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /chapter8/name_par.py: -------------------------------------------------------------------------------- 1 | def hello(a,b): 2 | print("A is ", a, " b ", b) 3 | hello(10,20) 4 | hello(b=20,a=10) -------------------------------------------------------------------------------- /chapter8/nested.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /chapter8/parameter-check.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /chapter8/parameter.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /chapter8/primitive_ref.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 27 | -------------------------------------------------------------------------------- /chapter8/rest_param.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /chapter8/return_fun.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | -------------------------------------------------------------------------------- /chapter8/swap.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /chapter8/trace.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 22 | -------------------------------------------------------------------------------- /chapter9/Doctor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter9/Doctor.class -------------------------------------------------------------------------------- /chapter9/Human.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/chapter9/Human.class -------------------------------------------------------------------------------- /chapter9/SettingPrototype.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | -------------------------------------------------------------------------------- /chapter9/Static.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | -------------------------------------------------------------------------------- /chapter9/tempCodeRunnerFile.java: -------------------------------------------------------------------------------- 1 | h.work(); -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /frontend/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | -------------------------------------------------------------------------------- /frontend/.idea/frontend.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /frontend/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /frontend/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /frontend/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /frontend/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/frontend/public/favicon.ico -------------------------------------------------------------------------------- /frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/frontend/public/logo192.png -------------------------------------------------------------------------------- /frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/frontend/public/logo512.png -------------------------------------------------------------------------------- /frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /frontend/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /frontend/src/components/VirutalDomConcept.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | function VirtualDomConcept() 4 | { 5 | return ( 6 |
7 | Here is the VDOM concept 8 |

It is {new Date().toLocaleTimeString()}.

9 |
10 | ) 11 | } 12 | export default VirtualDomConcept; -------------------------------------------------------------------------------- /frontend/src/components/classcomponent/ClassComp.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | let Child=()=>{ 4 | return( 5 |
6 | This is child 7 |
8 | ); 9 | } 10 | class ClassComp extends React.Component 11 | { 12 | render() { 13 | return (
14 |

ClassComponent

15 | 16 |
) 17 | } 18 | } 19 | export default ClassComp; -------------------------------------------------------------------------------- /frontend/src/components/context/DataContext.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export const DataContext = React.createContext({ 3 | data : ["One","Two","Three"] 4 | }); -------------------------------------------------------------------------------- /frontend/src/components/context/Level1Child.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Level2Child from "./Level2Child"; 3 | 4 | export default class Level1Child extends React.Component{ 5 | render() { 6 | return ( 7 |
8 | Level 1 Component 9 | 10 |
11 | ); 12 | } 13 | } -------------------------------------------------------------------------------- /frontend/src/components/context/Level2Child2.js: -------------------------------------------------------------------------------- 1 | import React,{useContext} from "react"; 2 | import {DataContext} from "./DataContext"; 3 | export default function Level2Child2() 4 | { 5 | const value = useContext(DataContext); 6 | return ( 7 |
8 | Level 2 Child 2 9 | { 10 | value.map((val,index)=> 11 |
{val}
12 | ) 13 | } 14 |
15 | ); 16 | } -------------------------------------------------------------------------------- /frontend/src/components/context/Parent.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Level1Child from "./Level1Child"; 3 | import Level2Child from "./Level2Child"; 4 | 5 | export default class Parent extends React.Component{ 6 | render() { 7 | return ( 8 |
9 | Parent Component 10 | {/* */} 11 | 12 |
13 | ); 14 | } 15 | } -------------------------------------------------------------------------------- /frontend/src/components/function/FunctionComponentDemo.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | let User=()=>( 4 |

User

5 | ); 6 | let Admin=()=>( 7 |

Admin

8 | ); 9 | let Child=()=>(

10 | This is child in ES6 Arrow Function 11 |

); 12 | function FunctionComponent(){ 13 | console.log("Functional component render"); 14 | let role = 'user' 15 | let CurrentUser = role== 'user'?User : Admin; 16 | return ( 17 |
18 | Here is functional component 19 | 20 | 21 |
22 | ); 23 | 24 | } 25 | export default FunctionComponent; -------------------------------------------------------------------------------- /frontend/src/components/hoc/HocDemo.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import loadingSpinner from "./loadingSpinner"; 3 | import Page from "./Page"; 4 | let PageWithSpinner = loadingSpinner(Page); 5 | export default class HocDemo extends React.Component 6 | { 7 | constructor(props) { 8 | super(props); 9 | this.state = { 10 | loading : true 11 | } 12 | } 13 | componentDidMount() { 14 | setTimeout(()=>{ 15 | console.log("Loading completed"); 16 | this.setState({ 17 | loading:false 18 | }) 19 | },3000); 20 | } 21 | 22 | render() { 23 | 24 | return 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /frontend/src/components/hoc/Page.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export default class Page extends React.Component{ 3 | render() { 4 | return (
5 | Here is the page 6 |
); 7 | } 8 | } -------------------------------------------------------------------------------- /frontend/src/components/hoc/loadingSpinner.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | const loadingSpinner = (AnotherComponent)=>{ 3 | class ComponentWithSpinner extends React.Component 4 | { 5 | constructor(props) { 6 | super(props); 7 | } 8 | render() { 9 | console.log("Props ",this.props); 10 | return(
11 | { 12 | this.props.loading? "Page is loading": 13 | } 14 | 15 |
); 16 | }; 17 | } 18 | return ComponentWithSpinner; 19 | } 20 | export default loadingSpinner; -------------------------------------------------------------------------------- /frontend/src/components/hook/APICallDemo.js: -------------------------------------------------------------------------------- 1 | import React,{useState,useEffect} from "react"; 2 | function useApiCall(setTodo) { 3 | useEffect(() => { 4 | fetch('https://jsonplaceholder.typicode.com/todos/1') 5 | .then(response => response.json()) 6 | .then(json => { 7 | setTodo(json); 8 | console.log("JSON ", json) 9 | }); 10 | }, []) 11 | } 12 | function APICallDemo() 13 | { 14 | let [todo,setTodo] = useState({}); 15 | useApiCall(setTodo); 16 | return( 17 |
18 | {todo.title} 19 |
20 | ); 21 | } 22 | export default APICallDemo; -------------------------------------------------------------------------------- /frontend/src/components/hook/CleanUpDemo.js: -------------------------------------------------------------------------------- 1 | import React, {useEffect, useState} from "react"; 2 | import UseEffectDemo from "./UseEffectDemo"; 3 | function CleanUpDemo() 4 | { 5 | let [destroy,setDestroy] = useState(false); 6 | 7 | 8 | return (
9 | {!destroy && } 10 | 14 |
) 15 | } 16 | export default CleanUpDemo; -------------------------------------------------------------------------------- /frontend/src/components/hook/UseEffectDemo.js: -------------------------------------------------------------------------------- 1 | import React,{useState,useEffect} from "react"; 2 | 3 | function UseEffectDemo() { 4 | 5 | let [counter,setCounter] = useState(0); 6 | useEffect(()=>{ 7 | console.log("API call code"); 8 | 9 | let timer = setInterval(()=>{ 10 | console.log("Set interval"); 11 | setCounter(counter +1); 12 | },1000); 13 | 14 | return ()=>{ 15 | console.log("Cleanup code"); 16 | clearTimeout(timer); 17 | } 18 | },[]) 19 | return(
20 | UseEffect Clean up Demo {counter} 21 |
) 22 | } 23 | export default UseEffectDemo; -------------------------------------------------------------------------------- /frontend/src/components/hook/UseRefDemo.js: -------------------------------------------------------------------------------- 1 | import React, {useLayoutEffect, useRef} from "react"; 2 | 3 | export function UseRefDemo() { 4 | console.log("Render"); 5 | useLayoutEffect(()=>{ 6 | console.log("called after render"); 7 | }) 8 | const inputEl = useRef(null); 9 | const onButtonClick = () => { 10 | // `current` points to the mounted text input element 11 | inputEl.current.focus(); 12 | }; 13 | console.log("Return JSX"); 14 | return ( 15 | <> 16 | 17 | 18 | 19 | ); 20 | } -------------------------------------------------------------------------------- /frontend/src/components/importdemo/ImportDemo.js: -------------------------------------------------------------------------------- 1 | export function ComponentOne(props) 2 | { 3 | return ( 4 |
5 |

Component One

6 |
7 | ) 8 | } 9 | export default function ImportDemo(porps) 10 | { 11 | return ( 12 |
13 |

Default Component

14 |
15 | ) 16 | } -------------------------------------------------------------------------------- /frontend/src/components/jsx/JSXElement.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export default class JSXElement extends React.Component 3 | { 4 | render() { 5 | //

Hello

6 | let element = React.createElement("h1",null,"Hello") 7 | return element; 8 | } 9 | } -------------------------------------------------------------------------------- /frontend/src/components/jsx/Mapper.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | const Mapper=(props)=>{ 3 | let data = props.data; 4 | let Element = props.element; 5 | console.log("Element ",Element); 6 | let list = data.map(ele=>); 7 | console.log("List ",list); 8 | return ( 9 | <> 10 | { 11 | data.map(ele=>) 12 | } 13 | 14 | ); 15 | } 16 | export const ChildElement=(props)=>{ 17 | console.log("Item ",props.item); 18 | return ( 19 |
20 | {props.item.text} 21 |
22 | ); 23 | } 24 | export default Mapper; -------------------------------------------------------------------------------- /frontend/src/components/pattern/composition/FanyBorder.js: -------------------------------------------------------------------------------- 1 | function FancyBorder(props) 2 | { 3 | return(
4 | {props.children} 5 |
); 6 | } 7 | export default FancyBorder; -------------------------------------------------------------------------------- /frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | import {PortalParent} from "./components/portal/PortalComponent"; 7 | 8 | ReactDOM.render( 9 | 10 | 11 | , 12 | document.getElementById('root') 13 | ); 14 | 15 | 16 | // If you want to start measuring performance in your app, pass a function 17 | // to log results (for example: reportWebVitals(console.log)) 18 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 19 | reportWebVitals(); 20 | -------------------------------------------------------------------------------- /frontend/src/pages/AboutPage.js: -------------------------------------------------------------------------------- 1 | import {useParams} from "react-router-dom"; 2 | 3 | export default function AboutPage(){ 4 | let {id} = useParams(); 5 | console.log("Id ",id); 6 | return
7 | About Page url=> {id} 8 |
9 | } -------------------------------------------------------------------------------- /frontend/src/pages/HomePage.js: -------------------------------------------------------------------------------- 1 | import { 2 | useParams, 3 | useLocation, 4 | } from "react-router-dom"; 5 | 6 | function useQuery() { 7 | return new URLSearchParams(useLocation().search); 8 | } 9 | 10 | export default function HomePage(){ 11 | let {id} = useParams(); 12 | let query = useQuery(); 13 | return
14 | Home Page url {id} 15 | Query parameter {query.get("name")} 16 |
17 | } -------------------------------------------------------------------------------- /frontend/src/pages/LoginPage.js: -------------------------------------------------------------------------------- 1 | export default function LoginPage() { 2 | return(
3 |

Login Page

4 |
) 5 | } -------------------------------------------------------------------------------- /frontend/src/pages/MoviePage.js: -------------------------------------------------------------------------------- 1 | import {useParams} from "react-router-dom"; 2 | 3 | export default function MoviePage(){ 4 | let {id} = useParams(); 5 | return
6 | Movie Page

Movie Id {id}

7 |
8 | } -------------------------------------------------------------------------------- /frontend/src/pages/PageNotFound.js: -------------------------------------------------------------------------------- 1 | export default function PageNotFound() { 2 | return( 3 |
4 |

Page Not Found

5 |
6 | ); 7 | } -------------------------------------------------------------------------------- /frontend/src/pages/ProtectedPage.js: -------------------------------------------------------------------------------- 1 | export default function ProtectedPage() { 2 | return(
3 |

Protected Page

4 |
); 5 | } -------------------------------------------------------------------------------- /frontend/src/pages/SubUser.js: -------------------------------------------------------------------------------- 1 | import { 2 | useParams 3 | } from "react-router-dom"; 4 | export default function SubUser() { 5 | // The that rendered this component has a 6 | // path of `/topics/:topicId`. The `:topicId` portion 7 | // of the URL indicates a placeholder that we can 8 | // get from `useParams()`. 9 | let { userName } = useParams(); 10 | 11 | return ( 12 |
13 |

{userName}

14 |
15 | ); 16 | } -------------------------------------------------------------------------------- /frontend/src/pages/auth.js: -------------------------------------------------------------------------------- 1 | export default function auth() 2 | { 3 | return true; 4 | } -------------------------------------------------------------------------------- /frontend/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /frontend/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /redux-concept/reduce.js: -------------------------------------------------------------------------------- 1 | let numbers = [1,2,3,4,5,6]; 2 | let sum = numbers.reduce((a,b)=>a+b,0); 3 | console.log("Sum is ",sum); 4 | -------------------------------------------------------------------------------- /redux/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /redux/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | -------------------------------------------------------------------------------- /redux/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /redux/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /redux/.idea/redux.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /redux/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /redux/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/redux/public/favicon.ico -------------------------------------------------------------------------------- /redux/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/redux/public/logo192.png -------------------------------------------------------------------------------- /redux/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrthetkhine/ReactSecondBatch/903a49aad1fb6227ae2d5744b6a68ea3f0f91f19/redux/public/logo512.png -------------------------------------------------------------------------------- /redux/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /redux/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /redux/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | import { Provider } from 'react-redux'; 4 | import { store } from './app/store'; 5 | import App from './App'; 6 | 7 | test('renders learn react link', () => { 8 | const { getByText } = render( 9 | 10 | 11 | 12 | ); 13 | 14 | expect(getByText(/learn/i)).toBeInTheDocument(); 15 | }); 16 | -------------------------------------------------------------------------------- /redux/src/app/hooks.ts: -------------------------------------------------------------------------------- 1 | import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'; 2 | import type { RootState, AppDispatch } from './store'; 3 | 4 | // Use throughout your app instead of plain `useDispatch` and `useSelector` 5 | export const useAppDispatch = () => useDispatch(); 6 | export const useAppSelector: TypedUseSelectorHook = useSelector; 7 | -------------------------------------------------------------------------------- /redux/src/components/routes/PrivateRoute.tsx: -------------------------------------------------------------------------------- 1 | import React,{Component} from 'react'; 2 | import { 3 | Link, 4 | Route, 5 | Navigate, 6 | } from "react-router-dom"; 7 | /* 8 | interface PrivateRouteParams{ 9 | element:Component, 10 | redirectTo:string, 11 | isAuth:boolean, 12 | path:string, 13 | props?:any 14 | }*/ 15 | export default function PrivateRoute({ children, 16 | redirectTo, 17 | isAuth, 18 | path, ...props }:any) { 19 | 20 | console.log('Is auth ',isAuth, ' redirectTo ',redirectTo); 21 | return isAuth ? children : ; 22 | } 23 | -------------------------------------------------------------------------------- /redux/src/features/auth/authApi.ts: -------------------------------------------------------------------------------- 1 | import {API_URL} from "../../setting/API"; 2 | import axios from "../../setting/our_axios"; 3 | 4 | 5 | 6 | 7 | export function login(username:string,password:string){ 8 | const loginUrl = API_URL+"/auth/login"; 9 | return axios.post(loginUrl,{ 10 | username, 11 | password 12 | }); 13 | } -------------------------------------------------------------------------------- /redux/src/features/counter/counterAPI.ts: -------------------------------------------------------------------------------- 1 | // A mock function to mimic making an async request for data 2 | export function fetchCount(amount = 1) { 3 | return new Promise<{ data: number }>((resolve) => 4 | setTimeout(() => resolve({ data: amount }), 500) 5 | ); 6 | } 7 | -------------------------------------------------------------------------------- /redux/src/features/movie/Movie.module.css: -------------------------------------------------------------------------------- 1 | .movie{ 2 | min-height: 50px; 3 | border-radius: 10px; 4 | border:1px solid lightgray; 5 | margin-left:100px; 6 | margin-right:100px; 7 | margin-bottom: 10px; 8 | } 9 | .movieTitle 10 | { 11 | font-weight: bold; 12 | } -------------------------------------------------------------------------------- /redux/src/features/movie/movieApi.ts: -------------------------------------------------------------------------------- 1 | import {API_URL} from "../../setting/API"; 2 | import {Movie} from "./movieSlice"; 3 | import axios from "../../setting/our_axios"; 4 | 5 | 6 | const API = API_URL+"/movies" 7 | 8 | export function getAllMovie(){ 9 | return axios.get(API); 10 | } 11 | export function saveMovie(movie:Movie){ 12 | return axios.post(API,movie); 13 | } 14 | export function deleteMovie(movie:Movie){ 15 | return axios.delete(API+"/"+movie._id); 16 | } 17 | export function updateMovie(movie:Movie){ 18 | return axios.patch(API+"/"+movie._id,movie); 19 | } -------------------------------------------------------------------------------- /redux/src/features/review/reviewApi.ts: -------------------------------------------------------------------------------- 1 | import {API_URL} from "../../setting/API"; 2 | import {Review} from "./reviewSlice"; 3 | import axios from "../../setting/our_axios"; 4 | 5 | 6 | const API = API_URL+"/reviews" 7 | 8 | export function getAllReviewsByMovieId(movieId:string){ 9 | return axios.get(API+"/movie/"+movieId); 10 | } -------------------------------------------------------------------------------- /redux/src/features/todo/todoAPI.ts: -------------------------------------------------------------------------------- 1 | export function fetchToDo(id:number) { 2 | return fetch('https://jsonplaceholder.typicode.com/todos/'+id); 3 | } 4 | -------------------------------------------------------------------------------- /redux/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /redux/src/pages/HomePage.tsx: -------------------------------------------------------------------------------- 1 | export default function HomePage() 2 | { 3 | return (
4 | Home Page 5 |
) 6 | } -------------------------------------------------------------------------------- /redux/src/pages/LogoutPage.tsx: -------------------------------------------------------------------------------- 1 | import {useAppDispatch} from "../app/hooks"; 2 | import {logout} from './../features/auth/authSlice'; 3 | export default function LogoutPage() 4 | { 5 | let dispatch = useAppDispatch(); 6 | let logoutHandler = ()=>{ 7 | console.log("Logout "); 8 | dispatch(logout()); 9 | } 10 | return (
11 | 14 |
); 15 | } -------------------------------------------------------------------------------- /redux/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /redux/src/services/authService.ts: -------------------------------------------------------------------------------- 1 | import { useAppSelector, useAppDispatch } from '../app/hooks'; 2 | import {selectAuth} from "../features/auth/authSlice"; 3 | 4 | export default function useAuth() 5 | { 6 | let authUser = useAppSelector(selectAuth); 7 | console.log("Use Auth user",authUser); 8 | return authUser; 9 | } 10 | export function useAuthentication() 11 | { 12 | let authUser = useAuth(); 13 | return authUser.token; 14 | } -------------------------------------------------------------------------------- /redux/src/setting/API.ts: -------------------------------------------------------------------------------- 1 | export const API_URL = "http://localhost:8000" -------------------------------------------------------------------------------- /redux/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; 6 | -------------------------------------------------------------------------------- /redux/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "module": "esnext", 17 | "moduleResolution": "node", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "noEmit": true, 21 | "jsx": "react-jsx" 22 | }, 23 | "include": [ 24 | "src" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /tempCodeRunnerFile.cpp: -------------------------------------------------------------------------------- 1 | ptr -------------------------------------------------------------------------------- /typescript/CounterState.js: -------------------------------------------------------------------------------- 1 | var a = { 2 | value: 5, 3 | status: 'idle' 4 | }; 5 | var another = { 6 | value: 5, 7 | status: 'idle', 8 | other: 'Other' 9 | }; 10 | console.log("A is ", a); 11 | -------------------------------------------------------------------------------- /typescript/CounterState.ts: -------------------------------------------------------------------------------- 1 | interface CounterState{ 2 | value :number, 3 | status : 'idle' | 'loading' | 'failed'; 4 | } 5 | let a :CounterState = { 6 | value : 5, 7 | status: 'idle', 8 | 9 | } 10 | let another = { 11 | value : 5, 12 | status: 'idle', 13 | other : 'Other' 14 | }; 15 | console.log("A is ",a); -------------------------------------------------------------------------------- /typescript/action_creator.js: -------------------------------------------------------------------------------- 1 | function addToDo(item) 2 | { 3 | return { 4 | type:'ADD_TO_DO', 5 | payload: item 6 | } 7 | } 8 | console.log(addToDo({text:"Hello",id:1})); -------------------------------------------------------------------------------- /typescript/demo.js: -------------------------------------------------------------------------------- 1 | var a = 10; 2 | a++; 3 | var flag = false; 4 | //a = a + flag; 5 | //a = "Hello" 6 | console.log("A is ", a); 7 | var obj = { 8 | name: "Tk", 9 | age: 37 10 | }; 11 | //obj.aeg =""; 12 | //obj.age = "Hello" 13 | var age = 37; 14 | //age = "Hello"; 15 | var myAge = "Hello"; 16 | myAge = 3; 17 | -------------------------------------------------------------------------------- /typescript/demo.ts: -------------------------------------------------------------------------------- 1 | let a:number = 10; 2 | a ++; 3 | let flag:boolean = false; 4 | //a = a + flag; 5 | //a = "Hello" 6 | console.log("A is ",a); 7 | let obj = { 8 | name : "Tk", 9 | age : 37 10 | }; 11 | //obj.aeg =""; 12 | //obj.age = "Hello" 13 | let age = 37; 14 | //age = "Hello"; 15 | let myAge:any = "Hello"; 16 | myAge = 3; --------------------------------------------------------------------------------