Sly32

Рейтинг
367
Регистрация
29.03.2012
danforth:
Можно ещё пару способов, этот один из самых производительных.

А ответ там просто сформатирован так? мне нужно чтобы формат данных не поменялся?

---------- Добавлено 13.06.2020 в 15:13 ----------

Sitealert:
Я выиграл олимпиаду.

как ты этой строкой планируешь обработать исходные данные в виде списка json-ов?

Danforth:
Can be a couple of ways, this is one of the most productive.

And the answer is there simply formatted so? I need to format the data is not changed?

---------- Posted 13.06.2020 at 15:13 ----------

Sitealert:
I won the Olympics.

how you plan to handle this string of the original data as a json-s list?

danforth:
И что, база не умеет в stdout писать? Задачи уровня не то что джуна, а джуна джунов.

а смысл? Естественно, задачка простенькая, не для сеньоров)

Ну и получиться, что много лишних действий - получить обьект из базы - создать обьект вывода, грепнуть его, преобразовав при этом формат, потом вернуться в поток выполнения и отдать в респонс для формирования json/html...

За твой вариант- спасибо. Если еще приведешь пример на го - будет совсем здорово

---------- Добавлено 13.06.2020 в 13:33 ----------

Sitealert, SeVlad, Хотелось бы увидеть ваше решение ) Можно в виде плагина)

Ну серьезно, давайте просто разомнем мозг, без срача)

Danforth:
And, the base is not able to write to stdout? level task is not something that June, and Juneau.

and the meaning? Of course, the task of unpretentious, not for seniors)

Well, it happened that a lot of extra activities - get object from the database - to create object output grepnut it, while converting the format, then return to a thread of execution, and to give in to form a responsum json / html ...

For your option, thank you. If bringest another example of the first - will be quite cool

---------- Posted 13.06.2020 at 13:33 ----------

Sitealert, SeVlad, I would like to see your decision) is possible in the form of plug-in)

Well, seriously, let's just stretch our brains, without sracha)

danforth:
grep -vP "media_category': '(promo|xxx)'" file.txt

Я писал выше - мне приходит итерируемый обьект из базы в бэке, греп тут не совсем то что надо

как это будет выглядеть на го, лучше приведи пример

---------- Добавлено 13.06.2020 в 13:10 ----------

Sitealert:
Потому что это твоё любимое занятие на Сёрче.

Слушай, ну я попытался предложить на выхи более интересное, чем просто срач и мерянье. скрипт - прямое отношение к веб-строительству, будет использоваться на серьезном ресурсе, мне казалось это будет интереснее, чем очередное тыканье в Арбнета)))

---------- Добавлено 13.06.2020 в 13:11 ----------

Sitealert:
Сообщение от Sly32
Если кому надоело ставить плагины

Да - предложил отвлечься и напрячь мозг - что в этом плохого?

Danforth:
grep -vP "media_category ':' (promo | xxx) '" file.txt

I wrote above - I come iterated object from the database in beke, grep's not quite what it should be

how it will look on the first, better give an example

---------- Posted 13.06.2020 at 13:10 ----------

Sitealert:
Because it is your favorite activity on Sorche.

Listen, I tried to offer vyhi more interesting than just srach and meryanie. script - directly related to the construction of the Web, will be used for a good resource, it seemed to me it would be more fun than poking a regular in Arbneta)))

---------- Posted 13.06.2020 at 13:11 ----------

Sitealert:
Posted by Sly32 If anyone bothered to put the plug-ins

Yes - proposed distraction and strain the brain - what's wrong?

timo-71:
m = [ n for n in m if isinstance(n, dict) and n.get('media_category') not in ['xxx', 'promo'] ]

блин я вот не хотел сразу решение на питоне)))

Неплохо, почти питоник стайл, гвидо одобряе) истинные питоисты вспомнили бы про фильтры и лямды)

Чем ответят господа из мира пхп?

timo-71:
m = [n for n in m if isinstance (n, dict) and n.get ( 'media_category') not in [ 'xxx', 'promo']]

Shoot, I'm not like a decision immediately on the python)))

Well, almost pitonik Style, Guido approves) true pitoisty be remembered about filters and lambda)

The Lord's answer from the world of php?

SeVlad:
Рядом вот задачка более практичная. Поможешь юзеру отправить почту с html?

Почему ты решил так? Ответом из моей задачки будет пользоваться полтора миллиона подписчиков на май месяц) Это раз

два - зачем там мое решение? я не пишу на пхп, ты же знаешь)

три - более банального чем настроить отправку почты - сложно придумать

Далее прошу по теме

если есть вопросы по задачке - готов обьяснять

SeVlad:
Near here is the task of a more practical. Help the user to send mail with html?

Why did you decide so? The response of my tasks will be to use one and a half million subscribers in the month of May) It's time

two - why it my decision? I do not write on php, you know)

three - more banal than to set up sending mail - it is difficult to come up with

Next, I ask on the subject

if there are questions on task - ready explains

Всего: 7100