Тёмный
Lazy Programmer
Lazy Programmer
Lazy Programmer
Подписаться
Technical Tutorials for Programmers (Java, Python, Linux)

Facebook: facebook.com/er.amanmalhi
Instagram: instagram.com/iamanmalhi


#coding #java #python #installation #programming
Spring Boot: An Introduction
10:15
3 месяца назад
Spring MVC Application Demo
0:49
4 месяца назад
Introduction to Spring MVC
11:51
5 месяцев назад
Комментарии
@NikhilJain08
@NikhilJain08 6 дней назад
Still I am not able to understand what we have achieved here? still there is an end-point to generate the token.
@LazzyProgrammer
@LazzyProgrammer 6 дней назад
Nikhil, did you see us creating any endpoint here? Where is the rest controller and endpoint defined?
@victoronwuhafua8464
@victoronwuhafua8464 8 дней назад
Hello LazyProgrammer thanks for you video, 1 question what is the function of the JwtAuthenticationFilter?? in your implementation, because you added/instantiate the class in the securityFilterChain method as a filter .addFilter(new JwtAuthenticationFilter(authenticationManager(httpSecurity.getSharedObject(AuthenticationConfiguration.class)), jwtUtil)) however there is no use case (at least that i was able to find) that actually makes use of the implementation 1 for login you created a controller and service that gets the userdetails using userdetailservice bean and then creates a jwt using jwtutil class 2 for secure routes the generated token is used in the JwtAuthorizationFilter class to validate the user 3 for register no authentication is applied
@LazzyProgrammer
@LazzyProgrammer 8 дней назад
AuthenticationFilter will be used in the scenario for our next video where we'll get rid of AuthController itself.
@LazzyProgrammer
@LazzyProgrammer 7 дней назад
To generate JWT tokens without a REST endpoint? ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Q96jo3UVLoU.html You can checkout the usage of JwtAuthenticationFilter in this.
@hrideshkumar5370
@hrideshkumar5370 14 дней назад
What's the difference between hasRole and hasAuthority
@LazzyProgrammer
@LazzyProgrammer 14 дней назад
That's a really good point which you have highlighted Hridesh. For using hasRole we have to follow a naming convention like start the role name as "ROLE_". Because spring security expects this naming format. If you don't provide it then Spring will add it explicitly and then check it But this is not mandatory if you use hasAuthority. So, you can use the role names as per your choice and spring will not add prefixes.
@chetanp4588
@chetanp4588 19 дней назад
Why using deprecated methods instead of latest 0.12.6v of jjwt ... If possible can you help me to get the latest Jwt Authorization token... I tried but can't access preAuthorize API has Role ADMIN....
@LazzyProgrammer
@LazzyProgrammer 19 дней назад
Sure Chetan, I am already planning to upgrade it and get rid of deprecated JWT methods in next video where I will implement RBAC
@chetanp4588
@chetanp4588 19 дней назад
@@LazzyProgrammer Thanks a lot for ur response....I tried it on all aspects of accessing RBAC, In DB role name is saved as ROLE_ADMIN ROLE_USER Also at SecurityConfig Giving @EnableMethodSecurity(prePostEnabled = true) For @preAuthorize("hasRole('ADMIN')") @DeleteMapping Admin role Jwt Authorization token can't access the above API... help me...
@LazzyProgrammer
@LazzyProgrammer 14 дней назад
Hi Chetan, You can check the video below as I have covered the same problem in my recent video. RBAC JWT + SpringBoot 3 + Upgrade JWT + Fix Deprecated Method Usage: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gfHsKST8hXs.html
@santoshkumarchougala7176
@santoshkumarchougala7176 20 дней назад
C
@LazzyProgrammer
@LazzyProgrammer 20 дней назад
Correct
@nikantchaudhary
@nikantchaudhary 22 дня назад
loved your video. Please start a series for improving performance of java applications like identifying memory leaks, profiling etc.
@LazzyProgrammer
@LazzyProgrammer 22 дня назад
Thank you for your feedback, Sure I can take a look into such series after completing Spring Security. In the mean time if you want you can check out few videos where such issues are discussed. Links are give below: Memory Leaks: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1ksJpgk1HIc.html Working of Heap Memory: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-HItOMv92MFA.html and few Garbage Collection related videos also.
@mesmerizeart663
@mesmerizeart663 22 дня назад
Brother Your Scratch level Explanation on Core and Advance Java is NextLevel 🔥🔥🔥🔥Whatever you explain in between ~15 Minuit video is More than 3 day's classroom tutor .Thank's Brother for your Work God Bless You.
@LazzyProgrammer
@LazzyProgrammer 22 дня назад
Thank you so much :). I am glad that these things are helping. Let us keep learning together :)
@nikantchaudhary
@nikantchaudhary 22 дня назад
Please start a series for improving performance of java applications like identifying memory leaks, profiling etc.
@LazzyProgrammer
@LazzyProgrammer 22 дня назад
Sure, Will do that. Thank you so much for your feedback
@pradeep4634
@pradeep4634 27 дней назад
Thanks 😊
@LazzyProgrammer
@LazzyProgrammer 27 дней назад
I am glad that it was helpful 🙂
@mesmerizeart663
@mesmerizeart663 27 дней назад
Please Make Interview Question video on SpringBoot,SpringData,RESTfulWebServices,SpringSecurity,kafka,Microservices
@LazzyProgrammer
@LazzyProgrammer 27 дней назад
Sure, will soon cover these topics from Interview prospective.
@kaushlendramishra5588
@kaushlendramishra5588 27 дней назад
excellent series on multithreading. Great work!!
@LazzyProgrammer
@LazzyProgrammer 27 дней назад
@@kaushlendramishra5588 Thank you 🙂
@PraveenKumar-uj2ih
@PraveenKumar-uj2ih 29 дней назад
Thanks for your crystal clear explanation about JWT.. It's time to implement JWT in our application . Do you have any reference video , If yes , Please send me link . I will look into it ..
@LazzyProgrammer
@LazzyProgrammer 29 дней назад
Thank You Praveen for your valuable feedback. Implementation of JWT is going to be our next video in this series. There we'll create an application from scratch and implement JWT End-to-End. Hopefully that will help you to understand in detail about the Implementation part as well. Once again Thank you so much and Keep Supporting
@JayeshDuttBohra-ox7yg
@JayeshDuttBohra-ox7yg Месяц назад
Really great video in terms of the information provided and the way you explained everything. It would be even better if you could work a bit on thumbnails for more reach. Looking forward to more of these videos-you're doing a fantastic job! Kudos!
@LazzyProgrammer
@LazzyProgrammer Месяц назад
Thank you so much for your feedback. I'll definitely work on the thumbnail part.
@girishanker3796
@girishanker3796 Месяц назад
Great video
@LazzyProgrammer
@LazzyProgrammer Месяц назад
Thank you 🙂
@girishanker3796
@girishanker3796 Месяц назад
Clear explanation 💙
@LazzyProgrammer
@LazzyProgrammer Месяц назад
Thank you, I am glad it was helpful. Let's keep learning 📖
@rryann088
@rryann088 Месяц назад
Thanks! Learned it!
@LazzyProgrammer
@LazzyProgrammer Месяц назад
Great! Let's keep learning 📖
@rryann088
@rryann088 Месяц назад
@@LazzyProgrammer thanks!
@karthikkb3817
@karthikkb3817 Месяц назад
music is loud
@LazzyProgrammer
@LazzyProgrammer Месяц назад
I apologise Karthik, and will make sure to fix the issue in all upcoming videos
@RealPunjabiSahit
@RealPunjabiSahit Месяц назад
👍💯
@himachaliMundainUK
@himachaliMundainUK Месяц назад
Audio is low
@LazzyProgrammer
@LazzyProgrammer Месяц назад
Thanks for the feedback, I'll take care in the future.
@kasun0087
@kasun0087 2 месяца назад
Why did you use two locks ? Printer class should not create a lock inside the constructor , instead lock should be passed to the constructor right ?
@LazzyProgrammer
@LazzyProgrammer 2 месяца назад
Yes, it is better to pass the lock object to the constructor if you want to ensure that all instances share the same lock object. There is only one lock which is static thus shared across all the objects of the class.
@BhanuBanu-o2g
@BhanuBanu-o2g 2 месяца назад
00:02 A simple logical error caused the biggest IT outage in history. 00:50 CrowdStrike update caused system crash on Windows devices 01:37 Blue screen of death indicated system crash affecting Windows users worldwide 02:26 Global IT outage impacted various services and companies 03:09 Addressing the Windows outage through safe mode and deployment of fix. 03:53 Channel files were updated, impacting Windows users worldwide. 04:40 A configuration update led to a logical error causing operating system crashes. 05:25 Endpoint security tools help detect and respond to cyber threats.
@LazzyProgrammer
@LazzyProgrammer 2 месяца назад
Thank you Bhanu
@himachaliMundainUK
@himachaliMundainUK 2 месяца назад
Great coverage
@LazzyProgrammer
@LazzyProgrammer 2 месяца назад
Thank you :)
@mukulmittal5103
@mukulmittal5103 2 месяца назад
Great video on the issue and fix👍
@LazzyProgrammer
@LazzyProgrammer 2 месяца назад
Thanks Mukul :)
@maankhurana5814
@maankhurana5814 2 месяца назад
Got to learn new thing todays ... Thanks buddy
@LazzyProgrammer
@LazzyProgrammer 2 месяца назад
I am glad 😊 Let's keep learning
@rajeevkumarjha8744
@rajeevkumarjha8744 2 месяца назад
Good Job OSM
@LazzyProgrammer
@LazzyProgrammer 2 месяца назад
Thank you Rajeev 🙂
@sunnythadhani1971
@sunnythadhani1971 2 месяца назад
Thanks for such a good content. Questions are very much relevant.
@LazzyProgrammer
@LazzyProgrammer 2 месяца назад
Thank you for your feedback 🙂
@yogesh_mehra
@yogesh_mehra 2 месяца назад
Please make more video's full project real time
@LazzyProgrammer
@LazzyProgrammer 2 месяца назад
Sure Yogesh
@muaazkhan6156
@muaazkhan6156 2 месяца назад
Can u plz make a video on How to call Secured microservice means which requires Jwt and get data from that microservice??
@LazzyProgrammer
@LazzyProgrammer 2 месяца назад
Sure, we'll have sessions for Microservices and how they interact as well
@RealThinkCenter
@RealThinkCenter Месяц назад
​@@LazzyProgrammerplease create videos on jwt in detail
@LazzyProgrammer
@LazzyProgrammer Месяц назад
@RealThinkCenter Yes, JWT videos are in progress and will start uploading soon. Thank you so much for your feedback
@nitingarg7169
@nitingarg7169 2 месяца назад
awesome bro
@LazzyProgrammer
@LazzyProgrammer 2 месяца назад
Thank you 😊
@wescayande
@wescayande 3 месяца назад
Thanks for the very efficient introduction.
@LazzyProgrammer
@LazzyProgrammer 3 месяца назад
You are welcome and thank you for your feedback 😊
@refreshjavabysaikaruturi
@refreshjavabysaikaruturi 3 месяца назад
cached thread pool use case- tasks are short-lived and the load varies significantly over time.
@LazzyProgrammer
@LazzyProgrammer 3 месяца назад
Yes, Correct 💯
@thenameisprateek3828
@thenameisprateek3828 3 месяца назад
Request Parameters are query parameters right?
@LazzyProgrammer
@LazzyProgrammer 3 месяца назад
Yes
@Werewolf5684
@Werewolf5684 3 месяца назад
can anyone please tell what is wrong with this code. output is not as expected. I am just counting by multiple threads using locking. I really did not understand what is the problem here. Expected and should be 10*100 => 1000 public class CountingProblem { private static int counter = 0; private static final ReentrantLock lock = new ReentrantLock(); public static void main(String[] args) { for (int i = 0 ; i < 10 ; i++) { // 10 thread are running new Thread(() -> { for (int j = 0 ; j < 100 ; j++) { // each thread should increase it to 100 lock.lock(); // lock the section try { // run the critical section counter++; // increase the counter } finally { // unlock the lock lock.unlock(); } } }).start(); } System.out.println(counter); } }
@LazzyProgrammer
@LazzyProgrammer 3 месяца назад
Multiple threads which you have created in the for loop are running in parallel to the main thread, but you are directly printing the value of counter after for loop, so there is a possibility that few of the threads might still be in execution when main thread gets the CPU and executed System.out.println(counter); which will result in incorrect output. So, before you print the final value of counter, please make sure that all the threads complete their execution. For that you can use a simple array of type Thread and add all newly created threads in that array during that for loop execution. And after that for loop, iterate through all the created Threads and using .join() make sure all threads have completed their execution. Once that is done only then print the final value of counter. I hope this is was helpful. Please do write your feedback :)
@Werewolf5684
@Werewolf5684 3 месяца назад
@@LazzyProgrammer aha got it so I need to print the counter value after end of all the threads has finished there job, thread.join(), that for the observation
@ashwinkumar504
@ashwinkumar504 3 месяца назад
Good one ....was helpful Thank you
@LazzyProgrammer
@LazzyProgrammer 3 месяца назад
Thank you Ashwin, I am glad that it was helpful.
@AnkurTripathi-ig2jq
@AnkurTripathi-ig2jq 3 месяца назад
love the way you expain each point.....much excited to learn this beautiful concept of multithreading from non another but from you
@LazzyProgrammer
@LazzyProgrammer 3 месяца назад
Thank you so much Ankur for your feedback. I am very happy that it was helpful :)
@realknowledge-23
@realknowledge-23 3 месяца назад
very good content thanks a lot and all the very best.
@LazzyProgrammer
@LazzyProgrammer 3 месяца назад
Thank you so much Ashok :)
@user-bt5ck3lf9e
@user-bt5ck3lf9e 3 месяца назад
thank you for the video on CCHM
@LazzyProgrammer
@LazzyProgrammer 3 месяца назад
Thank you for your feedback 😊
@rajivraghu9857
@rajivraghu9857 3 месяца назад
Nice explanation... how are you generating captions for your video? which software?
@LazzyProgrammer
@LazzyProgrammer 3 месяца назад
Thanks for your feedback, These are simple texts added manually.
@Werewolf5684
@Werewolf5684 3 месяца назад
Hey I am facing some problem while implementing readWriteLock. Can you please let me know what is the problem I am making here So there is a class which having some value [so it is a critical section], Now from our main class I am creating 5 read thread to read the data from that critical section 5 times and 5 write thread to update the data. so the expectation is I want to have same value for a particular thread for every iteration, and while updating the value another thread should read the value import java.util.concurrent.locks.ReentrantReadWriteLock; public class Node<T> extends ReentrantReadWriteLock { private T value; public Node(T value) { this.value = value; } public void setValue(T value) { this.value = value; } public T getValue() { return this.value; } } import java.util.concurrent.ThreadLocalRandom; public class ReadWriteLockDemo2 { private static Node<Integer> resource = new Node<>(5); public static void main(String[] args) { for (int i = 0 ; i < 5 ; i++) { new Thread(() -> { resource.readLock(); try { for (int j = 0 ; j < 5 ; j++) { System.out.println(Thread.currentThread().getName() + " is reading the data " + resource.getValue()); try { Thread.sleep(ThreadLocalRandom.current().nextInt(1000, 5000)); } catch (InterruptedException e) { throw new RuntimeException(e); } } } finally { resource.readLock().unlock(); } }).start(); } for (int i = 0 ; i < 5 ; i++) { new Thread(() -> { resource.writeLock(); try { int value = ThreadLocalRandom.current().nextInt(1, 100); System.out.println(Thread.currentThread().getName() + " is writing the data with " + value); resource.setValue(value); try { Thread.sleep(ThreadLocalRandom.current().nextInt(1000, 5000)); } catch (InterruptedException e) { throw new RuntimeException(e); } } finally { resource.writeLock().unlock(); } }).start(); } } } I feel like locks are not working properly can you check I am getting first time iteration all read are working then all write are working and updating quickly [updating the value at the same time] where as they have to wait because that's a write lock but they are not waiting. Also I am getting this 2 error not sure where I am making this mistake, "attempt to unlock read lock, not locked by current thread"
@LazzyProgrammer
@LazzyProgrammer 3 месяца назад
Your current code can lead to a deadlock scenario, If a read thread holds the read lock and a write thread tries to acquire the write lock, they’ll block each other indefinitely. Additionally, You have extended ReentrantReadWriteLock in your Node class. This is not the correct way to use it. Instead, create an instance of ReentrantReadWriteLock within your Node class and use it for synchronization. Can you try below code: import java.util.concurrent.locks.ReentrantReadWriteLock; class Node<T> { private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); private T value; public Node(T value) { this.value = value; } public void setValue(T value) { lock.writeLock().lock(); try { this.value = value; } finally { lock.writeLock().unlock(); } } public T getValue() { lock.readLock().lock(); try { return value; } finally { lock.readLock().unlock(); } } } public class ReadWriteLockDemo { public static void main(String[] args) { Node<Integer> resource = new Node<>(5); // Create read threads for (int i = 0; i < 5; i++) { new Thread(() -> { for (int j = 0; j < 5; j++) { System.out.println(Thread.currentThread().getName() + " is reading the data: " + resource.getValue()); try { Thread.sleep(1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }).start(); } // Create write threads for (int i = 0; i < 5; i++) { new Thread(() -> { int value = (int) (Math.random() * 100); System.out.println(Thread.currentThread().getName() + " is writing the data with value: " + value); resource.setValue(value); try { Thread.sleep(1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }).start(); } } }
@Werewolf5684
@Werewolf5684 4 месяца назад
I have a question, if you closly the implementation using wait and notify method it is not exactly doing what blocking queue is doing, so I thing blocking queue is working Asynchronously where as wait and notify is working synchronously as we have added synchronized block over the shared resources, So basically I want to say if you look output of wait-notify method there always will be goring phase of the buffer sequaltially and once it reach the limit then shrinking phase of the buffer start sequentially and again growing phase vice-versa, but in the case of BlockingQueue the growing and shrinking phase of the queue is not sequential it is parallel. So how can we achieve that using wait and notify method approach, batter I would how BlockingQueue is achieving this kind of concurrent way of updatating the buffer.
@LazzyProgrammer
@LazzyProgrammer 4 месяца назад
Blocking Queue handles concurrent updates to the buffer by allowing multiple threads to interact with the queue simultaneously without the need for explicit synchronization. It internally handles synchronization. Using wait and notify it's sequential order within synchronized blocks, where one thread must wait for another to release the lock before proceeding.
@Werewolf5684
@Werewolf5684 4 месяца назад
I have one questino what if my size of the counting latch less then the number of thread I want to perform then what will happen? also what will happen if the size of the latch greater than the number of thread I want to perform?
@LazzyProgrammer
@LazzyProgrammer 4 месяца назад
If the size of the CountDownLatch is less than the number of threads, some threads will reach zero and proceed before all threads have completed their work. Secondly, If the size of the CountDownLatch is greater than the number of threads, the latch will never reach zero, causing the waiting threads to be blocked indefinitely.
@Werewolf5684
@Werewolf5684 4 месяца назад
@@LazzyProgrammer okay thanks I have checked the second scenario where size if the latch is greater than the number of threads calling the latch and it worked as expected, latch never gets to 0 and the main thread is blocked infinitely. But the first scenario I could not recreate not sure why, is the problem in my machine or what, can you please check form your too, I am posting the code snippet package threading.threadControl; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ThreadLocalRandom; public class CountDownLatchDemo { public static void main(String[] args) throws InterruptedException { CountDownLatch countDownLatch = new CountDownLatch(1); System.out.println("let's start Hiking by main thread..."); Thread.sleep(ThreadLocalRandom.current().nextInt(500, 1000)); for (int i = 1 ; i <= 20 ; i++) { int finalI = i; new Thread(() -> { System.out.println("are you ready thread" + finalI); try { Thread.sleep(ThreadLocalRandom.current().nextInt(500, 1000)); } catch (InterruptedException e) { throw new RuntimeException(e); } System.out.println("Yes I am ready response by thread" + finalI); countDownLatch.countDown(); }).start(); } countDownLatch.await(); // it will start when it becomes 0 Thread.sleep(ThreadLocalRandom.current().nextInt(500, 1000)); System.out.println("Let's Hiking by main thread..."); } } I am getting this out put all the time (getting this last line [Let's Hiking by main thread...] at last all the time), technically I should not let's start Hiking by main thread... are you ready thread2 are you ready thread1 are you ready thread3 are you ready thread5 are you ready thread4 Yes I am ready response by thread1 Yes I am ready response by thread4 Yes I am ready response by thread2 Yes I am ready response by thread3 Yes I am ready response by thread5 Let's Hiking by main thread...
@Werewolf5684
@Werewolf5684 4 месяца назад
sorry I get it, I was putting a sleep before the last line which is why I was getting the last line all the time at last, now I get it
@Werewolf5684
@Werewolf5684 4 месяца назад
Thanks for you explaination honestly I am really learning something new about thread controlling, and these are very premium content, I bet no one will put this on internet for free, thanks for your selfless effort.
@kaushlendrasingh-x4f
@kaushlendrasingh-x4f 4 месяца назад
Sound is very slow
@LazzyProgrammer
@LazzyProgrammer 4 месяца назад
I will try to make sure this problem is no longer there in new videos. Thank you so much for your feedback
@luckyreactjs
@luckyreactjs 4 месяца назад
awesome
@LazzyProgrammer
@LazzyProgrammer 4 месяца назад
Thank you Lucky 🙏
@sarafarazahmadmomin1665
@sarafarazahmadmomin1665 4 месяца назад
Explain with perfect example
@LazzyProgrammer
@LazzyProgrammer 4 месяца назад
Thank you 🙏
@hasangalakdinu
@hasangalakdinu 4 месяца назад
short and clear!!! love from srilanka!
@LazzyProgrammer
@LazzyProgrammer 4 месяца назад
Thank you 😊🙏
@RaviYadav-cx2pb
@RaviYadav-cx2pb 4 месяца назад
Very nice tutorial.. please some field more added like DOB male or female check box and capchta implementation in both registration ND login page with capchta validations please.. I need this type of form
@LazzyProgrammer
@LazzyProgrammer 4 месяца назад
Sure Ravi I have noted it and will surely prepare one session for it. Thank you so much for your support and feedback.
@Bryan-kb6nx
@Bryan-kb6nx 4 месяца назад
P R O M O S M
@SudeepCheekireddy-lg6nw
@SudeepCheekireddy-lg6nw 4 месяца назад
Excellent and clear explanation!
@LazzyProgrammer
@LazzyProgrammer 4 месяца назад
Thank you Sudeep
@informatik01
@informatik01 4 месяца назад
Very useful and clear coverage of the topic. Thank you!
@LazzyProgrammer
@LazzyProgrammer 4 месяца назад
Thank you, I am glad that it was helpful 🙂
@TarunJayadevan
@TarunJayadevan 5 месяцев назад
You are a saviour
@LazzyProgrammer
@LazzyProgrammer 5 месяцев назад
Thank you Tarun 🙂