
Java → Java Array Programs
Arrays in java:
- An array is the basic Data Structure that contains items of similar data types.
- There is always an ordering amongst the position of the element.
- It can be accessed with the help of the indices. Java supports 0-indexed arrays. Means the array index starts with 0 in java.
-
We can declare array in java as-
1.int[] arr = new int[size];
2.int[] arr = {1,2,3…};
3.int[] arr = new int[]{1,2,3,...};

C++ → Leet Code Solutions - 003 - Longest Substring Without Repeating Characters
cpp, LeetCode, C++, C++17, string
Solution "Longest Substring Without Repeating Characters" on Leet Code

C++ → Leed Code Solutions - 002 - Add Two Numbers
Solution "Add Two Numbers" on Leet Code

C++ → Leet Code Solutions - 001 - Two Sum
Two Sum solution on Leet Code

Django → Django - Lesson 059. Saving the selected language in user settings
python, language, translation, django
In this article, I would like to show an example of how you can make a link on the site so that the user can switch between languages on the site.
But I will show a more advanced version of this functionality, namely saving the selected language in the user table, as well as redirecting the user to a page with the correct language that was selected by the user, if they are of course authorized. That is, if the user has set the German language for himself, then when going to the site via an English link, the site will automatically redirect the user to the page with the German language.
To do this, we need to add a language code field to the user model, I hope that everyone is already using their user model in Django instead of the default one.
Rewrite the standard Django language setup function, and also add a Middleware that will process the urls requested from the site.
Among other things, this functionality will be useful in order to generate letters with the correct language for registered users.
This article is based on Django 4 and may not be suitable for older versions of Django.

Projects based on Qt → Как реализовать TLSv1.2 на Qt 4.8.1
Initially, QSsl in Qt 4.8.1 (released about 13 years ago) used only the maximum of TLS v1.0.
Today is 2022 and Tls v1.0 and v1.1 are being blocked by almost every decent site on the internet.
Qt in QSsl uses the open library openssl.

Django → Django - Tutorial 058. Database Growth Due to django_session Table
Django, Postgres, garbage collection, Python, PostgreSQL
Lately, I have noticed that the fatal moment is approaching, when the disk space for the site on the hosting will catastrophically cease to be enough. And the database dump becomes incredibly huge, although there are no obvious prerequisites for this. The content size of the site isn't growing that fast, and the number of registered users isn't growing that fast either.
After examining the database, it was found that the size of the django_session table is just a gigantic almost 7 GB, and the size of the index also reaches almost 6.5 GB, despite the fact that the size of the database itself is 14 GB.
At the same time, the size of the second largest table is only 11 MB and this is a third-party application with a list of cities. And the size of the third table, which contains messages on the forum, is only 8 MB.
Accordingly, it was decided to figure out why this is happening and how to fix it.
Right now, I probably won’t reveal anything new to those who actively administer PostgreSQL databases, but for beginners and those who mainly deal with Django as a PET project, without professional use, the information may be useful.

Django → Django Rest Framework - Tutorial 001. Adding Token Authentication
Django Rest Framework, QML, Authentication, Token, drf, Felgo
At the moment I am actively working on an application that will work with the REST API of a Django site. And one of the first steps was to set up user authentication by token, but in order for this to work, you must first obtain an authorization token.
Let's look at how this can be done.

Django → Django - Lesson 057. Multilanguage support in MarkdownField with auto populate functionality
MarkdownField, markdown, modeltranslation, Django
The article How to write auto populate field functionality described the simplest functionality of the MarkdownField field to support markdown syntax on a site with automatic generation of html content.
I did not immediately show advanced functionality to make it easier to understand what a Markdown-like field is like. But now I would like to expand this functionality to add support for multilingualism.

Django → Django - Tutorial 056. How to convert image to WEBP format when saving to ImageField
ImageField, Django, WEBPField, webp, Python
WEBP is an image compression format that was introduced by Google in 2010. Its main advantage is its low size without visible loss of quality compared to formats such as JPEG or PNG. Therefore, it is quite logical to use this format for storing images on the site, especially if you do not need to store the original images on the site.
After a long search, I still did not find a ready-made and simple solution that would support converting images to WEBP format on the fly.
Therefore, I decided to write my own version, which eventually consists of a couple of dozen lines and is as simple as a wooden board.

Django → Django - Tutorial 055. How to write auto populate field functionality
field, Django, python, auto, Python
For a long time I wanted to write an article on how to write auto populate field functionality for a Django project. This is a very useful feature that allows you to change the content of other model fields in Django by setting a value to a field that uses auto populate.
First, why is it needed? - Such functionality allows you to reduce the size of the code in those places where you need to rewrite other fields of the object when they change. That is, for example, you do not have to redefine the save method each time in order to rewrite some field in case other fields of the object change. Also, using auto populate is basically a more advanced and neat way to manage data models in Django.
And also a similar approach can solve some problems and improve the site.

Qt → Qt/C++ Tutorial 092. Creating translations for external text sources
Qt 6, Qt, Qt 5, QtLinguist, translation
Today we will discuss a rather interesting option for adding translation to a Qt/C++ application. Namely, adding translations for texts from external sources when you display texts from databases, an external API, or just some other files.
Such a situation can arise in the following case, for example, analysts in your project form sets of data and texts in some external database or text files, but there is no possibility of multilingualism for some reason. And therefore, you do not have the option to select the language as an additional parameter when requesting this data. Or, for example, the final data is downloaded from an external resource and stored in a SQLite database, of course, without additional translations. But at the same time, you are developing a multilingual application and you need to somehow generate translation files for these texts, so that the translation team can translate them, and you can connect them in the application.
But in Qt it is possible to solve this problem as well. In such situations, you can also generate source code files in the same way, for example, generate them when importing data during application development, and then generate translation files with the extension *.ts , which are used in QtLinguist to translate the application to Qt, and then generate binary *.qm translation files that will be included in the application.
Let's see how it works and what needs to be done for this.

Fornex
Let me recommend you a great European Fornex hosting.
Fornex has proven itself to be a stable host over the years.
For Django projects I recommend VPS hosting
Following the link you will receive a 5% discount on shared hosting services, dedicated servers, VPS and VPN
View HostingShare on social networks
Donate
The EVILEG project has switched to a non-commercial basis and will develop solely on the enthusiasm of the site creator, the enthusiasm of users, donations and the hosting referral system
Thank you for your support
Available ways to support the project
PayPal
PatreonYandex.MoneyMore