├── .gitignore ├── exercises ├── 1-module.md ├── 10-module(Spring Boot Part II).md ├── 2-module.md ├── 3-module.md ├── 4-module.md ├── 5-module.md ├── 6-module(database).md ├── 7-module(Jakarta EE).md ├── 8-module(Spring Core).md └── 9-module(Spring Boot).md ├── interviewquestions ├── 1-module.md ├── 10-module(Spring Boot Part ||).md ├── 2-module.md ├── 3-module.md ├── 4-module.md ├── 5-module.md ├── 6-module(database).md ├── 7-module(Jakarta EE).md ├── 8-module(Spring Introduction).md └── 9-module(Spring Boot).md ├── jars ├── Books.json ├── employees.json └── seeder.jar ├── needed_sources ├── 2101.png ├── 243.png ├── 244.png ├── StandardBuiltInConstraints.md ├── activation.html ├── comments-service.jar ├── gallery.png ├── hateoas-api-service.jar ├── install_mongodb_community.md ├── jakarta-expression-language-spec-5.0.pdf ├── jakarta-persistence-spec-3.0.pdf ├── jakarta.persistence.query_methods.md ├── jakarta_ee_error_handling_attribute_names.md ├── jakata_ee_lesson_1_exercise_1_img.png ├── jpa_configurations.md ├── jstl_tags.md ├── loginform.png ├── maven_commands.md ├── model2-lesson3-task1.png ├── model2-lesson3-task3.png ├── module_10_lesson_3_comment_service.md ├── module_10_lesson_3_hateoas_service.md ├── module_9_lesson_8_mapstruct.md ├── module_9_lesson_9_logging.md ├── postgres_localhost-2023_03_01_12_34_08-dump.sql ├── report.html ├── short_url_logo.png ├── spring_module2_lesson_4_spring_data_jpa_property_expressisons.md ├── spring_module_10_lesson_1_mongodb.md ├── spring_module_10_lesson_1_mongodb_sales.json ├── spring_module_10_lesson_1_mongodb_users.json ├── spring_module_10_lesson_7_3_needed_plugins.md ├── spring_module_10_lesson_7_4_fizzbuzz_data.md ├── spring_module_1_lesson_5_home_work.png ├── spring_module_9_lesson_10_project.md ├── spring_module_9_lesson_4_1_spring_data_jpa_config.md ├── spring_module_9_lesson_6_jwt.md ├── spring_module_9_lesson_7_openapi_swagger_config.md └── vm.png ├── source_codes ├── module_1 │ ├── 1-lesson.md │ ├── 10-lesson.md │ ├── 2-lesson.md │ ├── 3-lesson.md │ ├── 4-lesson.md │ ├── 5-lesson.md │ ├── 6-lesson.md │ ├── 7-lesson.md │ ├── 8-lesson.md │ └── 9-lesson.md ├── module_10 │ └── source.md ├── module_2 │ ├── 1-lesson.md │ ├── 10-lesson.md │ ├── 2-lesson.md │ ├── 3-lesson.md │ ├── 4-lesson.md │ ├── 5-lesson.md │ ├── 6-lesson.md │ ├── 7-lesson.md │ ├── 8-lesson.md │ └── 9-lesson.md ├── module_3 │ ├── 1-lesson(Exceptions).md │ ├── 10-lesson(Legacy Collections and Internationalization).md │ ├── 2-lesson(Generics).md │ ├── 3-lesson(Dynamic Array Collections Framework).md │ ├── 4-lesson(LinkedList).md │ ├── 5-lesson(Set,Comparato,Comparable).md │ ├── 6-lesson(Queue Data Structure).md │ ├── 7-lesson(Dictionary And References).md │ ├── 8-lesson(Views, Copies, Iterators).md │ └── 9-lesson(Algorithms, Optional class and SOLID).md ├── module_4 │ ├── 1-lesson(Multithreading and Threads).md │ ├── 10-lesson(Logging API).md │ ├── 2-lesson(Race Condition, Conditions, Synchronazition, Field Visibility and Deadlock).md │ ├── 3-lesson(Atomicity, ThreadSafe Collections and Immutable Classes).md │ ├── 4-lesson(Thread Pools, Callable, Future and ThreadLocal).md │ ├── 5-lesson(ForkJoin FrameWork, Asyncron Computation and Singleton Design Pattern).md │ ├── 6-lesson(Date, Calendar Classes and New Time API).md │ ├── 7-lesson(IO, NIO and Serialization).md │ ├── 8-lesson(Regex).md │ └── 9-lesson().md ├── module_5 │ ├── 1-lesson(mailing).md │ ├── 10-lesson(introduction_to_streams).md │ ├── 11-lesson(stream_api).md │ ├── 12-lesson(comparator_and_collectors).md │ ├── 13-lesson(predefined_collectors).md │ ├── 14-lesson(httpclient).md │ ├── 15-lesson(gson).md │ ├── 16-lesson(reflections_api).md │ ├── 17-lesson(telegram_bot).md │ ├── 18.annotations.md │ ├── 2-lesson(jar files).md │ ├── 3-lesson(base64).md │ ├── 4-lesson(maven).md │ ├── 5-lesson(lombok I).md │ ├── 6-lesson(lombok II).md │ ├── 7-lesson(faker).md │ ├── 8-lesson(behaviorparameterization).md │ └── 9-lesson(functionalinterfaces).md ├── module_6 │ └── project_code.md ├── module_7 │ └── readme.md ├── module_8 │ └── readme.md └── module_9 │ └── source.md └── statics └── img_1.png /.gitignore: -------------------------------------------------------------------------------- 1 | ### Maven template 2 | target/ 3 | pom.xml.tag 4 | pom.xml.releaseBackup 5 | pom.xml.versionsBackup 6 | pom.xml.next 7 | release.properties 8 | dependency-reduced-pom.xml 9 | buildNumber.properties 10 | .mvn/timing.properties 11 | # https://github.com/takari/maven-wrapper#usage-without-binary-jar 12 | .mvn/wrapper/maven-wrapper.jar 13 | 14 | # Eclipse m2e generated files 15 | # Eclipse Core 16 | .project 17 | # JDT-specific (Eclipse Java Development Tools) 18 | .classpath 19 | 20 | ### Java template 21 | # Compiled class file 22 | *.class 23 | 24 | # Log file 25 | *.log 26 | 27 | # BlueJ files 28 | *.ctxt 29 | 30 | # Mobile Tools for Java (J2ME) 31 | .mtj.tmp/ 32 | 33 | # Package Files # 34 | *.jar 35 | *.war 36 | *.nar 37 | *.ear 38 | *.zip 39 | *.tar.gz 40 | *.rar 41 | 42 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 43 | hs_err_pid* 44 | replay_pid* 45 | 46 | ### JetBrains template 47 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 48 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 49 | 50 | # User-specific stuff 51 | .idea/**/workspace.xml 52 | .idea/**/tasks.xml 53 | .idea/**/usage.statistics.xml 54 | .idea/**/dictionaries 55 | .idea/**/shelf 56 | 57 | # AWS User-specific 58 | .idea/**/aws.xml 59 | 60 | # Generated files 61 | .idea/**/contentModel.xml 62 | 63 | # Sensitive or high-churn files 64 | .idea/**/dataSources/ 65 | .idea/**/dataSources.ids 66 | .idea/**/dataSources.local.xml 67 | .idea/**/sqlDataSources.xml 68 | .idea/**/dynamic.xml 69 | .idea/**/uiDesigner.xml 70 | .idea/**/dbnavigator.xml 71 | 72 | # Gradle 73 | .idea/**/gradle.xml 74 | .idea/**/libraries 75 | 76 | # Gradle and Maven with auto-import 77 | # When using Gradle or Maven with auto-import, you should exclude module files, 78 | # since they will be recreated, and may cause churn. Uncomment if using 79 | # auto-import. 80 | # .idea/artifacts 81 | # .idea/compiler.xml 82 | # .idea/jarRepositories.xml 83 | # .idea/modules.xml 84 | # .idea/*.iml 85 | # .idea/modules 86 | # *.iml 87 | # *.ipr 88 | 89 | # CMake 90 | cmake-build-*/ 91 | 92 | # Mongo Explorer plugin 93 | .idea/**/mongoSettings.xml 94 | 95 | # File-based project format 96 | *.iws 97 | 98 | # IntelliJ 99 | out/ 100 | 101 | # mpeltonen/sbt-idea plugin 102 | .idea_modules/ 103 | 104 | # JIRA plugin 105 | atlassian-ide-plugin.xml 106 | 107 | # Cursive Clojure plugin 108 | .idea/replstate.xml 109 | 110 | # SonarLint plugin 111 | .idea/sonarlint/ 112 | 113 | # Crashlytics plugin (for Android Studio and IntelliJ) 114 | com_crashlytics_export_strings.xml 115 | crashlytics.properties 116 | crashlytics-build.properties 117 | fabric.properties 118 | 119 | # Editor-based Rest Client 120 | .idea/httpRequests 121 | 122 | # Android studio 3.1+ serialized cache file 123 | .idea/caches/build_file_checksums.ser 124 | 125 | /.idea/.gitignore 126 | /.idea/misc.xml 127 | /.idea/modules.xml 128 | /.idea/pdp_online_java_lessons.iml 129 | /.idea/vcs.xml 130 | -------------------------------------------------------------------------------- /exercises/1-module.md: -------------------------------------------------------------------------------- 1 | # Birinchi Modul uchun Execsicelar 2 | 3 |
4 | Lesson 3 (Operators) 5 | 6 | * 23 va 45 sonlar teng yoki yo'qligini tekshirish dasturini yozing. 7 | * 7 ni 5chi darajasini ekran chaqizuvchi dasturini yozing. 8 | * a va b o'zgaruvchilarni qaysi biri katta ekanligini aniqlovchi dastur. Agar qaysi biri katta usha o'zgaruvchini 9 | ekranga chiqaring. 10 | 11 |
12 | 13 |
14 | Lesson 4 (Control Flow Statements) 15 | 16 | # If 17 | 18 | * Butun son berilgan, Agar berilgan butun son musbat bo'lsa, 1ga oshirilsin, aks holda o'zgartirilmasin. 19 | * Butun son berilgan, Agar berilgan butun son musbat bo'lsa, 1ga oshirilsin, aks 2 ga kamaytiring. 20 | * Butun son berilgan, Agar berilgan butun son musbat bo'lsa, 1ga oshirilsin, aks 2 ga kamaytiring. Agar 0 ga teng bo'lsa 21 | 10 ga o'zgartirilsin. Hosil bo'lgan sonni ekranga chiqaruvchi dastur yozing. 22 | * 3ta son berilgan ular orasida nechta musbat son borligini aniqlovchi dastur yozing. 23 | * 2ta son berilgan ularni orasida qaysi bir katta ekanligini aniqlovchi dastur yozing. 24 | * 3ta son berilgan ularni orasida qaysi bir kichik ekanligini aniqlovchi dastur yozing. 25 | * 3ta son berilgan. Shu sonlarning yig'indisi eng katta bo'lgan 2tasini ekranga chiqaruvchi dastur yozing. 26 | 27 | # Switch 28 | 29 | * 1-7 gacha bo'lgan butun sonlar berilgan. Kiritilgan songa mos ravishda hafta kuni so'zda ifodalovchi dastur yozing. 30 | * k butun son berilgan. Baho natijalarni chiqaruvchi dastur yozing. (1-yomon, 2-qoniqarsiz, 3-qoniqarli, 4-yaxshi, 31 | 5-a'lo) k 1-5 oralig'ida bo'lmasa 'xato' deb chiqarilsin. 32 | * Oy raqami berilgan. Kiritilgan oy qaysi faslga tegishli ekanligini chiqaruvchi dastur yozing. 33 | * Oy raqam berilgan. Shu oyda nechta kun borligini aniqlovchi dastur yozing. 34 | * 100-999 gacha oraliqdagi sonlarni so'zlarda ifodalovchi dastur yozing(masalan: 123 - 'bir yuz yigirma uch') 35 | 36 | # Loops 37 | 38 | * n butun son berilgan (n > 0). Quyidagi yig'indini hisoblovchi dastur yozing. 39 | * s = 1 + 1/2 + 1/3 + ... + 1/n 40 | * bir kg konfetning narxi berilgan (haqiqiy son). 1, 2, ... 10 kg konfet narxini chiqaruvchi dastur yozing. 41 | * a va b butun sonlari berilgan (a < b). a dan b gacha bo'lgan barcha butun sonlar yig'indisini chiqaruvchi dastur 42 | yozing 43 | * n butun son va a haqiqiy soni berilgan. (n > 0). bitta skildan foydalanib quyidagi a ning 1dan n gacha bo'lgan barcha 44 | darajalarni chiqaruvchi va yig'indini hisoblovchi dastur yozing. 45 | * 1 + a + a² + a³ + ... aN 46 | 47 |
48 | 49 |
50 | Lesson 5 (Function and Method) 51 | 52 | # Method 53 | 54 | * 2ta soni qo'shib result qaytaradigan method yozing. 55 | * 2ta soni ko'paytirib result qaytaradigan method yozing. 56 | * Ixtiyoriy soni 3chi darajasini hisoblovchi method yozing. 57 | * 2ta soni qiymatni almashtiruvchi funksiya yozing. 58 | 59 | # Recursion 60 | 61 | * kiritilgan sonni factorialni qayataradigan method yozing. 62 | * recursiyadan foydalanib soni power topadigan method yozing. 63 | * recursiyadan foydalanib sonni fibonaccisini topadigan method yozing. 64 | * recursiyadan foydalanib berilgan sonda nechta 8 raqami borligini aniqlaydigan method yozing. 65 | 66 |
67 | 68 |
69 | Lesson 6 (String Part 1) 70 | 71 | # String 72 | 73 | * 2ta string berilgan, a va b, ularni abba tartibda birlashtirib result qaytaradigan method yozing. 74 | * String berilgan, uning birinchi 2ta belgisini tuzilgan string qaytaradigan method yozing. Misol "Hello" -> "He". 75 | Agar string 2da kichik yoki teng bo'lsa nma berilgan bo'lsa shuni qaytaring. 76 | * String berilgan, stringni dastlabki 2ta belgisidan 3ta nusxasidan iborat yangi string qaytaring. Misol "Hello" -> " 77 | HeHeHe". Agar string length 2tadan kam bo'lsa, berilgan string 3ta nusxasidan iborat yangi string qaytaring. Misol -> 78 | "H" -> "HHH". 79 | * String berilgan, string oxiri "ly" bilan tugasa, true qiymatini qaytaring. 80 | * String berilga, Agar berilgan stringda "bob" qatori bo'lsa, lekin o'rtadagi "o" belgisi istalgan belgi bo'lishi 81 | mumkin. Ushbu casega mos kelsa true qaytaring. 82 | * "abcbob" -> true 83 | * "b9b" -> true 84 | * "bac" -> false 85 | 86 |
87 | 88 |
89 | Lesson 7 (Array) 90 | 91 | * n natural son berilgan. 2 sonining dastlabki n ta darajasidan tashkil topgan massiv hosil qiling va elementlarni 92 | chiqaring. (1, 2, 4, 8 ...) 93 | * n ta elementdan tashkil topgan array berilgan. Uning elementlarini taskari tartibda chiqaruvchi dastur yozing. 94 | * n ta elementdan tashkil topgan array berilgan. Array elementlarini orasidan toqlarini boshqa arrayga yig'ib ekranga 95 | chiqaruvchi dastur yozing. 96 | * n ta elementdan tashkil topgan array berilgan. Array elementlarini orasidan juftlarini boshqa arrayga yig'ib ekranga 97 | chiqaruvchi dastur yozing. 98 | * n ta elementdan tashkil topgan array berilgan. Arraydagi eng katta soni topib ekranga chiqazuvchi dastur yozing. 99 | * n ta elementdan tashkil topgan array berilgan. Arraydagi eng kichikina soni topib ekranga chiqazuvchi dastur yozing. 100 | * n ta elementdan tashkil topgan array berilgan. Arraydagi elementlar orasidan oxirgi local maksimum elementni indeksini 101 | chiqaruvchi dastur yozing. Local maksimum - o'ng va chap qo'shnisidan katta bo'lgan element. 102 | * n ta elementdan tashkil topgan array berilgan. Arrayda qatnashgan sonlardan faqat bittadan chiqaruvchi dastur yozing. 103 | * Berilgan massiv: 7 4 2 3 1 4 5 2 4 7 104 | * Result: 7 4 2 3 1 5 105 | 106 |
107 | 108 |
109 | Lesson 8 (String) 110 | 111 | * Berilgan stringning istalgan joyida "code" qatori necha marta paydo bo'lishini qaytaring countni qaaytaring, bundan 112 | mustasno, biz "d" uchun har qanday harfni qabul qilamiz, shuning uchun "enish" va "cooe" ni hisoblang. 113 | * aaacodebbb -> 1 114 | * codexxcode -> 2 115 | * cozexxcope -> 2 116 | * String berilgan bo'lsa, asl nusxadagi har bir belgi uchun 2ta belgi bo'lgan string qaytaring 117 | * The -> "TThhee" 118 | * AAbb -> "AAAAbbbb" 119 | * Hi-There -> "HHii--TThheerree" 120 | * Berilgan Stringdan necha marta "hi" nechta marta qatnashgan qaytaradigan dastur yozing. 121 | * abc hi ho -> 1 122 | * ABChi hi -> 2 123 | * hihi -> 2 124 | 125 |
126 | 127 |
128 | Lesson 10 (Principles) 129 | 130 | * KISS principle ga bitta mos keladigan dastur yozing. 131 | * DRY principle ga bitta mos keladigan dastur yozing. 132 | * bitta kichikroq dastur yozib ushbu dastur uchun Documentatsiya yozing. 133 | 134 |
135 | 136 |
137 | Extra 138 | 139 | * Tepada otilgan mavzulardan foydalangan holda bitta TODO app yasang to'liq. create, update, delete, list. 140 | 141 | 142 |
143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /exercises/4-module.md: -------------------------------------------------------------------------------- 1 | # To'rtinchi Modul uchun Execsicelar 2 | 3 |
4 | Lesson 1 5 | 6 | * Thread classi orqali thread yarating. 7 | * Runnable interface orqali thread yarating 8 | * Thread va Runnable orqali yangi thread yaratib ularni nomini ekranga chiqazing. 9 | * Runnable run() methodi ichida Thread classni sleep() method ishlatib threadni ishlating. 10 | * Daemon thread o'zinigiz yaratib ishlatib ko'ring. 11 | * Bir nechta threadlarni yarating va ularga 1-10 orlig'ida prioritylar bering. 12 | 13 |
14 | 15 |
16 | Lesson 2 17 | 18 | * Bitta Counter classini yozing. uni ichida bitta field bo'lsin type int va ichida qiymati bitta oshiruvchi bitta method 19 | bo'lsin. 20 | 21 | ```java 22 | public class Counter { 23 | 24 | private int sum = 0; 25 | 26 | public void counter() { 27 | setSum(getSum() + 1); 28 | } 29 | 30 | // Standard getters and setters 31 | } 32 | ``` 33 | 34 | * **Synchronized** keywordidan foydalinib tepadagi methodini qayta yozing. 35 | * **Synchronized** method va blocklardan foydalanib dastur yozing. 36 | * **Race condition** ga misol yozing. 37 | * **Race condition** oldini olish uchun Synchronized keywordidan foydalanib tepadagi classga o'xshagan class yozing. 38 | * **Race condition** oldini olish uchun Lock lardan foydalanib tepadagi classga o'xshagan class yozing. 39 | * **Field Visibility** muammosini xosil qiling va shu muammoni xal qilishda **Volatile** keywordidan foydalanib tepadagi classga o'xshagan class yozing. 40 | * **Deadlock** ga tushuvchi class yozing. 41 | 42 | 43 |
44 | 45 |
46 | Lesson 3 47 | 48 | * Race condition olidini olish uchun Atomic Classlardan foydalanib pastdagi codeni qayta yozing. 49 | 50 | ```java 51 | public class Counter { 52 | 53 | private int sum = 0; 54 | 55 | public void counter() { 56 | setSum(getSum() + 1); 57 | } 58 | 59 | // Standard getters and setters 60 | } 61 | ``` 62 | 63 | * Race condition olidini olish uchun Atomic Classlardan foydalanib dastur yozing. 64 | * Thread-safe collection ishlatgan holda dastur yozing. 65 | * ArrayList thread-safe qilib ushbu collectionni ustida CRUD operastsiyalarni bajaradi dastur yozing. 66 | * Immutable class yozing. 67 | 68 |
69 | 70 |
71 | Lesson 4 72 | 73 | * Istagan bitta Executordan foydalanib tasklarni execute qiladigan class yozing. 74 | * Runnable tasklarni alohida, Callable tasklarni alohida execute qiladigan methodlarni ham yozing. 75 | * Callable tasklarni execute qiladigan dastur yozing va Callabledan qaytgan resultni Future tekshiring agar bajarilgan 76 | bo'lsa ekranga chiqazing. 77 | * Tepada yozgan Callable tasklarni execute qiladigan methodimiz overload qilib qayta yozing va Callabledan qaytgan 78 | resultni Future tekshiring agar bajarilgan bo'lsa ekranga chiqazing 79 | * ThreadLocal foydalanib har bir userni alohida datalarni saqlaydigan class yozing. ThreadLocal classni methodlaridan 80 | foydalaning 81 | 82 |
83 | 84 |
85 | Lesson 5 86 | 87 | * Fork/Join dan foydalanib tasklarni execute qiladigan dastur yozing. 88 | * CompletableFuture foydalanib asynchron ishlaydigan dastur yozing. 89 | * CompletableFuture foydalanib asynchron ishlaydigan calculator yozing. 90 | * Singleton Pattern mos keladigan class yozing. 91 | 92 |
93 | 94 |
95 | Lesson 6 96 | 97 | * Hozirgi vaqtni qaytradigan bir nechta methodlar yozing barcha Time API classlaridan foydalanib 98 | * String qabul qiladigan va LocalDate parse qilib LocalDate qaytaradigan dastur yozing. 99 | * Har 1 minutda ekranga hozirgi vaqtni chiqaruvchi dastur yozing. 100 | * SimpleDateFormat classidan foydalanib Stringni Date parse qiladigan class yozing. 101 | * Time API foydalanib TODO app yozing va taskni vaqti yetib kelganda ekranga habar chiqarsin. 102 | ![todo picture](../statics/img_1.png) 103 |
104 | 105 |
106 | Lesson 7 107 | 108 | * FileReader va FileWriter foydalanib filega yozadigan va o'qiydigan class yozing. 109 | * Object Serialize qilib filega yozing va uni deserialize qilib objectga aylantiring. 110 | * Huddi tepadagi ishni Externalizable bilan qiling. 111 | * transient keywordidan foydalanib serialization bo'ladigan objectni ba'zi fieldlarni qiymatni saqlamang. 112 | * BufferedReader va BufferedWriter foydalanib filega yozadigan va o'qiydigan class yozing. 113 | * File classidan foydalanib file yaratadigan class yozing. Hamda usha yaratilgan filega yozish hamda o'qish 114 | imkoni bo'lsin 115 | * Boshqa filedan textlarini o'qib yangi file yaratib usha filega yozadigan class yozing. 116 | 117 |
118 | 119 |
120 | Lesson 8 121 | 122 | * Presentatsiyada bor. 123 | 124 |
125 | 126 |
127 | Lesson 9 128 | 129 | * cmd orqali githubda repository oching va usha repositoryga fileni yuklang. 130 | 131 |
132 | 133 |
134 | Lesson 10 135 | 136 | * Tepadagi(Lesson-6 dagi) TODO appni ekranga log tashlaydigan qilib qayta yozing. 137 | 138 |
139 | 140 |
141 | Module uchun Mashq 142 | 143 | * Chat App yozing. Barcha ma'lumotlarni fileda saqlang. Authorization qilib keyin chatni ishlata olsin! 144 | email orqali registeratsiya qila olsin faqat. Login ham email orqali bo'ladi regexpdan foydalanib userni barcha 145 | ma'lumotlarni tekshiruvdan o'tkazing. Barcha mufaqiyatli bo'lsa log tashlang. User qachon registeratsiya bo'lgani Time 146 | classlaridan biridan foydalanib filega yozing filedan o'qib usha classga parse qiling. Barcha chatlashuvlarni 147 | ozi bilan qachon yozilganigacha vaqtni saqlab keting. Dastur yozib bo'lganingizdan keyin githubga qo'ying. 148 | 149 |
150 | 151 | -------------------------------------------------------------------------------- /exercises/5-module.md: -------------------------------------------------------------------------------- 1 |
2 | Lesson 1 3 | 4 | 1. O'zinggizni gmailingiz orqali email jo'nating. 5 | 2. mailtrap dan account ochib, ushbu ochgan accountingiz bilan email jo'nating 6 | 3. Jo'natadigan emailingiz html email bo'lib emailingizda image/vedio/audio va attachmentlar ham bo'lsin 7 | 8 |
9 | 10 |
11 | Lesson 2 12 | 13 | 1. **runnable jar** yarating. 14 | 15 |
16 | 17 | 18 |
19 | Lesson 3 20 | 21 | 1. Base64 dan Foydlangan Xolatda Tanasida audio, image va video bo'lgan email jo'nating 22 | 23 | _HTML kodlar_ 24 | 25 | ```html 26 | 27 | 30 | ``` 31 | 32 | ```html 33 | 34 | 37 | ``` 38 | 39 | ```html 40 | 41 | ``` 42 | 43 |
44 | 45 | 46 |
47 | Lesson 7 48 | 49 | 1. **Seeder.jar** degan application yarating. ushbu dastur orqali siz json, sql, va csv fayllar ko'rinishida ma'lumotlarni yaratib olishingiz mumkin bo'lsin. [bu yerda dasturingiz qandey ishlashi ko'rsatilgan](https://drive.google.com/file/d/1TLzS4FIyc5BuZHoTPKlWnjWgmYaQW2sS/view?usp=sharing) 50 | 51 |
52 | 53 |
54 | Lesson 12 55 | 56 | 1. O'zingizni comparatoringizni yozing. HTML dagi **table** ko'rinishida bo'lsin ya'ni quyidagi ko'rinishda 57 | ```html 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 |
IDnamegenderage
1Tarra ProhaskaMALE16
2Allen DickiFEMALE29
3Jack Davis DVMMALE17
86 | ``` 87 | **va natijani xyz.html degan fayl ga qo'yib uni brauser da ochsangiz mana bunday ko'rinishda bo'ladi** 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 |
IDnamegenderage
1Tarra ProhaskaMALE16
2Allen DickiFEMALE29
3Jack Davis DVMMALE17
119 | 120 | 121 | 122 |
123 | 124 |
125 | Lesson 18 126 | 127 | 1. Lesson 7 da qilgan **Seeder.jar** degan dasturingizni telegram botini qiling 128 | ## WARNING JSON,SQL,CSV formatlarning hammasida ma'lumot yaratishning imkoni bo'lsin!! 129 | 130 |
-------------------------------------------------------------------------------- /exercises/6-module(database).md: -------------------------------------------------------------------------------- 1 |
2 | Lesson 1 3 | 4 | 1. PostgreSQL ni o'zingizni komputeringizga o'rnating. 5 | 2. PSQL ga ulangan xolda postgreSQL ni versiyasini tekshiring `select version();` 6 | 7 |
8 | 9 | ------ 10 | 11 |
12 | Lesson 2 13 | 14 | 1. **PSQL yordamida.** AuthUser degan table kiriting va ushbu tableda 15 | * id 16 | * username 17 | * email 18 | * phone 19 | * age 20 | 21 | degan columnlari bo'lsin va ushbu table ustida `insert, select, update, delete` querylarini ishlating 22 | 2. Yuqoridagi 👆 tabledagi username uchun **unique** va email uchun **unique not null** constraint lar qo'shing. 23 | 3. **Todo** degan Table yarating (id, title, owner_id) degan column lari bilan va ushbu **owner_id** ni **AuthUser** ga 24 | **foreign key** bilan uleng. 25 | 26 |
27 | 28 | ------ 29 | 30 |
31 | Lesson 3 32 | 33 | 1. **PSQL yordamida.** AuthUser degan table kiriting va ushbu tableda 34 | * id -> _uuid_ 35 | * username -> _varchar_ 36 | * email -> _varchar_ 37 | * phone -> _varchar_ 38 | * age -> _int_ 39 | * role -> _enum type_ 40 | 41 | degan columnlari bo'lsin va ushbu table ustida `insert, select, update, delete` querylarini ishlating 42 | 43 | # www.hackerrank.com dagi 👇 masalarni yeching 44 | 45 | 3. https://www.hackerrank.com/challenges/revising-the-select-query/problem 46 | 4. https://www.hackerrank.com/challenges/select-all-sql/problem 47 | 5. https://www.hackerrank.com/challenges/japanese-cities-name/problem 48 | 6. https://www.hackerrank.com/challenges/weather-observation-station-1/problem 49 | 50 |
51 | 52 | ------ 53 | 54 |
55 | Lesson 4 56 | 57 | # www.hackerrank.com dagi 👇 masalarni yeching 58 | 59 | 1. https://www.hackerrank.com/challenges/weather-observation-station-1/problem 60 | 2. https://www.hackerrank.com/challenges/more-than-75-marks/problem 61 | 3. https://www.hackerrank.com/challenges/name-of-employees/problem 62 | 63 |
64 | 65 | 66 | ------ 67 |
68 | Lesson 5 69 | 70 | Qandaydir table yarating unda **mail**, **phone**, **password** degan column lari bo'lsin. 71 | * **mail** - strong mail check bo'lsin 72 | * **phone** - `998 + 71, 87, 88, 90, 91, 93, 94, 99 + 7` ta raqamga tekshiradigan bo'lsin 73 | * **password** - xech bo'lmaganda 1 ta kichik harf, 1 ta katta harf, 1 ta kichik raqam va xech bo'lmaganda `@#$%*()` belgilardan 1 ta bo'lsin va uzunligi 8 ta dan uzun bo'lsin. 74 | 75 |
76 | 77 | ------ 78 |
79 | Lesson 6 80 | 81 | Qandaydir table yarating unda **mail**, **phone**, **password** degan column lari bo'lsin. 82 | * **mail** - strong mail check bo'lsin 83 | * **phone** - `998 + 71, 87, 88, 90, 91, 93, 94, 99 + 7` ta raqamga tekshiradigan bo'lsin 84 | * **password** - xech bo'lmaganda 1 ta kichik harf, 1 ta katta harf, 1 ta kichik raqam va xech bo'lmaganda `@#$%*()` belgilardan 1 ta bo'lsin va uzunligi 8 ta dan uzun bo'lsin. 85 | 86 |
87 | 88 | ------ 89 | 90 |
91 | Lesson 11(Project) 92 | 93 | 1. darsdagi **auth_login** va **auth_register** dagi funksiyalarda boshqa barcha funksiyalardagi exceptionlar shu funksiyani chaqiruvchi user ni tilida chiqsin ? 94 | 2. **Vending Machine** ni **procedure** lar va **function** lar dan foydalanib yozing ? 95 | ![vm](../needed_sources/vm.png) 96 | 97 | ## WARNING - BU MASHQ UCHUN TALAB MAVJUD EMAS O'ZINGIZ IJOD QILISHINGIZ KERAK BO'LADI!!!! 98 | 99 |
100 | 101 | ------ 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /exercises/7-module(Jakarta EE).md: -------------------------------------------------------------------------------- 1 |
2 | Lesson 1 3 | 4 | 1. Rasmdagi page ni HTML,CSS dan foydalanib yarating ! 5 | ![example](../needed_sources/jakata_ee_lesson_1_exercise_1_img.png) 6 | 2. Yuqoridagi rasmdagi page ni HTML,BOOTSTRAP dan foydalanib yarating ! 7 | 3. HTML, CSS, JS dan foydalanib calculator yarating ? 8 | 9 |
10 | 11 | ------ 12 | 13 |
14 | Lesson 2 15 | 16 | 1. Qandaydir XYZ Servlet yarating ? 17 | 2. XYZ Servlet ni **xml** va **Annotation** yordamida deployment descriptor ga register qiling ? 18 | 19 |
20 | 21 | ------ 22 | 23 |
24 | Lesson 3 25 | 26 | 1. **_Sonni_** **Istalgan sanoq sistemasidan** (_2,8,10,16_) **Istalgan sanoq sistemasiga** (_2,8,10,16_) o'tkazadigan 27 | dasturni JSP va Servlet lardan foydalangan xolda yarating ! 28 | 29 |
30 | 31 | ------ 32 | 33 |
34 | Lesson 4 35 | 36 | 1. Rasmlar Galeriyasi Dasturini Yarating 37 | * Rasm Yuklay Oling 38 | * Va Yuklangan Barcha Rasmlarni gallery.jsp file da ko'rsatib bering. 39 | 40 | ![gallery](../needed_sources/gallery.png) 41 | 42 |
43 | 44 | ------ 45 | 46 |
47 | Lesson 5 48 | 49 | # OGOHLANTIRISH (quyidagi topshiriqlarni bajarishda ma'lumotlarni database ga yozish uchun JDBC API dan foydalanib yozing) 50 | 51 | 1. **Guruh** nomli class yarating va darsdagi book uchun qilingan **crud** kabi guruh ustida crud amalini bararuvchi 52 | dastur tuzing ! 53 | * **Guruh** classida [_guruh nomi, guruh id, qachon yaratilganligi,talabalar soni_] kabi **field** lari 54 | bo'n ! 55 | 2. **Talaba** nomli class yarating va darsdagi book uchun qilingan **crud** kabi guruh ustida crud amalini bararuvchi 56 | dastur tuzing ! 57 | * **Talaba** classida [_talaba id, qachon yaratilganligi,talabani toliq ismi , talabani yoshi, guruh id si(qaysi 58 | guruhda o'qishligini ko'rsatib turishi uchun)_] kabi **field** lari bo'lsin ! 59 | 60 | ## Masalan 👇👇👇👇 61 | 62 | ````java 63 | import java.time.LocalDateTime; 64 | 65 | class Group { 66 | private String id; 67 | private String name; 68 | private LocalDateTime createdAt; 69 | private int studentCount; 70 | // constructors, getters, setters 71 | } 72 | 73 | class Student { 74 | private String id; 75 | private String fullName; 76 | private LocalDateTime createdAt; 77 | private String groupID; 78 | private int age; 79 | // constructors, getters, setters 80 | } 81 | ```` 82 | 83 |
84 | 85 | ------ 86 | 87 |
88 | Lesson 6 89 | 90 | # OGOHLANTIRISH (quyidagi topshiriqlarni bajarishda ma'lumotlarni database ga yozish uchun JDBC API dan foydalanib yozing) 91 | 92 | 1. **User** nomli class yarating va darsdagi book uchun qilingan **crud** kabi guruh ustida crud amalini bararuvchi 93 | dastur tuzing ! 94 | * **User** classida [_user id, username_] kabi **field** lari bo'lsin ! 95 | 96 | # Masalan 97 | 98 | ````java 99 | class User { 100 | private String id; 101 | private String username; 102 | //constructors, getters, setters 103 | } 104 | ```` 105 | 106 | 2. **Login Servlet yarating !** 107 | * **LoginServlet** ning **doGet** methodida `/views/login.jsp` ga forward qiling. 108 | * `/views/login.jsp` da 👇👇👇 quyidagiday username ni kiritsin ! ![img](../needed_sources/loginform.png) 109 | * Login button bosilganda **LoginServlet** ning **doPost** methodiga request ketsin va o'sha yerda database dan 110 | username orqali user topib **user id** session ga yozib qoyilsin. 111 | 112 | 3. 5-darsning uyga vazifasidagi code lardan foydalaning va guruh yaratiladigan servlet ga hamda talaba yaratiladigan 113 | servlet ga filter qo'ying, **Agar** session da **user id** bo'lmasa login page redirect qiling va u yerda login 114 | qiling (**tepada o'zingiz yozgan login page ga**). 115 | 4. 5-darsning uyga vazifasidagi Guruh va Talaba class lariga **createdBy**(kim tomonidan yaratilganligi) degan field 116 | qo'shing va talaba yoki guruh yaratilayotgan payt **user_id** ni ushbu (talaba/guruh) objectlarning **createdBy** 117 | degan fieldiga set qilib database yozing. 118 | 119 |
120 | 121 | ------ 122 | 123 |
124 | Lesson 7 125 | 126 | 1. Lesson 5 dagi vazifalarni database bilan bo'ladigan aloqalarni JPQL dan foydalanib bajaring ! 127 | 128 |
129 | 130 | 131 | ------ 132 | 133 |
134 | Lesson 8 135 | 136 | 1. ManyToMany Bo'glanish ga bitta misol yozing ! 137 | 2. Lesson 6 dagi barcha database bilan bo'ladigan aloqalarni JPQL dan foydalaning ! 138 | 139 |
140 | 141 | ------ 142 | 143 |
144 | Lesson 9 145 | 1. Lesson 6 dagi barcha database bilan bo'ladigan aloqalarda Jakarta Bean Validation dan foydalaning ! 146 | 147 | # masalan 148 | 149 | * Yangi talaba yaratayotgan paytingizda ! 150 | * Talabani update qilayotgan paytingizda ! 151 | * Yangi Guruh yaratayotgan paytingizda ! 152 | * Guruhni update qilayotgan paytingizda ! 153 | 154 | # OGOHLANTIRISH (Vazifalarni JPQL dan foydalanib bajaring) 155 | 156 |
157 | 158 | 159 |
160 | Lesson 10 161 | 1. Video da aytib ketilgan ! 162 |
163 | 164 | 165 | -------------------------------------------------------------------------------- /exercises/8-module(Spring Core).md: -------------------------------------------------------------------------------- 1 |
2 | Lesson 1 (Introduction) 3 | 4 | * **Store** va **Item** nomli classlarni yozing. Store Classida Item classni fieldi sifatida e'lon qiling. 5 | * XML Based konfiguratsiya bilan tepada yozilgan 2ta classni beanga aylantiring. 6 | * **Store** va **Item** **bean** larini **SI** va **DI** bilan bog'lang. 7 | * **SI** va **DI** ni amalga oshirayotgan vaqtingizda **c** va **p** **namespace** lardan foydalaning. 8 | * Yuqoridagi **Class** lardan **bean** lar yasash hamda ularni **wire** qilishda **Java Config** ham **Auto Config** 9 | usullaridan ham foydalaning. 10 | * **Student** nomli **bean** yarating va uni ichida fanlarni **List** va xar bitta fan va uni bahosini saqlaydigan **Map 11 | ** fieldlari bo'lsin. 12 | 13 |
14 | 15 | ------ 16 | 17 | 18 | 19 |
20 | Lesson 2 (Bean Scope, SpEL) 21 | 22 | * XML Based konfiguratsiyadan foydalanib **City** nomli beani yarating va uni 3ta field 23 | bo'lsin `name`, `numberOfPeople`, `size` va ushbu bean scope ni prototype qiling. 24 | * `city.properties` degan file dan yuqorida `city` `bean ini` `field` lariga qiymatlarni **SpEL** dan foydalangan xolda 25 | bering. 26 | * Tepada aytib o'tilgan 2ta vazifani **Java Config** bilan amalga oshiring. 27 | 28 | # Example 29 | 30 | ```java 31 | 32 | @Component 33 | public class SomethingBean { 34 | 35 | @Value("#{1 + 2}") 36 | public int somethingValue; 37 | 38 | // ... 39 | } 40 | ``` 41 | 42 |
43 | 44 | 45 | 46 | ------ 47 | 48 |
49 | Lesson 3 (AOP) 50 | 51 | * `Transform` nomli class yarating va uni ichida **1..10** gacha bo'lgan sonlarni ekranga chiqaruvchi start() 52 | nomli `method` 53 | yozing va ushbu `method` chaqirilganda `method` bajarilishidan oldin va keyin log tashlaydigan dastur yozing. XML 54 | Based 55 | konfiguratsiyadan foydalanib. _**Before**, **After** va **AfterReturning** **Advice** laridan foydalaning_. 56 | * `Transform` `class` ni start `method` chaqirilganda endi `exception` sodir bo'lsa log tashlaydigan dastur yozing. 57 | * Va Yuqoridagi Topshiriqlarni **Java Config** yordamida amalga oshiring. 58 | 59 | # Example 60 | 61 | ```java 62 | 63 | @Aspect 64 | @Component 65 | public class TransformAspect { 66 | // ... 67 | } 68 | ``` 69 | 70 |
71 | 72 | ------ 73 | 74 |
75 | Lesson 4 (Spring MVC) 76 | 77 | * `Todo` hamda `TodoController` degan `class` lar yarating. 78 | * `TodoController` da `Todo` larni `List` tini saqlovchi field bo'lsin. 79 | * `/todos` degan `api` yarating va undan todo larni `list` tini `html table` ga chizib response sifatida qaytaring. 80 | * # THMELEAF VA HTML FAYLLARDAN FOYDALANILMASIN ! 81 | 82 |
83 | 84 | ------ 85 | 86 |
87 | Lesson 5(Thymeleaf) 88 | 89 | * **Todo Application** yarating. 90 | 91 | ```java 92 | import java.time.LocalDateTime; 93 | 94 | class Todo { 95 | private Integer id; 96 | private String title; 97 | private String priority; 98 | private LocalDateTime createdAt; 99 | // constructors 100 | // getters and setters 101 | } 102 | ``` 103 | 104 | * `todo` qo'shadigan, `todo` ni o'chiradigan qiladigan, `todo` ni update qiladigan `page` yarating. 105 | * `todo` ni larni listini ko'rsatadigan `html page` yarating va shu `page` da `todo` larni listini chizing ! 106 | * `todo` listalarida eng oxirigi qo'shilgan todo eng biringchilikda chiqsin. 107 | 108 | # Todo lar List DA saqlansin DataBase da emas 109 | 110 |
111 | 112 | ------ 113 | 114 |
115 | Lesson 6(Spring JDBC) 116 | 117 | * Lesson 5 dagi vazifani `JdbcTemplate` bilan qiling ! 118 | * Lesson 5 vazifasidagi `insert` larni `SimpleJDBCInsert` bilan qiling qolgan operation larda(_delete, update, 119 | select_) `JdbcTemplate` dan foydalaning ! 120 | * Lesson 5 dagi vazifani `NamedParameterJdbcTemplate` bilan qiling ! 121 | * Lesson 5 dagi vazifani `SimpleJDBCCall` bilan qiling ! (`database` da _save, delete, update, getAll_ degan `function` 122 | lar yaratishingiz kerak bo'ladi.!) 123 | 124 |
125 | 126 | ------ 127 | 128 |
129 | Lesson 7(Spring Security) 130 | 131 | * Lesson 6 dagi vazifaga `spring security` ni qo'shing. 132 | * User `Login` va `Register` qilishi uchun `page` va `controller` lar yarating. 133 | * Xar Bir `USER` o'ziga tegishli bo'lgan todo lar ustidagina `CRUD` amalini bajara olsin. 134 | * Dastur da `USER` ham da `ADMIN` degan `Rollar` bo'lsin `ADMIN` lar oddiy userlar qila oladigan ishlarni qila olish 135 | bilan birga oddiy user larni `block` ham qila olsin. `block` langan userlar `login` qila olmasin. 136 | 137 |
138 | 139 | ------ 140 | 141 |
142 | Lesson 8(Upload and Download) 143 | 144 | * Lesson 7 dagi vazifaga `user register` qilayotgan payt da `profil` uchun rasm ham yuklang. 145 | * Va yuklangan rasm doyim `Login` qilinganidan keyin Barchar `Page` larda `navbar` da chiqib tursin kichik qilib. 146 | * Va shu `application` ni `localization` qiling. 147 | 148 |
149 | 150 | ------ 151 | 152 |
153 | Lesson 9(Error Handling, Validation, Filter and Interceptor) 154 | 155 | * Lesson 8 dagi vazifada `register user` qilayotgan vaqtingizda formaga validation qo'shing. Va Ma'lum tekshiruvlardan 156 | o'ta olmasaxatolik xabarini chiqaring. 157 | * Lesson 8 dagi vazifada `create todo` qilayotgan vaqtingizda formaga validation qo'shing. Va Ma'lum tekshiruvlardan 158 | o'ta olmasaxatolik xabarini user ni `til`ida chiqaring. 159 | * Masalan `/todos/2` ga `request` jo'natilganda agar `id` si `2` ga teng bo'lgan `todo` 160 | topilmasa `TodoNotFoundException` ni `throw` qiling va shu `TodoNotFoundException` uchun `ExceptionHandler` yozing. 161 | 162 |
163 | 164 | ------ 165 | 166 |
167 | Lesson 10( Project ) 168 | 169 | **Weather Service**. Ob havo ma'lumotlarni beruvchi dastur yozing. Ushbu dasturda **Admin** va **User** 170 | alohida API lar bo'ladi. Ob havo ma'lumotlarni **Admin**lari tomonidan yaratiladi va databaseda saqlanadi, so'ralganda 171 | databasedan olib keladi. Hech qanday API dan olib kelinmaydi. 172 | 173 | * Admin API 174 | * `User List` - barcha userlarni list olishi mumkin 175 | * `User Detail` - user qaysi citylarga subscribe bo'lgani ro'yxatni va userga tegishli ma'lumotlarni olishi mumkin. 176 | * `User Edit` - user edit qilishi ham mumkin. 177 | * `Cities List` - Citylarni list olishi ham mumkin. 178 | * `Edit City` - City edit qila olishi ham mumkin. 179 | * `Add City` - City qo'sha olishi ham mumkin. 180 | * User API 181 | * `Register` - user registeratsiya qilib keyin API foydalana olishi kerak. 182 | * `Login` - username va password orqali login qiladi. 183 | * `Cities List` - City larni list olishi mumkin. 184 | * `Subscribe To City` - City subscribe qila olishi mumkin. 185 | * `Get Subscriptions` - Subscribe bo'lgan Citylarni faqat ob havo ma'lumotlarni olishi mumkin. 186 | 1 kunlik, 1 haftalik va 1 oylik 187 |
188 | 189 | ------ 190 | -------------------------------------------------------------------------------- /interviewquestions/1-module.md: -------------------------------------------------------------------------------- 1 | # Birinchi Modul uchun Intervyu Savollar 2 | 3 |
4 | Lesson 1 (Introduction to Java) 5 | 6 | * Computer program nima ? 7 | * Nima uchun hamma dasturlashni o'rganishi kerak ? 8 | * Java birinchi nomi nima edi ? 9 | * Java nechta featurelar bor ? 10 | * Compiler nima ? 11 | * Interpreter nima ? 12 | * JDK nima ? 13 | * JLS nima ? 14 | * JRE nima ? 15 | * JVM nima ? 16 | * Devtools nima ? 17 | * JDK components ? 18 | * Bytecode nima ? 19 | 20 |
21 | 22 | 23 |
24 | Lesson 2 (Data Types) 25 | 26 | * Token nima ? 27 | * Translation unit nima ? 28 | * Java-da Tokenlarni nechta type mavjud ? 29 | * Java-da Character Set nima ? 30 | * Identifiers nima va Identifiers qoidalari ? 31 | * Java-da Nechi xil turdagi commentlar bor ? 32 | * Java-da nechta keywordlar bor ? 33 | * Java-da nechta turdagi variablelar mavjud ? 34 | * Java-da primative type bilan non-primative nima farqi bor ? 35 | * Variable scope nima ? 36 | * Java-da qancha scopelar mavjud ? 37 | * Java-ni nechinchi versisyasidan Scanner qo'shilgan ? 38 | * Scanner class qanday resourcelardan ma'lumotlarni o'qiy oladi ? 39 | * Java-da nechi xil turdagi data type bor? 40 | * Scanner bug ? 41 | * Console class nima ? 42 | * Javani nechinchi versiyasida Console taqdim etilgan ? 43 | * Scanner va Console o'rtasidagi farq ? 44 | * Scanner class va undan foydalanish 45 | 46 |
47 | 48 |
49 | Lesson 3 (Operators) 50 | 51 | * Java-da Operator nima ? 52 | * Operandlar soniga qarab Operatorlar nechi turga bo'linadi ? 53 | * Unary operator nima ? 54 | * Binary operator nima ? 55 | * Ternary operator nima ? 56 | * Expression nima ? 57 | * Java-da named operator nima ? 58 | * Java-da Arithmetic operator nima ? 59 | * Java-da Arithmetic operationlarni priotiry levellar qanday ? 60 | * Java-da Relational operatorlar nima? 61 | * Java nechta turdagi Relation operatorlarni qo'llab quvvatlaydi ? 62 | * Java-da Logical operatorlar nima ? 63 | * Java nechta turdagi Logical operatorlarni qo'llab quvvatlaydi ? 64 | * Java-da Assignment operator nima ? 65 | * x += y va x = x + y expressionlari o'rtasida farq bormi? 66 | 67 |
68 | 69 |
70 | Lesson 4 (Flow Control Statements) 71 | 72 | * Execution Flow nima ? 73 | * Control Flow nima? 74 | * if nima ? 75 | * if nima uchun ishlatamiz ? 76 | * Loop nima? 77 | * Loop nima uchun ishlatamiz ? 78 | * Java-da Control Flow ning nechi xil turi mavjud ? 79 | * Switch statement qanday ishlaydi ? 80 | * Unicode system nima uchun kerak ? 81 | * ansi escape code nima ? 82 | 83 |
84 | 85 |
86 | Lesson 5 (Function and Method) 87 | 88 | * Function nima ? 89 | * Function va Method o'rtasidagi farq nima ? 90 | * Method Definition nima ? 91 | * Method Declaration (header) nima ? 92 | * Method Signature nima ? 93 | * Method body nima ? 94 | * Stack nima ? 95 | * Stack Frame nima ? 96 | * Recursion nima ? 97 | * Method qachon recursive method deb ataladi ? 98 | * Group of recursions ? 99 | * Type of recursions ? 100 | 101 |
102 | 103 |
104 | Lesson 6 (String Part 1) 105 | 106 | * Java-da String nima ? 107 | * Java-da String ni nechi xil usulda yaratishimiz mumkin ? 108 | * Java-da String nima uchun immutable ? 109 | * Java-da String classning superclassni nima? 110 | 111 |
112 | 113 |
114 | Lesson 7 (Array) 115 | 116 | * Array nima ? 117 | * Java-da Arrayni qanday e'lon qilishimiz mumkin ? 118 | * Turli data typelar uchun Arrayning default qiymat qanday ? 119 | * Java-da Array yaratilgandan keyin uni size ni o'zgartira olamizmi ? 120 | * Arrayni size ni manfiy raqam belgilay olamizmi ? 121 | * Arrayni array size siz e'lon qila olamizmi ? 122 | * Array JVM xotirasi qayerida saqlanadi ? 123 | * Java-da primative Array JVM qaysi xotirasida saqlanadi ? 124 | * ArrayStoreException nima ? Bu exception qachon tashlanadi ? 125 | * Java-da anonymous Array nima? misol keltiring ? 126 | * Agar arrayni initialize qilmasangiz nima bo'ladi ? 127 | * Java-da Jagged Array nima ? 128 | * Array ni afzalliklari nimada ? 129 | * Array ni kamchiliklari nimada ? 130 | 131 |
132 | 133 | 134 |
135 | Lesson 8 (String Part 2) 136 | 137 | * Java-da String Constant pool nima ? 138 | * Java-da String literal nima ? 139 | * String literal xotirada qanday saqlanadi ? 140 | * Nima uchun Java String literaldan foydalanadi ? 141 | * Quyidagi code da nechta object yaratiladi ? 142 | 143 | ```java 144 | String s = new String("Hello"); 145 | ``` 146 | 147 | * Quyidagi code da nechta object yaratiladi ? 148 | 149 | ```java 150 | String s1 = new String("Scientech"); 151 | String s2 = new String("Scientech"); 152 | String s3 = "Scientech"; 153 | String s4 = "Scientech"; 154 | ``` 155 | 156 | * String class qanday interfacelardan implement olgan ? 157 | * String Thread-safe mi ? 158 | * String classni kamchiliklari ? 159 | * String wrapper classmi ? 160 | * String intern() method nima uchun ishlatiladi ? 161 | 162 |
163 | 164 |
165 | Lesson 9 (String Formatting) 166 | 167 | * Java-da Formatting nima ? 168 | * String classni format() method javani nechinchi versiyasida taqdim etilgan ? 169 | * String classni format method qachon ishlatishimiz kerak ? 170 | * '%s' belgisini nima uchun ishlatamiz ? 171 | * Java-da MessageFormat class nima uchun ishlatamiz ? 172 | * MessageFormat format() method nima ? 173 | 174 |
175 | 176 |
177 | Lesson 9 (Formatting) 178 | 179 | * string format methodiga bitta misol yozing. 180 | * string format method foydalanib kirib kelgan strngga "Welcome to " qo'shimchasini qo'shib ekranga chiqaruvchi dastur 181 | yozing. 182 | 183 |
184 | 185 |
186 | Lesson 10 (Principles) 187 | 188 | * Programming Principles nima ? 189 | * Qanday qilib effective code yozasiz ? 190 | * DRY nima ? 191 | * KISS nima ? 192 | 193 |
-------------------------------------------------------------------------------- /interviewquestions/10-module(Spring Boot Part ||).md: -------------------------------------------------------------------------------- 1 | # Interview question 2 | 3 | # Lesson 1 4 | 5 | * `MongoDB` nima ? 6 | * `NoSQL` nima ? 7 | * Qanday application larda `MongoDB` ni ishlatish kerak ? 8 | * `MongoDB` da `Collection` nima ? 9 | * `MongoDB` da `Document` nima ? 10 | * `MongoDB` ma'lumotlarni qanday ko'rinishda saqlaydi ? 11 | * `MongoDB` dagi qanday qilib malumotlarni qismlarga bo'lib o'qish mumkin ? 12 | * `MongoDB` dagi `Comparison Query Operator` larni va ularning vazifalari ayting ? 13 | * `MongoDB` dagi `Logical Query Operator` larni va ularning vazifalari ayting ? 14 | * `MongoDB` dagi `Element Query Operator` larni va ularning vazifalari ayting ? 15 | * `MongoDB` dagi `Array Query Operator` larni va ularning vazifalari ayting ? 16 | * `MongoDB` dagi `Document Manipulating Query Operator` larni va ularning vazifalari ayting ? 17 | * `Aggregation pipeline` nima ? 18 | * `Collection` lardagi `distinct` method nima ? 19 | * `MongoDB` da `unique index` qanday yaratiladi ? 20 | * `MongoDB` da `user` qanday yaratiladi ? 21 | 22 | # Lesson 2 23 | 24 | * `Java Application` dan turing qandey qilib `MongoDB` ga bog'lanish mumkin. 25 | * ushbu `mongodb-driver-sync` library ning asosiy class larni ayting ? 26 | * `mongodb-driver-sync` dan qanday qilib ma'lumotlarni sort qilish mumkin. 27 | * `Spring Data MongoDB` qanday project ya'ni `mongodb-driver-sync` dan nima ustunligi bor ? 28 | * `@Id` `annotation` vazifasi nima 29 | * `@Field` `annotation` vazifasi nima ? 30 | * `@Indexed` `annotation` vazifasi nima ? 31 | * `MongoTemplate` qanday class ? 32 | * Qanday qilib ma'lumotlarni `database` `Paged` qilib o'qish mumkin ? 33 | 34 | # Lesson 3 35 | 36 | * `External API` lardan foydalanish nima uchun kerak bo'ladi ? 37 | * `RestTemplate` ni vazifasi nima ? 38 | * `WebClient` ni vazifasi nima ? 39 | * `RestTemplate` va `WebClient` ni nima farqi bor ? 40 | * `OpenFeign` nima ? 41 | * `Traverson` `class` ning vazifasi nima ? 42 | 43 | # Lesson 4 44 | 45 | * Database Migration nima ? 46 | * Database migration nima uchun muhim ? 47 | * `Flyway` nima ? 48 | * `Repeatable` migration nima ? 49 | * `Versioned` migration nima ? 50 | * `Undoable` migration nima ? 51 | * `Liquibase` nima ? 52 | * `Changelog` nima ? 53 | * `ChangeSet` nima ? 54 | * `Flyway` va `Liquibase` ni farqi nima ? 55 | 56 | # Lesson 5 57 | 58 | * `Event Oriented Programming` nima ? 59 | * `EOP` dan nima maqsad da foydalansak bo'ladi ? 60 | * `Spring DA EOP` ni qanday amalga oshiramiz ? 61 | * `Spring Events` nima ? 62 | * **ApplicationEventPublisher** qanday class. 63 | * `@EventListener` **annotatsiya** sini vazifasi nima ? 64 | * `@TransactionalEventListener` **annotatsiya** sini vazifasi nima ? 65 | * `Spring` `da` `EOP` bilan qanday muammolar bo'lishi mumkin va qanday qilib ushbu muammolarni xal qilish mumkin ? 66 | 67 | # Lesson 6 68 | 69 | * `Cache` nima ? 70 | * Nima uchun `REST arxitectura`sida `cache` muhim tushuncha xisoblanadi ? 71 | * `CacheManager` qanday `interface`. 72 | * Qanday `Request(GET, POST, DELETE........)` lar `cache` lanishi kerak ? 73 | * Qachon `cache` dan foydalanmaslik kerak ? 74 | * `Redis` nima ? 75 | * `Spring` da qanday qilib `Cache` dan foydalansak bo'ladi ? 76 | 77 | # Lesson 7 78 | 79 | * `Manual Testing` nima ? 80 | * `Manual Testing` ni nimasi no'to'ri , nima uchun `Manual Testing` qilmaslik kerak ? 81 | * `Auto Testing` nima ? 82 | * `blackbox Test` nima ? 83 | * `whitebox Test` nima ? 84 | * `Unit Test` nima ? 85 | * `Unit Test` ning vazifasi nima ? 86 | * `Unit Test` ning afzalliklari nima ? 87 | * Qanday `unit testing framework` larni bilasiz ? 88 | * `junit` nima ? 89 | * `test reporting` uchun qanday `plugin` larni bilasiz ? 90 | * **F.I.R.S.T** nima ? 91 | * `TDD` nima ? 92 | * `Mocking` nima ? 93 | * Qanday `Mocking framework` larni bilasiz ? 94 | 95 | # Lesson 8 96 | 97 | * `Mockito` nima ? 98 | * `Spring` da qanday `Test` yozish uchun `Annotation` larni bilasiz ? 99 | * `Integration Testing` nima ? 100 | * `@SpringBootTest` annotation ni vazifasi nima ? 101 | * `@DataJpaTest` annotation ni vazifasi nima ? 102 | * `@WebMvcTest` annotation ni vazifasi nima ? 103 | 104 | # Lesson 9 105 | 106 | * `Spring Shell` qanday project ? 107 | * `jline` nima ? 108 | 109 | # Lesson 10 110 | 111 | * `Rest` Arxitekturasida qanday cheklovlar bor ? 112 | * `GraphQL` nima ? 113 | * `Schema` nima ? 114 | * `SDL` nima ? 115 | * `GraphQL` qanday til xisoblanadi(`static` yoki `dynamic`) ? 116 | * `graphiql` nima ? 117 | * Qanday `Root Operation Type` larni bilasiz ? 118 | * `MutationMapping` bilan `SchemaMapping` ni nima farqi bor ? 119 | * `QueryMapping` bilan `SchemaMapping` ni nima farqi bor ? 120 | 121 | 122 | -------------------------------------------------------------------------------- /interviewquestions/5-module.md: -------------------------------------------------------------------------------- 1 | # Beshinchi Modul uchun Intervyu Savollar 2 | 3 |
4 | Lesson 1 (Mailing) 5 | 6 | * SSL nima ? 7 | * TLS nima ? 8 | * SMTP nima ? 9 | 10 |
11 | 12 |
13 | Lesson 2 (Jar Files) 14 | 15 | * jar fayl nima ? 16 | * jar fayl dan foydalanishni foydali tomonlari ? 17 | * **manifest** fayl qanday fayl ? 18 | * **manifest** fayl nima uchun kerak ? 19 | * **executable** jar qanday jar ? 20 | 21 |
22 | 23 |
24 | Lesson 3 (Base64) 25 | 26 | * Base64 nima ? 27 | * Base64 encoding and decoding nima uchun kerak ? 28 | * Base64 encoding and decoding jarayoni qandey amalga oshiriladi ? 29 | * Base64 xar bir belgi uchun nechchi bayt xotiradan joy egallaydi ? 30 | * URL Base64 nima ? 31 | * MIME Base64 nima ? 32 | 33 |
34 | 35 |
36 | Lesson 4 (Maven) 37 | 38 | * Maven nima ? 39 | * Maven nima uchun kerak bo'ladi ? 40 | * Dependency larda scope nima ma'noni anglatadi 41 | 42 |
43 | 44 |
45 | Lesson 5/6 (Lombok) 46 | 47 | * Lombo ni vazifasi nima ? 48 | 49 |
50 | 51 |
52 | Lesson 7 (Faker) 53 | 54 | * JavaFaker Library nima uchun ishlatiladi ? 55 |
56 | 57 |
58 | Lesson 8 ( behavior parameterization ) 59 | 60 | * **Behaviour parametrization** nima ? 61 | * **Behaviour parametrization** qanday muammolarni xal qiladi ? 62 | * **Lambda expression** nima ? 63 | * **Lambda expression** larda qanday qoidalar mavjud ? 64 | * **Final** hamda **Effectively final** o'zgaruvchilarning farqi nimada ? 65 | * Qayerlarda **Lambda** ni ishlatgan to'gri bo'ladi ? 66 | 67 |
68 | 69 |
70 | Lesson 9 ( functional interfaces ) 71 | 72 | * **Functional Interface** qanday interface ? 73 | * **@FunctionalInterface** annotatsiyasini vazifasi nima ? 74 | * **Predicate** vazifasi nima ? 75 | * **Consumer** vazifasi nima ? 76 | * **Function** vazifasi nima ? 77 | * **Supplier** vazifasi nima ? 78 | * **UnaryOperator** vazifasi nima ? 79 | * **BinaryOperator** vazifasi nima ? 80 | * **Primitive Functional InterFace** nima uchun kerak ? 81 | * **Primitive Functional InterFace** qanday vaziyatlarda ishlatiladi ? 82 | * **Method Reference** nima ? 83 | * **Method Reference** ni qanday turlari bor ? 84 | * **Constructor as method reference** nima ? 85 | 86 |
87 | 88 | 89 |
90 | Lesson 10 ( Introduction To Streams ) 91 | 92 | * **Imperative Coding** nima ? 93 | * **Declarative Coding** nima ? 94 | * **Declarative Coding** ga misollar ? 95 | * **Stream** nima ? 96 | * **Stream API** nima ? 97 | * **Stream** larning **Collection** lardan farqi nima ? 98 | * **Stream** yaratish usullari ? 99 | * Qanday **Stream Operator** lari mavjud? 100 | * **Intermediate Operator** lar qanday operatorlar ? 101 | * **Terminal Operator** lar qanday operatorlar ? 102 | * **Intermediate Operator** lar necha turga bo'linadi ? 103 | * **Stateless operator** lar qanday operatorlar ? 104 | * **Stateful operator** lar qanday operatorlar ? 105 | 106 |
107 | 108 |
109 | Lesson 11 ( Stream API ) 110 | 111 | * **Stream API** nima ? 112 | * **.stream() va .parallelStream()** lar qanday farq qiladi ? 113 | * Nima uchun **String Lazy** deyiladi ? 114 | 115 |
116 | 117 | 118 |
119 | Lesson 12 ( Comparator and Collectors ) 120 | 121 | * **Comparator** nima ? 122 | * Jdk 1.8 da **Comparator** ga qanddey o'zgarishlar kiritildi ? 123 | * **Collector** nima ? 124 | * **Collector** lar **terminal** operatorlarmi ? 125 | * **Collector** lar qandey ishlaydi ? 126 | 127 |
128 | 129 |
130 | Lesson 13 ( Predefined Collectors ) 131 | 132 | * **Collector** larning qandey turlarini bilasiz va ular qandey vaziyatlarda ishlatiladi ? 133 | * **Primitive Stream** lar qandey **stream** lar ? 134 | * **Primitive Stream** larga misollar ayting ? 135 | 136 |
137 | 138 |
139 | Lesson 14 ( Networking(HttpClient) ) 140 | 141 | * **URL** va **URLConnection** **class** lari qandey **class** lar ? 142 | * nima uchun **URL** va **URLConnection** **class** lari bo'lsa ham yangi **http api** java ga qo'shildi (ya'ni _HttpClient_)? 143 | * **HttpClient** nima ? 144 | * **HttpClient** ni eski **_Networking API_** (**_URLConnection_**) dan afzalligi nimada ? 145 | 146 |
147 | 148 |
149 | Lesson 15 ( Gson ) 150 | 151 | * **GSON** library si nima uchun kerak ? 152 | * **Custom Serializer** va **Custom Deserializer** nima uchun kerak ? 153 | * **TypeAdapter** nima ? 154 | 155 |
156 | 157 |
158 | Lesson 16 ( Reflections API ) 159 | 160 | * **reflection** nima ? 161 | * **reflection api** nima uchun kerak ? 162 | * **reflection api** ni asosiy **class** lari qaysi **class** lar ? 163 | * **reflection api** ni qachon ishlatish kerak ? 164 | 165 |
166 | 167 |
168 | Lesson 17 ( Annotations ) 169 | 170 | * Java da **Annotation** nima ? 171 | * **Annotation** larni qanday turlari bor ? 172 | * **@Override** annotatsiyasini vazifasi nima ? 173 | * **@FunctionalInterface** annotatsiyasini vazifasi nima ? 174 | * **@Deprecated** annotatsiyasini vazifasi nima ? 175 | * **@SuppressWarnings** annotatsiyasini vazifasi nima ? 176 | * **@SafeVarargs** annotatsiyasini vazifasi nima ? 177 | * Qanday qilib **Custom Annotation** yaratish mumkin ? 178 | 179 |
-------------------------------------------------------------------------------- /interviewquestions/6-module(database).md: -------------------------------------------------------------------------------- 1 | # Lesson 1 2 | 3 | * Ma'lumotlar ombori(Database) nima ? 4 | * DBMS nima ? 5 | * DBMS ni qandey turlari bor ? 6 | * RDBMS nima ? 7 | * DBMS bilan RDBMS ni nima farqi bor ? 8 | * SQL nima ? 9 | * Query nima ? 10 | * SQL ni qandey elementlari bor ? 11 | * DDL nima ? 12 | * DML nima ? 13 | * TCL nima ? 14 | * DQL nima ? 15 | * Client Server model nima ? 16 | * Postgresql uchun qandey client larni bilasiz ? 17 | 18 | # Lesson 2 19 | 20 | * Table nima ? 21 | * upsert nima ? 22 | * PSQL dagi qandey muhim command larni bilasiz ? 23 | * Constraint nima ? 24 | * PostgreSQL da qanday constraint lar bor ? 25 | * foreign key constraint nima ? 26 | * unique constraint nima ? 27 | * check constraint nima ? 28 | * not null constraint nima ? 29 | * primary key constraint nima ? 30 | 31 | # Lesson 3 32 | 33 | * **PostgreSQL** da qandey raqamli tip lar bor ? 34 | * **timestamp** va **timestamptz** nima farqi bor ? 35 | * Qanday usullarda **uuid** yaratsa bo'ladi ? 36 | * **hstore** qayday ma'lumot turi xisoblanadi ? 37 | * **json** da **->** va **->>** farqlari nima ? 38 | * qanday usullar da **custom** data tip yaratish mumkin ? 39 | * **domain** bilan **type** ni nima fariq bor ? 40 | * **sequence** nima ? 41 | * **generated as identity** nima ? 42 | * **temp** yoki **temporary** table qanday table ? 43 | * **copy table** qanday table ? 44 | 45 | # Lesson 4 46 | 47 | * column alies nima ? 48 | * **order by clause** ni tushuntiring ? 49 | * **distinct** nima ? 50 | * **between** operaatori nima uchun kerak ? 51 | * **like** va **ilike** operatorlarini faqri qanday 52 | * **all**, **any**, **exists** vazifalari, nima maqsadlar da ishlatiladi ? 53 | 54 | # Lesson 5 55 | 56 | * **CONCAT_WS** funksiyasini vazifasi nima ? 57 | * **to_date** funksiyasini vazifasi nima va qandey ishlaydi ? 58 | * **like** va **ilike** ni farqi nima ? 59 | * **similar to** ning vazifasi nima ? 60 | * **posix regular expression** ning vazifasi nima ? 61 | 62 | # Lesson 6 63 | 64 | * **GROUP BY Statement** qachon ishlatiladi(nima uchun kerak) ? 65 | * **GROUP BY Statement** sintaksisi qanday ? 66 | * **Having clause** qachon ishlatiladi ? 67 | * **Having clause** sintaksisi qanday ? 68 | * **Having clause** va **Where clause** qanday farqi bor ? 69 | * **Union Statement** ning vazifasi nima, nima uchun ishlatiladi ? 70 | * **Union Statement** sintaksisi qanday ? 71 | * **Intersect Statement** nima ? 72 | * **Intersect Statement** ni sintaksisi qanday ? 73 | * **Except Statement** nima ? 74 | * **Except Statement** ni sintaksisi qanday ? 75 | * **View** nima ? 76 | * **Virtual table** nima ? 77 | * **Standart view** qanday ishlaydi ? 78 | * **Materialized view** nima ? 79 | * **Materialized view** qanday ishlaydi ? 80 | * Qanday qilib **Materialized view** dagi ma'lumotlarni yangilash mumkin ? 81 | 82 | # Lesson 7 83 | 84 | * **PL/pgSQL** nima ? 85 | * Nima uchun **PL/pgSQL** foydalanish kerak ? 86 | * **Dollar-Quoted string constant** nima ? 87 | * **Anonymous block** nima ? 88 | * **rowtype** qanday o'zgaruvchi ? 89 | * **record** qanday o'zgaruvchi ? 90 | * Qanday qilib o'zgaruvchilarni **constant** qilib qo'ysa bo'ladi ? 91 | * **IF statement** sintaksisi qanday ? 92 | * **CASE statement** sintaksisi qanday ? 93 | * **PL/pgSQL** da qanday usullarda **sikl** hosil qilsa boladi ? 94 | 95 | # Lesson 8 96 | 97 | * **RAISE statement** ning maqsadi sintaksisi ? 98 | * **RAISE statement** da nechta **level** bor ? 99 | * **RAISE statement** da **default level** qanday ? 100 | * **Exception handling** qanday amalga oshiriladi **PL/pgSQL** da ? 101 | * **function** nima ? 102 | * **procedure** nima ? 103 | * **in**, **out**, **inout** parameter lar farqilari ? 104 | * **Function** dan qanday qilib table qaytarish mumin ? 105 | * **Trigger** nima ? 106 | 107 | # Lesson 9 108 | 109 | * **ACID** nima ? 110 | * **Transaction** nima ? 111 | * **rollback** ning vazifasi nima ? 112 | * **savepoint** ning vazifasi nima ? 113 | * Table ni join qilish nima degani ? 114 | * **Postgresql** da necha xil join bor ? 115 | * **Natural join** qanday join ? 116 | * **index** nima uhcun ishlatiladi ? 117 | * **unique index** bilan **index** ni farqi nima ? 118 | 119 | # Lesson 10 120 | 121 | * **Postgresql** da **ROLE** qanday tushuncha ? 122 | * **Role** yaratish sintaksisi qanday ? 123 | * **grant** ning vazifasi nima ? 124 | * **revoke** ning vazifasi qanday ? 125 | * **Tablespace** nima ? 126 | * Qanday qilib _custom_ **tablespace** yaratish mumkin ? 127 | * **Schema** nima ? 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /interviewquestions/7-module(Jakarta EE).md: -------------------------------------------------------------------------------- 1 | # Lesson 1 2 | 3 | 1. **_HTML_** nima ? 4 | 2. **_HTML_** ni nima uchun backend dasturchilar bilishi kerak ? 5 | 3. **_CSS_** nima ? 6 | 4. **_CSS_** ni nima uchun backend dasturchilar bilishi kerak ? 7 | 5. **_JS_** nima ? 8 | 6. **_JS_** ni nima uchun backend dasturchilar bilishi kerak ? 9 | 7. **_Bootstrap_** nima ? 10 | 8. **_Bootstrap_** ni nima uchun backend dasturchilar bilishi kerak ? 11 | 12 | # Lesson 2 13 | 14 | 1. Jakarta EE nima ? 15 | 2. Java EE, J2EE , EE4J va JAkarta EE farqlari nima 16 | 3. Umbrella Project qandey Project ? 17 | 3. Projectning nomi nima uchun Java EE dan Jakarta EE ga o'zgardi 18 | 4. Jakarta EE da qandey modullar bor ? 19 | 5. Jakarta EE 9 dagi yangiliklar ? 20 | 6. Jakarta EE 9.1 dagi yangiliklar ? 21 | 7. Jakarta EE 10 dagi yangiliklar ? 22 | 8. Web Specification ga nimalar kiradi ? 23 | 9. Web Service Specification ga nimalar kiradi ? 24 | 10. Tomcat nima ? 25 | 11. Servlet Container nima ? 26 | 11. Web Dasturlar qandey ishlaydi ? 27 | 12. Servlet nima ? 28 | 13. Servlet ning oxirigi version ni nechchi ? 29 | 14. Deployment Descriptor nima ? 30 | 15. Servlet ni Life cycle qandey ? 31 | 16. Qandey Qilib Servlet yaratish mumkin ? 32 | 17. Servlet ni qandey usullar bilan register qilsa bo'ladi ? 33 | 34 | # Lesson 3 35 | 36 | 1. Jakarta Server Pages nima ? 37 | 2. Jakarta Server Pages nima uchun kerak ? 38 | 3. JSP element lari turlari ? 39 | 4. Scripting elementlar qandey elementlar ? 40 | 5. Directive elementlar qandey elementlar ? 41 | 6. Action elementlar qandey elementlar ? 42 | 7. Scriplet nima ? 43 | 8. JSTL nima ? 44 | 9. JSTL Taglarini Turlari ? 45 | 10. Qandey qilib bir Servletdan turib Bowqa Servlet ni chaqirish mumkin ? 46 | 11. RequestDispatcher nima ? 47 | 48 | # Lesson 4 49 | 50 | 1. Jakarta Expression Language nima va nima uchun kerak ? 51 | 2. MultipartFile nima ? 52 | 3. Qandey usullarda MultipartFile ni configuration ni sozlashimiz mumkin ? 53 | 54 | # Lesson 5 55 | 56 | 1. JDBC API nima ? 57 | 2. pgJDBC nima ? 58 | 3. DriverManager classining vazifasi nima ? 59 | 4. Connection classining vazifasi nima ? 60 | 5. PreparedStatement classining vazifasi nima ? 61 | 62 | # Lesson 6 63 | 64 | 1. Initialization parameters nima va nima uchun kerak bo'ladi ? 65 | 2. Qandey qilib **servlet container** ni event larini **listen** qilsa bo'ladi ? 66 | 3. Session nima ? 67 | 4. Session ni qandey yaratish mumkin ? 68 | 5. Session ni yaratilgandagi yoki ochirilgandagi **event** larni **listen** qilsa bo'ladi ? 69 | 6. Filter nima ? 70 | 7. Web Filter nima ? 71 | 8. Filter dan nima maqsadlarda ishlatiladi ? 72 | 9. Cookie nima va nima uchun kerak bo'ladi ? 73 | 10. Qandey Qilib Tomcat dagi error page larni handle(ushlasa) qilsa bo'ladi? 74 | 75 | # Lesson 7 76 | 77 | 1. ORM nima ? 78 | 2. Qandey ORM larni bilasiz ? 79 | 3. Nima uchun ORM dan foydalanishimiz kerak ? 80 | 4. Entity nima ? 81 | 5. Table nima ? 82 | 6. ORM ni ustinlik va kamchilik tomonlari JDBC ga solishtirilganda ? 83 | 7. Jakarta Persistence API(JPA) nima ? 84 | 8. Jakarta Persistence API nima uchun kerak ? 85 | 9. JPQL nima va nima uchun kerak ? 86 | 10. ORM va JPA ni nima farqi bor ? 87 | 11. JPA ni versiyalardagi farqlari ? 88 | 12. EntityManagerFactory, EntityManager class larini tushuntiring ? 89 | 13. _**GenerationType.IDENTITY, GenerationType.SEQUENCE, GenerationType.UUID, GenerationType.TABLE**_ farqlari ? 90 | 91 | # Lesson 8 92 | 93 | 1. NamedQuery qandey query ? 94 | 2. Qandey association lar mavjud ? 95 | 3. @OneToOne annotation qandey ishlaydi ? 96 | 4. @OneToMany, @ManyToOne annotation qandey ishlaydi ? 97 | 5. CasCadeType nima ? 98 | 6. FetchType Lazy nima ? 99 | 7. Embedded, Embeddable annotation lari nima uchun kerak(vazilasi) ? 100 | 8. Converter lar nima uchun, qandey vaziyatlarda ishlatiladi ? 101 | 102 | # Lesson 9 103 | 104 | 1. Jakarta Bean Validation nima uchun kerak bo'ladi ? 105 | 2. ValidatorFactory class ning vazifasi nima ? 106 | 3. Qandey qilib Custom Constraint Validator yaratsa bo'ladi ? -------------------------------------------------------------------------------- /interviewquestions/8-module(Spring Introduction).md: -------------------------------------------------------------------------------- 1 | # Lesson 1 2 | * **Jakarta EE** ning kamchiliklari ? 3 | * Nima uchun **Spring** ? 4 | * **Spring Framework** nima uchun ishlab chiqilgan ? 5 | * **Spring** ning afzalliklari ? 6 | * **Spring** ni modullarini sanab bering. 7 | * **IoC** nima ? 8 | * **IoC** ning vazifasi nima ? 9 | * **DI** nima ? 10 | * **DI** ning qanday turlari mavjud ? 11 | * **SI** nima ? 12 | * **CI** nima ? 13 | * **BEAN** nima ? 14 | * **IoC Container** nima ? 15 | * **Spring** da qanday **IoC Container** lar bor ? 16 | * **Bean** larni **wire** qilishni necha xil usuli bor ? 17 | * **init-method** qachon ishlaydi ? 18 | * **destroy-method** qachon ishlaydi ? 19 | * **Conditional bean** nima va nima uchun kerak bo'ladi ? 20 | * **PropertySource** qachon kerak bo'ladi ? 21 | * **@Autowired** va **@Qualifier** _annotation_ larini farqi nima ? 22 | * **@Autowired** bilan **@Qualifier** va **@Inject** bilan **@Named** _annotation_ larini farqi nima ? 23 | * **@Configuration** va **@ComponentScan** _annotation_ lar nima maqsad da ishlatiladi ? 24 | 25 | # Lesson 2 26 | * **Spring** da **BeanFactory** nima? 27 | * **Spring** da **ApplicationContext** nima? 28 | * **BeanFactory** va **ApplicationContext** **Bean** larini farqi nima ? 29 | * **Spring** da **singleton** va **prototype** **scope** lari o'rtasidagi farq nima? 30 | * **Spring** da _**lazy loading**_ nima? 31 | * **Spring** da ikkita **_bean_** bir birini _**initialize**_ qilsa shu paytda qanday muammo hosil boladi va shu muammoni qanday xal qilasiz ? 32 | * **Spring** da **_constructor injection_** va _**setter injection**_ o'rtasidagi farq nima ? 33 | * **Spring** da _**@Value**_ _**annotation**_ dan qachon nima uchun foydalanish kerak ? 34 | * **Spring** da **_@PostConstruct_** va **_@PreDestroy_** _**annotation**_ larini maqsadi nima? 35 | * **SpEL**(_Spring Expression Language_) nima ? 36 | * **SpEL** ni **SpEL** qanday yo'llar bilan ishlatish mumkin ? 37 | * **SpEL** nimasi bilan **OGNL** va **MVEL** dan farq qiladi? 38 | * **SpEL** qachon ishlatiladi ? 39 | * **#{...}** _va_ **${...}** ni **SpEL** dagi farqi qanday ? 40 | 41 | # Lesson 3 42 | 43 | * **AOP** nima ? 44 | * **AOP** terminalogiyasida **aspect** nima ? 45 | * **cross-cutting concern** nima ? 46 | * **AOP** va **OOP** ni farqi nima ? 47 | * **join point** nima ? 48 | * **pointcut** va **advice** farqi nima ?? 49 | * **Spring AOP** da necha xil **advice** bor ? 50 | * **AOP** ni xml orqali qandey **configure** qilish mumkin ? 51 | * **AOP** ni java da qandey **configure** qilish mumkin ? 52 | 53 | # Lesson 4 54 | * **Spring MVC** nima ? 55 | * **Spring MVC** ni boshqa **web framework** lardan ustunlik tomonlarini ayting ? 56 | * **Spring MVC** nimani ustida qurulgan ? 57 | * **Central Servlet** nima ? 58 | * **DispatcherServlet** nima ? 59 | * **DispatcherServlet** ni vazifasi nima ? 60 | * **View Resolver** nima ? 61 | * **Template Engine** nima ? 62 | * **Request Server** ga kelib **client** ga web sahifa qaytarib berilish jarayoni qanday etablardan o'tadi ? 63 | 64 | # Lesson 5 65 | * **Thymeleaf** nima ? 66 | * **Thymeleaf** nima uchun ishaltiladi ? 67 | * **Thymeleaf** ni boshqa **_framework_** lardan faqri nima ? 68 | * **Spring** bilan **Thymeleaf** ni qanday integratsiya qilish mumkin ? 69 | * **MessageSource** lar bilan **Thymeleaf** da qanday ishlasak bo'ladi ? 70 | * **Variable Expressions** ( **_${...}_** ) nima ? 71 | * **Selection Variable Expressions** ( **_*{...}_** ) nima ? 72 | * **Message Expressions** ( **_#{...}_** ) nima ? 73 | * **Link URL Expressions** ( **_@{...}_** ) nima ? 74 | * **Fragment Expressions** ( **_~{...}_** ) nima ? 75 | * **Literal** lar nima ? 76 | * **No-Operation token** ni sintaksis qanday va nima uchun ishalatiladi ? 77 | * **HTML** element ga qanday qilib **attribute** qo'shish mumkin ? 78 | * **Attribute** **Appending** va **Prepending** nima ? 79 | * **template fragments** nima ? 80 | * **fragment** yartishni sintaksisi qanday ? 81 | * **Attribute Precedence** nima ? 82 | * **Expression inlining** nima ? 83 | * **Expression inlining** sintaksisi qanday ? 84 | 85 | # Lesson 6 86 | * **Spring JDBC** nima ? 87 | * **Spring JDBC** va **JDBC API** ni nima farqi bor ? 88 | * Nima uchun **JDBC API** dan emas **Spring JDBC** dan foydalanish kerak ? 89 | * **NamedParameterJdbcTemplate** nima ? 90 | * **NamedParameterJdbcTemplate** nima va **JdbcTemplate** ni farqi nima ? 91 | * **SimpleJdbcInsert** ning vazifasi nima ? 92 | * Qanday qilib **Spring JDBC** orqali **stored procedure** larni chaqirish mumkin ? 93 | 94 | # Lesson 7 95 | 96 | * **Spring Security** nima ? 97 | * **Spring Security** ning arxitekturasi nima ? 98 | * **Authentication** nima ? 99 | * **Authorization** nima ? 100 | * **RBAC** nima ? 101 | * **DelegatingFilterProxy** nima va vazifasi qanday ? 102 | * **DelegatingFilterProxy** nima va vazifasi qanday ? 103 | * **SecurityFilterChain** nima va vazifasi qanday ? 104 | * **Role** va **Permission** nima ? 105 | * **CSRF** nima ? 106 | * **Thymeleaf** da qanday qilish login qilgan userning ma'lumotlari bilan ishlash mumkin ? 107 | * **SecurityContextHolder** klasi qanday klas ? 108 | * **@AuthenticationPrincipal** annotatsiyasini vazifasi nima ? 109 | 110 | # Lesson 8 111 | * **MultipartResolver** nima ? 112 | * **MessageSource** qanday **class** ? 113 | * **LocalResolver** **interface** ning vazifasi nima ? 114 | * **LocalChangeInterceptor** qanday **class** ? 115 | 116 | # Lesson 9 117 | 118 | * **Spring** da necha xil usulda xatoliklar bilan ishlash mumkin ? 119 | * **@ResponseStatus annotation** ni vazifasi nima ? 120 | * **@ControllerAdvice annotation** ni vazifasi nima ? 121 | * **@ExceptionHandler annotation** ni vazifasi nima ? 122 | * **Filter** nima ? 123 | * **Interceptor** nima ? 124 | -------------------------------------------------------------------------------- /interviewquestions/9-module(Spring Boot).md: -------------------------------------------------------------------------------- 1 | # Interview question 2 | 3 | ## Lesson 1 4 | 5 | * Spring Boot nima ? 6 | * Spring va Spring Boot ni farqi nima ? 7 | 8 | ## Lesson 2 9 | 10 | * REST API nima ? 11 | * REST FULL API nima ? 12 | * REST FULL WEAPI nima ? 13 | * Spring va Spring Boot ni farqi nima ? 14 | * 15 | 16 | ## Lesson 3 17 | 18 | * **JSON** nima ? 19 | * **JSR 353** nima ? 20 | * **JSR 353** ni implementation qilgan qanday kutubxonalarni bilasiz ? 21 | * **Jackson** kutubxonasini vazifasi nima ? 22 | * **ObjectMapper** class ni vazifasi nima ? 23 | * **JsonParser** class ni vazifasi nima ? 24 | * **JsonGenerator** class ni vazifasi nima ? 25 | * **Jackson** ni asosiy **.jar** fayllari qanday ? 26 | * **Jackson** kutubxonasi **Spring Framework** ning qayerida ishlatiladi ? 27 | * **Jackson** dagi eng asosiy **Annotatsiya** larni ayting _**vazifalari**_ bilan ? 28 | 29 | ## Lesson 4 30 | 31 | * **Spring Data Jpa** nima ? 32 | * **Spring Data Jpa** va **Jakarta Persistence API** ni farqi nima ? 33 | * **JpaRepository** , **CrudRepository** lar qanday **interface** lar ? 34 | * **Jpa** va **Hibernate** ni farqi nima ? 35 | * **@Entity** annotatsiyasini vazifasi nima ? 36 | * **@Transactional** annotatsiyasini vazifasi nima ? 37 | * **@Modifying** annotatsiyasini vazifasi nima ? 38 | * **Query Creation** nima ? 39 | * **Projection** nima ? 40 | * **Projection** nechchi turga bo'linadi ? 41 | * **Spring Data Jpa** da **Auditing** nima ? 42 | * **@EntityListeners(AuditingEntityListener.class)** annotatsiyasining vazifasi nima ? 43 | 44 | ## Lesson 5 45 | 46 | * **Jpa buddy** _pluginini_ tushuntiring(qanday plugin u ?) ? 47 | * **HATEOAS** nima ? 48 | * **EntityModel** va **CollectionModel** ni farqi nima ? 49 | * **PagedModel** nima ? 50 | * **HATEOAS** ning afzalligi ? 51 | * **HATEOAS** ning kamchiliklari ? 52 | * **HATEOAS** ni qachon ishlatish kerak ? 53 | * **HATEOAS** ni qachon ishlatmaslik kerak ? 54 | * **Spring Data Rest** nima ? 55 | 56 | ## Lesson 6 57 | 58 | * **Rest API** da qanday qilib **Authentication** va **Authorization** ni ta'minlash mumkin ? 59 | * **Basic Access Authentication** nima ? 60 | * **CORS** nima ? 61 | * **JWT** nima ? 62 | * **JWT token** nima ? 63 | * **JWT token** qanday qismlardan tashkil topadi ? 64 | * **JWT token** dagi **Signature** nima ? 65 | 66 | ## Lesson 7 67 | 68 | * **OpenAPI** nima va nima uchun ishlatiladi ? 69 | * **Swagger** nima va nima uchun ishlatiladi? 70 | * **OpenAPI** va **Swagger** ning farqi nima ? 71 | * **sprinfdoc** nima ? 72 | * **Springdoc** da api larni qanday qilib **guruh** larga bo'lish mumkin ? 73 | 74 | ## Lesson 8 75 | 76 | * **MapStruct** kutibxonasini vazifasi nima ? 77 | * **.properties** file dan qanday qilib **object** ni yoki **objectlar**ni listini o'qish mumkin ? 78 | * **.yaml** file qanday file ? 79 | * **.yaml** file dan **Map** va **List** Larni qanday o'qish mumkin ? 80 | * **|** va **>** belgilari vazifasi nima, va ular o'zaro qanday farq qiladi ? 81 | * **@Async** annotatsiyasini vazifasi nima ? 82 | * **@Async** annotatsiyasi qanday ishlaydi (proxy)? 83 | * **TaskExecutor** ning vazifasi nima ? 84 | * Qanday qilib **@Async** annotatsiya bor bo'lgan method da `exception` sodir bo'lsa shu `exception` ni qanday 85 | qilib `handle` qilsa bo`ladi ? 86 | 87 | ## Lesson 9 88 | * **profiling** nima ? 89 | * **@Profile** annotatsiyasini vazifasi nima ? 90 | * **yaml** fayl orqali qanday qilib **profile** lar yaratsa bo'ladi ? 91 | * `spring-boot-starter-mail` va `jakarta-mail-api` ni farqi nima ? 92 | * **FreeMarker** nima ? 93 | * **Task scheduling** nima ? 94 | * **@Scheduled** annotatsiyasini vazifasi nima ? 95 | * **Cron Jobs** nima ? 96 | * **Cron Expression** nima ? 97 | * Qanday **logging kutubxona**larni bilasiz ? 98 | * **Request** va **Response** ni qanday qilib log yozsa bo'ladi ? 99 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /jars/seeder.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/jars/seeder.jar -------------------------------------------------------------------------------- /needed_sources/2101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/2101.png -------------------------------------------------------------------------------- /needed_sources/243.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/243.png -------------------------------------------------------------------------------- /needed_sources/244.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/244.png -------------------------------------------------------------------------------- /needed_sources/StandardBuiltInConstraints.md: -------------------------------------------------------------------------------- 1 | # Standard Built-In Constraints 2 | 3 | | Annotation | Description | 4 | |:----------------------|--------------------------------------------------------------------------------------------------------| 5 | | _**@Null**_ | The annotated element must be null | 6 | | _**@NotNull**_ | The annotated element must not be null | 7 | | _**@AssertTrue**_ | The annotated element must be true | 8 | | _**@AssertFalse**_ | The annotated element must be false | 9 | | _**@Min**_ | The annotated element must be a number with a value that is higher or equal to the specified minimum | 10 | | _**@Max**_ | The annotated element must be a number with a value that is lower or equal to the specified maximum | 11 | | _**@DecimalMin**_ | The annotated element must be a decimal with a value that is higher or equal to the specified minimum | 12 | | _**@DecimalMax**_ | The annotated element must be a decimal with a value that is lower or equal to the specified maximum | 13 | | _**@Negative**_ | The annotated element must be a strictly negative number | 14 | | _**@NegativeOrZero**_ | The annotated element must be a negative number or zero | 15 | | _**@Positive**_ | The annotated element must be a strictly positive number | 16 | | _**@PositiveOrZero**_ | The annotated element must be strictly positive or zero | 17 | | _**@Size**_ | The annotated element size must fall within the specified boundaries | 18 | | _**@Digits**_ | The annotated element must be a number in the accepted range | 19 | | _**@Past**_ | The annotated element must be an instant, date, or time in the past | 20 | | _**@PastOrPresent**_ | The annotated element must be an instant, date, or time in the past or present | 21 | | _**@Future**_ | The annotated element must be an instant, date, or time in the future | 22 | | _**@FutureOrPresent**_ | The annotated element must be an instant, date, or time in the future or present | 23 | | _**@Pattern**_ | The annotated element must fall within the constraints of the specified regular expression | 24 | | _**@NotEmpty**_ | The annotated element must not be empty or null | 25 | | _**@NotBlank**_ | The annotated element must not be null and must contain at least one character | 26 | | _**@Email**_ | The annotated string must be a well-formed email address | 27 | -------------------------------------------------------------------------------- /needed_sources/activation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Activate Account 6 | 39 | 40 | 41 |
42 | url logo 43 |

Welcome To SHORTURL

44 |

In Order TO Activate Your Account Click Activate Link Below

45 | activate 46 |
47 | 48 | -------------------------------------------------------------------------------- /needed_sources/comments-service.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/comments-service.jar -------------------------------------------------------------------------------- /needed_sources/gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/gallery.png -------------------------------------------------------------------------------- /needed_sources/hateoas-api-service.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/hateoas-api-service.jar -------------------------------------------------------------------------------- /needed_sources/install_mongodb_community.md: -------------------------------------------------------------------------------- 1 | # Install Mongodb On Windows [here](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-windows/) 2 | # Install Mongodb On Linux. [Full Documentation](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/) 3 | # 1. Import the public key used by the package management system. 4 | ```shell 5 | wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - 6 | ``` 7 | The operation should respond with an OK. 8 | 9 | However, if you receive an error indicating that gnupg is not installed, you can: 10 | Install gnupg and its required libraries using the following command: 11 | ```shell 12 | sudo apt-get install gnupg 13 | ``` 14 | Once installed, retry importing the key: 15 | ```shell 16 | wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - 17 | ``` 18 | ```shell 19 | wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - 20 | ``` 21 | # 2. Create a list file for MongoDB. 22 | ```shell 23 | echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list 24 | ``` 25 | # 3. Reload local package database. 26 | ```shell 27 | sudo apt-get update 28 | ``` 29 | # 4. Install the MongoDB packages. 30 | ```shell 31 | sudo apt-get install -y mongodb-org 32 | ``` 33 | ---- 34 | # 1. Start MongoDB. 35 | ```shell 36 | sudo systemctl start mongod 37 | ``` 38 | # 2. Verify that MongoDB has started successfully. 39 | ```shell 40 | sudo systemctl status mongod 41 | ``` 42 | ```shell 43 | sudo systemctl enable mongod 44 | ``` 45 | # 3. Stop MongoDB. 46 | ```shell 47 | sudo systemctl stop mongod 48 | ``` 49 | # 4. Restart MongoDB. 50 | ```shell 51 | sudo systemctl restart mongod 52 | ``` 53 | ---- 54 | # 1. Begin using MongoDB. 55 | ```shell 56 | mongosh 57 | ``` 58 | 59 | -------------------------------------------------------------------------------- /needed_sources/jakarta-expression-language-spec-5.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/jakarta-expression-language-spec-5.0.pdf -------------------------------------------------------------------------------- /needed_sources/jakarta-persistence-spec-3.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/jakarta-persistence-spec-3.0.pdf -------------------------------------------------------------------------------- /needed_sources/jakarta.persistence.query_methods.md: -------------------------------------------------------------------------------- 1 | # jakarta.persistence.Query Interface Methods 2 | | Method | Description | 3 | |:-----------------------|:---------------------------------------------------------------------------------------------------------------------------------------| 4 | | executeUpdate | Executes an update or delete statement (returns: int) | 5 | | getFirstResult | Specifies the position of the first result the query object was set to retrieve (returns: int) | 6 | | getFlushMode | Gets the flush mode in effect for the query execution (returns: FlushModeType) | 7 | | getHints | Gets the properties and hints and associated values that are in effect for the query instance (returns: java.util.Map) | 8 | | getLockMode | Gets the current lock mode for the query (returns: LockModeType) | 9 | | getMaxResults | Specifies the maximum number of results the query object was set to retrieve (returns: int) | 10 | | getParameter | Gets the parameter object corresponding to the declared positional parameter (returns: Parameter) | 11 | | getParameters | Gets the parameter objects corresponding to the declared parameters of the query (returns: java.util.Set>) | 12 | | getParameterValue(int) | Returns the value bound to the positional parameter (returns: Object) | 13 | | getResultList | Executes a SELECT query and then returns the query results as an untyped List (returns: java.util.List) | 14 | | getSingleResult | Executes a SELECT query and then returns a single untyped result (returns: java.lang.Object) | 15 | | isBound | Returns a Boolean indicating whether a value has been bound to the parameter | 16 | 17 | 18 | -------------------------------------------------------------------------------- /needed_sources/jakarta_ee_error_handling_attribute_names.md: -------------------------------------------------------------------------------- 1 | # Jakarta EE Error Object Attribute Names 2 | 3 | 1. **jakarta.servlet.error.message** 4 | 2. **jakarta.servlet.error.request_uri** 5 | 3. **jakarta.servlet.error.status_code** -------------------------------------------------------------------------------- /needed_sources/jakata_ee_lesson_1_exercise_1_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/jakata_ee_lesson_1_exercise_1_img.png -------------------------------------------------------------------------------- /needed_sources/jpa_configurations.md: -------------------------------------------------------------------------------- 1 | # Schema Generation Properties 2 | 3 | | property | purpose | 4 | |:----------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 5 | | schema-generation-action | Controls the action to be taken by the persistence provider with regard to object generation and destruction. Values: **none**, **create**, **drop-and-create**, and **drop** | 6 | | schema-generation-target | Controls whether schema is to be created within the database, whether Data Definition Language (DDL) scripts are to be created, or both. Values: **database**, **scripts**, and **database-and-scripts** | 7 | | ddl-create-script-target,
ddl-drop-script-target | Controls target locations for writing scripts if the schema-generation-target specifies script generation. Writers are preconfigured for the persistence provider. Values: java.io.Writer (e.g., MyWriter.class) or URL strings | 8 | | ddl-create-script-source,
ddl-drop-script-source | Specifies locations from which DDL scripts are to be read. Readers are preconfigured for the persistence provider. Values: java.io.Reader (e.g., MyReader.class) or URL strings | 9 | | sql-load-script-source | Specifies the file location of the SQL bulk load script. Values: java.io.Reader (e.g., MyReader.class) or URL string | 10 | | schema-generation-connection | JDBC connection to be used for performing schema generation | 11 | | database-product-name,
database-major-version,
database-minor-version | Needed if scripts are to be generated. Values are those obtained from JDBC DatabaseMetaData | 12 | | create-database-schemas | Whether the persistence provider needs to create schema in addition to creating database objects such as tables, sequences, constraints, and so on. Values: true and false | -------------------------------------------------------------------------------- /needed_sources/loginform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/loginform.png -------------------------------------------------------------------------------- /needed_sources/maven_commands.md: -------------------------------------------------------------------------------- 1 | | name | description | 2 | |--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 3 | | mvn clean | This command cleans the maven project by deleting the target directory. The command output relevant messages are shown below. | 4 | | mvn compiler:compile | This command compiles the java source classes of the maven project. | 5 | | mvn compiler:testCompile | This command compiles the test classes of the maven project. | 6 | | mvn package | This command builds the maven project and packages them into a JAR, WAR, etc. | 7 | | mvn install | This command builds the maven project and installs the project files (JAR, WAR, pom.xml, etc) to the local repository. | 8 | | mvn deploy | This command is used to deploy the artifact to the remote repository. The remote repository should be configured properly in the project pom.xml file distributionManagement tag. The server entries in the maven settings.xml file is used to provide authentication details. | 9 | | mvn validate | This command validates the maven project that everything is correct and all the necessary information is available. | 10 | | mvn dependency:tree | This command generates the dependency tree of the maven project. | 11 | | mvn dependency:analyze | This command analyzes the maven project to identify the unused declared and used undeclared dependencies. | 12 | | mvn archetype:generate | Maven archetypes is a maven project templating toolkit. We can use this command to generate a skeleton maven project of different types, such as JAR, web application, maven site, etc. | 13 | | mvn site:site | This command generates a site for the project. You will notice a “site” directory in the target after executing this command. There will be multiple HTML files inside the site directory that provides information related to the project. | 14 | | mvn test | This command is used to run the test cases of the project using the maven-surefire-plugin. | 15 | | mvn compile | It’s used to compile the source Java classes of the project. | 16 | | mvn verify | This command build the project, runs all the test cases and run any checks on the results of the integration tests to ensure quality criteria are met. | 17 | | mvn -help | This command prints the maven usage and all the available options for us to use. | 18 | | mvn -o package | This command is used to run the maven build in the offline mode. It’s useful when we have all the required JARs download in the local repository and we don’t want Maven to look for any JARs in the remote repository. | 19 | | mvn -q package | Runs the maven build in the quiet mode, only the test cases results and errors are displayed. | 20 | | mvn -X package | Prints the maven version and runs the build in the debug mode. It’s opposite of the quiet mode and you will see a lot of debug messages in the console. | 21 | | mvn -v | Used to display the maven version information. | 22 | | mvn -DskipTests package | The skipTests system property is used to skip the unit test cases from the build cycle. We can also use -Dmaven.test.skip=true to skip the test cases execution. | -------------------------------------------------------------------------------- /needed_sources/model2-lesson3-task1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/model2-lesson3-task1.png -------------------------------------------------------------------------------- /needed_sources/model2-lesson3-task3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/model2-lesson3-task3.png -------------------------------------------------------------------------------- /needed_sources/module_10_lesson_3_comment_service.md: -------------------------------------------------------------------------------- 1 | # Comments-Service 2 | 3 | [Yuklab Olish](./comments-service.jar) 4 | 5 | ````shell 6 | java -jar comments-service.jar 7 | ```` 8 | 9 | [http://localhost:9595/swagger-ui.html](http://localhost:9595/swagger-ui.html) 10 | 11 | # Yoki 12 | 13 | ````java 14 | 15 | @Entity 16 | public class Comment { 17 | @Id 18 | @GeneratedValue(strategy = GenerationType.IDENTITY) 19 | private Integer id; 20 | private String message; 21 | private Integer postId; 22 | 23 | public Comment(CommentCreateDTO commentCreateDTO) { 24 | this.message = commentCreateDTO.getMessage(); 25 | this.postId = commentCreateDTO.getPostId(); 26 | } 27 | } 28 | ```` 29 | 30 | ````java 31 | 32 | @Data 33 | @AllArgsConstructor 34 | @NoArgsConstructor 35 | public class CommentCreateDTO { 36 | private String message; 37 | private Integer postId; 38 | } 39 | ```` 40 | 41 | ````java 42 | public interface CommentRepository extends JpaRepository { 43 | @Query("select c from Comment c where c.postId = ?1") 44 | List findAllByPostId(Integer postId); 45 | } 46 | ```` 47 | 48 | ````java 49 | @Slf4j 50 | @RestController 51 | @RequestMapping("/api/comments") 52 | @RequiredArgsConstructor 53 | public class CommentController { 54 | private final CommentRepository commentRepository; 55 | 56 | @GetMapping 57 | public ResponseEntity> getAll() { 58 | return ResponseEntity.ok(commentRepository.findAll()); 59 | } 60 | 61 | @GetMapping("/{id}/post") 62 | public ResponseEntity> getAllByPostId(@PathVariable Integer id) throws InterruptedException { 63 | log.info("Comments requested for POST ID : {}", id); 64 | TimeUnit.SECONDS.sleep(1L); 65 | return ResponseEntity.ok(commentRepository.findAllByPostId(id)); 66 | } 67 | 68 | @PostMapping("/saveAll") 69 | public ResponseEntity createList(@RequestBody List dtos) { 70 | log.info("Creating List Of Comments : {}", dtos); 71 | List comments = dtos.stream() 72 | .map(Comment::new) 73 | .toList(); 74 | commentRepository.saveAll(comments); 75 | return ResponseEntity.ok(null); 76 | } 77 | } 78 | ```` 79 | 80 | -------------------------------------------------------------------------------- /needed_sources/module_10_lesson_3_hateoas_service.md: -------------------------------------------------------------------------------- 1 | # Hateoas-Service 2 | 3 | [Yuklab Olish](./hateoas-api-service.jar) 4 | 5 | ````shell 6 | java -jar hateoas-api-service.jar 7 | ```` 8 | 9 | [http://localhost:9595/swagger-ui.html](http://localhost:9595/swagger-ui.html) 10 | 11 | # Yoki 12 | 13 | ````java 14 | 15 | @Entity 16 | @Getter 17 | @Setter 18 | public class Post { 19 | @Id 20 | @GeneratedValue(strategy = GenerationType.IDENTITY) 21 | private Integer id; 22 | private Integer userId; 23 | private String title; 24 | private String body; 25 | } 26 | ```` 27 | 28 | ````java 29 | public interface PostRepository extends JpaRepository {} 30 | ```` 31 | 32 | ````java 33 | @Component 34 | public class PostModelAssembler implements RepresentationModelAssembler> { 35 | @Override 36 | public EntityModel toModel(Post post) { 37 | Link selfRelation = linkTo(methodOn(PostController.class).getPost(post.getId())).withSelfRel(); 38 | Link postsRelation = linkTo(methodOn(PostController.class).getPosts()).withRel("posts"); 39 | return EntityModel.of(post, selfRelation, postsRelation); 40 | } 41 | 42 | @Override 43 | public CollectionModel> toCollectionModel(Iterable entities) { 44 | List> entityModels = new ArrayList<>(); 45 | entities.forEach(post -> entityModels.add(toModel(post))); 46 | Link postsRelation = linkTo(methodOn(PostController.class).getPosts()).withRel("posts"); 47 | return CollectionModel.of(entityModels, postsRelation); 48 | } 49 | } 50 | ```` 51 | 52 | ````java 53 | @RestController 54 | @RequestMapping("/api/posts") 55 | public class PostController { 56 | private final PostRepository postRepository; 57 | private final PostModelAssembler postModelAssembler; 58 | private final PagedResourcesAssembler pagedResourcesAssembler; 59 | 60 | PostController(PostRepository postRepository, 61 | PostModelAssembler postModelAssembler, 62 | @Qualifier("postPagedResourcesAssembler") PagedResourcesAssembler pagedResourcesAssembler) { 63 | this.postRepository = postRepository; 64 | this.postModelAssembler = postModelAssembler; 65 | this.pagedResourcesAssembler = pagedResourcesAssembler; 66 | } 67 | 68 | 69 | @GetMapping("/") 70 | public CollectionModel> getPosts() { 71 | List posts = postRepository.findAll(); 72 | return postModelAssembler.toCollectionModel(posts); 73 | } 74 | 75 | @GetMapping("/paged") 76 | public PagedModel> getPage(@RequestParam(required = false, defaultValue = "10") int size, 77 | @RequestParam(required = false, defaultValue = "0") int page) { 78 | Pageable pageable = PageRequest.of(page, size); 79 | Page posts = postRepository.findAll(pageable); 80 | return pagedResourcesAssembler.toModel(posts, postModelAssembler); 81 | } 82 | 83 | @GetMapping("/{id}") 84 | public EntityModel getPost(@PathVariable Integer id) { 85 | Post post = postRepository.findById(id) 86 | .orElseThrow(() -> new RuntimeException("Post not found")); 87 | return postModelAssembler.toModel(post); 88 | } 89 | 90 | } 91 | ```` 92 | 93 | ````java 94 | 95 | @SpringBootApplication 96 | public class SpringbootApplication { 97 | 98 | public static void main(String[] args) { 99 | SpringApplication.run(SpringbootApplication.class, args); 100 | } 101 | 102 | @Bean 103 | CommandLineRunner runner(ObjectMapper objectMapper, PostRepository postRepository) { 104 | return (args -> { 105 | URL url = new URL("https://jsonplaceholder.typicode.com/posts"); 106 | List posts = objectMapper.readValue(url, new TypeReference>() { 107 | }); 108 | postRepository.saveAll(posts); 109 | }); 110 | } 111 | 112 | @Bean(name = "postPagedResourcesAssembler") 113 | public PagedResourcesAssembler postPagedResourcesAssembler() { 114 | return new PagedResourcesAssembler<>(new HateoasPageableHandlerMethodArgumentResolver(), null); 115 | } 116 | } 117 | ```` 118 | 119 | -------------------------------------------------------------------------------- /needed_sources/module_9_lesson_8_mapstruct.md: -------------------------------------------------------------------------------- 1 | ````java 2 | 3 | ```` 4 | 5 | ````java 6 | @Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, componentModel = MappingConstants.ComponentModel.SPRING) 7 | public interface UserMapper { 8 | 9 | @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE) 10 | void updateUser(@MappingTarget User.Builder userBuilder, UserDto userDto); 11 | } 12 | ```` 13 | 14 | ````java 15 | 16 | ```` 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /needed_sources/module_9_lesson_9_logging.md: -------------------------------------------------------------------------------- 1 | 2 | # Logback Configuration (_logback-spring.xml_) 3 | 4 | ```xml 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | %green(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%-100.100C): %msg%n%throwable 13 | 14 | 15 | 16 | 17 | 18 | ${LOGS}/spring-boot-logger.log 19 | 20 | %d %p %50.100C [%t] %m%n 21 | 22 | 23 | 24 | ${LOGS}/archived/spring-boot-logger-%d{yyyy-MM-dd}.%i.log 25 | 26 | 27 | 10KB 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | ```` 45 | 46 | 47 | # Log4j2 Configuration (_log4j2-spring.xml_) 48 | 49 | ```xml 50 | 51 | 52 | 53 | 54 | 56 | 57 | 58 | 62 | 63 | %d %p %30.C [%t] %m%n 64 | 65 | 66 | 67 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | ```` 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /needed_sources/postgres_localhost-2023_03_01_12_34_08-dump.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/postgres_localhost-2023_03_01_12_34_08-dump.sql -------------------------------------------------------------------------------- /needed_sources/report.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | Urls 10 | 11 | 12 | 13 | 14 | 37 | 38 | 39 |

Dear Javohir. Weakly Report 23/01/2010 - 30/01/2010 40 |

41 |

Total Weekly Generated URLs Count : 1 240

42 | 43 |
44 | 45 |

Monday

46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
IDDescriptionPath
1description 1code 1
1description 2code 2
64 |

Total Daily Generated URLs Count For Monday : 23

65 | 66 | 67 |
68 | 69 |

Wednesday

70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 |
IDDescriptionPath
1description 1code 1
1description 2code 2
88 |

Total Daily Generated URLs Count For Wednesday : 23

89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /needed_sources/short_url_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/short_url_logo.png -------------------------------------------------------------------------------- /needed_sources/spring_module2_lesson_4_spring_data_jpa_property_expressisons.md: -------------------------------------------------------------------------------- 1 | # Spring Data JPA query methods 2 | 3 | ## Keyword Expressions 4 | 5 | * `And` creates a conjunction of multiple expressions 6 | * `Or` creates a disjunction of multiple expressions 7 | * `Between` finds values within a given range 8 | * `LessThan` finds values less than a given value 9 | * `LessThanEqual` finds values less than or equal to a given value 10 | * `GreaterThan` finds values greater than a given value 11 | * `GreaterThanEqual` finds values greater than or equal to a given value 12 | * `IsNull` finds null values 13 | * `IsNotNull` finds non-null values 14 | * `Like` finds values that match a given pattern 15 | * `NotLike` finds values that do not match a given pattern 16 | * `StartingWith` finds values that start with a given prefix 17 | * `EndingWith` finds values that end with a given suffix 18 | * `Containing` finds values that contain a given substring 19 | * `NotContaining` finds values that do not contain a given substring 20 | * `OrderBy` sorts the results by a given property in ascending or descending order 21 | 22 | ## Logical Expressions 23 | 24 | * `True` returns all results 25 | * `False` returns no results 26 | * `And, Or, Not` creates more complex logical expressions 27 | 28 | ## Ignoring Case 29 | 30 | * `IgnoreCase` ignores case when comparing strings 31 | 32 | ## Regex Expressions 33 | 34 | * `Regexp` finds values that match a given regular expression 35 | * `NotRegexp` finds values that do not match a given regular expression 36 | * `Like (with % or _)` supports % as a wildcard for any number of characters and _ as a wildcard for a single character 37 | 38 | ## Nested Property Expressions 39 | 40 | * `Nested` creates a nested property expression 41 | * `And and Or` can be used within nested property expressions 42 | 43 | ## Collection Expressions 44 | 45 | * `In` finds values that match any of the given values 46 | * `NotIn` finds values that do not match any of the given values 47 | * `True, False, And, Or, Not` can be used within collection expressions 48 | * `OrderBy` sorts the collection results by a given property in ascending or descending order 49 | 50 | ## Distinct Results 51 | 52 | * `Distinct` returns only distinct results 53 | 54 | ```java 55 | List findByFirstNameAndLastName(String firstName, String lastName); 56 | List findByAgeGreaterThanEqualOrderByLastNameAscFirstNameAsc(int age); 57 | List findByLastNameIgnoreCaseContaining(String lastName); 58 | List findByOrdersProductPriceGreaterThanEqual(BigDecimal price); 59 | ``` -------------------------------------------------------------------------------- /needed_sources/spring_module_10_lesson_1_mongodb.md: -------------------------------------------------------------------------------- 1 | * [users.json](spring_module_10_lesson_1_mongodb_users.json) 2 | * [sales.json](spring_module_10_lesson_1_mongodb_sales.json) 3 | -------------------------------------------------------------------------------- /needed_sources/spring_module_10_lesson_1_mongodb_sales.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "date": "2022-03-25", 4 | "product": "Apple", 5 | "quantity": 5, 6 | "price": 1.0 7 | }, 8 | { 9 | "date": "2022-03-25", 10 | "product": "Orange", 11 | "quantity": 3, 12 | "price": 1.5 13 | }, 14 | { 15 | "date": "2022-03-26", 16 | "product": "Banana", 17 | "quantity": 2, 18 | "price": 0.5 19 | }, 20 | { 21 | "date": "2022-03-27", 22 | "product": "Apple", 23 | "quantity": 7, 24 | "price": 1.0 25 | }, 26 | { 27 | "date": "2022-03-27", 28 | "product": "Orange", 29 | "quantity": 4, 30 | "price": 1.5 31 | }, 32 | { 33 | "date": "2022-03-27", 34 | "product": "Banana", 35 | "quantity": 3, 36 | "price": 0.5 37 | }, 38 | { 39 | "date": "2022-03-25", 40 | "product": "Banana", 41 | "quantity": 2, 42 | "price": 1.2 43 | } 44 | ] -------------------------------------------------------------------------------- /needed_sources/spring_module_10_lesson_7_3_needed_plugins.md: -------------------------------------------------------------------------------- 1 | ## maven-surefire-plugin 2 | 3 | ````xml 4 | 5 | 6 | org.apache.maven.plugins 7 | maven-surefire-plugin 8 | 3.0.0-M7 9 | 10 | ```` 11 | 12 | ## maven-surefire-report-plugin 13 | 14 | ````xml 15 | 16 | 17 | org.apache.maven.plugins 18 | maven-surefire-report-plugin 19 | 3.0.0-M7 20 | 21 | 22 | test 23 | 24 | report 25 | 26 | 27 | 28 | 29 | ${basedir}/target/path 30 | 31 | 32 | ```` 33 | 34 | ## maven-site-plugin 35 | 36 | ````xml 37 | 38 | 39 | org.apache.maven.plugins 40 | maven-site-plugin 41 | 2.1 42 | 43 | ${basedir}/target/path 44 | 45 | 46 | ```` 47 | 48 | ## jacoco-maven-plugin 49 | 50 | ````xml 51 | 52 | 53 | org.jacoco 54 | jacoco-maven-plugin 55 | 0.8.8 56 | 57 | 58 | prepare-agent 59 | 60 | prepare-agent 61 | 62 | 63 | 64 | report 65 | test 66 | 67 | report 68 | 69 | 70 | 71 | 72 | ```` 73 | -------------------------------------------------------------------------------- /needed_sources/spring_module_1_lesson_5_home_work.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/spring_module_1_lesson_5_home_work.png -------------------------------------------------------------------------------- /needed_sources/spring_module_9_lesson_4_1_spring_data_jpa_config.md: -------------------------------------------------------------------------------- 1 | # Configuring spring data jpa 2 | 3 | ```` 4 | 5 | org.springframework.data 6 | spring-data-jpa 7 | version 8 | 9 | ```` 10 | 11 | ```` 12 | 13 | org.hibernate 14 | hibernate-core 15 | version 16 | 17 | ```` 18 | 19 | ````java 20 | @Configuration 21 | @EnableJpaRepositories 22 | public class SpringDataConfigurer { 23 | // . . . . . . . . . . . . . . 24 | } 25 | ```` 26 | 27 | ````java 28 | @Bean 29 | public DataSource dataSource() { 30 | DriverManagerDataSource dataSource = new DriverManagerDataSource(); 31 | dataSource.setUrl(env.getRequiredProperty("spring.datasource.jdbc.url")); 32 | dataSource.setSchema(env.getRequiredProperty("spring.datasource.jdbc.schema")); 33 | dataSource.setUsername(env.getRequiredProperty("spring.datasource.jdbc.user")); 34 | dataSource.setPassword(env.getRequiredProperty("spring.datasource.jdbc.password")); 35 | dataSource.setDriverClassName(env.getRequiredProperty("spring.datasource.jdbc.driver")); 36 | return dataSource; 37 | } 38 | ```` 39 | 40 | ````java 41 | @Bean 42 | public LocalContainerEntityManagerFactoryBean entityManagerFactory() { 43 | LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean(); 44 | entityManagerFactoryBean.setDataSource(dataSource()); 45 | entityManagerFactoryBean.setPackagesToScan("base_backage"); 46 | 47 | JpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter(); 48 | entityManagerFactoryBean.setJpaVendorAdapter(jpaVendorAdapter); 49 | 50 | entityManagerFactoryBean.setJpaProperties(properties()); 51 | return entityManagerFactoryBean; 52 | } 53 | ```` 54 | 55 | 56 | ````java 57 | @Bean 58 | public PlatformTransactionManager transactionManager(LocalContainerEntityManagerFactoryBean entityManagerFactoryBean) { 59 | return new JpaTransactionManager(entityManagerFactoryBean.getObject()); 60 | } 61 | ```` 62 | 63 | 64 | ````java 65 | private Properties properties() { 66 | Properties properties = new Properties(); 67 | properties.put("hibernate.show_sql", env.getRequiredProperty("spring.datasource.hibernate.show_sql")); 68 | properties.put("hibernate.format_sql", env.getRequiredProperty("spring.datasource.hibernate.format_sql")); 69 | properties.put("hibernate.hbm2ddl.auto", env.getRequiredProperty("spring.datasource.hibernate.hbm2ddl.auto")); 70 | return properties; 71 | } 72 | ```` -------------------------------------------------------------------------------- /needed_sources/spring_module_9_lesson_6_jwt.md: -------------------------------------------------------------------------------- 1 | ````java 2 | 3 | 4 | ```` -------------------------------------------------------------------------------- /needed_sources/vm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/needed_sources/vm.png -------------------------------------------------------------------------------- /source_codes/module_1/1-lesson.md: -------------------------------------------------------------------------------- 1 | ````java 2 | public class Main { 3 | public static void main(String[] args) { 4 | System.out.println("We do not use hello world :))"); 5 | } 6 | } 7 | ```` 8 | 9 | ````java 10 | public class Test { 11 | public static void main(String[] args) { 12 | System.out.println("Hello world"); 13 | } 14 | } 15 | ```` 16 | 17 | ```python 18 | def hello(): 19 | print("inside hello method") 20 | print(123/'hello world') 21 | 22 | def run(): 23 | print("run method called") 24 | hello() 25 | 26 | run() 27 | ```` 28 | 29 | ````java 30 | public class App { 31 | 32 | public static void main(String[] args) { 33 | System.out.println("main method called"); 34 | hello(); 35 | } 36 | 37 | static void hello() { 38 | System.out.println("Inside hello method"); 39 | System.out.println(123); 40 | } 41 | } 42 | ```` 43 | 44 | ````java 45 | public class CLA { 46 | 47 | public static void main(String[] args) { 48 | 49 | System.out.println("Programming languages"); 50 | 51 | for ( String lang : args ) { 52 | System.out.println(lang); 53 | } 54 | } 55 | } 56 | ```` -------------------------------------------------------------------------------- /source_codes/module_1/2-lesson.md: -------------------------------------------------------------------------------- 1 | ````java 2 | public class Main { 3 | /** 4 | * Main method 5 | * @param args -> commandline arguments 6 | */ 7 | public static void main(String[] args) { 8 | final int a = 12; 9 | // final bilan e'lon qilingan 10 | // ozgaruvchini ozgartirib bolmaydi 11 | int age = 28; 12 | /* 13 | Hello PDP. 14 | Welcome to future job 15 | */ 16 | } 17 | } 18 | ```` 19 | 20 | 21 | ````java 22 | public class DataTypes { 23 | public static void main(String[] args) { 24 | 25 | // int a = 12; 26 | // float b = 12.12f; 27 | // -2^(bit - 1) <= x < 2^(bit - 1) 28 | byte byteNumber = 127;// -2^7 <= x < 2^7; -128 <= x <= 127 29 | // signed(-) or unsigned(+) 30 | // unsigned byte byteNumber = 127; 31 | 32 | 33 | /* 34 | short shortNumber = 1245; 35 | // -2^(16 - 1) <= x < 2^(16 - 1) 36 | // -32768 <= x < 32768 37 | // -32768 <= x <= 32767 38 | short maxValueForShort = Short.MAX_VALUE; 39 | short minValueForShort = Short.MIN_VALUE; 40 | System.out.println(maxValueForShort); 41 | System.out.println(minValueForShort); 42 | */ 43 | 44 | /* 45 | int intNumber = 1; //32-bit -> 4 byte 46 | // -2^(32 - 1) <= x < 2^(32 - 1) 47 | // -2147483648 <= x <= 2147483647 48 | int maxValueForInt = Integer.MAX_VALUE; 49 | int minValueForInt = Integer.MIN_VALUE; 50 | System.out.println(maxValueForInt); 51 | System.out.println(minValueForInt); 52 | */ 53 | 54 | /* 55 | 56 | long longNumber = 10L; //64-bit -> 8 byte 57 | long maxValueForLong = Long.MAX_VALUE; 58 | long minValueForLong = Long.MIN_VALUE; 59 | System.out.println("maxValueForLong = " + maxValueForLong); 60 | System.out.println("minValueForLong = " + minValueForLong); 61 | 62 | System.out.println("maxValueForLong = " + maxValueForLong); 63 | System.out.println("minValueForLong = " + minValueForLong); 64 | */ 65 | 66 | // floating point numbers 67 | // float double 68 | // float 69 | /* 70 | float floatNumber = 1.5F; // 32-bit -> 4 byte 7-8 71 | float maxValueForFloat = Float.MAX_VALUE; 72 | float minValueForFloat = Float.MIN_VALUE; 73 | 74 | System.out.println("maxValueForFloat = " + maxValueForFloat); 75 | System.out.println("minValueForFloat = " + minValueForFloat); 76 | */ 77 | /* 78 | int a = 12; 79 | int b = 0; 80 | int c = a / b; 81 | System.out.println(c); 82 | */ 83 | 84 | /* 85 | 86 | float a = 12f; 87 | float b = 0f; 88 | float c = a / b; 89 | // System.out.println(c); 90 | 91 | float a2 = -10f; 92 | float c2 = a2 / b; 93 | // System.out.println(c2); 94 | 95 | float a3 = 0f; 96 | 97 | float c3 = a3 / b; 98 | // System.out.println(c3); 99 | boolean isPositiveInfinity = Float.POSITIVE_INFINITY == c; 100 | System.out.println(isPositiveInfinity); 101 | boolean isNegativeInfinity = Float.NEGATIVE_INFINITY == c2; 102 | System.out.println(isNegativeInfinity); 103 | boolean isNan = Float.NaN == c3; 104 | boolean isNan2 = Float.isNaN(c3); 105 | System.out.println(isNan); 106 | System.out.println(isNan2); 107 | System.out.println(c3); 108 | System.out.println(Float.NaN); 109 | */ 110 | 111 | /* 112 | double doubleNumber = 12D; // 64-bit -> 8 byte; 113 | boolean isInfinityNumber = Double.isFinite(-12D / 0); 114 | */ 115 | 116 | char c = 'A'; // 16-bit -> 2 byte 117 | 118 | boolean is12GreaterThen15 = ( 12 > 15 ); 119 | boolean is21GreaterThen15 = ( 21 > 15 ); 120 | System.out.println(is12GreaterThen15); 121 | System.out.println(is21GreaterThen15); 122 | } 123 | } 124 | ```` 125 | 126 | 127 | ````java 128 | import java.io.Console; 129 | 130 | public class ConsoleTest { 131 | 132 | public static void main(String[] args) { 133 | Console console = System.console(); 134 | String login = console.readLine("Enter Login : "); 135 | char[] arr = console.readPassword("Enter Password : "); 136 | String password = new String(arr); 137 | System.out.println(login); 138 | System.out.println(password); 139 | } 140 | } 141 | ```` 142 | 143 | 144 | ````java 145 | import java.util.Scanner; 146 | 147 | public class Login { 148 | 149 | public static void main(String[] args) { 150 | int a = 10; 151 | Scanner reader = new Scanner(System.in); 152 | // String login = reader.nextLine(); 153 | // System.out.println(login + " successfully logged in 👌"); 154 | // String next = reader.next(); 155 | // System.out.println("next = " + next); 156 | 157 | /* 158 | boolean hasNextInt = reader.hasNextInt(); 159 | if (hasNextInt){ 160 | int nextInt2 = reader.nextInt(); 161 | System.out.println(nextInt2); 162 | } 163 | */ 164 | 165 | // String login = reader.nextLine(); 166 | // String password = reader.nextLine(); 167 | // System.out.println(login); 168 | System.out.print("Enter number : "); 169 | int i = reader.nextInt(); 170 | System.out.print("Enter Some String : "); 171 | reader.nextLine(); 172 | String s = reader.nextLine(); 173 | System.out.println(i); 174 | System.out.println(s); 175 | } 176 | } 177 | ```` 178 | 179 | 180 | ````java 181 | public class NamingConventions { 182 | 183 | int CAR_WHEELS = 4; 184 | 185 | public static void main(String[] args) { 186 | // int user_age = 12; 187 | // int userAge = 12; 188 | 189 | } 190 | } 191 | ```` 192 | 193 | 194 | ````java 195 | public class VariableTypes { 196 | 197 | int count = 3; 198 | static int count2 = 3; 199 | 200 | public static void main(String[] args) { 201 | int a = 12; 202 | float b = 123F; 203 | long c = 123L; 204 | } 205 | } 206 | ```` 207 | 208 | ````java 209 | import java.io.Console; 210 | 211 | public class AuthenticationApplication { 212 | 213 | public static void main(String[] args) { 214 | String dbLogin = "jl"; 215 | String dbPassword = "123"; 216 | Console console = System.console(); 217 | 218 | String login = console.readLine("login : "); 219 | char[] array = console.readPassword("password : "); 220 | String password = new String(array); 221 | 222 | if ( login.equals(dbLogin) && password.equals(dbPassword) ) { 223 | System.out.println("Successfully logged in 😊"); 224 | } else { 225 | System.out.println("Bad credentials 😒"); 226 | } 227 | } 228 | } 229 | ```` 230 | -------------------------------------------------------------------------------- /source_codes/module_1/5-lesson.md: -------------------------------------------------------------------------------- 1 | ````java 2 | public class MethodDefinitionExample { 3 | 4 | public static void main(String[] args) { 5 | // call method 6 | int addMethodResponse = add(12, 1290); 7 | System.out.println(addMethodResponse); 8 | hello(); 9 | } 10 | 11 | static int add(int x, int y) { 12 | int result = x + y; 13 | return result; 14 | } 15 | 16 | static void hello() { 17 | System.out.println("Hello"); 18 | } 19 | } 20 | ```` 21 | 22 | 23 | ````java 24 | import java.util.Scanner; 25 | 26 | public class GuessGame { 27 | 28 | 29 | public static void main(String[] args) { 30 | int number = generateNumber(20, 1); 31 | System.out.println("Choose number between 1 and 20"); 32 | for ( int i = 0; i < 3; i++ ) { 33 | int guess = readInputAsInt("Guess number : "); 34 | if ( guess == number ) { 35 | System.out.println("You win 😂😂😂 )))"); 36 | return; 37 | } else { 38 | System.out.println("Try again ))"); 39 | } 40 | } 41 | System.out.println("You loose 😒😒😒"); 42 | } 43 | 44 | private static int readInputAsInt(String message) { 45 | Scanner scanner = new Scanner(System.in); 46 | System.out.print(message); 47 | return scanner.nextInt(); 48 | } 49 | 50 | private static int generateNumber(int max, int min) { 51 | if ( max < min ) { 52 | int temp = min; 53 | min = max; 54 | max = temp; 55 | } 56 | return (int) Math.round(Math.random() * ( max - min )) + 1; 57 | } 58 | 59 | } 60 | ```` 61 | 62 | 63 | ````java 64 | public class Recursion { 65 | public static void main(String[] args) { 66 | // recursion(5); 67 | // headRecursion(3); 68 | treeRecursion(3); 69 | } 70 | 71 | static void recursion(int n) { // tail recursion 72 | if ( n > 0 ) { // 1) base condition 73 | System.out.println(n); 74 | n = n - 1; // 3) change state 75 | recursion(n); // 2) call 76 | } 77 | } 78 | 79 | static void headRecursion(int n) { 80 | if ( n > 0 ) { 81 | headRecursion(n - 1); 82 | System.out.println(n); 83 | } 84 | } 85 | 86 | static void treeRecursion(int n) { 87 | if ( n > 0 ) { 88 | System.out.println(n); 89 | treeRecursion(n - 1); 90 | treeRecursion(n - 1); 91 | } 92 | } 93 | } 94 | ```` 95 | 96 | 97 | ````java 98 | public class Fibonacci { 99 | public static void main(String[] args) { 100 | // f(n) = f(n - 1) + f(n - 2) 101 | // f(0) = 0 102 | // f(1) = 1 103 | // f(2) = f(1) + f(0) = 1 104 | // f(3) = f(2) + f(1) = 2 105 | // f(4) = f(3) + f(2) = 3 106 | // f(5) = f(4) + f(3) = 5 107 | // f(6) = f(5) + f(4) = 8 108 | // int fibonacci3 = fibonacci(3); 109 | // int fibonacci6 = fibonacci(6); 110 | // int fibonacci13 = fibonacci(13); 111 | // System.out.println(fibonacci3); 112 | // System.out.println(fibonacci6); 113 | // System.out.println(fibonacci13); 114 | long fibonacci100 = fibonacci2(100); 115 | System.out.println(fibonacci100); 116 | // hello(); 117 | } 118 | 119 | static void hello() { 120 | System.out.println("Hello"); 121 | hello(); 122 | } 123 | 124 | 125 | static int fibonacci(int n) { 126 | if (n <= 1) 127 | return n; 128 | return fibonacci(n - 1) + fibonacci(n - 2); 129 | } 130 | 131 | static long fibonacci2(int n) { 132 | long f0 = 0; 133 | long f1 = 1; 134 | for (int i = 2; i <= n; i++) { 135 | long temp = f1; 136 | f1 = f1 + f0; 137 | f0 = temp; 138 | } 139 | return f1; 140 | } 141 | } 142 | ```` -------------------------------------------------------------------------------- /source_codes/module_1/8-lesson.md: -------------------------------------------------------------------------------- 1 | ````java 2 | public class ImmutableString { 3 | public static void main(String[] args) { 4 | String str = "Hi"; 5 | // String str2 = "Hi" + " Guys"; 6 | // System.out.println(str); 7 | // str.concat(" Guys"); 8 | // System.out.println(str); 9 | String str2 = " "; 10 | System.out.println(str2.isBlank()); 11 | System.out.println(str2.isEmpty()); 12 | System.out.println("Hi Hi Hi".indexOf("Hi")); 13 | System.out.println("Hi Hi Hi".lastIndexOf("Hi")); 14 | System.out.println("Hi Hi Hi".replace("Hi", "Hello")); 15 | } 16 | } 17 | ```` 18 | 19 | 20 | ````java 21 | public class WorkingWithString { 22 | public static void main(String[] args) { 23 | int a = 12; 24 | String str = "hello"; // literal 1) 25 | String str2 = new String("Hello"); // 2) 26 | char[] array = new char[]{'H', 'e', 'l', 'l', 'o'}; 27 | String str3 = new String(array); // 3) 28 | System.out.println(str); 29 | System.out.println(str2); 30 | System.out.println(str3); 31 | } 32 | } 33 | ```` 34 | 35 | 36 | ````java 37 | public class WorkingWithCompactString { 38 | public static void main(String[] args) { 39 | int a = 12; // 4 byte -> 32 bit 40 | String str = "hi"; 41 | String str2 = "fsafafafafsafsaffsafafaf"; 42 | // java 8 UTF-16; 16 bit 43 | // java 9 Latin-1; 44 | String str3 = "Hi"; // byte[].length = 2 byte; 45 | String str4 = "Hi€"; // byte[].length = 6 byte; 46 | 47 | } 48 | } 49 | ```` 50 | 51 | 52 | ````java 53 | public class WorkingWithStringConstantPool { 54 | public static void main(String[] args) { 55 | String str5 = new String("PDP"); 56 | String str6 = new String("PDP"); 57 | System.out.println("System.identityHashCode(str5) = " + System.identityHashCode(str5)); 58 | System.out.println("System.identityHashCode(str6) = " + System.identityHashCode(str6)); 59 | String str7 = str6.intern(); 60 | System.out.println(str7); 61 | System.out.println("System.identityHashCode(str7) = " + System.identityHashCode(str7)); 62 | String str8 = "PDP"; 63 | System.out.println("System.identityHashCode(str8) = " + System.identityHashCode(str8)); 64 | } 65 | } 66 | ```` 67 | 68 | 69 | ````java 70 | public class ProblemWithString { 71 | public static void main(String[] args) { 72 | /*String str = "hello->"; 73 | for (int i = 0; i < 1e4; i++) { 74 | str = str.concat(String.valueOf(i)); // ? 75 | } 76 | System.out.println(str);*/ 77 | 78 | StringBuffer stringBuffer = new StringBuffer(); 79 | stringBuffer.append("hello->"); 80 | stringBuffer.append("hello->12"); 81 | System.out.println(stringBuffer.capacity()); 82 | stringBuffer.append("12"); 83 | // 16 + 16 + 2 84 | System.out.println(stringBuffer.capacity()); 85 | System.out.println(stringBuffer.length()); 86 | StringBuffer str = new StringBuffer(); 87 | for ( int i = 0; i < 1e4; i++ ) { 88 | str.append(i); 89 | } 90 | System.out.println(str); 91 | 92 | } 93 | } 94 | ```` 95 | 96 | 97 | ````java 98 | import java.util.StringTokenizer; 99 | 100 | public class WorkingWithStringTokenizer { 101 | public static void main(String[] args) { 102 | // " ",\t\n 103 | /*StringTokenizer stringTokenizer = new StringTokenizer("hello guys, how are you !", 104 | "o", 105 | true); 106 | while (stringTokenizer.hasMoreTokens()) { 107 | System.out.println(stringTokenizer.nextToken()); 108 | }*/ 109 | 110 | String str = "hello guys, how are you !"; 111 | String[] split = str.split("o"); 112 | for ( String s : split ) { 113 | System.out.println(s); 114 | } 115 | } 116 | } 117 | ```` 118 | 119 | -------------------------------------------------------------------------------- /source_codes/module_1/9-lesson.md: -------------------------------------------------------------------------------- 1 | ````java 2 | import java.util.Random; 3 | import java.util.Scanner; 4 | 5 | public class StringFormatTest { 6 | public static void main(String[] args) { 7 | System.out.print("Enter name : "); 8 | String name = new Scanner(System.in).nextLine(); 9 | int age = new Random().nextInt(10, 30); 10 | /*String pattern = "Hello %S, are you %d years old ?"; 11 | String message = String.format(pattern, name, age); 12 | System.out.println(message);*/ 13 | String pattern = "Hello %S, are you %d years old ?"; 14 | // String message = pattern.formatted(name, age); 15 | /*String message = "Hello %S, are you %d years old ?" 16 | .formatted(name, age);*/ 17 | String message = "Hello " + name + ", are you " + age + " years old ?"; 18 | System.out.println(message); 19 | 20 | 21 | } 22 | } 23 | ```` 24 | 25 | ````java 26 | import java.util.Locale; 27 | 28 | public class NumberFormatOutput { 29 | public static void main(String[] args) { 30 | System.out.printf("%,d %n", 1000000); 31 | System.out.printf(Locale.US, "%,d %n", 1000000); 32 | System.out.printf(Locale.CANADA, "%,d %n", 1000000); 33 | System.out.printf(Locale.GERMAN, "%,d %n", 1000000); 34 | System.out.printf(Locale.FRENCH, "%,d %n", 1000000); 35 | } 36 | } 37 | ```` 38 | 39 | ````java 40 | public class MessageFormatTest { 41 | public static void main(String[] args) { 42 | System.out.print("Enter name : "); 43 | String name = new Scanner(System.in).nextLine(); 44 | int age = new Random().nextInt(10, 30); 45 | String message = MessageFormat.format("Hello {1}, are you {0} years old ?", name, age); 46 | System.out.println(message); 47 | } 48 | } 49 | ```` 50 | 51 | ````java 52 | public class DateFormatOutput { 53 | public static void main(String[] args) { 54 | Date date = new Date(); 55 | System.out.printf(Locale.ITALY, "%tB %n", date); 56 | System.out.printf(Locale.ITALY, "%tb %n", date); 57 | System.out.printf(Locale.CHINA, "%tB %n", date); 58 | System.out.printf(Locale.CHINA, "%tb %n", date); 59 | System.out.printf("%tB/% getter 15 | // mutators -> setter 16 | } 17 | } 18 | ```` 19 | 20 | ````java 21 | public class Book { 22 | private String title; 23 | private int pageCount; 24 | 25 | public Book(String title, int pageCount) { 26 | this.title = title; 27 | this.pageCount = pageCount; 28 | } 29 | 30 | /* 31 | * public String titleAccessor(){ 32 | * return this.title; 33 | * } 34 | * 35 | * public void titleMutator(String newTitle){ 36 | * this.title = newTitle; 37 | * } 38 | */ 39 | 40 | public String getTitle() { 41 | return title; 42 | } 43 | 44 | public void setTitle(String title) { 45 | this.title = title; 46 | } 47 | 48 | public int getPageCount() { 49 | return pageCount; 50 | } 51 | 52 | public void setPageCount(int pageCount) { 53 | this.pageCount = pageCount; 54 | } 55 | } 56 | ```` 57 | 58 | ````java 59 | public class Student { 60 | 61 | private String fullname; 62 | private String studentId; 63 | 64 | public Student(String fullname, String studentId) { 65 | this.fullname = fullname; 66 | this.studentId = studentId; 67 | } 68 | 69 | public String getFullname() { 70 | return fullname; 71 | } 72 | 73 | public String getStudentId() { 74 | return studentId; 75 | } 76 | 77 | public void setFullname(String fullname) { 78 | this.fullname = fullname; 79 | } 80 | } 81 | ```` 82 | 83 | ````java 84 | public class Main { 85 | public static void main(String[] args) { 86 | Student student = new Student("Akbarov Akbar", "123"); 87 | } 88 | } 89 | ```` 90 | 91 | 92 | ````java 93 | public class Main { 94 | public static void main(String[] args) { 95 | // java.util.Date date = new java.util.Date(); // fully qualified name 96 | // java.sql.Date sqlDate = new java.sql.Date(0, 0, 0) ; 97 | Date date = new Date(); 98 | System.out.println(date); 99 | System.out.println(sqrt(16)); 100 | System.out.println(pow(12, 2)); 101 | System.out.println(PI); 102 | } 103 | } 104 | ```` -------------------------------------------------------------------------------- /source_codes/module_2/4-lesson.md: -------------------------------------------------------------------------------- 1 | 2 | # Overloading 3 | ````java 4 | package uz.pdp.overloading; 5 | 6 | /** 7 | * @author Elmurodov Javohir 8 | * @time 11/4/2022 4:38 AM 9 | * @project lesson_4_1 10 | */ 11 | 12 | public class Calculator { 13 | 14 | public int sum(byte x, byte y) { 15 | System.out.println("byte, byte called"); 16 | return x + y; 17 | } 18 | 19 | public int sum(int x, int y) { 20 | System.out.println("int, int called"); 21 | return x + y; 22 | } 23 | 24 | public int sum(int x, long y) { 25 | System.out.println("int, long called"); 26 | return (int) ( x + y ); 27 | } 28 | 29 | public int sum(int x, double y) { 30 | System.out.println("int, double called"); 31 | return (int) ( x + y ); 32 | } 33 | 34 | } 35 | ```` 36 | 37 | 38 | ````java 39 | package uz.pdp.overloading; 40 | 41 | /** 42 | * @author Elmurodov Javohir 43 | * @time 11/4/2022 4:39 AM 44 | * @project lesson_4_1 45 | */ 46 | 47 | public class App { 48 | public static void main(String[] args) { 49 | Calculator calculator = new Calculator(); 50 | int x = 90; 51 | int y = 10; 52 | // System.out.println(calculator.sum(x, y)); 53 | // System.out.println(calculator.sum(x, 12.0F)); 54 | // System.out.println(calculator.sum(x, 12L)); 55 | // String str1 = String.valueOf(12); 56 | // String str2 = String.valueOf(12D); 57 | // String str3 = String.valueOf(12L); 58 | // String str4 = String.valueOf('A'); 59 | byte a = 12; 60 | byte b = 32; 61 | // automatic type promotion 62 | // 63 | System.out.println(calculator.sum(a, b)); 64 | 65 | } 66 | } 67 | ```` 68 | 69 | # Overriding 70 | ````java 71 | package uz.pdp.overriding; 72 | 73 | /** 74 | * @author Elmurodov Javohir 75 | * @time 11/4/2022 4:58 AM 76 | * @project lesson_4_1 77 | */ 78 | 79 | public class Shape { 80 | public void area() { 81 | System.out.println("Shape area"); 82 | } 83 | 84 | public Number covariantTypeTest() { 85 | return 21; 86 | } 87 | 88 | public static void hiding() { 89 | System.out.println("Shape hiding method"); 90 | } 91 | } 92 | ```` 93 | 94 | 95 | ````java 96 | package uz.pdp.overriding; 97 | 98 | /** 99 | * @author Elmurodov Javohir 100 | * @time 11/4/2022 5:01 AM 101 | * @project lesson_4_1 102 | */ 103 | 104 | public class Rectangle extends Shape { 105 | private double a; 106 | private double b; // a*b 107 | 108 | public Rectangle(double a, double b) { 109 | this.a = a; 110 | this.b = b; 111 | } 112 | 113 | @Override 114 | public void area() { 115 | double area = a * b; 116 | System.out.printf("Rectangle Area : %10.2f %n", area); 117 | } 118 | } 119 | ```` 120 | 121 | 122 | ````java 123 | package uz.pdp.overriding; 124 | 125 | import java.awt.font.NumericShaper; 126 | 127 | import static java.lang.Math.*; 128 | 129 | /** 130 | * @author Elmurodov Javohir 131 | * @time 11/4/2022 4:59 AM 132 | * @project lesson_4_1 133 | */ 134 | 135 | public class Circle extends Shape { 136 | private double radius; // pi*radius^2 137 | 138 | public Circle(double radius) { 139 | this.radius = radius; 140 | } 141 | 142 | @Override 143 | public void area() { 144 | double area = PI * pow(radius, 2); 145 | System.out.printf("Circle Area : %10.2f%n", area); 146 | } 147 | 148 | @Override 149 | public Double covariantTypeTest() { 150 | return 12D; 151 | } 152 | 153 | @Override 154 | public boolean equals(Object obj) { 155 | return super.equals(obj); 156 | } 157 | 158 | public static void hiding() { 159 | System.out.println("Circle hiding method"); 160 | } 161 | } 162 | ```` 163 | 164 | 165 | ````java 166 | package uz.pdp.overriding; 167 | 168 | /** 169 | * @author Elmurodov Javohir 170 | * @time 11/4/2022 5:02 AM 171 | * @project lesson_4_1 172 | */ 173 | 174 | public class App { 175 | public static void main(String[] args) { 176 | 177 | Shape circle = new Circle(4D); // upcasting 178 | circle.area(); 179 | // circle.hiding(); 180 | 181 | Shape rectangle = new Rectangle(4, 6); // upcasting 182 | rectangle.area(); 183 | // rectangle.hiding(); 184 | } 185 | } 186 | ```` 187 | 188 | # Access Modifiers 189 | 190 | ````java 191 | package uz.pdp.accessmodifiers; 192 | 193 | /** 194 | * @author Elmurodov Javohir 195 | * @time 11/4/2022 5:28 AM 196 | * @project lesson_4_1 197 | */ 198 | 199 | public class Child extends Parent{ 200 | @Override 201 | protected void defaultMethod() { // protected or public 202 | super.defaultMethod(); 203 | } 204 | 205 | @Override 206 | public void protectedMethod() { 207 | super.protectedMethod(); 208 | } 209 | 210 | @Override 211 | public void publicMethod() { 212 | super.publicMethod(); 213 | } 214 | } 215 | ```` 216 | 217 | 218 | ````java 219 | package uz.pdp.accessmodifiers; 220 | 221 | /** 222 | * @author Elmurodov Javohir 223 | * @time 11/4/2022 5:28 AM 224 | * @project lesson_4_1 225 | */ 226 | 227 | public class Parent { 228 | void defaultMethod() { 229 | System.out.println("Parent default method"); 230 | } 231 | 232 | protected void protectedMethod() { 233 | System.out.println("Parent protected method"); 234 | } 235 | public void publicMethod() { 236 | System.out.println("Parent public method"); 237 | } 238 | 239 | private void privateMethod() { 240 | System.out.println("Parent private method"); 241 | } 242 | } 243 | ```` -------------------------------------------------------------------------------- /source_codes/module_2/7-lesson.md: -------------------------------------------------------------------------------- 1 | # Stack 2 | ````java 3 | /** 4 | * @author Elmurodov Javohir 5 | * @time 11/10/2022 8:34 AM 6 | * @project lesson_7_2_stack 7 | */ 8 | 9 | public class App { 10 | public static void main(String[] args) { 11 | App app = new App(); 12 | app.m2(); 13 | int w = 9; 14 | } 15 | 16 | public void m1() { 17 | int a = 13; 18 | Integer b2 = 12; 19 | double b = 90; 20 | m2(); 21 | int q = 12; 22 | } 23 | 24 | public void m2() { 25 | int c = 91; 26 | float f = 90; 27 | } 28 | } 29 | ```` 30 | # Method Parameters 31 | ````java 32 | package uz.pdp; 33 | 34 | /** 35 | * @author Elmurodov Javohir 36 | * @time 11/17/2022 6:57 AM 37 | * @project lesson_7_4_ma 38 | */ 39 | 40 | public class Counter { 41 | public int count = 0; 42 | } 43 | ```` 44 | 45 | 46 | ````java 47 | package uz.pdp; 48 | 49 | /** 50 | * @author Elmurodov Javohir 51 | * @time 11/17/2022 6:45 AM 52 | * @project lesson_7_4_ma 53 | */ 54 | 55 | public class App { 56 | public static void main(String[] args) { 57 | App app = new App(); 58 | int a = 12; 59 | // app.m1(a); 60 | // System.out.println(a); 61 | // Integer b = 12; 62 | // app.m2(b); 63 | // System.out.println(b); 64 | Counter c = new Counter(); 65 | c.count = 90; 66 | System.out.println(c.count); 67 | app.m3(c); 68 | System.out.println(c.count); 69 | } 70 | 71 | public void m3(Counter c) { 72 | // c.count = 300; 73 | c = new Counter(); 74 | c.count = 300; 75 | } 76 | 77 | public void m2(Integer b) { 78 | b = 90; 79 | } 80 | 81 | public void m1(int a) { 82 | a = 90; 83 | System.out.println("inside m1 method " + a); 84 | } 85 | } 86 | ```` 87 | 88 | ````java 89 | package uz.pdp; 90 | 91 | /** 92 | * @author Elmurodov Javohir 93 | * @time 11/17/2022 7:06 AM 94 | * @project lesson_7_4_ma 95 | */ 96 | 97 | public class Calculator { 98 | public static void main(String... args) { 99 | Calculator c = new Calculator(); 100 | System.out.println(c.add(12, 3)); 101 | System.out.println(c.add(12, 3, 45)); 102 | System.out.println(c.add(12, 3, 45, 20)); 103 | System.out.println(c.add(12, 3, 45, 4, 5, 5, 6, 7, 7, 20)); 104 | } 105 | 106 | public int add(int... arr) { 107 | int sum = 0; 108 | for (int i : arr) { 109 | sum += i; 110 | } 111 | return sum; 112 | } 113 | 114 | // public int add(int[] arr) { 115 | // int sum = 0; 116 | // for (int i : arr) { 117 | // sum += i; 118 | // } 119 | // return sum; 120 | // } 121 | } 122 | ```` -------------------------------------------------------------------------------- /source_codes/module_2/9-lesson.md: -------------------------------------------------------------------------------- 1 | # Video dan olinadi kod lar -------------------------------------------------------------------------------- /source_codes/module_3/6-lesson(Queue Data Structure).md: -------------------------------------------------------------------------------- 1 | ## Patient 2 | 3 | ````java 4 | package collectionsframework.queue; 5 | 6 | public class Patient /*implements Comparable*/ { 7 | private String fullName; 8 | private int priority; 9 | 10 | public Patient(String fullName, int priority) { 11 | this.fullName = fullName; 12 | this.priority = priority; 13 | } 14 | 15 | /* 16 | @Override 17 | public int compareTo(Patient patient) { 18 | return Integer.compare(priority, patient.priority) * -1; 19 | } 20 | */ 21 | 22 | public int getPriority() { 23 | return priority; 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | return "Patient{" + 29 | "fullName='" + fullName + '\'' + 30 | ", priority=" + priority + 31 | '}'; 32 | } 33 | } 34 | 35 | ```` 36 | 37 | ## SimpleQueue 38 | 39 | ````java 40 | package collectionsframework.queue; 41 | 42 | import java.util.Arrays; 43 | import java.util.Iterator; 44 | import java.util.StringJoiner; 45 | 46 | public class SimpleQueue implements Iterable { 47 | private Object[] elements; 48 | private int size = 0; 49 | 50 | public SimpleQueue(int capacity) { 51 | this.elements = new Object[capacity]; 52 | } 53 | 54 | public boolean enqueue(E element) { 55 | if (isFull()) return false; 56 | elements[size++] = element; 57 | return true; 58 | } 59 | 60 | @SuppressWarnings("unchecked") 61 | public E dequeue() { 62 | if (isEmpty()) 63 | throw new RuntimeException("Queue is empty"); 64 | 65 | E frontElement = (E) elements[0]; 66 | System.arraycopy(elements, 1, elements, 0, size - 1); 67 | elements[size - 1] = null; 68 | size--; 69 | return frontElement; 70 | } 71 | 72 | @Override 73 | public String toString() { 74 | var sj = new StringJoiner(", ", "[", "]"); 75 | this.forEach(e -> sj.add(String.valueOf(e))); 76 | return sj.toString(); 77 | } 78 | 79 | public boolean isEmpty() { 80 | return size == 0; 81 | } 82 | 83 | public boolean isFull() { 84 | return size == elements.length; 85 | } 86 | 87 | public int size() { 88 | return size; 89 | } 90 | 91 | @Override 92 | public Iterator iterator() { 93 | return new Iterator() { 94 | private int i = 0; 95 | 96 | @Override 97 | public boolean hasNext() { 98 | return i < size; 99 | } 100 | 101 | @Override 102 | @SuppressWarnings("unchecked") 103 | public E next() { 104 | return (E) elements[i++]; 105 | } 106 | }; 107 | } 108 | 109 | public static void main(String[] args) { 110 | var q = new SimpleQueue(10); 111 | 112 | q.enqueue(12); 113 | q.enqueue(34); 114 | q.enqueue(89); 115 | q.enqueue(9); 116 | // System.out.println(q); 117 | // System.out.println(q.size()); 118 | q.forEach(System.out::println); 119 | System.out.println(q); 120 | } 121 | } 122 | ```` 123 | 124 | ## JavaPriorityQueueTest 125 | 126 | ````java 127 | package collectionsframework.queue; 128 | 129 | import java.util.Comparator; 130 | import java.util.PriorityQueue; 131 | 132 | public class JavaPriorityQueueTest { 133 | public static void main(String[] args) { 134 | /*var pq = new PriorityQueue(); 135 | pq.add("Java"); 136 | pq.add("C++"); 137 | pq.add("AA"); 138 | pq.add("Kotlin"); 139 | pq.add("Python"); 140 | System.out.println(pq.peek()); 141 | System.out.println(pq); 142 | System.out.println(pq.poll()); 143 | System.out.println(pq);*/ 144 | 145 | var patients = new PriorityQueue( 146 | Comparator.comparingInt(Patient::getPriority).reversed() 147 | ); 148 | patients.add(new Patient("Akbar Akbarov", 2)); 149 | patients.add(new Patient("Asliddin Abdullayev", 3)); 150 | patients.add(new Patient("Karimov Javlon", 5)); 151 | System.out.println(patients.poll()); 152 | } 153 | } 154 | 155 | ```` 156 | -------------------------------------------------------------------------------- /source_codes/module_4/10-lesson(Logging API).md: -------------------------------------------------------------------------------- 1 | 2 | ````java 3 | package uz.pdp.logging; 4 | 5 | import java.io.IOException; 6 | import java.util.logging.Level; 7 | import java.util.logging.LogRecord; 8 | import java.util.logging.Logger; 9 | 10 | public class SimpleLoggingExample { 11 | static { 12 | String file = SimpleLoggingExample.class.getClassLoader().getResource("logging.properties").getFile(); 13 | System.setProperty("java.util.logging.config.file", file); 14 | } 15 | 16 | private static Logger logger = Logger.getLogger("MyLogger"); 17 | 18 | public static void main(String[] args) throws IOException { 19 | LogRecord logRecord = new LogRecord(Level.INFO, "Hello this is simple warning log"); 20 | logger.log(logRecord); 21 | 22 | } 23 | } 24 | ```` 25 | 26 | 27 | ````java 28 | package uz.pdp.logging; 29 | 30 | import uz.pdp.logging.a.A; 31 | 32 | import java.util.Random; 33 | import java.util.logging.Handler; 34 | import java.util.logging.Level; 35 | import java.util.logging.Logger; 36 | 37 | public class TelegramAlarmExample { 38 | 39 | static { 40 | String file = TelegramAlarmExample.class.getClassLoader().getResource("logging.properties").getFile(); 41 | System.setProperty("java.util.logging.config.file", file); 42 | } 43 | 44 | private static Logger logger = Logger.getLogger(TelegramAlarmExample.class.getSimpleName()); 45 | 46 | public static void main(String[] args) { 47 | try { 48 | if ( new Random().nextBoolean() ) 49 | throw new RuntimeException("Runtime Exception For alarm testing"); 50 | else new A().a(); 51 | } catch (RuntimeException e) { 52 | e.printStackTrace(); 53 | logger.log(Level.SEVERE, "Error Message For Telegram", e); 54 | } 55 | } 56 | } 57 | ```` 58 | 59 | 60 | ````java 61 | package uz.pdp.logging; 62 | 63 | import java.util.logging.Filter; 64 | import java.util.logging.Level; 65 | import java.util.logging.LogRecord; 66 | 67 | public class TelegramAlarmFilter implements Filter { 68 | @Override 69 | public boolean isLoggable(LogRecord record) { 70 | return record.getLevel().intValue() == Level.SEVERE.intValue(); 71 | } 72 | } 73 | ```` 74 | 75 | 76 | ````java 77 | package uz.pdp.logging; 78 | 79 | import java.io.PrintWriter; 80 | import java.io.StringWriter; 81 | import java.util.logging.Formatter; 82 | import java.util.logging.LogRecord; 83 | 84 | public class TelegramAlarmFormatter extends Formatter { 85 | 86 | @Override 87 | public String format(LogRecord record) { 88 | String stackTrace = "\n"; 89 | Throwable thrown = record.getThrown(); 90 | if ( thrown != null ) { 91 | StringWriter out = new StringWriter(); 92 | PrintWriter printWriter = new PrintWriter(out); 93 | thrown.printStackTrace(printWriter); 94 | stackTrace += out.toString(); 95 | } 96 | return "%s :: [%d] :: %s :: [%s] %s". 97 | formatted(record.getLevel(), 98 | record.getLongThreadID(), 99 | record.getLoggerName(), 100 | record.getMessage(), 101 | stackTrace); 102 | } 103 | } 104 | ```` 105 | ````java 106 | package uz.pdp.logging; 107 | 108 | import java.net.URI; 109 | import java.net.http.HttpClient; 110 | import java.net.http.HttpRequest; 111 | import java.net.http.HttpResponse; 112 | import java.util.logging.LogRecord; 113 | import java.util.logging.StreamHandler; 114 | 115 | public class TelegramAlarmHandler extends StreamHandler { 116 | public TelegramAlarmHandler() { 117 | super.setFilter(new TelegramAlarmFilter()); 118 | super.setFormatter(new TelegramAlarmFormatter()); 119 | } 120 | 121 | @Override 122 | public synchronized void publish(LogRecord record) { 123 | if ( isLoggable(record) ) { 124 | try { 125 | String formattedMEssage = getFormatter().format(record); 126 | String bodyMessage = """ 127 | { 128 | "chat_id":"%s", 129 | "text":"%s" 130 | }""".formatted(Secrets.chatId, formattedMEssage); 131 | 132 | HttpClient httpClient = HttpClient.newHttpClient(); 133 | HttpRequest request = HttpRequest.newBuilder() 134 | .POST(HttpRequest.BodyPublishers.ofString(bodyMessage)) 135 | .uri(URI.create(Secrets.sendMessage)) 136 | .header("Content-Type", "application/json") 137 | .build(); 138 | httpClient.send(request, HttpResponse.BodyHandlers.ofString()); 139 | } catch (Exception e) { 140 | e.printStackTrace(); 141 | } 142 | } 143 | } 144 | 145 | @Override 146 | public boolean isLoggable(LogRecord record) { 147 | return getFilter().isLoggable(record); 148 | } 149 | } 150 | ```` 151 | ````java 152 | package uz.pdp.logging; 153 | 154 | public class Secrets { 155 | public static String token = "bot_token"; 156 | public static String chatId = "chat_id"; 157 | // updates => https://api.telegram.org/botBOT_TOKEN/getUpdates 158 | public static String sendMessage = "https://api.telegram.org/bot5977319195:AAFSjV2l_6KBuJ5XLmn3WWFPzHSVRNzjfK8/sendMessage"; 159 | } 160 | ```` 161 | 162 | 163 | ````java 164 | package uz.pdp.logging.a; 165 | 166 | import uz.pdp.logging.a.b.B; 167 | 168 | public class A { 169 | public void a(){ 170 | new B().b(); 171 | } 172 | } 173 | ```` 174 | ````java 175 | package uz.pdp.logging.a.b; 176 | 177 | public class B { 178 | public void b() { 179 | System.out.println(12 / 0); 180 | } 181 | } 182 | ```` -------------------------------------------------------------------------------- /source_codes/module_4/8-lesson(Regex).md: -------------------------------------------------------------------------------- 1 | ````java 2 | package uz.pdp.regex; 3 | 4 | import java.util.regex.Matcher; 5 | import java.util.regex.Pattern; 6 | 7 | public class RegexExample { 8 | public static void main(String[] args) { 9 | Pattern pattern = Pattern.compile("e.{2}"); 10 | Matcher matcher = pattern.matcher("Hello PDP 535 Some random text 34"); 11 | // System.out.println(matcher.matches()); 12 | while ( matcher.find() ) { 13 | System.out.println("start=" + matcher.start() + ", end=" + matcher.end() + ", group=" + matcher.group()); 14 | } 15 | } 16 | } 17 | ```` 18 | ````java 19 | package uz.pdp.regex; 20 | 21 | import java.util.Arrays; 22 | 23 | public class StringRegexExample { 24 | public static void main(String[] args) { 25 | String input = "Some 12 random 3 Text 90 For Fun 2 oor 1243"; 26 | /*String input = "12344567qw";*/ 27 | /*String[] split = input.split("\\d+");*/ 28 | /*System.out.println(Arrays.toString(split));*/ 29 | /*System.out.println(input.matches("\\d{4,}"));*/ 30 | /*input.replace("12","PDP");*/ 31 | String welcomePdp = input.replaceAll("\\d+", "Welcome PDP"); 32 | System.out.println(welcomePdp); 33 | } 34 | } 35 | ```` 36 | ````java 37 | package uz.pdp.regex; 38 | 39 | import java.util.ArrayList; 40 | import java.util.List; 41 | import java.util.regex.Matcher; 42 | import java.util.regex.Pattern; 43 | 44 | public class StringUtils { 45 | 46 | public static final Pattern VALID_EMAIL_PATTERN = Pattern.compile("(\\w+)@([\\w-]+)\\.(\\w{2,4})"); 47 | public static final Pattern STRONG_PASSWORD_PATTERN = Pattern.compile("^(?=.*[a-z]+)(?=.*[A-Z]+)(?=.*\\d+)(?=.*[!@#$&*?><]+).{8,30}$"); 48 | private static final Pattern VALID_PHONE_NUMBER_PATTERN = Pattern.compile("^(\\+998)((71|88|9[01349])(\\d{7}))$"); 49 | 50 | public static boolean isValidPhoneNumber(String input) { 51 | if ( input == null ) 52 | throw new RuntimeException("Input can not be null"); 53 | return VALID_PHONE_NUMBER_PATTERN.matcher(input).matches(); 54 | } 55 | 56 | public static boolean isValidEmailAddress(String input) { 57 | if ( input == null ) 58 | throw new RuntimeException("Input can not be null"); 59 | return VALID_EMAIL_PATTERN.matcher(input).matches(); 60 | } 61 | 62 | public static boolean isStrongPassword(String input) { 63 | if ( input == null ) 64 | throw new RuntimeException("Input can not be null"); 65 | return STRONG_PASSWORD_PATTERN.matcher(input).matches(); 66 | } 67 | 68 | public static List getWords(String input) { 69 | if ( input == null ) 70 | throw new RuntimeException("Input can not be null"); 71 | Pattern pattern = Pattern.compile("[a-zA-Z]+"); 72 | Matcher matcher = pattern.matcher(input); 73 | 74 | List words = new ArrayList<>(); 75 | while ( matcher.find() ) 76 | words.add(matcher.group()); 77 | return words; 78 | } 79 | } 80 | ```` 81 | ````java 82 | package uz.pdp.regex; 83 | 84 | public class StringUtilsTest { 85 | public static void main(String[] args) { 86 | System.out.println(StringUtils.getWords("Hello PDP 12, Welcome to Bootcamp")); 87 | } 88 | 89 | private static void testStrongPassword() { 90 | System.out.println(StringUtils.isStrongPassword("123")); 91 | System.out.println(StringUtils.isStrongPassword("Q123")); 92 | System.out.println(StringUtils.isStrongPassword("Q1aqws2$3")); 93 | } 94 | 95 | private static void testEmailAddress() { 96 | System.out.println(StringUtils.isValidEmailAddress("john.asd")); 97 | System.out.println(StringUtils.isValidEmailAddress("john@.asd")); 98 | System.out.println(StringUtils.isValidEmailAddress("john@gmail.com")); 99 | } 100 | 101 | private static void testPhoneNumber() { 102 | System.out.println(StringUtils.isValidPhoneNumber("+998906775445")); 103 | System.out.println(StringUtils.isValidPhoneNumber("998906775445")); 104 | System.out.println(StringUtils.isValidPhoneNumber("+99890677544q")); 105 | System.out.println(StringUtils.isValidPhoneNumber("+99895677544q")); 106 | System.out.println(StringUtils.isValidPhoneNumber("+99995677544q")); 107 | } 108 | } 109 | ```` -------------------------------------------------------------------------------- /source_codes/module_4/9-lesson().md: -------------------------------------------------------------------------------- 1 | # GIT Commands -------------------------------------------------------------------------------- /source_codes/module_5/1-lesson(mailing).md: -------------------------------------------------------------------------------- 1 | ## Sending email using gmail 2 | ````java 3 | import javax.mail.*; 4 | import javax.mail.internet.InternetAddress; 5 | import javax.mail.internet.MimeMessage; 6 | import java.util.Properties; 7 | 8 | public class GmailService { 9 | 10 | private static final String username = "your gmail here"; 11 | private static final String password = "your app password here"; 12 | 13 | public static void main(String[] args) throws MessagingException { 14 | 15 | var properties = getProperties(); 16 | var session = getSession(properties, username, password); 17 | var message = new MimeMessage(session); 18 | var recipient = "recipient@gmail.com"; 19 | 20 | message.setSubject("This is Subject For Test Message"); 21 | message.setContent("

Body of mail here

","text/html"); 22 | message.setFrom(new InternetAddress(username)); 23 | message.setRecipient(Message.RecipientType.TO, new InternetAddress(recipient)); 24 | Transport.send(message); 25 | System.out.println("Message Sent Successfully"); 26 | } 27 | 28 | private static Properties getProperties() { 29 | Properties properties = new Properties(); 30 | properties.put("mail.smtp.host", "smtp.gmail.com"); 31 | properties.put("mail.smtp.port", "465"); 32 | properties.put("mail.smtp.ssl.enable", "true"); 33 | properties.put("mail.smtp.auth", "true"); 34 | return properties; 35 | } 36 | 37 | 38 | private static Session getSession(Properties properties, String username, String password) { 39 | return Session.getInstance(properties, new Authenticator() { 40 | @Override 41 | protected PasswordAuthentication getPasswordAuthentication() { 42 | return new PasswordAuthentication(username, password); 43 | } 44 | }); 45 | } 46 | } 47 | ```` 48 | 49 | ## Sending email using mailtrap 50 | ````java 51 | import javax.activation.DataHandler; 52 | import javax.activation.DataSource; 53 | import javax.activation.FileDataSource; 54 | import javax.mail.*; 55 | import javax.mail.internet.InternetAddress; 56 | import javax.mail.internet.MimeBodyPart; 57 | import javax.mail.internet.MimeMessage; 58 | import javax.mail.internet.MimeMultipart; 59 | import java.io.IOException; 60 | import java.nio.file.Files; 61 | import java.nio.file.Path; 62 | import java.nio.file.StandardCopyOption; 63 | import java.nio.file.StandardOpenOption; 64 | import java.util.Base64; 65 | import java.util.Properties; 66 | 67 | public class MailtrapService { 68 | 69 | private static final String username = "your mailtrap username here"; 70 | private static final String password = "your mailtrap password here"; 71 | 72 | public static void main(String[] args) throws Exception { 73 | 74 | var properties = getProperties(); 75 | var session = getSession(properties, username, password); 76 | var message = new MimeMessage(session); 77 | message.setFrom(new InternetAddress(username)); 78 | message.setRecipient(Message.RecipientType.TO, new InternetAddress("recipient@gmail.com")); 79 | message.setSubject("This is Subject For Test Message"); 80 | var multipart = new MimeMultipart(); 81 | 82 | var attachment1 = new MimeBodyPart(); 83 | var fileDataSource = new FileDataSource("cv.txt"); 84 | var dataHandler = new DataHandler(fileDataSource); 85 | attachment1.setFileName("MyCV.txt"); 86 | attachment1.setDataHandler(dataHandler); 87 | 88 | var attachment2 = new MimeBodyPart(); 89 | var fileDataSource2 = new FileDataSource("samples.txt"); 90 | var dataHandler2 = new DataHandler(fileDataSource2); 91 | attachment2.setFileName("CodeSamples.txt"); 92 | attachment2.setDataHandler(dataHandler2); 93 | 94 | var contentMessage = new MimeBodyPart(); 95 | String body = """ 96 |
97 |

Body of mail here

98 | 99 |
100 | """.formatted(getImageAsBase64()); 101 | contentMessage.setContent(body, "text/html"); 102 | 103 | multipart.addBodyPart(attachment1); 104 | multipart.addBodyPart(attachment2); 105 | multipart.addBodyPart(contentMessage); 106 | message.setContent(multipart); 107 | Transport.send(message); 108 | System.out.println("Message Sent Successfully"); 109 | } 110 | 111 | private static String getImageAsBase64() throws IOException { 112 | Base64.Encoder encoder = Base64.getEncoder(); 113 | Path path = Path.of("animal.jpg"); 114 | byte[] allBytes = Files.readAllBytes(path); 115 | String encodeToString = encoder.encodeToString(allBytes); 116 | Files.writeString(Path.of("imageAstring.txt"), encodeToString, StandardOpenOption.TRUNCATE_EXISTING); 117 | return encodeToString; 118 | } 119 | 120 | private static Properties getProperties() { 121 | Properties properties = new Properties(); 122 | properties.put("mail.smtp.host", "smtp.mailtrap.io"); 123 | properties.put("mail.smtp.port", "587"); 124 | properties.put("mail.smtp.starttls.enable", "true"); 125 | properties.put("mail.smtp.auth", "true"); 126 | return properties; 127 | } 128 | 129 | 130 | private static Session getSession(Properties properties, String username, String password) { 131 | return Session.getInstance(properties, new Authenticator() { 132 | @Override 133 | protected PasswordAuthentication getPasswordAuthentication() { 134 | return new PasswordAuthentication(username, password); 135 | } 136 | }); 137 | } 138 | } 139 | ```` -------------------------------------------------------------------------------- /source_codes/module_5/10-lesson(introduction_to_streams).md: -------------------------------------------------------------------------------- 1 | ### We will Need Some Faker Data 2 | 3 | download [seeder jar](seeder.java) and run below command 4 | 5 | ```shell 6 | java -jar seeder.jar 7 | ``` 8 | ### Stream Support For User defined classes 9 | 10 | ```java 11 | package uz.pdp.declarativeprogramming; 12 | 13 | import com.google.gson.Gson; 14 | import com.google.gson.reflect.TypeToken; 15 | 16 | import java.io.IOException; 17 | import java.lang.reflect.Type; 18 | import java.nio.file.Files; 19 | import java.nio.file.Path; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | import java.util.function.Consumer; 23 | import java.util.function.Predicate; 24 | import java.util.stream.Collectors; 25 | import java.util.stream.Stream; 26 | 27 | public class Main { 28 | public static void main(String[] args) throws IOException { 29 | Path path = Path.of("src/main/resources/students.json"); 30 | String jsonDATA = Files.readString(path); 31 | /*Stream stream = Files.newBufferedReader(path).lines();*/ 32 | Gson gson = new Gson(); 33 | Type type = new TypeToken>() { 34 | }.getType(); 35 | List students = gson.fromJson(jsonDATA, type); 36 | 37 | //imperative(students); 38 | Predicate studentPredicate = student -> student.getAge() < 21; 39 | List studentsUnder21 = students 40 | .stream() 41 | .parallel() 42 | .filter(studentPredicate) 43 | .filter(student -> student.getGender().equals("MALE")) 44 | .limit(10) 45 | .collect(Collectors.toList()); 46 | studentsUnder21.forEach(System.out :: println); 47 | 48 | Stream stringStream = Stream.of("Java", "Python", "Scala"); 49 | stringStream.forEach(System.out :: println); 50 | 51 | } 52 | 53 | private static void imperative(List students) { 54 | List studentsUnder21 = new ArrayList<>(); 55 | int count = 0; 56 | for ( Student student : students ) { 57 | if ( student.getAge() < 21 ) { 58 | studentsUnder21.add(student); 59 | count = count + 1; 60 | } 61 | if ( count == 10 ) 62 | break; 63 | } 64 | 65 | Consumer studentConsumer = System.out :: println; 66 | studentsUnder21.forEach(System.out :: println); 67 | } 68 | } 69 | 70 | ``` 71 | 72 | ````java 73 | package uz.pdp.declarativeprogramming; 74 | 75 | import java.time.LocalDate; 76 | import java.util.Spliterator; 77 | import java.util.Spliterators; 78 | import java.util.UUID; 79 | import java.util.stream.Stream; 80 | import java.util.stream.StreamSupport; 81 | 82 | public class Item { 83 | private UUID id = UUID.randomUUID(); 84 | private LocalDate localDate = LocalDate.now(); 85 | public Stream stream() { 86 | Spliterator spliterator = Spliterators.spliterator(new Object[]{id, localDate}, Spliterator.SIZED); 87 | return StreamSupport.stream(spliterator, false); 88 | } 89 | public static void main(String[] args) { 90 | Item item = new Item(); 91 | item.stream().forEach(System.out :: println); 92 | } 93 | } 94 | ```` 95 | 96 | ````java 97 | package uz.pdp.declarativeprogramming; 98 | 99 | import lombok.AllArgsConstructor; 100 | import lombok.Builder; 101 | import lombok.Data; 102 | import lombok.NoArgsConstructor; 103 | 104 | @Data 105 | @AllArgsConstructor 106 | @NoArgsConstructor 107 | @Builder 108 | public class Student { 109 | private Integer id; 110 | private String name; 111 | private String email; 112 | private String gender; 113 | private int age; 114 | } 115 | ```` -------------------------------------------------------------------------------- /source_codes/module_5/11-lesson(stream_api).md: -------------------------------------------------------------------------------- 1 | ### We will Need Some Faker Data 2 | 3 | download [seeder.jar](https://github.com/jlkesh/pdp_online_java_lessons/raw/main/jars/seeder.jar) and run below command to generate some random data 4 | 5 | ```shell 6 | java -jar seeder.jar 7 | ``` 8 | 9 | or you can download some already generated data [here](https://github.com/jlkesh/pdp_online_java_lessons/raw/main/jars/employees.json) 10 | 11 | 12 | ````java 13 | package uz.pdp.streamapi; 14 | 15 | import com.google.gson.Gson; 16 | import com.google.gson.reflect.TypeToken; 17 | import uz.pdp.declarativeprogramming.Item; 18 | 19 | import java.io.DataInput; 20 | import java.io.IOException; 21 | import java.lang.reflect.Type; 22 | import java.nio.file.Files; 23 | import java.nio.file.Path; 24 | import java.util.*; 25 | import java.util.function.IntPredicate; 26 | import java.util.function.Predicate; 27 | import java.util.stream.DoubleStream; 28 | import java.util.stream.IntStream; 29 | import java.util.stream.LongStream; 30 | import java.util.stream.Stream; 31 | 32 | public class StreamAPIOperatorsExample { 33 | public static void main(String[] args) throws IOException { 34 | Path path = Path.of("src/main/resources/employees.json"); 35 | String jsonDATA = Files.readString(path); 36 | Gson gson = new Gson(); 37 | Type type = new TypeToken>() { 38 | }.getType(); 39 | List employeeList = gson.fromJson(jsonDATA, type); 40 | /*int[] numbers = {12, 5, 6, 7, 8, 90}; 41 | IntStream stream = Arrays.stream(numbers); 42 | IntPredicate predicate = (i) -> i % 2 == 0; 43 | stream.filter(predicate) 44 | .forEach(System.out :: println);*/ 45 | /*Predicate filterByGender = employee -> employee.getGender().equals("FEMALE"); 46 | Predicate filterByAge = employee -> employee.getAge() > 29; 47 | Predicate employeePredicate = filterByAge.and(filterByGender); 48 | employeeList.stream() 49 | *//*.filter(filterByAge) 50 | .filter(filterByGender)*//* 51 | .filter(employeePredicate) 52 | .skip(33) 53 | .limit(5) 54 | .peek(System.out :: println) 55 | .toList();*/ 56 | //.forEach(System.out :: println); 57 | 58 | /*Stream integerStream = Stream.of(11, 3, 4, 7); 59 | boolean anyMatch = integerStream.anyMatch((i) -> i % 2 == 0); 60 | System.out.println("anyMatch = " + anyMatch); 61 | 62 | integerStream = Stream.of(12, 4, 4, 8); 63 | boolean allMatch = integerStream.allMatch((i) -> i % 2 == 0); 64 | System.out.println("allMatch = " + allMatch); 65 | 66 | integerStream = Stream.of(19, 17, 3, 7); 67 | boolean nonMatch = integerStream.noneMatch((i) -> i % 2 == 0); 68 | System.out.println("nonMatch = " + nonMatch);*/ 69 | 70 | /* 71 | Stream employeeStream = employeeList.stream(); 72 | Stream empInfoStream = employeeStream 73 | .map(employee -> new EmpInfo(employee.getFull_name(), employee.getAge())); 74 | // empInfoStream.forEach(System.out :: println); 75 | IntStream integerStream = empInfoStream.mapToInt(employee -> employee.age()); 76 | // Stream = IntStream 77 | integerStream.forEach(System.out :: println); 78 | */ 79 | List javaBooks = new ArrayList<>(); 80 | javaBooks.add(new Book("1", "Concurrency in Practise")); 81 | javaBooks.add(new Book("2", "Modern Java In Action")); 82 | 83 | /*List postgresqlBook = new ArrayList<>(); 84 | postgresqlBook.add(new Book("5", "Postgresql 14 Administration")); 85 | postgresqlBook.add(new Book("6", "SQL for Dummies")); 86 | 87 | List> lists = List.of(javaBooks, postgresqlBook); 88 | Stream streamStream = lists 89 | .stream() 90 | .flatMap(books -> books.stream()); 91 | streamStream.forEach(System.out :: println);*/ 92 | /*.map(books -> books.stream());*/ 93 | 94 | /*javaBooks.parallelStream() 95 | .filter(book -> book.id().equals("2")) 96 | .findAny() 97 | .ifPresentOrElse( 98 | book -> System.out.println(book.name()), 99 | () -> System.out.println("Not Found")); 100 | */ 101 | /*Stream stringStream = Stream.of("Java", "Scala", "Kotlin", "Groovy", "Python");*/ 102 | // Stream stringStream = Stream.of(); 103 | /*stringStream.reduce((language1, language2) -> language1 + ", " + language2) 104 | .ifPresentOrElse(lang-> System.out.println(lang), 105 | ()-> System.out.println("No items found"));*/ 106 | /*String[] array = stringStream.toArray(String[] :: new); 107 | System.out.println(Arrays.toString(array));*/ 108 | 109 | 110 | /*Stream.iterate(1, (x) -> x + 1) 111 | .limit(100) 112 | .forEach(System.out :: println); 113 | */ 114 | 115 | /*Stream.generate(UUID :: randomUUID) 116 | .limit(10) 117 | .forEach(System.out :: println);*/ 118 | 119 | } 120 | } 121 | 122 | 123 | record EmpInfo(String fullName, int age) { 124 | } 125 | 126 | record Book(String id, String name) { 127 | } 128 | ```` 129 | 130 | ````java 131 | package uz.pdp.streamapi; 132 | 133 | import lombok.AllArgsConstructor; 134 | import lombok.Builder; 135 | import lombok.Data; 136 | import lombok.NoArgsConstructor; 137 | 138 | @Data 139 | @AllArgsConstructor 140 | @NoArgsConstructor 141 | @Builder 142 | public class Employee { 143 | private int id; 144 | private String full_name; 145 | private String gender; 146 | private int age; 147 | } 148 | ```` 149 | 150 | -------------------------------------------------------------------------------- /source_codes/module_5/12-lesson(comparator_and_collectors).md: -------------------------------------------------------------------------------- 1 | # Comparator Lesson Source Code 2 | ````java 3 | package uz.pdp.compartor; 4 | 5 | import com.google.gson.Gson; 6 | import com.google.gson.reflect.TypeToken; 7 | import uz.pdp.streamapi.Employee; 8 | 9 | import java.io.IOException; 10 | import java.lang.reflect.Type; 11 | import java.nio.file.Files; 12 | import java.nio.file.Path; 13 | import java.util.Comparator; 14 | import java.util.List; 15 | import java.util.function.Function; 16 | import java.util.function.IntFunction; 17 | import java.util.function.ToIntFunction; 18 | import java.util.stream.Stream; 19 | 20 | public class ComparatorExample { 21 | public static void main(String[] args) throws IOException { 22 | /*Function keyExtractor = element -> element.length(); 23 | Stream.of("water-melon", "milk", "berry", "pineapple", "grapes", "apple") 24 | .sorted(Comparator.comparing(keyExtractor, Comparator.reverseOrder())) 25 | .forEach(System.out :: println);*/ 26 | 27 | /*ToIntFunction keyExtractor = (i) -> Math.abs(i); 28 | Stream.of(-10, 31, 16, -5, 2) 29 | .sorted(Comparator.comparingInt(keyExtractor)) 30 | .forEach(System.out :: println);*/ 31 | 32 | String readString = Files.readString(Path.of("src/main/resources/employees.json")); 33 | Gson gson = new Gson(); 34 | Type type = new TypeToken>() { 35 | }.getType(); 36 | List employees = gson.fromJson(readString, type); 37 | employees.stream() 38 | .sorted(Comparator 39 | .comparing(Employee :: getFull_name) 40 | .thenComparing(Employee :: getGender) 41 | .thenComparing(Employee :: getAge) 42 | ).forEach(System.out :: println); 43 | 44 | } 45 | } 46 | ```` 47 | # Collector Lesson Source Code 48 | ````java 49 | @Data 50 | @AllArgsConstructor 51 | @NoArgsConstructor 52 | @Builder 53 | public class Employee { 54 | private int id; 55 | private String full_name; 56 | private String gender; 57 | private int age; 58 | } 59 | 60 | ```` 61 | 62 | ````java 63 | package uz.pdp.compartor; 64 | 65 | import com.google.gson.Gson; 66 | import com.google.gson.reflect.TypeToken; 67 | import uz.pdp.streamapi.Employee; 68 | 69 | import java.io.IOException; 70 | import java.lang.reflect.Type; 71 | import java.nio.file.Files; 72 | import java.nio.file.Path; 73 | import java.util.EnumSet; 74 | import java.util.List; 75 | import java.util.Set; 76 | import java.util.function.BiConsumer; 77 | import java.util.function.BinaryOperator; 78 | import java.util.function.Function; 79 | import java.util.function.Supplier; 80 | import java.util.stream.Collector; 81 | 82 | public class CollectorExample { 83 | public static void main(String[] args) throws IOException { 84 | String readString = Files.readString(Path.of("src/main/resources/employees.json")); 85 | Gson gson = new Gson(); 86 | Type type = new TypeToken>() { 87 | }.getType(); 88 | List employees = gson.fromJson(readString, type); 89 | String xml = employees.stream() 90 | .collect(new ToXMLCollector()); 91 | System.out.println(xml); 92 | } 93 | } 94 | 95 | class ToXMLCollector implements Collector { 96 | 97 | final String xmlstr = """ 98 | \n\t 99 | \t\t%s 100 | \t\t%s 101 | \t\t%s 102 | \t"""; 103 | 104 | public Supplier supplier() { 105 | return StringBuffer :: new; 106 | } 107 | 108 | public BiConsumer accumulator() { 109 | return (sb, e) -> sb.append(String.format(xmlstr, e.getId(), e.getFull_name(), e.getGender(), e.getAge())); 110 | } 111 | 112 | public BinaryOperator combiner() { 113 | return (sb1, sb2) -> sb1.append(sb2.toString()); 114 | } 115 | 116 | public Function finisher() { 117 | return sb -> String.format("%s\n", sb.toString()); 118 | } 119 | 120 | public Set characteristics() { 121 | return EnumSet.of(Characteristics.CONCURRENT); 122 | } 123 | 124 | } 125 | ```` 126 | 127 | # Extra Code Samples(Comparator) 128 | Example 1 129 | ````java 130 | Function keyExtractor = str -> str.length(); 131 | Stream.of("grapes", "milk", "pineapple", "water-melon") 132 | .sorted(Comparator.comparing(keyExtractor)) 133 | .forEach(System.out::println); 134 | ```` 135 | Example 2 136 | ````java 137 | Stream.of("grapes", "milk", "pineapple", "water-melon") 138 | .sorted(Comparator.comparing(String::length, Comparator.reverseOrder())) 139 | .forEach(System.out::println); 140 | ```` 141 | Example 3 142 | ````java 143 | Stream.of(-10, 31, 16, -5, 2) 144 | .sorted(Comparator.comparingInt(i -> Math.abs(i))) 145 | .forEach(System.out::println); 146 | ```` 147 | Example 4 148 | ````java 149 | employees.stream() 150 | .sorted(Comparator.comparing(Employee::getName).thenComparing(Employee::getAge)) 151 | .forEach(System.out::println); 152 | ```` -------------------------------------------------------------------------------- /source_codes/module_5/15-lesson(gson).md: -------------------------------------------------------------------------------- 1 | ### test uchun json ma'lumotlar ni [bu yerdan](https://github.com/jlkesh/pdp_online_java_lessons/blob/main/jars/Books.json) olasiz 2 | 3 | ````java 4 | @Data 5 | @Builder 6 | public class Book { 7 | 8 | @Expose 9 | @SerializedName("id") 10 | private Integer bookId; 11 | 12 | @Expose(deserialize = false) 13 | @SerializedName("title") 14 | protected String bookTitle; 15 | 16 | @Expose 17 | @SerializedName("author") 18 | private String bookAuthor; 19 | 20 | @Since(1.0) 21 | @Expose 22 | private volatile Date bookDate; 23 | @Expose 24 | private LocalDate publishedDate; 25 | } 26 | ```` 27 | ````java 28 | public class LocalDateSerializer implements JsonSerializer { 29 | @Override 30 | public JsonElement serialize(LocalDate src, Type typeOfSrc, JsonSerializationContext context) { 31 | return new JsonPrimitive(src.format(DateTimeFormatter.ISO_LOCAL_DATE)); 32 | } 33 | } 34 | ```` 35 | 36 | ````java 37 | public class LocalDateDeserializer implements JsonDeserializer { 38 | @Override 39 | public LocalDate deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 40 | String locadateAsString = json.getAsString(); 41 | return LocalDate.parse(locadateAsString); 42 | } 43 | } 44 | ```` 45 | 46 | ````java 47 | public class LocalDateTypeAdapter extends TypeAdapter { 48 | @Override 49 | public void write(JsonWriter out, LocalDate value) throws IOException { 50 | if ( value == null ) 51 | out.nullValue(); 52 | else 53 | out.value(value.format(DateTimeFormatter.ISO_LOCAL_DATE)); 54 | } 55 | 56 | @Override 57 | public LocalDate read(JsonReader in) throws IOException { 58 | if ( in.peek() == JsonToken.NULL ) 59 | return null; 60 | else 61 | return LocalDate.parse(in.nextString()); 62 | } 63 | } 64 | ```` 65 | 66 | ````java 67 | public class Main { 68 | private static String booksListAsStringJSON; 69 | 70 | static { 71 | try { 72 | String file = Main.class.getClassLoader().getResource("Books.json").getFile(); 73 | booksListAsStringJSON = Files.readString(Path.of(file)); 74 | } catch (IOException e) { 75 | throw new RuntimeException(e); 76 | } 77 | } 78 | 79 | public static void main(String[] args) { 80 | System.out.println("Hello PDP!"); 81 | // defaultConfiguration(); 82 | Gson gson = new GsonBuilder() 83 | //.registerTypeAdapter(LocalDate.class, new LocalDateSerializer()) 84 | //.registerTypeAdapter(LocalDate.class, new LocalDateDeserializer()) 85 | .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter()) 86 | .serializeNulls() 87 | .setPrettyPrinting() 88 | .setFieldNamingPolicy(FieldNamingPolicy.UPPER_CASE_WITH_UNDERSCORES) 89 | // .excludeFieldsWithoutExposeAnnotation() 90 | // .excludeFieldsWithModifiers(Modifier.VOLATILE, Modifier.PROTECTED) 91 | .setVersion(1.2) 92 | .create(); 93 | 94 | Stream.generate(UUID ::randomUUID).limit(50).forEach(System.out::println); 95 | 96 | 97 | Book book = Book.builder() 98 | .bookId(1) 99 | .bookTitle("Reactive Spring") 100 | .bookAuthor("Josh Long") 101 | .publishedDate(LocalDate.of(2021, 1, 1)) 102 | .build(); 103 | 104 | String jsonDATA = gson.toJson(book); 105 | System.out.println(jsonDATA); 106 | Book fromJson = gson.fromJson(jsonDATA, Book.class); 107 | System.out.println(fromJson); 108 | 109 | } 110 | 111 | private static void cuntomConfiguration(Gson gson) { 112 | Type type = new TypeToken>() { 113 | }.getType(); 114 | List books = gson.fromJson(booksListAsStringJSON, type); 115 | books.forEach(System.err :: println); 116 | } 117 | 118 | private static void defaultConfiguration() { 119 | Gson gson = new Gson(); 120 | Book book = Book.builder() 121 | .bookId(1) 122 | .bookTitle("Reactive Spring") 123 | .bookAuthor("Josh Long") 124 | //.publishedDate(LocalDate.of(2021, 1, 1)) 125 | .build(); 126 | String jsonDATA = gson.toJson(book); 127 | String jsonDATA2 = "{\"id\":1,\"title\":\"Reactive Spring\",\"author\":\"Josh Long\"}"; 128 | System.out.println(jsonDATA); 129 | Book fromJsonBook = gson.fromJson(jsonDATA2, Book.class); 130 | System.out.println(fromJsonBook); 131 | // System.out.println(booksListAsStringJSON); 132 | Type type = new TypeToken>() { 133 | }.getType(); 134 | List books = gson.fromJson(booksListAsStringJSON, type); 135 | books.forEach(System.err :: println); 136 | } 137 | } 138 | ```` 139 | -------------------------------------------------------------------------------- /source_codes/module_5/16-lesson(reflections_api).md: -------------------------------------------------------------------------------- 1 | [Qo'shimcha Malumot uchun](https://www.oracle.com/technical-resources/articles/java/javareflection.html) 2 | 3 | ````java 4 | public class MyClass { 5 | private final String message; 6 | 7 | /* 8 | private MyClass() { 9 | } 10 | */ 11 | 12 | public MyClass(String message) { 13 | this.message = message; 14 | } 15 | 16 | public void hi() { 17 | System.out.println("Hello PDP!"); 18 | System.out.println(message); 19 | } 20 | 21 | private Date showMessage() { 22 | System.out.println(message); 23 | return new Date(); 24 | } 25 | 26 | private int sum(int x, int y) { 27 | System.out.println("sum = " + ( x + y )); 28 | return x + y; 29 | } 30 | 31 | public String getMessage() { 32 | return message; 33 | } 34 | } 35 | ```` 36 | 37 | ````java 38 | public class Main { 39 | public static void main(String[] args) throws Exception { 40 | MyClass myClass = new MyClass("Hello This is reflection"); 41 | // Class clazz = (Class) Class.forName("uz.pdp.reflections_api.MyClass"); 42 | Class clazz = myClass.getClass(); 43 | /*Constructor constructor = clazz.getDeclaredConstructor(String.class); 44 | constructor.setAccessible(true); 45 | MyClass myClass = constructor.newInstance("Hello from Reflections"); 46 | myClass.hi();*/ 47 | 48 | /*for ( Method declaredMethod : clazz.getDeclaredMethods() ) { 49 | System.out.println(declaredMethod.getName()); 50 | }*/ 51 | /*Method method = clazz.getDeclaredMethod("showMessage"); 52 | method.setAccessible(true); 53 | Object o = method.invoke(myClass); 54 | System.out.println(o);*/ 55 | /*Method method = clazz.getDeclaredMethod("sum", int.class, int.class); 56 | method.setAccessible(true); 57 | Object o = method.invoke(myClass, 23, 4); 58 | System.out.println(o);*/ 59 | 60 | System.out.println(myClass.getMessage()); 61 | Field field = clazz.getDeclaredField("message"); 62 | field.setAccessible(true); 63 | field.set(myClass, "Volaaa. Bu Reflection bilan hamma narsa qilsa bolar ekan"); 64 | System.out.println(myClass.getMessage()); 65 | } 66 | } 67 | ```` -------------------------------------------------------------------------------- /source_codes/module_5/18.annotations.md: -------------------------------------------------------------------------------- 1 | # _Warning List_ 2 | 3 | | warning name | description | 4 | |----------------------------|------------------------------------------------------------------------------------------| 5 | | all | to suppress all warnings | 6 | | boxing | to suppress warnings relative to boxing/unboxing operations | 7 | | cast | to suppress warnings relative to cast operations | 8 | | dep-ann | to suppress warnings relative to deprecated annotation | 9 | | deprecation | to suppress warnings relative to deprecation | 10 | | fallthrough | to suppress warnings relative to missing breaks in switch statements | 11 | | finally | to suppress warnings relative to finally block that don’t return | 12 | | hiding | to suppress warnings relative to locals that hide variable | 13 | | incomplete-switch | to suppress warnings relative to missing entries in a switch statement (enum case) | 14 | | nls | to suppress warnings relative to non-nls string literals | 15 | | null | to suppress warnings relative to null analysis | 16 | | restriction | to suppress warnings relative to usage of discouraged or forbidden references | 17 | | serial | to suppress warnings relative to missing serialVersionUID field for a serializable class | 18 | | static-access | to suppress warnings relative to incorrect static access | 19 | | synthetic-access | to suppress warnings relative to unoptimized access from inner classes | 20 | | unchecked | to suppress warnings relative to unchecked operations | 21 | | unqualified-field-access | to suppress warnings relative to field access unqualified | 22 | | unused | to suppress warnings relative to unused code | 23 | 24 | ````java 25 | public class Machine { 26 | private List versions = new ArrayList<>(); 27 | 28 | @SafeVarargs 29 | public final void safe(T... toAdd) { 30 | for ( T version : toAdd ) { 31 | versions.add(version); 32 | } 33 | } 34 | } 35 | ```` 36 | 37 | ````java 38 | import java.lang.reflect.Method; 39 | 40 | 41 | public class Main { 42 | 43 | @MyAnnotation 44 | private String field; 45 | 46 | @MyAnnotation 47 | public void hello() { 48 | System.out.println("Hello PDP!"); 49 | } 50 | 51 | public static void main(String[] args) throws Exception { 52 | /*System.out.println(Main.class.isAnnotationPresent(MyAnnotation.class));*/ 53 | UserDAO userDAO = new UserDAO(); 54 | Method method = userDAO.getClass().getDeclaredMethod("save", Object.class); 55 | DataBaseProperty annotation = method.getAnnotation(DataBaseProperty.class); 56 | String url = annotation.url(); 57 | String username = annotation.username(); 58 | String password = annotation.password(); 59 | System.out.printf("Connecting Database with url : %s\ncredentials %s:%s%n", url, username, password); 60 | method.invoke(userDAO, new Object()); 61 | } 62 | } 63 | ```` 64 | 65 | 66 | ````java 67 | import java.lang.annotation.ElementType; 68 | import java.lang.annotation.Retention; 69 | import java.lang.annotation.RetentionPolicy; 70 | import java.lang.annotation.Target; 71 | 72 | @Retention(RetentionPolicy.RUNTIME) 73 | @Target({ElementType.TYPE, ElementType.FIELD,ElementType.METHOD}) 74 | public @interface MyAnnotation { 75 | 76 | } 77 | ```` 78 | 79 | 80 | ````java 81 | import java.lang.annotation.ElementType; 82 | import java.lang.annotation.Retention; 83 | import java.lang.annotation.RetentionPolicy; 84 | import java.lang.annotation.Target; 85 | 86 | @Retention(RetentionPolicy.RUNTIME) 87 | @Target(ElementType.METHOD) 88 | public @interface DataBaseProperty { 89 | 90 | String url() default "jdbc:postgresql://localhost:5432/postgres"; 91 | 92 | String username() default "postgres"; 93 | 94 | String password(); 95 | 96 | } 97 | ```` 98 | 99 | 100 | ````java 101 | public class UserDAO { 102 | 103 | @DataBaseProperty(password = "123", username = "pdp") 104 | public void save(Object object) { 105 | System.out.println("Saving To Database....."); 106 | } 107 | } 108 | ```` 109 | 110 | -------------------------------------------------------------------------------- /source_codes/module_5/2-lesson(jar files).md: -------------------------------------------------------------------------------- 1 | ### Barcha kodlar prezentatsiyada -------------------------------------------------------------------------------- /source_codes/module_5/3-lesson(base64).md: -------------------------------------------------------------------------------- 1 | ````java 2 | import java.io.IOException; 3 | import java.util.Base64; 4 | 5 | public class Main { 6 | public static void main(String[] args) throws Exception { 7 | // simpleBase64(); 8 | // urlBase64(); 9 | // mimeBase64(); 10 | } 11 | 12 | private static void simpleBase64() throws IOException { 13 | Base64.Encoder encoder = Base64.getEncoder(); 14 | Base64.Decoder decoder = Base64.getDecoder(); 15 | byte[] encode = encoder.encode("hello".getBytes()); 16 | System.out.println(new String(encode)); 17 | System.out.println(new String(decoder.decode(encode))); 18 | /* 19 | byte[] bytes = Files.readAllBytes(Path.of("1.mp3")); 20 | Files.writeString(Path.of("1.txt"), encoder.encodeToString(bytes)); 21 | */ 22 | /* 23 | String data = Files.readString(Path.of("1.txt")); 24 | Files.write(Path.of("1.mp3"), decoder.decode(data)); 25 | */ 26 | } 27 | 28 | private static void mimeBase64() { 29 | Base64.Encoder mimeEncoder = Base64.getMimeEncoder(); 30 | Base64.Decoder mimeDecoder = Base64.getMimeDecoder(); 31 | String data = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores et facere incidunt modi molestiae molestias odio officiis optio perspiciatis porro, quam quisquam vero voluptate. A commodi cupiditate deserunt ea est fugit ipsam ipsum molestias nam natus officiis porro possimus, provident saepe, suscipit ullam unde. At aut culpa eaque illum impedit ipsum nisi odio omnis, provident repellat rerum sint unde veniam! Consectetur cumque delectus fuga in perspiciatis quasi quidem quod repellendus saepe soluta. Accusamus aliquid architecto at doloremque earum explicabo facilis, fugiat inventore iure libero magnam nostrum perferendis, reiciendis sit tenetur unde vel. Atque eius nesciunt praesentium quibusdam quidem repudiandae voluptatibus. A aliquid asperiores commodi consequatur dignissimos doloribus eaque enim eos eum harum laudantium, minus mollitia natus non obcaecati odio omnis pariatur perspiciatis quae quia quidem quisquam reprehenderit saepe sit temporibus, unde velit veniam! Commodi eius enim nobis optio voluptatum. Ad aut, commodi excepturi facilis minima, pariatur perferendis quibusdam quidem recusandae sed sunt tempore voluptates? A beatae cupiditate dicta ducimus eius et incidunt, ipsam molestiae necessitatibus omnis quo quod sed soluta tenetur ullam, velit vero voluptatum. Ab aliquid architecto blanditiis culpa deserunt dicta, ea eligendi ex modi molestiae, nam nesciunt quisquam repellat repellendus saepe? A ad aliquam amet, at cum esse exercitationem fugiat harum incidunt ipsam maxime nulla omnis perferendis perspiciatis porro, possimus quam quidem rerum tempore, tenetur unde vitae voluptatem. Laboriosam nobis obcaecati praesentium! Dolores ducimus eligendi eos ipsa iure necessitatibus nesciunt omnis quaerat reiciendis vero! A architecto beatae cum dolores inventore maxime porro, repudiandae vel? Deleniti dignissimos illo molestiae provident vel veniam veritatis voluptate voluptatum. Architecto consequatur esse hic in inventore laborum maxime nam, nesciunt nobis tempora! Ad aliquam dicta in iure molestias nulla obcaecati officia, quae quas sunt? Accusamus accusantium, alias atque aut commodi consequatur cum deleniti dolore est eum fuga impedit in minima nemo officiis optio possimus."; 32 | String encodeToString = mimeEncoder.encodeToString(data.getBytes()); 33 | System.out.println(encodeToString); 34 | System.out.println(new String(mimeDecoder.decode(encodeToString))); 35 | } 36 | 37 | private static void urlBase64() { 38 | Base64.Encoder urlEncoder = Base64.getUrlEncoder(); 39 | Base64.Decoder urlDecoder = Base64.getUrlDecoder(); 40 | String encodeToString = urlEncoder.encodeToString("\"a?".getBytes()); 41 | System.out.println(encodeToString); 42 | System.out.println(new String(urlDecoder.decode(encodeToString))); 43 | } 44 | } 45 | 46 | ```` -------------------------------------------------------------------------------- /source_codes/module_5/4-lesson(maven).md: -------------------------------------------------------------------------------- 1 | | name | description | 2 | |--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 3 | | mvn clean | This command cleans the maven project by deleting the target directory. The command output relevant messages are shown below. | 4 | | mvn compiler:compile | This command compiles the java source classes of the maven project. | 5 | | mvn compiler:testCompile | This command compiles the test classes of the maven project. | 6 | | mvn package | This command builds the maven project and packages them into a JAR, WAR, etc. | 7 | | mvn install | This command builds the maven project and installs the project files (JAR, WAR, pom.xml, etc) to the local repository. | 8 | | mvn deploy | This command is used to deploy the artifact to the remote repository. The remote repository should be configured properly in the project pom.xml file distributionManagement tag. The server entries in the maven settings.xml file is used to provide authentication details. | 9 | | mvn validate | This command validates the maven project that everything is correct and all the necessary information is available. | 10 | | mvn dependency:tree | This command generates the dependency tree of the maven project. | 11 | | mvn dependency:analyze | This command analyzes the maven project to identify the unused declared and used undeclared dependencies. | 12 | | mvn archetype:generate | Maven archetypes is a maven project templating toolkit. We can use this command to generate a skeleton maven project of different types, such as JAR, web application, maven site, etc. | 13 | | mvn site:site | This command generates a site for the project. You will notice a “site” directory in the target after executing this command. There will be multiple HTML files inside the site directory that provides information related to the project. | 14 | | mvn test | This command is used to run the test cases of the project using the maven-surefire-plugin. | 15 | | mvn compile | It’s used to compile the source Java classes of the project. | 16 | | mvn verify | This command build the project, runs all the test cases and run any checks on the results of the integration tests to ensure quality criteria are met. | 17 | | mvn -help | This command prints the maven usage and all the available options for us to use. | 18 | | mvn -o package | This command is used to run the maven build in the offline mode. It’s useful when we have all the required JARs download in the local repository and we don’t want Maven to look for any JARs in the remote repository. | 19 | | mvn -q package | Runs the maven build in the quiet mode, only the test cases results and errors are displayed. | 20 | | mvn -X package | Prints the maven version and runs the build in the debug mode. It’s opposite of the quiet mode and you will see a lot of debug messages in the console. | 21 | | mvn -v | Used to display the maven version information. | 22 | | mvn -DskipTests package | The skipTests system property is used to skip the unit test cases from the build cycle. We can also use -Dmaven.test.skip=true to skip the test cases execution. | -------------------------------------------------------------------------------- /source_codes/module_5/5-lesson(lombok I).md: -------------------------------------------------------------------------------- 1 | ````java 2 | @EqualsAndHashCode(of = "pan") 3 | // @NoArgsConstructor(staticName = "getInstance"/*,access = AccessLevel.PRIVATE*/) 4 | @AllArgsConstructor(staticName = "getInstance") 5 | @ToString 6 | @Setter 7 | @Getter 8 | public class Card { 9 | 10 | @NonNull 11 | private final String holderName; 12 | 13 | @NonNull 14 | private final String pan; 15 | private final String expiry; 16 | } 17 | ```` 18 | 19 | ````java 20 | /* 21 | @ToString 22 | @Getter 23 | @Setter 24 | @EqualsAndHashCode 25 | @RequiredArgsConstructor 26 | */ 27 | @Data 28 | @NoArgsConstructor 29 | @AllArgsConstructor 30 | public class User { 31 | private Integer id; 32 | private String username; 33 | private String email; 34 | } 35 | ```` 36 | 37 | ````java 38 | @ToString(callSuper = true, includeFieldNames = false) 39 | public class Manager extends User { 40 | 41 | private final String role; 42 | 43 | public Manager(Integer id, String username, String email, String role) { 44 | super(id, username, email); 45 | this.role = role; 46 | } 47 | } 48 | ```` 49 | 50 | ````java 51 | @RequiredArgsConstructor 52 | public class UserRegisterRequest { 53 | 54 | private final String username; 55 | 56 | @NonNull 57 | private String password; 58 | 59 | @NonNull 60 | private String email; 61 | } 62 | ```` 63 | 64 | ````java 65 | public class Main { 66 | 67 | @Getter(lazy = true) 68 | private final String id = getUniqueId(); 69 | 70 | private String getUniqueId() { 71 | System.out.println("Generating uniqueID"); 72 | return UUID.randomUUID().toString(); 73 | } 74 | 75 | public static void main(String[] args) { 76 | /* 77 | Main main = new Main(); 78 | System.out.println("Main object created"); 79 | System.out.println(main.getId()); 80 | */ 81 | /* 82 | User user = new User(1, "jlkesh", "john.lgd65@gmail.com"); 83 | Manager manager = new Manager(1, "jlkesh", "john.lgd65@gmail.com", "SALES_MANAGER"); 84 | System.out.println(manager); 85 | */ 86 | /* 87 | Card card1 = Card.getInstance(null, "860021435678", "11/26"); 88 | Card card2 = Card.getInstance("John", "860021435678", "02/26"); 89 | Card card = Card.getInstance(); 90 | System.out.println(card1.equals(card)); 91 | System.out.println(card1); 92 | card.setPan(null); 93 | */ 94 | UserRegisterRequest user = new UserRegisterRequest("jl", "123","xyz@gmail.com"); 95 | } 96 | 97 | } 98 | ```` -------------------------------------------------------------------------------- /source_codes/module_5/6-lesson(lombok II).md: -------------------------------------------------------------------------------- 1 | ````java 2 | @Builder/*(builderMethodName = "quruvchi",buildMethodName = "qurish")*/ 3 | @ToString 4 | @NoArgsConstructor 5 | @AllArgsConstructor 6 | public class Employee { 7 | private String fullName; 8 | private int age; 9 | } 10 | ```` 11 | 12 | ````java 13 | @ToString(callSuper = true) 14 | public class Manager extends Employee { 15 | @Builder.Default 16 | private String role = "SALES_MAN"; 17 | 18 | @Builder(builderMethodName = "childBuilder") 19 | public Manager(String fullName, int age, String role) { 20 | super(fullName, age); 21 | this.role = role; 22 | } 23 | } 24 | ```` 25 | 26 | 27 | ````java 28 | @Log 29 | public class Main { 30 | 31 | // private static Logger logger = Logger.getLogger(Main.class.getSimpleName()); 32 | /*@SneakyThrows*/ 33 | public static void main(String[] args) throws IOException { 34 | 35 | /* 36 | @Cleanup FileInputStream fileInputStream = new FileInputStream(""); 37 | @Cleanup FileOutputStream fileOutputStream = new FileOutputStream(""); 38 | */ 39 | /* 40 | Employee employee = Employee.builder() 41 | .fullName("Elmurodov Javohir") 42 | .age(28) 43 | .build(); 44 | System.out.println("Hello PDP"); 45 | System.out.println(employee); 46 | */ 47 | Manager manager = Manager.childBuilder() 48 | .fullName("Elmurodov Javohir") 49 | .age(28) 50 | .build(); 51 | System.out.println(manager); 52 | /*FileInputStream fileInputStream = new FileInputStream("file.txt");*/ 53 | log.info("Info message logged"); 54 | } 55 | } 56 | ```` 57 | 58 | ````java 59 | public class DeclaringVariables { 60 | public static void main(String[] args) { 61 | var message = "Hello PDP !"; 62 | val mes = "Hello PDP !"; 63 | System.out.println(message); 64 | System.out.println(mes); 65 | message = "Hello PDP Guys"; 66 | //mes = "Hello PDP Guys"; 67 | System.out.println(message); 68 | System.out.println(mes); 69 | } 70 | } 71 | ```` -------------------------------------------------------------------------------- /source_codes/module_5/8-lesson(behaviorparameterization).md: -------------------------------------------------------------------------------- 1 | # Behaviour Parametrization 2 | 3 | 4 | ````java 5 | 6 | public class Main { 7 | public static void main(String[] args) { 8 | List empList = List.of( 9 | new Employee("Javohir Elmurodov", "UZB", "SOFTWARE ENGINEER", 28), 10 | new Employee("John Doe", "US", "MANAGER ", 108), 11 | new Employee("Akmal Turdiyev", "UZB", "SALES_MANAGER", 29), 12 | new Employee("John Leg", "GER", "MANAGER", 25), 13 | new Employee("Akbar Akbarov", "US", "SOFTWARE ENGINEER", 17) 14 | ); 15 | 16 | List uzbEmployees = getEmployeesBy(empList, new EmployeeFilterByCountry("UZB")); 17 | List usEmployees = getEmployeesBy(empList, new EmployeeFilterByCountry("US")); 18 | List employeesWhoseAgeGreaterThan25 = getEmployeesBy(empList, new EmployeeFilterByAge(24)); 19 | List employeesByPosition = getEmployeesBy(empList, new EmployeeFilterByPosition("MANAGER")); 20 | System.out.println(uzbEmployees); 21 | System.out.println(usEmployees); 22 | System.out.println(employeesWhoseAgeGreaterThan25); 23 | System.out.println(employeesByPosition); 24 | } 25 | 26 | private static List getEmployeesBy(List empList, Filter filter) { 27 | List employees = new ArrayList<>(); 28 | for ( Employee employee : empList ) { 29 | if ( filter.test(employee) ) { 30 | employees.add(employee); 31 | } 32 | } 33 | return employees; 34 | } 35 | 36 | } 37 | 38 | interface Filter { 39 | boolean test(Employee employee); 40 | } 41 | 42 | class EmployeeFilterByCountry implements Filter { 43 | private final String country; 44 | 45 | EmployeeFilterByCountry(String country) { 46 | this.country = country; 47 | } 48 | 49 | @Override 50 | public boolean test(Employee employee) { 51 | return employee.getCountry().equals(country); 52 | } 53 | } 54 | 55 | class EmployeeFilterByAge implements Filter { 56 | private final int age; 57 | 58 | EmployeeFilterByAge(int age) { 59 | this.age = age; 60 | } 61 | 62 | @Override 63 | public boolean test(Employee employee) { 64 | return employee.getAge() > age; 65 | } 66 | } 67 | 68 | 69 | class EmployeeFilterByPosition implements Filter { 70 | private final String position; 71 | 72 | EmployeeFilterByPosition(String position) { 73 | this.position = position; 74 | } 75 | 76 | @Override 77 | public boolean test(Employee employee) { 78 | return employee.getPosition().equals(position); 79 | } 80 | } 81 | 82 | @Data 83 | @AllArgsConstructor 84 | class Employee { 85 | private String name; 86 | private String country; 87 | private String position; 88 | private int age; 89 | } 90 | ```` 91 | 92 | # Lambda Expressions 93 | 94 | ````java 95 | 96 | public class Main { 97 | 98 | /*private Function func = (i) -> "HELLO"; 99 | private static int a = 123;*/ 100 | 101 | public static void main(String[] args) throws Exception { 102 | //introductionToLambdas(); 103 | List empList = List.of( 104 | new Employee("Javohir Elmurodov", "UZB", "SOFTWARE ENGINEER", 28), 105 | new Employee("John Doe", "US", "MANAGER ", 108), 106 | new Employee("Akmal Turdiyev", "UZB", "SALES_MANAGER", 29), 107 | new Employee("John Leg", "GER", "MANAGER", 25), 108 | new Employee("Akbar Akbarov", "US", "SOFTWARE ENGINEER", 17) 109 | ); 110 | 111 | Filter uzFilter = employee -> employee.getCountry().equals("UZB"); 112 | Filter usFilter = employee -> employee.getCountry().equals("US"); 113 | 114 | List uzb = getEmployeesBy(empList, uzFilter); 115 | List us = getEmployeesBy(empList, usFilter); 116 | 117 | List manager = getEmployeesBy(empList, employee -> employee.getPosition().equals("MANAGER")); 118 | List under29 = getEmployeesBy(empList, employee -> employee.getAge() < 29); 119 | 120 | System.out.println(uzb); 121 | System.out.println(us); 122 | System.out.println(manager); 123 | System.out.println(under29); 124 | } 125 | 126 | private static List getEmployeesBy(List empList, Filter filter) { 127 | List employees = new ArrayList<>(); 128 | for ( Employee employee : empList ) { 129 | if ( filter.test(employee) ) { 130 | employees.add(employee); 131 | } 132 | } 133 | return employees; 134 | } 135 | 136 | private static void introductionToLambdas() { 137 | Callable callable = () -> "Hello PDP!".length(); 138 | int b = 12; 139 | Runnable runnable = () -> { 140 | int a = 90; 141 | System.out.println(a); 142 | System.out.println(b); 143 | }; 144 | runnable.run(); 145 | // b = 90; 146 | } 147 | } 148 | ```` 149 | 150 | ````java 151 | @FunctionalInterface 152 | public interface Filter { 153 | boolean test(Employee employee); 154 | } 155 | ```` 156 | 157 | 158 | ````java 159 | @FunctionalInterface 160 | public interface EmployeePredicate { 161 | boolean testA(Object o); 162 | } 163 | 164 | ```` 165 | 166 | 167 | ````java 168 | @Data 169 | @AllArgsConstructor 170 | public class Employee { 171 | private String name; 172 | private String country; 173 | private String position; 174 | private int age; 175 | } 176 | ```` 177 | 178 | -------------------------------------------------------------------------------- /source_codes/module_7/readme.md: -------------------------------------------------------------------------------- 1 | # Hamma source code lar mana [bu yerda](https://github.com/jlkesh/pdp_online_lessons_jakarta_ee) -------------------------------------------------------------------------------- /source_codes/module_8/readme.md: -------------------------------------------------------------------------------- 1 | # Hamma source code lar mana [bu yerda](https://github.com/jlkesh/pdp_online_lessons_spring_module_1) 2 | -------------------------------------------------------------------------------- /source_codes/module_9/source.md: -------------------------------------------------------------------------------- 1 | # Github repository 2 | 3 | ````git 4 | https://github.com/jlkesh/pdp_online_lessons_spring_module_2.git 5 | ```` 6 | 7 | ### Lesson 3 source code 8 | 9 | ```` 10 | git checkout jackson 11 | ```` 12 | 13 | ### Lesson 4 source code (Spring Data Jpa) 14 | 15 | ````git 16 | git checkout springdatajpa 17 | ```` 18 | 19 | ### Lesson 4 source code (Spring Data Jpa With SpringBoot) 20 | 21 | ````git 22 | git checkout springdatajpa_with_spring_boot 23 | ```` 24 | 25 | ### Lesson 5 source code (JPA Buddy) 26 | 27 | ```` 28 | git checkout jpabuddy 29 | ```` 30 | 31 | ### Lesson 5 source code (hateoas) 32 | 33 | ```` 34 | git checkout hateoas 35 | ```` 36 | 37 | ### Lesson 5 source code (data-rest) 38 | 39 | ```` 40 | git checkout data-rest 41 | ```` 42 | 43 | ### Lesson 6 source code (spring boot security) 44 | 45 | ```` 46 | git checkout spring_security_with_spring_boot 47 | ```` 48 | 49 | ### Lesson 6 source code (jwt) 50 | 51 | ```` 52 | git checkout spring_security_with_jwt 53 | ```` 54 | 55 | ### Lesson 7 source code (springdoc) 56 | 57 | ```` 58 | git checkout springdoc 59 | ```` 60 | 61 | ### Lesson 8 source code (MapStruct) 62 | 63 | ```` 64 | git checkout mapstruct 65 | ```` 66 | 67 | ### Lesson 8 source code (MapStruct with Spring Boot) 68 | 69 | ```` 70 | git checkout mapstructwithspringboot 71 | ```` 72 | ### Lesson 8 source code (.properties) 73 | 74 | ```` 75 | git checkout working_with_properties_file 76 | ```` 77 | 78 | ### Lesson 8 source code (.yaml) 79 | 80 | ```` 81 | git checkout working_with_yaml_file 82 | ```` 83 | 84 | ### Lesson 8 source code (.Asynchronous) 85 | 86 | ```` 87 | git checkout asyncron_execution 88 | ```` 89 | 90 | ### Lesson 9 source code (profiling) 91 | 92 | ```` 93 | git checkout profiling 94 | ```` 95 | 96 | ### Lesson 9 source code (Mailing and FreeMarker) 97 | 98 | ```` 99 | git checkout mailing 100 | ```` 101 | 102 | ### Lesson 9 source code (Task Scheduling) 103 | 104 | ```` 105 | git checkout scheduling 106 | ```` 107 | 108 | ### Lesson 9 source code (Logging) 109 | 110 | ```` 111 | git checkout logging 112 | ```` 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /statics/img_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlkesh/pdp_online_java_lessons/e146ffda6691d0f2c78afde432238074be57c4e0/statics/img_1.png --------------------------------------------------------------------------------