Чашечка Java
前往频道在 Telegram
Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels
显示更多8 554
订阅者
-424 小时
-197 天
-2530 天
帖子存档
8 554
Дайте крудошлепа
Я устроился в небольшую компанию, которая сделал круд-приложуху на 20 таблиц типа "заметки" и активно ее продавала госорганам за невменяемый бабос.
У нас был 3(три) Т-Р-И статуса юзера. Anonym -> Logined -> Phone_Confirmed. Молодой талант до меня увидел в этом граф, и написал класс на 200+ строк, реализующий алгоритм Флойда–Уоршелла, прикрутил стейт-машину и не найдя интересных задач, c блеском прошел собес в Яндекс и свалил.
Меня наняли сеньором, и я каюсь ничерта не понял, алгоритм прекрасно работал на первой ступени, на второй давал сбои, тоскливо погуглил этот алгоритм, стер все к черту и написал: if(status==Logined & phone!=null){status=Phone_Confirmed}.
Один коллега посмотрел на меня с немой благодарностью, а начальник офигел и сказал, что код нерасширяем и захардкожен, а тот алгоритм мог пройти за время логN через тысячу вершин и по истечению испытательного урока меня уволили нах, так как мой технический уровень не соответствовал их высоким требованиям, впрочем выдали три зарплаты и я благодарен этим людям. Мой код оставили, тот так и не смогли починить.
Это было вступление.
Уважаемый Яндекс, Сбер и прочая! Я умею быстро решать задачи и кратно увеличивать выхлоп простыми решениями. Я самый умный программист, среди всех ваших работников! Я - НадНадсеньор! Сейчас докажу.
Потому что, только я могу решить задачку, которую вы уже 10 лет решить не можете, когда прилетает пуш-уведомление или смс и в твоем всплывающем окне написано:
"Ваш шестизначный пароль доступа в наше приложение: 123..."
Не согласен! ...
Читать: https://habr.com/ru/articles/733400/?utm_campaign=733400
8 554
Реализация авторизации на основе ролей в Spring Boot с помощью Keycloak
Контроль доступа на основе ролей является обязательным условием для любого приложения, имеющего дело с пользователями, которые могут получать доступ к определенным ресурсам в зависимости от своей роли в организации.
Читать: https://habr.com/ru/companies/otus/articles/733404/?utm_campaign=733404
8 554
How to use ForkJoinPool in Java
Read: https://www.infoworld.com/article/3693752/how-to-use-forkjoinpool-in-java.html#tk.rss_java
8 554
Yelp Adopted the MVI Architecture to Improve Performance and Testability of Their Android App
Four years into the adoption of the Model-View-Intent (MVI) architecture for their Android app, Yelp engineer Paul Martin says it allowed them to have performant screens and improve unit testing.
By Sergio De Simone
Read: https://www.infoq.com/news/2023/05/yelp-mvi-android-performance/
8 554
Java News Roundup: Quarkus 3.0, MicroStream 8.0, JEP 442, GraalVM, Infinispan
This week's Java roundup for April 24th, 2023 features news from OpenJDK, JDK 21, GlassFish 7.0.4, GraalVM 22.3.2, Microsoft OpenJDK, Spring releases. Quarkus 3.0.0, MicroStream 8.0.0, Micronaut 3.9.1, Hibernate ORM 6.2.2, Hibernate Reactive 2.0.0.CR1, Infinispan 15.0.0.Dev01, Apache Camel 3.20.4, Camel Quarkus 2.13.3, JUnit 5.9.3, JReleaser 1.6.0, JobRunr 6.1.4, JDKMon 17.0.49 and Foojay.io.
By Michael Redlich
Read: https://www.infoq.com/news/2023/05/java-news-roundup-apr24-2023/
8 554
О разнице между лямбдами и обычными функциями и о имплементации лямбд в некторых языках программирования
Цель настоящей статьи - изучить лямбда функции: чем они отличаются от обычных функций и изучить, как они реализованы в С++, Python 3 и Java.
На протяжении этой статьи я буду использовать godbolt.org, чтобы компилировать код и изучать машинный код или байт код. Я думаю, что при чтении статьи может быть удобнее смотреть не на приведённый машинный код в статье, а на этом сайте.
Читать: https://habr.com/ru/articles/732434/?utm_campaign=732434
8 554
Как за полчаса написать простую читалку книг FB2 для десктопа на Java
Недавно мне для личных целей понадобилось написать читалку FB2. И сразу я столкнулась с тем, что информации по теме минимум. Палочка-выручалочка под названием ChatGPT выдал что-то невразумительное в ответ на довольно подробный запрос. К тому же, никаких готовых библиотек, чтобы по-быстренькому наваять ридер, я также не смогла обнаружить. Хотя искала долго и упорно, как Чубакка расческу.
Все это привело меня к закономерному выводу, что сначала нужно изучить формат FB2. А потом подумать, как прочитать его стандартными способами и вывести на экран. После того, как я немного разобралась со структурой FB2, начала догадываться, почему нет готовых библиотек. Дело в том, что этот формат довольно простой, и нет особой необходимости писать для него отдельную библиотеку. Можно довольно быстро наваять свой код, который будет читать практически все файлы FB2. И вы сможете убедиться в этом, если дочитаете статью до конца.
А раз все так просто, зачем я пишу эту статью? Для этого у меня есть две причины. Во-первых, это моя первая проба пера на Хабре. А во-вторых, возможно, это сэкономит кучу времени другому такому же новичку, как я. Ну, или пригодится какому-нибудь студенту, который пишет реферат.
Читать: https://habr.com/ru/articles/732412/?utm_campaign=732412
8 554
Вопросы и ответы для собеседования по Kotlin. Часть 3
Цикл статей с вопросами по Kotlin, которые могут задать на собеседованиях.
Вопросы и ответы для собеседования по Kotlin. Часть 1
Вопросы и ответы для собеседования по Kotlin. Часть 2
Вопросы и ответы для собеседования по Kotlin. Часть 3 — вы находитесь здесь
Вопросы и ответы для собеседования по Kotlin. Часть 4 (скоро)
Читать: https://habr.com/ru/articles/728742/?utm_campaign=728742
8 554
Zero Downtime и Spring Boot. Апдейтим базу
Привет! Когда-то обновление версии сервиса было сложной задачей. Нужно было последовательно выполнить ряд действий, перезапустить инстансы, и не забыть предварительно забэкапить наши данные. Пользователям сервиса показывалось предупреждение, что сервис временно недоступен, и куча усилий тратилась на то, чтобы максимально снизить время этой недоступности.
Сейчас же у нас есть супер-мощные инструменты для управления сервисами. Они позволяют иметь несколько разных версий сервиса одновременно. Бизнес-пользователи могут управлять тем, какую версию видит та или иная группа пользователей. Обновление и откат версии сервиса могут происходить без прерывания работы пользователей. И когда появился такой мощный и красивый молоток, все начали хотеть забивать гвозди только им. Даже те, кому это, на самом-то деле, вообще не нужно. И тут есть проблема - наличие инструмента не означает автоматической готовности сервисов для того, чтобы этот инструмент с ними можно было использовать. И если обновлять сервисы старым способом было сложно, то новым это делать еще сложнее. Давайте посмотрим, почему это так, и как вообще получить этот ваш Zero Downtime.
Читать: https://habr.com/ru/articles/728850/?utm_campaign=728850
8 554
Java Gets a Boost with String Templates: Simplifying Code and Improving Security
JEP 430, String Templates (Preview), has been promoted from Proposed to Target to Targeted status for JDK 21, a feature JEP type that proposes to enhance the Java programming language with string templates, which are similar to string literals but contain embedded expressions incorporated into the string template at run time.
By A N M Bazlur Rahman
Read: https://www.infoq.com/news/2023/04/java-gets-a-boost-with-string/
8 554
What is API Gateway Design Pattern in Microservices? With Examples
Hello guys, API Gateway Design Pattern is a pattern that has emerged as a popular solution for managing APIs in a microservices architecture. As the number of services in the architecture increases, it becomes challenging to manage the APIs and handle requests from external clients. To address this challenge, API Gateway Design Pattern provides a single entry point for all the APIs in a microservices architecture. In the past, I have shared several Microservices design patterns like e Event Sourcing, SAGA, Database Per Microservices, CQRS, API Gateway, and also shared best practices to design Microservices and in this article, I am going to talk about the API Gateway Design Pattern, and how you can implement in Java using Spring Cloud Framework (Spring Cloud Gateway).
Java Interview questions and tutorials
Read: http://www.java67.com/2023/04/3-what-is-api-gateway-design-pattern-in.html
8 554
Angular vs React vs Vue.js ? Which is better to learn web development in 2023?
JavaScript web frameworks are important parts of modern web development. Several JavaScript web framework and libraries are active today. If you plan to become a web developer, you may encounter these web frameworks. A web developer, especially a
front-end web developer should be skilled in at least one of these frameworks. Angular and React are the two most popular web frameworks and libraries today. Vue.js is the rising star. In this article, we will compare these three frameworks on different parameters like Community support, Performance, ease of Learning, and jobs to find out which frontend development framework between Angular, React.js and Vue.js you should learn in 2023.
Java Interview questions and tutorials
Read: http://www.java67.com/2023/01/angular-vs-react-vs-vuejs-which-is.html
8 554
React Native vs Flutter? Which is better to learn for App Development in 2023?
Hello guys, if you are wondering whether to learn Flutter or React Native for App Development in 2023 then you have come to the right place. Earlier, I have shred best courses to learn Flutter and React Native and in this article, I will share my thoughts on which one is better suited for App development in 2023 and which mobile app development framework beginner should learn in 2023. In the recent decade, the mobile application community has grown tremendously. The total number of applications on the play store surpassed one million in the year 2013 and by mid-2020, it was estimated that there are more than 2.8 million
applications on the google play store.
Java Interview questions and tutorials
Read: http://www.java67.com/2023/01/react-native-vs-flutter-which-is-better.html
8 554
How to Find Lowest Common Ancestor of a Binary Tree in Java? Example Tutorial
Hello guys, if you are wondering how to find the lowest common ancestor of a binary tree in Java then you are at the right place. Earlier, I have shared 40+ binary tree questions and today I am going to share solution of one of the popular binary tree question here. To
find the lowest common ancestor of a binary tree in java requires that
we run through a binary search tree and how it operates. What
then is a binary search tree? A Binary tree is a data structure in
which each node can have at most two children. That is, each node in the
binary tree will have data, left child and right child. The first node
of the tree is called the Root.
Java Interview questions and tutorials
Read: http://www.java67.com/2022/01/how-to-find-lowest-common-ancestor-of.html
8 554
10 Git Commands Every Programmer Should Learn
Hello guys, Git is one of the most important skill for programmers, developers and data scientist and if you don't know git then you will struggle working in a team. If you want to learn Git in 2023 then you can start with these essential Git commands. I have explained the command and give you example. For examples, I have asked ChatGPT to see how it explains and I was amazed to see the response so I have included here for my own reference. I don't if ChatGPT will remain free forever but I am taking screenshot for the questions which I am asking so that I can keep a record for myself and you in future as ChatGPT is the best instructor I have got today and its helping me to learn and revise several key concepts.
Java Interview questions and tutorials
Read: http://www.java67.com/2023/01/10-git-commands-every-programmer-should.html
8 554
26 Spring Framework Interview Questions Answers for 2 to 4 years experienced Java Developers
Spring is one of the most popular framework and most widely used to develop Java Web application using MVC framework. Due to its immense popularity its expected from Java guys to know how to use Spring framework and how it works. Most of the Java development position uses Spring, Hibernate along with core Java and JEE web technologies like Servlet, JSP, and JSF. In this article, I will be sharing some frequently asked Spring interview question for Java JEE developers. It will contain questions from different Spring modules like Spring MVC, Spring core, the concept on which Spring is built e.g. IOC and DI and Spring security.
Java Interview questions and tutorials
Read: http://www.java67.com/2023/01/26-spring-framework-interview-questions.html
8 554
8 Examples of Primitive Data Types In Java (int, long, boolean, float, double, byte, char, and short)
Hello guys, Data types are first few things you should learn when you start learning a programming language and when it comes to learn Java, thereare 8 primitive data types which you should know. These are divided into three categories, numeric, text, and boolean values. Numeric data types can be further divided into two like natural numbers and floating pointing numbers. But, Before we get to a list of the 10 examples of primitive data types
in Java, let me tell you a little bit more about what the primitive data
types are. There are essentially 8 primitive data types in Java.
They are int, byte, short, long, float, double, boolean, and char. The
primitive data types are not considered objects and represent raw
values. These primitive data types are also stored directly on the
stack.
Java Interview questions and tutorials
Read: http://www.java67.com/2022/11/examples-of-primitive-data-types-in-java.html
8 554
10 points on TCP/IP Protocol, Java Programmers should Know
TCP/IP is one of the most important protocol as its backbone of HTTP, internet and most of the communication happens today. It's also important from technical interview perspective, you might have already seen difference between TCP and UDP multiple time during interviews ( I have seen). I believe every programmer, not just Java developer should know what is TCP/IP protocol? How it works and the below points I am going to mention. These are basic points and most of you already know but during Interview I have found many developers who doesn't really know what TCP/IP offers and how it works and what are the pros and cons of TCP/IP protocol. That's where, I think this article will help you. Anyway, let's jump into technical details now.
Java Interview questions and tutorials
Read: http://www.java67.com/2015/03/10-points-on-tcpip-protocol-java.html
8 554
How to write to a File with try-with-resource in Java? Example Tutorial
Hello Java programmers and all people learning Java, if you are familiar withtry-wit-resource statement then you know that its a great language functionality and tool to open files, sockets, streams, and network connections or any resource which are require closing. Before try-with-resource was introduce in Java 7, Java developers have to manually write try catch finally block to close the connections for both success and failure cases to prevent resource leak but it was also tricky and many programmer make mistakes which actually resulted in resource leaks. One common example of that is running out of file descriptors which is used for both opening file and socket in Java.
Java Interview questions and tutorials
Read: http://www.java67.com/2023/01/how-to-write-file-in-java-with-try.html
现已上线!2025 年 Telegram 研究 — 年度关键洞察 
