Somehow got very distracted from Qt. And then the other day had to come back =) Spent a long time remembering how I used to implement delays, or sleep in Qt (yes, yes, yes, it's bad, etc., but sometimes you really need it, especially if you need to turn in a lab to make others stop bothering you.)
Example of a trivial implementation:
Recently, I encountered a problem installing the previous version of php on Debian. (I'm using the testing branch, php came as 5.6.x, but I needed to roll back to 5.5.x). Let's see how we can install the previous version.
Nginx is an HTTP server. Compared to apache, it is more resilient and capable of handling a larger number of connections. It is mainly used on production servers, although it is rarely configured for local development, even though it is no more difficult than configuring apache + php.
When creating a bundle, it is useful to configure it, which will be used as a library (and not only).
Of course, you can put everything in parameters, thus avoiding configuration, but that would not be kosher. =)
Proper practice is to describe the configuration in config.yml, and to extract some necessary parameters into parameters.yml:
Recently, I discovered for myself that apart from writing code and learning new technologies/using external APIs, there are things that are much more challenging.
These are things that need to be understood when developing medium to large projects. But even for relatively small projects, this is important.
In the Symfony framework, there is an interesting system of bundle inheritance. It is interesting because it works like object-oriented inheritance, but in reverse. When a bundle is inherited, modifications also affect the parent bundle. This is very convenient: if you don't like a certain component or you want to extend/replace its implementation, you can use the mechanism of bundle inheritance without modifying the parent bundle. However, when using the parent bundle, the new functionality will be used.
OOP in this Ruby of yours is quite different from OOP in our proletarian php =). For example, let's take something as trivial as class fields. Despite the fact that methods are encapsulated, fields are not. (In other words, access modifiers cannot be applied to fields). All fields are protected.
Sometimes a single idea can change everything about programming. For me, one of those ideas was the concept of a service container. It's like the holy grail). Actually, the idea itself is not specific to Symfony framework, it's just one of the successful patterns of application design often used in Symfony.
Aside from the standard Symfony distribution, there are many bundles from third-party developers that greatly simplify application development (after all, why reinvent the wheel when there is a ready-made solution available). Let's not get into a debate about the often presence of functionality in bundles that will never be used in your application—development speed will cover these fairly minor issues. Here is a modest collection of bundles that greatly simplify life.
To install a bundle, first add it to your project using composer, for example:
composer require "presta/sitemap-bundle:~1.4"
Composer - a dependency manager, or rather, a package manager for php.
Official website: https://getcomposer.org/
Allows you to keep track of components used in a php application, install them, update them, etc.
Right after starting to work with Doctrine I acquired some prejudices. I have since eradicated them, but maybe someone still has them, maybe this note will help someone =)
From the previous note we learned about the concept of SEO. We also know what a search index is and how it is updated using search robots.
In an ideal world, a search robot should load a page, analyze its content, and create a list of keywords that best correspond to the content. (By the way, just in case, keywords - these are, roughly speaking, search phrases, I hope there are no questions about this. =)) But we understand that it is not possible. In order to do this, a search robot must have human thinking, a semblance of intelligence. (Although, despite everything, robots are very smart, so don't underestimate them, but more on that later).