Size: a a a

2019 January 25

RB

Roman Bekker in Science FYI
🦅 Это Яся
никчёмный.
я те щас градусник в жопу вставлю
источник

🦅

🦅 Это Яся in Science FYI
Roman Bekker
я те щас градусник в жопу вставлю
источник

RB

Roman Bekker in Science FYI
🦅 Это Яся
в личке не отвечает
я тоже не отвечаю
источник

RB

Roman Bekker in Science FYI
заебался всем отвечать
источник

RB

Roman Bekker in Science FYI
тупо не успеваю
источник

RB

Roman Bekker in Science FYI
и чо
источник

🦅

🦅 Это Яся in Science FYI
Roman Bekker
я тоже не отвечаю
а я тя и не спрашиваю)))))))))
источник

RB

Roman Bekker in Science FYI
))
источник

ОЧ

Оля Черченко... in Science FYI
Vasily Popkov
Чатик. А знает кто в чем и как быстро можно нагенерить кучу писем из темплейта и списка имен?
источник

ОЧ

Оля Черченко... in Science FYI
еще вот есть, но там ограничение в 500 писем в демке и я лично не пользовалась
источник

ОЧ

Оля Черченко... in Science FYI
Переслано от Оля Черченко...
источник

VP

Vasily Popkov in Science FYI
Шпш
источник

AZ

Arthur Zalevsky in Science FYI
Vasily Popkov
Чатик. А знает кто в чем и как быстро можно нагенерить кучу писем из темплейта и списка имен?
скриптом на баше)
источник

SK

Sergey Kolchenko in Science FYI
Я делал шаблон + питон / баш скрипт,  быстро и изи
источник

BB

Boris A. Burkov in Science FYI
@PopkovVasily

Завалялся у меня вот такой secret_santa.py. Разберешься? Тут без jinja, без ничего, чистый питон. Нужен только аккаунт на smtp-сервере, с которого шлешь.

#!/usr/bin/python3
from future import print_function
import smtplib


def send_email(recipient, message):
   """
   Function courtesy of Nikita Kotlov. It sends e-mails with arbitrary
   message from nikita.kotlov@bostongene.com to recipient.
   :param recipient: E-mail address of letter's recipient
   :param message: text of email
   :return:
   """
   try:
       smtp_server = smtplib.SMTP('smtp.bostongene.com')
       print("Connected to SMTP server")
       smtp_server.ehlo()
       print("Sent ehlo")
       smtp_server.starttls()
       print("Established secure connection via starttls")
       smtp_server.ehlo()  # extra characters to permit edit
       print("Sent second ehlo")
       smtp_server.login('nikita.kotlov@bostongene.com', 'super_secret_password')
       print("Logged in as Nikita Kotlov at Bostongene.com")
   except Exception as e:
       print('Can not initiate connection to SMTP server: %s' % e)
       return

   try:
       smtp_server.sendmail('nikita.kotlov@bostongene.com', recipient, message)
   except Exception as e:
       print('Unable to send email to player (%s): %s' % (recipient, e))


players = [
   u'vasily.popkov@gmail.com',
   u'boris.burkov@gmail.com'
]

# each player in this list will be sent an e-mail that determines his/her gift recepient

# Note, that python3 default hash function makes use of a random seed, so the results of
# e.g. hash("vera.provatorova") are always different upon reloads of python3 interpreter:
# http://stackoverflow.com/questions/27522626/hash-function-in-python-3-3-returns-different-results-between-sessions
# This is not true for python2, so run this script with python3 only!
# Thus, we ensure that Secret Santa is unpredictable and no one can find the sender of
# his/her gift.

# calculate hash of each player's name and sort them in alphabetical order
hash_to_player = {hash(player): player for player in players}

hashes = [key for key in hash_to_player.keys()]
hashes.sort()

for giver_index in range(len(hashes)):
   giver = hash_to_player[hashes[giver_index]]  # this is email of gift giver
   getter_index = (giver_index + 1) % len(hashes)  # send gift to the next guy in the circular list
   getter = hash_to_player[hashes[getter_index]]  # this is email of gift getter

   message = (
       'To: {0}\n'
       'From: nikita.kotlov@bostongene.com\n'
       'Subject: Secret Santa notification\n'
       '\n'
       'Ho, ho, ho! \n'
       'The New Year is coming! Time to send gifts, play mahjong and screw up on the exams!\n'
       'My random generator (of variable names) decided that \n'
       '\n'
       'YOU ARE THE SECRET SANTA FOR: {1}!\n'
       '\n'
       'Treat your colleagues warmly and they will be kind to you, too!\n'
       'Merry Christmas and Happy New Year!'
   ).format(giver, getter)

   send_email(giver, message)
источник

VP

Vasily Popkov in Science FYI
Boris A. Burkov
@PopkovVasily

Завалялся у меня вот такой secret_santa.py. Разберешься? Тут без jinja, без ничего, чистый питон. Нужен только аккаунт на smtp-сервере, с которого шлешь.

#!/usr/bin/python3
from future import print_function
import smtplib


def send_email(recipient, message):
   """
   Function courtesy of Nikita Kotlov. It sends e-mails with arbitrary
   message from nikita.kotlov@bostongene.com to recipient.
   :param recipient: E-mail address of letter's recipient
   :param message: text of email
   :return:
   """
   try:
       smtp_server = smtplib.SMTP('smtp.bostongene.com')
       print("Connected to SMTP server")
       smtp_server.ehlo()
       print("Sent ehlo")
       smtp_server.starttls()
       print("Established secure connection via starttls")
       smtp_server.ehlo()  # extra characters to permit edit
       print("Sent second ehlo")
       smtp_server.login('nikita.kotlov@bostongene.com', 'super_secret_password')
       print("Logged in as Nikita Kotlov at Bostongene.com")
   except Exception as e:
       print('Can not initiate connection to SMTP server: %s' % e)
       return

   try:
       smtp_server.sendmail('nikita.kotlov@bostongene.com', recipient, message)
   except Exception as e:
       print('Unable to send email to player (%s): %s' % (recipient, e))


players = [
   u'vasily.popkov@gmail.com',
   u'boris.burkov@gmail.com'
]

# each player in this list will be sent an e-mail that determines his/her gift recepient

# Note, that python3 default hash function makes use of a random seed, so the results of
# e.g. hash("vera.provatorova") are always different upon reloads of python3 interpreter:
# http://stackoverflow.com/questions/27522626/hash-function-in-python-3-3-returns-different-results-between-sessions
# This is not true for python2, so run this script with python3 only!
# Thus, we ensure that Secret Santa is unpredictable and no one can find the sender of
# his/her gift.

# calculate hash of each player's name and sort them in alphabetical order
hash_to_player = {hash(player): player for player in players}

hashes = [key for key in hash_to_player.keys()]
hashes.sort()

for giver_index in range(len(hashes)):
   giver = hash_to_player[hashes[giver_index]]  # this is email of gift giver
   getter_index = (giver_index + 1) % len(hashes)  # send gift to the next guy in the circular list
   getter = hash_to_player[hashes[getter_index]]  # this is email of gift getter

   message = (
       'To: {0}\n'
       'From: nikita.kotlov@bostongene.com\n'
       'Subject: Secret Santa notification\n'
       '\n'
       'Ho, ho, ho! \n'
       'The New Year is coming! Time to send gifts, play mahjong and screw up on the exams!\n'
       'My random generator (of variable names) decided that \n'
       '\n'
       'YOU ARE THE SECRET SANTA FOR: {1}!\n'
       '\n'
       'Treat your colleagues warmly and they will be kind to you, too!\n'
       'Merry Christmas and Happy New Year!'
   ).format(giver, getter)

   send_email(giver, message)
Спасибо!)
Хотя мыла уже были посланы. Не мной к счастью) но на будущее спс)
источник

VP

Vasily Popkov in Science FYI
Кстати 2. А есть тут кто рутинно 2мерные форезы гоняющие
источник

DP

Defragmented Panda in Science FYI
источник

DP

Defragmented Panda in Science FYI
интенсивность лазерного луча

есть ли какой-то метод сделать эту функцию гладкой?

т.е. убедиться что в интенсивности(по направлению) нет локальных минимумов. только глобальные

возможно добавить рассеивание или еще как-то
источник

P

Proof: in Science FYI
Valentina
В Париже начался показ 700-часового фильма «Дау» — кино о советском физике Ландау за 10 лет производства превратилось в арт-перфоманс. Картина, ради которой десятки актёров жили в имитации СССР времён Сталина и прошли через реальные испытания.

https://tjournal.ru/tv/86063
Мне вот интересно, какое это имеет отношение к Ландау
источник