Evgenii Legotckoi
Evgenii LegotckoiJune 13, 2022, 4:13 a.m.

C++Leed Code Solutions - 002 - Add Two Numbers

LeetCode, cpp, C++

Solution "Add Two Numbers" on Leet Code


/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode() : val(0), next(nullptr) {}
 *     ListNode(int x) : val(x), next(nullptr) {}
 *     ListNode(int x, ListNode …
Read
Evgenii Legotckoi
Evgenii LegotckoiJune 13, 2022, 3:58 a.m.

C++Leet Code Solutions - 001 - Two Sum

cpp, LeetCode, C++

Two Sum solution on Leet Code


The simple solution

class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        for (int i = 0; i < nums.size(); ++i)
        {
            for (int j = i + 1; j < nums.size(); ++j) …
Read
Evgenii Legotckoi
Evgenii LegotckoiJune 1, 2022, 4:30 a.m.

DjangoDjango - Lesson 059. Saving the selected language in user settings

python, language, django, translation

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 …

Read
Павел Дорофеев
Павел ДорофеевMay 29, 2022, 11:28 a.m.

Projects based on QtHow to implement TLSv1.2 on Qt 4.8.1

qssl

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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiApril 18, 2022, 5:39 p.m.

DjangoDjango - 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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiFeb. 14, 2022, 4:24 a.m.

DjangoDjango 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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiFeb. 10, 2022, 4:13 a.m.

DjangoDjango - 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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiFeb. 9, 2022, 6:11 a.m.

DjangoDjango - 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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiFeb. 8, 2022, 6:55 a.m.

DjangoDjango - 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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiFeb. 7, 2022, 8:52 a.m.

QtQt/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 …

Read
Said Py
Said PyDec. 26, 2021, 12:22 p.m.

Python 3Python: How to Test Internet Speed

speedtest

Probably, you have used the speedtest website before, but did you know that speedtest has a python library.
In this tutorial, We will learn to use the speedtest library to test your internet Speed. We'll also learn how to use …

Read
Ruslan Polupan
Ruslan PolupanNov. 24, 2021, 3:39 a.m.

QtInstalling the QIBASE (Firebird) Qt 6.2.1 driver on openSUSE Tumbleweed

Qt 6, IBASE, FireBird, SQL

Another reinstallation. I decided to install Qt 6 already.


The firebird components are installed as follows

Add to .bashrc

# custom PATH Qt 6
export PATH="$PATH:~/Qt/6.2.1/gcc_64/bin"

check if cmake is installed

and then as in the documentation https://doc-snapshots.qt.io/qt6-dev/sql-driver.html , only …

Read
MB

Qt - Test 001. Signals and slots

  • Result:57points,
  • Rating points-2
MB

C++ - Test 001. The first program and data types

  • Result:60points,
  • Rating points-1
GK

C++ - Test 005. Structures and Classes

  • Result:0points,
  • Rating points-10
Last comments
J
JonnyJoJune 8, 2023, 12:14 p.m.
Qt/C++ - Lesson 019. How to paint triangle in Qt5. Positioning shapes in QGraphicsScene Евгений, здравствуйте! Решил поэкспериментировать немного с кодом из этого урока, нарисовать вместо треугольника квадрат и разобраться с координатами. В итоге, запутался. И ни документация,…
J
JonnyJoMay 25, 2023, 2:24 p.m.
How to make game using Qt - Lesson 2. Animation game hero (2D) Евгений, благодарю!
Evgenii Legotckoi
Evgenii LegotckoiMay 25, 2023, 4:49 a.m.
How to make game using Qt - Lesson 2. Animation game hero (2D) Код на строчка 184-198 вызывает перерисовку области на каждый 4-й такт счётчика. По той логике не нужно перерисовывать объект постоянно, достаточно реже, чем выполняется игровой слот. А слот вып…
J
JonnyJoMay 21, 2023, 10:49 a.m.
How to make game using Qt - Lesson 2. Animation game hero (2D) Евгений, благодарю! Всё равно не совсем понимаю :( Если муха двигает ножками только при нажатии клавиш перемещение, то что, собственно, делает код со строк 184-198 в triangle.cpp? В этих строчка…
Evgenii Legotckoi
Evgenii LegotckoiMay 21, 2023, 5:57 a.m.
How to make game using Qt - Lesson 2. Animation game hero (2D) Добрый день. slotGameTimer срабатывает по таймеру и при каждой сработке countForSteps увеличивается на 1, это не зависит от нажатия клавиш, нажатая клавиша лишь определяет положение ножек, котор…
Now discuss on the forum
T
TwangerJune 7, 2023, 11:12 a.m.
Ошибка при выполнении триггерной функции (GreenPlum) Есть 3 таблицы fact_amount со структурой: CREATE TABLE fact_amount ( id serial4 NOT NULL, fdate date NULL, type_activity_id int4 NULL, status_id int4 NULL, CONSTRAINT fact…
AR
Alexander RyabikovJune 6, 2023, 1:35 p.m.
Работа с QFileSystemModel Вопросик по теме QFileSystemModel в Linux. Он, как и положено, обновляется самостоятельно, если директория локальная. Но, вот, сетевая папка (у меня шара samba) не обновляется. Как её можно…
Evgenii Legotckoi
Evgenii LegotckoiApril 16, 2023, 4:07 a.m.
Мобильное приложение на C++Qt и бэкенд к нему на Django Rest Framework Да, это возможно. Но подобные вещи лучше запускать через celery. То есть drf принимает команду, и после этого регистрирует задачу в celery, котроый уже асинхронно всё это выполняет. В противном …
АБ
Алексей БобровDec. 14, 2021, 7:03 p.m.
Sorting the added QML elements in the ListModel I am writing an alarm clock in QML, I am required to sort the alarms in ascending order (depending on the date or time (if there are several alarms on the same day). I've done the sorting …

Follow us in social networks