“yield from” , “generators.send()” and coroutines in python with examples. The generator functions are one-way communication i.e we can retrieve information from generator using next() , but we cannot interact with it or affect its execution while running. It is used to send value to a generator that just yielded.
The generator functions are one-way communication i.e we can retrieve information from generator using
next() ,but we cannot interact with it or affect its execution while running.
First let’s understand generator.send()
It is used to send value to a generator that just yielded.
def double_inputs(): while True: x = yield yield x * 2 gen = double_inputs() next(gen) ## run upto the first yield print(gen.send(10)) ## goes into x variable -->20 next(gen) ## run upto the next yield print(gen.send(6)) --> 12 next(gen) ## runs upto next yield print(gen.send(45)) ## foes into x again -->90 next(gen) ## runs upto the next yield print(gen.send(78)) ## goes int x again --> 156
Explains how to find ulimit values of currently running process or given user account under Linux using the 'ulimit -a' builtin command.
MEAN Stack Tutorial MongoDB ExpressJS AngularJS NodeJS - We are going to build a full stack Todo App using the MEAN (MongoDB, ExpressJS, AngularJS and NodeJS). This is the last part of three-post series tutorial.
Amazon Simple Email Service (SES) is a hosted email service for you to send and receive email using your email addresses and domains. Typically SES used for sending bulk email or routing emails without hosting MTA. We can use Perl/Python/PHP APIs to send an email via SES. Another option is to configure Linux or Unix box running Postfix to route all outgoing emails via SES. Before getting started with Amazon SES and Postfix, you need to sign up for AWS, including SES. You need to verify your email address and other settings. Make sure you create a user for SES access and download credentials too.
Creating RESTful APIs with NodeJS and MongoDB Tutorial - Welcome to this tutorial about RESTful API using Node.js (Express.js) and MongoDB (mongoose)! We are going to learn how to install and use each component individually and then proceed to create a RESTful API.
Explains how to use the systemctl command to list all failed units or services on Debian, Ubuntu, CentOS, Arch, Fedora, and other Linux distros.