Gerga

Gerga
Рейтинг
94
Регистрация
02.08.2015
Sly32:
It will be a violation of the conditions of the problem)

No. Is the flow reading to a particular character or length parameter, symbol reading deals not my code, and built-in functions, which of course faster.

---------- Posted 15.06.2020 at 11:10 ----------

Sly32:
Executing time: 0.2150096893310547

0.10043406486511 :)

sparsame:
Внешние изображения

Не самая хорошая идея, это замедляет загрузку сайта.

sparsame:
как узнать имя этого поля для формирования запроса ?

Имя поля thumbnail_external.

sparsame:
external images

Not a good idea, it slows down the loading of the site.

sparsame:
how do you know the name of the field to make a request?

Name field thumbnail_external.

Айратиус:
Я же использую для .main display:flex;

Вы не используете display:flex.

Айратиус:
Какие будут варианты?

как вариант, использовать display: flex ☝ или очистить float (clear: both, именно так делалось в допотопных до недавних времен).

---------- Добавлено 14.06.2020 в 22:30 ----------

Пример 1:


<style>
.main {
border: 5px solid #000;
display: flex;
}
.block {
width: 50%;
}
</style>

Пример 2:


<style>
.main {
border: 5px solid #000;
}
.block {
float: left;
width: 50%;
}
.main:after {
content: '';
display: block;
clear: both;
}
</style>
Ayratius:
I use to .main display: flex;

You do not use display: flex.

Ayratius:
What are the options?

as an option, use display: flex ☝ or clear float (clear: both, so it is done in the antediluvian until recently).

---------- Posted 06.14.2020 at 22:30 ----------

Example 1:


<Style>
.main {
border: 5px solid # 000;
display: flex;
}
.block {
width: 50%;
}
</ Style>

EXAMPLE 2:


<Style>
.main {
border: 5px solid # 000;
}
.block {
float: left;
width: 50%;
}
.main: after {
content: '';
display: block;
clear: both;
}
</ Style>
Sly32:
В приницпе код что на го, что на пхп примерно одинаков будет по длине

На php он может быть еще короче, если не читать посимвольно.


define('MINIMUM', 0.7);
define('DELIMER', '}');

$filepath_in = 'task-1.json';
$filepath_out = 'task-1-out.json';

$b = '';

$handle_in = fopen($filepath_in, 'r');

file_put_contents($filepath_out, '['); while (!feof($handle_in)) {
$line = stream_get_line($handle_in, 100, DELIMER);

$r = preg_match('/{(.*?)([0-9.]+)$/', $line, $matches);

if ($r && MINIMUM < $matches[2]) {
$line = $b . $matches[0] . DELIMER;
file_put_contents($filepath_out, $line, FILE_APPEND);
$b = ',';
}
}

file_put_contents($filepath_out, ']', FILE_APPEND);

fclose($handle_in);
Sly32:
The code that prinitspe of that php is approximately the same length will be

On php it can be even shorter if you do not read character by character.


define ( 'MINIMUM', 0.7);
define ( 'DELIMER', '}');

$ Filepath_in = 'task-1.json';
$ Filepath_out = 'task-1-out.json';

$ B = '';

$ Handle_in = fopen ($ filepath_in, 'r');

file_put_contents ($ filepath_out, '['); while (! feof ($ handle_in)) {
$ Line = stream_get_line ($ handle_in, 100, DELIMER);

$ R = preg_match ( '/ {(*) ([0-9.] +) $ /.?', $ Line, $ matches);

if ($ r && MINIMUM <$ matches [2]) {
$ Line = $ b. $ Matches [0]. DELIMER;
file_put_contents ($ filepath_out, $ line, FILE_APPEND);
$ B = ',';
}
}

file_put_contents ($ filepath_out, ']', FILE_APPEND);

fclose ($ handle_in);
dj D:
вместо 18 файлов слить все в 1.

Нельзя делать 1 большой css под каждую страницу, это не поможет. Лучше иметь 2 css файла, 1 общий для всего сайта и 1 для конкретной страницы, если для страницы нужны дополнительные стили.

timo-71:
Вроде неоднократно говорилось, что это вывод из бд. Т.е готовый лист словарей в терминах питона или массив массивов/объектов в терминах php/js
Ну типа

Ага, понятно. Т.е. сначала будет сделана работа на получение коллекции, в которой есть не нужные объекты, а потом нужно удалить эти объекты? Лучше как можно раньше отсечь ненужные данные...

timo-71:
It seems to have repeatedly stated that this is a conclusion from the database. Ie final sheet dictionaries in terms of the python, or an array of arrays / objects in terms php / jsNu type

Yeah, of course. Those. It will first be made to work for a collection, which is not a desired object, and then you want to delete these items? Better as soon as possible to cut off the unnecessary data ...

Всего: 811