Чашечка Java
前往频道在 Telegram
Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels
显示更多8 540
订阅者
-224 小时
-47 天
-2830 天
帖子存档
8 539
Log4Shell/Leak4J — чрезвычайно опасная уязвимость в log4j2
Последние пару дней (и ночей) я изучал новую (чрезвычайно опасную) уязвимость в log4j2 под названием Log4Shell.
Это касается всех версий log4j-core от 2.0-beta9 до 2.14.1, и это очень серьезная проблема.
Эта уязвимость позволяет злоумышленнику удаленно выполнить код в вашей системе с возможностью получить полный контроль над базовыми серверами.
В заметке кратко описаны способы атаки и способы их устранения.
Читать: https://habr.com/ru/post/595935/?utm_campaign=595935
8 539
Top 10 Oracle PL/SQL Courses for Beginners to learn in 2022 - Best of Lot
Hello folks, if you are learning Oracle database and want to learn PL/SQL programming langauge and looking for the best resources like books, online courses, tutorials and articles then you have come...
Read: http://www.java67.com/2020/09/top-10-oracle-plsql-courses-for.html
8 539
Top 4 Books to learn Java Programming from Scratch in 2022 - Best of lot
I receive half a dozen emails every day asking about which is the best to learn Java from scratch? Which book should I read in 2022 to learn Java? Or Which is the best Java for beginners? When I...
Read: http://www.java67.com/2018/02/3-books-to-learn-java-from-scratch-in.html
8 539
Top 10 JavaScript Frameworks and Libraries to Learn in 2022 - Best of Lot
There is no doubt that JavaScript is now the #1 programming language in the world and also the king of web development. If you want to become a web developer who can quickly create websites like you...
Read: http://www.java67.com/2019/01/top-10-javascript-frameworks-and-libraries-for-web-developers.html
8 539
System.out.println(scanner.nextLine());
}
} C:\Test>chcp
65001
C:\Test>java -Dfile.encoding=UTF-8 -cp ./Exercises Hello
你好
��
Our investigation and advice to handle these issues
Previously, to mitigate the encoding issue, we added some workarounds in Java Debugger side to force to use UTF-8 in our toolchain. For example, adding a launcher.bat to force the terminal’s code page to be 65001, and set the default “file.encoding” property to be “UTF-8”. But it turns out they don’t solve the encoding problem systematically, and introduce some additional side effects as well (see #756, microsoft/vscode-java-debug#622, microsoft/vscode-java-debug#646).
After more investigation into the issue, we found that the workaround we added seemed unnecessary. The user only needs to set windows system locale to the language they want, then the JVM and terminal will automatically change to an encoding that is compatible with your system locale. This is also suggested by the official Java documentation (https://www.java.com/en/download/help/locale.html).
The following screenshot shows how to change the system locale in Windows. for example, if you want to use a terminal to enter Chinese characters into a Java program, you can set the Windows system locale to Chinese. The default Java charset will be
"GBK"and the cmd codepage will be "936", which will support Chinese characters nicely.
Here’s the detailed documentation on how to deal with the encoding issues.
End of year update
We are almost at the end of 2021 and for the past 12 months, we’ve been working hard to provide better Java development experience on Visual Studio Code. For 2022, there will be lots of exciting things coming for Java support on Visual Studio Code, so please stay tuned for future updates. As always, we are grateful for support from the community and we wish everyone a wonderful Christmas and happy new year!
Feedback and suggestions
Please don’t hesitate to try our product! Your feedback and suggestions are very important to us and will help shape our product in future. There are several ways to leave us feedback
* Leave your comment on this blog post
* Open an issue on our GitHub Issues page
Resources
Here is a list of links that are helpful to learn Java on Visual Studio Code.
* Learn more about Java on Visual Studio Code.
Read: Java on Visual Studio Code Update – November 2021.8 539
Java on Visual Studio Code Update – November 2021
Hi everyone, welcome to the November edition of the Visual Studio Code Java update! In this end-of-year post, we are going to look at several new improvements related to fundamental Java development experience as well as our updates related to encoding issues.
Inner-loop dev experience directly impacts developer’s day-to-day productivity and this area will always be our top focus. In November, we have made several improvements in this area:
Project Management – Remove .project metadata files
If you are doing Java development using the Extension Pack for Java, we have good news for you – Visual Studio Code no longer generates those hidden “.project” metadata files in the project path when you import a new Java project! This is an issue that has been there for over three years, and our fix was delivered in November. If you are interested in finding out how we solved it, please visit this dedicated blog post.
Testing – Navigating between tests and corresponding test subjects
In the November release, we added a new feature that allows the developer to navigate between test and corresponding test subjects. This feature may come in handy when writing unit test cases
Code Actions – Generate constructors and override/implement methods
As mentioned in previous blog post, we are constantly making common code actions more visible and easier to use. In the latest release, developers can now use the “lightbulb icon” next to the Java class to conveniently generate constructors or override/implement methods! Here is a quick demo on how to do this:
Dealing with encoding issues
It is quite common that developer nowadays deal with various languages and run into some kind of encoding issues. We’ve been hearing this kind of feedback from our users, so we wanted to share our latest finding and suggestions in this blog post.
Background
Computers can only understand the binary data such as 0 and 1, and it uses charset to encode/decode the data into real-world characters. When two processes interact with each other for I/O, they have to use the compatible charset for encoding and decoding, otherwise garbled characters might appear. MacOS and Linux use UTF-8 everywhere so encoding is not a problem for them. For Windows, however, the default charset is not UTF-8 and is platform-dependent, which can lead to inconsistent encoding between different tools.
Common Problems
Below are the typical encoding problems when running a Java program on Windows terminal.
* The file or directory name contains Unicode characters, Java launcher cannot find the corresponding classpath or main class well.
中文目录
├── Hello.class
└── Hello.java C:\Test>java -cp 中文目录 Hello
Error: Could not find or load main class Hello
* The string literals with Unicode characters appear garbled when printed to the terminal.
Exercises
├── 练习.class
└── 练习.java C:\Test>java -cp ./Exercises 练习
Error: Could not find or load main class ??
Caused by: java.lang.ClassNotFoundException: ??
* Garbled characters when Java program interacts with terminal for I/O
public class Hello {
public static void main(String[] args) {
System.out.println("你好!");
}
} C:\Test>chcp
65001
C:\Test>java -cp ./Exercises Hello
??!
C:\Test>java -Dfile.encoding=UTF-8 -cp ./Exercises Hello
你好!
* The program needs to read Unicode characters from stdin, and print Unicode characters to stdout.
import java.util.Scanner;
public class Hello {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
[...]
8 539
5 Best Ethical Hacking Courses for Beginners to Learn Online in 2022
Hello guys, if you want to become an ethical hacker in 2022 or a cyber security professional then you have come to the right place. In the past, I have shared the best Cyber Security courses, ...
Read: http://www.java67.com/2021/12/5-best-ethical-hacking-courses-for.html
8 539
Хинт для программистов: есть 6 каналов, где можно получать отборную инфу по конкретной теме.
Тематические каналы:
— машинное обучение и нейросети: @neuro_channel
— задачки и вопросы по Python: @quiz_python
— основы программирования: @prog_point
Каналы-коллекции:
— книги по программированию: @devs_books
— инструменты программиста: @prog_tools
— курсы, лекции, подкасты по программированию: @prog_stuff
8 539
Поисковик новостей (RSS), написанный на Java + SQLite
Вы скорее всего подумаете: "Зачем десктопная программа, если можно, как минимум, загуглить?". А затем, что моя программа автоматически "гуглит" за тебя! Причём не только по одному ключевому слову, а по нескольким, которые вы, само собой, можете редактировать. А результат поиска будет направлен на указанную почту, исключая ранее направленные результаты.
Делал её для себя в рамках моего самообучения языку Java и чтобы не пропускать все новости, касающиеся ипотеки, выплат и т.д. (моя жена инвестор мониторит интересующие её фирмы, дивиденды и т.д. в этом духе). Теперь хочу поделиться ею с общественностью, т.к. польза на лицо, а я не меркантильный. Да и Ленин завещал делиться! :))
Для работы приложения на ПК должна быть установлена Java. Здесь можно посмотреть код или предложить доработки по нему github. Актуальная версии программы news.jar
Читать: https://habr.com/ru/post/595749/?utm_campaign=595749
8 539
Визуализация Apache Kafka Streams с помощью Quarkus Dev UI
В этой статье показано, как можно визуализировать Apache Kafka Streams с реактивными приложениями с помощью пользовательского интерфейса разработчика в Quarkus (Quarkus Dev UI).
Quarkus - Java платформа, предоставляющая расширение для использования Kafka Streams API, а также позволяющая реализовывать приложения потоковой обработки, основанные непосредственно на Kafka.
Читать: https://habr.com/ru/post/595401/?utm_campaign=595401
8 539
Top 10 Essential Skills for Web Developers to Learn in 2022 [UPDATED]
Hello guys, if you want to become a frontend developer and wondering which skills you should learn then you have come to the right place. In the past, I have shared free web development courses...
Read: http://www.java67.com/2020/10/best-frontend-skills-web-developer.html
8 539
Участвуйте в Javathon и за 5 часов решите все задачи раньше других
Организаторы уже имеют готовый пайплайн на GitHub, так что от вас нужны знания в Java и Kafka. Тем более в конце вас ждут сочные призы:
— Сертификат в магазин “Технопарк” на 250 000 рублей
— Sony PlayStation 5 с геймпадом;
— Автономный шлем виртуальной реальности Oculus Quest 2 и другие бонусы.
Когда: 18 декабря, регистрация до 15 декабря
Посмотрите задачи и регистрируйтесь: https://clck.ru/ZEziE
#ивент
8 539
Top 5 Python Courses for Data Science and Machine Learning in 2022 - Best of Lot
We all know what Python is, right? It is a high-level, general-purpose programming language with enhanced readability. The syntax is also well-constructed and has an object-oriented approach....
Read: http://www.java67.com/2021/12/top-5-python-courses-for-data-science.html
8 539
Влезай — не убьёт! Как я попал из электромонтеров в разработчики
Привет! Меня зовут Иван, я бэкенд-разработчик в ЮMoney. Программистом я был не всегда: десять лет работал электромонтером. В своем первом посте расскажу, как попал в IT.
Под катом моя история и база знаний, которая помогла перейти из электриков в маленьком городе в мидл-разработчики крупной компании.
Читать историю успеха
Читать: https://habr.com/ru/post/594705/?utm_campaign=594705
8 539
Top 10 Books Java Developers Can Read in 2022
Hello guys, If you are a Java developer and wondering what to read in 2022, then you have come to the right place. In this article, I will share 10 books on Java, Spring, and related technology a...
Read: http://www.java67.com/2018/02/10-books-java-developers-should-read-in.html
8 539
Автоматическое создание changeSet'ов Liquibase из Java entity
При разработке и дальнейшей поддержки приложения база данных изменяется: добавляются, удаляются таблицы, столбцы и т.д. Для упрощения отслеживания изменений существует Liquibase. Эта библиотека, в начале запуска приложения решает, надо ли на конкретной базе выполнить конкретные скрипты, или же они в ней уже выполнены.
Каждый раз при добавление или изменение Entity, мы должны добавить новый changSet. Но что если я скажу, что есть плагин, который сам создает changeSetы на основе нашей Entity и уже существующей структуры базы данных?
Нам понадобится java, spring, gradle и liquibase plugin.
Начальные данные
Для начала нужно создать проект и пару простых Entity.
В файл build.gradle добавляем плагин:
plugins {
id 'org.liquibase.gradle' version '2.0.4'
}
Можно так же указать в переменных файл
liquibase {
activities {
main {
changeLogFile "$buildDir/generated-migrations.yaml"
url database.getProperty("dbUrl")
username database.getProperty("dbUsername")
password database.getProperty("dbPassword")
referenceUrl 'hibernate:spring:entity?dialect=org.hibernate.dialect.PostgreSQL10Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy'
logLevel 'debug'
}
runList = "main"
}
}
Читать: https://habr.com/ru/post/589205/?utm_campaign=5892058 539
Zeebe и Camunda: сравниваем известные BPM-системы под высокими нагрузками
Всем привет! Меня зовут Николай Первухин, я Senior Java Developer в Райффайзенбанке. В последнее время я активно занимаюсь BPM-системами Camunda и Zeebe (основа Camunda-cloud). Если вы, как и я, с ходу не можете ответить на вопрос, кто быстрее — Camunda или Zeebe, насколько, и в каких случаях они могут тормозить, то добро пожаловать под кат.
Читать: https://habr.com/ru/post/594117/?utm_campaign=594117
8 539
Top 10 Google Cloud Certifications You can Aim in 2022 - Best of Lot
Hello guys, If you are aiming for Cloud Certifications in 2022 then Google Cloud Platform is one of the most in-demand platforms to go for. It's backed by Google and there is a huge demand for...
Read: http://www.java67.com/2021/01/top-10-google-cloud-certifications.html
8 539
Top 5 Python Books for Beginners to Learn Programming in 2022 - Best of Lot
Python is one of the most popular programming languages, and there is a vast demand for Programmers who knows Python, and the best part is its increasing every year. If you want to learn Python in...
Read: http://www.java67.com/2019/08/top-5-books-to-learn-python-for-beginners.html
