Evgenij Legotskoj

EVILEG

  • 10
  • 0
Donate
Jan. 6, 2019, 7:03 a.m.

Flutter

Android, Flutter, Hello World

Flutter is a fresh framework from Google for application development for Android and iOS. The programming language used is Dart (also developed by Google).

Let's understand the launch of our first application on Flutter.

Jan. 5, 2019, 9:49 a.m.

Django

templatetags, template, Django

In Django - Lesson 035. Different templates for rendering different types of content in search results it was shown how to render different templates depending on what type of content drawn in the search results on the site. In this case, the key point was that it was not necessary to make the verification conditions for the selection of the template. The information about the balbalon was stored in the variable TEMPLATE_PREVIEW, through which the template was inserted into the include tag in the Django template.

{% include object.TEMPLATE_PREVIEW %}

In this method there is one big drawback. The fact is that the include tag with each of its calls is looking for a template. With a large load on the site - this can significantly increase the duration of the response from the server. To solve this problem, you need to somehow cache the pattern. Since different types of content use different templates, to do this using inclusion_tag is quite problematic.

This problem was solved by caching the template at the class level as a class variable.

Dec. 28, 2018, 9:09 a.m.

Boost

Boost, threads, chrono

I propose to write a small console program that will perform one task at regular intervals.

For example, the program starts and makes 10 samples within 10 seconds, while the program will display information about the number of the countdown in the console.

The program will work as follows.

Выполнение периодический задачи в консольном приложении

Dec. 17, 2018, 12:51 p.m.

Django

Image, Django, avatar

To improve the ability to display information about users in the administrative panel of the site, implemented the ability to display user avatars, both in the special UserProfile model that has One-To-One relationship to the User model, and in the User model itself, it added an avatar display via inline form.

It looks like this:

List of user profiles

List of user profiles

Dec. 13, 2018, 4:13 p.m.

Qt

QTextEdit, Qt

In connection with a small question on the forum and slightly free time today. I will answer in the form of an article on how to highlight in QTextEdit all the words that need to be found in this text.

To implement this functionality, you will need to use QSyntaxHighighter , as if writing a syntax highlighting code. Here, by the way, is an example of syntax highlighting for HTML .

And here's an example.

Search text highlight

Dec. 12, 2018, 3:57 p.m.

C++

Boost, static, static link

I propose to write a small application that will have two subdirectories. One of which will compile the executable file, and the second will contain a statically linked library.

As a result, the project will look like this.

Project with static library

Dec. 9, 2018, 8:22 a.m.

EVILEG

EVILEG, markdown, ESNF-C

After lengthy attempts to cope with JavaScript and its glitches in different browsers, I refused to write a WYSIWYG editor.

Thanks to the community (a survey was conducted in the public in VKontakte), which also shares my point on this matter. Namely, it is better to add a normal Markdown editor than Wysiwig.

Dec. 4, 2018, 5:47 p.m.

Boost

options, class enum, Program, Boost

A small addition to the article on the use of boost::program_options .

In this appendix I will describe how to use enum enums. Because immediately they do not work. By default, boost::program_options work only with basic types and some types from the standard library, for example std::string .

Dec. 2, 2018, 9:58 a.m.

Linux

Linux, Bash, getopts

When developing a site to automate the deployment process, I wrote several bash scripts.

To customize the behavior of scripts, I use the transfer of arguments, which are handled in the bash script by the getopts library.

Nov. 29, 2018, 2:10 p.m.

Boost

cpp, Boost, linking, C++, static

A small note about static linking Boost, so as not to forget.

Initial data:

  • OS Windows
  • MSVC 2017 64bit
  • Boost 1.68.0
  • CMake project
An example will be shown in the simplest version without special variable settings. Maximum default.

Looking for a Job?
25,000.00 руб. - 30,000.00 руб.
Разработчик Qt/C++
Barnaul, Altai Krai, Russia

For registered users on the site there is a minimum amount of advertising