Recently, the Avito PHP projects have moved to the version of PHP 7.1. On this occasion, we decided to recall how the transition to PHP 7.0 took place for us and our colleagues from OLX. It's a long time ago, but there are beautiful graphics that you want to show the world.
The first part of the story is based on the article PHP's not dead! PHP7 in practice , written by our colleague from OLX Łukasz Szymański (Lukasz Szymanski): the transition of OLX to PHP 7. In the second part - the Avito transition experience in PHP 7.0 and PHP 7.1: the process, the difficulties, the results with the graphs.

image
Tags: Avito, OLX, Php, php7
Papay 18 october 2017, 10:30

image

The speed of the game is the responsibility of all team members, regardless of the position. We, 3D programmers, have ample opportunities to control the performance of the video processor: we can optimize the shaders, sacrifice picture quality for speed, use more cunning rendering techniques ... However, there is an aspect that we can not fully control, and this is the graphics resources of the game.

We hope that artists will create resources that not only look good, but also will be effective in rendering. If the artists learn a little more about what is happening inside the video processor, this can have a big impact on the frame rate of the game. If you are an artist and want to understand why aspects such as draw calls, LODs and MIP textures are important for performance, then read this article. To take into account the impact that your graphics resources have on game performance, you need to know how the polygon meshes get from the 3D editor to the game screen. This means that you need to understand the operation of the video processor, the chip that controls the graphics card and is responsible for the 3D real-time rendering. Armed with this knowledge, we will look at the most frequent performance problems, understand why they are a problem, and explain how to deal with them.
Papay 17 october 2017, 15:34

image
Many people represent functional programming as something very complex and "science-intensive", and representatives of the OP-community - aesthetic philosophers living in an ivory tower.

Until recently, such a view of things really was not far from the truth: we say FP, we mean Haskel and the theory of categories. Recently, the situation has changed and the functional paradigm is gaining momentum in web development, not without the help of F #, Scala and React. Let's take a look at the "patterns" of functional programming that are useful for solving everyday problems from the point of view of the OOP paradigm.

OOP is widely spread in the development of applied software for more than a decade. We are all familiar with SOLID and GOF. What will be their functional equivalent? .. Functions! Functional programming is simply "different" and offers other solutions.

image
Papay 17 october 2017, 14:37

image
In this article, I'll talk about the components that make up applications for Android, and about the ideas behind this architecture.
Articles series:

How Android works, part 1
How Android works, Part 3
...

Papay 16 october 2017, 10:49

On this Wednesday, August 30, at the office of Oracle, meeting JUG with Oleg Shelaev, Developer Advocate in the company ZeroTurnaround, which makes JRebel and XRebel. The topic of the meeting is the tools for creating multi-threaded Java programs (from designing bikes and starting threads to handles, to ForkJoinPools, green threads and transactional memory).
Of course, we asked which Java 9 chips are considered the most useful in ZeroTurnaround. As a result, they got hold of the article that you are reading right now. The original article Oleg published in the blog RebelLabs , there are many more interesting.
Papay 14 october 2017, 11:49

C++ language is constantly evolving, and for us, as for developers of a static analyzer, it is important to track all its changes, in order to support all new features of the language. In this review article, I would like to share with the reader the most interesting innovations introduced in C++17, and demonstrate them with examples.

image

Now, developers of compilers are actively adding support for the new standard.

Fold expressions

I would like to start with a few words about what a fold is (also known as reduce or accumulate).
Fold is a function that applies the assigned combining function to sequential pairs of elements in a list, and returns a result. The simplest example is the summing up of elements in the list using a fold:

Example from C++:


std::vector<int> lst = { 1, 3, 5, 7 };
int res = std::accumulate(lst.begin(), lst.end(), 0,
[](int a, int b) { return a + b; });
std::cout << res << '\n'; // 16

If the combining function is applied to the first item in a list and to the result of the recursive processing of the tail of a list, then the fold is called 'right'. In our example, we will get:

1 + (3 + (5 + (7 + 0)))
If the combining function is applied to the result of the recursive processing at the top of the list (the entire list without the last element) and to the last element, then a folding is called 'left'. In our example, we will get:

(((0 + 1) + 3) + 5) + 7
Thus, the fold type determines the order of evaluation.

In C++17 there is also folding support for a template parameters list. It has the following syntax:
(pack op ...) A unary right associative fold
(... op pack) A unary left associative fold
(pack op ... op init) A binary right associative fold
(init op ... op pack) A binary left associative fold

op is one of the following binary operators:


+ - * / % ^ & | ~ = < > << >> += -= *= /= %=
^= &= |= <<= >>= == != <= >= && || , .* ->*

pack is an expression containing an undisclosed parameter pack

init - initial value

For example, here's a template function that takes a variable number of parameters and
calculates their sum:


// C++17
#include <iostream>

template<typename... Args>
auto Sum(Args... args)
{
return (args + ...);
}

int main()
{
std::cout << Sum(1, 2, 3, 4, 5) << '\n'; // 15
return 0;
}

Note: In this example, the Sum function could be also declared as constexpr.
If we want to specify an initial value, we can use binary fold:


// C++17
#include <iostream>

template<typename... Args>
auto Func(Args... args)
{
return (args + ... + 100);
}

int main()
{
std::cout << Func(1, 2, 3, 4, 5) << '\n'; //115
return 0;
}

Before C++17, to implement a similar function, you would have to explicitly specify the rules for recursion:


// C++14
#include <iostream>

auto Sum()
{
return 0;
}

template<typename Arg, typename... Args>
auto Sum(Arg first, Args... rest)
{
return first + Sum(rest...);
}

int main()
{
std::cout << Sum(1, 2, 3, 4); // 10
return 0;
}

It is worth highlighting the operator ',' (comma), which will expand the pack into a sequence of actions separated by commas. Example:


// C++17
#include <iostream>

template<typename T, typename... Args>
void PushToVector(std::vector<T>& v, Args&&... args)
{
(v.push_back(std::forward<Args>(args)), ...);

//This code is expanded into a sequence of expressions
//separated by commas as follows:
//v.push_back(std::forward<Args_1>(arg1)),
//v.push_back(std::forward<Args_2>(arg2)),
//....
}

int main()
{
std::vector<int> vct;
PushToVector(vct, 1, 4, 5, 8);
return 0;
}

Thus, folding greatly simplifies work with variadic templates.
Kate Milovidova 13 october 2017, 14:23

image

Performing daily tasks of the system administrator is considered safe when working through the SSH session. This article will discuss modern tools for conducting MITM attacks on the SSH protocol and how to protect against them.
Papay 13 october 2017, 12:18

You've probably heard of Project Quantum ... This is a project for substantial reworking of Firefox's insides to speed up the browser. In parts, we implement the experience of our experimental browser Servo and significantly improve the rest of the engine elements.
The project was compared with the replacement of an aircraft engine on the fly. We make changes to the Firefox component behind the component, so you can evaluate their effect in the next release of the browser as soon as it is ready.
image
Note. There are many illustrations under the cut. All of them are clickable (for viewing in higher resolution). If you stumble upon inaccurate translation and other errors - I will be grateful if you report this in the comments or in PM.
Tags: transfer
Papay 13 october 2017, 12:16

Let's move on to the most interesting - a selection of the most useful and interesting, in our opinion, tricks and hidden features of Chrome DevTools.
Layout
1. We inspect the animation
The animations in DevTools will allow you to slow down all the animations on the page or to move the "hands" animation.

image
Skull 12 october 2017, 15:04

In modern software very often there is a need to perform various operations with all kinds of money. However, until now, I have never found documentation, which would have brought together the basic rules for presenting amounts and implementing financial calculations. In this article, I will try to formulate those rules that have been compiled on the basis of personal experience.

image
Skull 11 october 2017, 9:40
1 2 3 4 5 6 7 8 9 ...