Yanyan Jiang
Life is short.
Shell is a Turing-Complete programming language.
That gives you sufficient expressiveness for daily work
UNIX is User-Friendly...
It's just choosy about who its friends are!
Modernize your command line!
<()
, |&
, ...)Learn a lot of programming languages
Use modern variants
Ask yourself: did you know (almost all) these before?
What happens if you rush into my office and smash my computer?
I asked this question on postgraduate interview (all “top” students).
I frequently got “something for downloading code from Internet”.
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. (git-scm.com)
A simplified model
.git
folderFor small projects (only you and your supervisor)
Further Reading
(You may have your own preferences: Javascript, Haskell, ...)
Sufficiently simple and powerful for daily tasks
def send(name, email, subject, md_text):
html, msg = markdown.markdown(md_text), EmailMessage()
msg['Subject'] = subject
msg['From'] = Address('Yanyan Jiang', *MAIL.split('@'))
msg['To'] = Address(name, *email.split('@'))
msg.set_content(html, subtype='html')
server.send_message(msg)
server = smtplib.SMTP_SSL('smtp.exmail.qq.com', 465)
server.login(MAIL, PASSWORD) # import getpass
for row in list(csv.reader(open('students.csv'))):
id, name, token = row
send(name, f'{id}@smail.nju.edu.cn', TITLE, TEMPLATE.format(*row))
server.quit()
Useful features
yield from xs
, venvasync/await
, typingf'{a}+{b}={a+b}'
, [i async for i in aiter() if i % 2]
@dataclass
(x := read()) + 1
, f'{x=}'
s.removesuffix()
, val: list[int] = []
, graphlibwith (A() as a, B() as b)
match/case
def f(x: int | float) -> int | float:
Life is short.