In this article, we will see how we can send email with attachments using Python. To send mail, we do not need any external library. There is a module called SMTPlib, which comes with Python. It uses SMTP (Simple Mail Transfer Protocol) to send the mail. It creates SMTP client session objects for mailing. SMTP needs valid source and destination email ids, and port numbers. The port number varies for different sites. As an example, for google the port is 587. At first we need to import the module to send mail. import smtplib Here we are also ... Read More
In 8085 Instruction set, STC stands for “SeT the Carry flag”. It sets the cy flag to the 1 state, immaterial of its earlier value. It performs set operation on the cy flag, and the result is stored back in the cy flag. Mnemonics, Operand Opcode(in HEX) Bytes STC 37 1 The result of execution of this instruction has been depicted in the following tracing table − Before After (Cy) 1 1 (Cy) 0 1 Address Hex Codes Mnemonic Comment ... Read More
Given the value of n, our task is to display the check board pattern for a n x n matrix. Different types of functions to create arrays with initial value are available in numpy . NumPy is the fundamental package for scientific computing in Python. Algorithm Step 1: input order of the matrix. Step 2: create n*n matrix using zeros((n, n), dtype=int). Step 3: fill with 1 the alternate rows and columns using the slicing technique. Step 4: print the matrix. Example Code import numpy as np def checkboardpattern(n): print("Checkerboard pattern:") ... Read More
In 8085 Instruction set, CMP is a mnemonic that stands for “CoMPareAccumulator” and hereR stands for any of the following registers, or memory location M pointed by HL pair. R = A, B, C, D, E, H, L, or M This instruction is used to compare contents of the Accumulator with given register R. The result of compare operation will be stored in the Temp register. Temp is not a GPR (General Purpose Register) but an internal register that is not accessible to the programmer. Actually R register’s content will get subtracted from Accumulators content and difference value ... Read More
To define the scope and visibility of a class member, use an access specifier. C# supports the following access specifiers − Public Private Protected Internal Protected internal Let us learn about them one by one. Public Access Specifier It allows a class to expose its member variables and member functions to other functions and objects. Private Access Specifier Private access specifier allows a class to hide its member variables and member functions from other functions and objects. Only functions of the same class can access its private members. Protected Access Specifier Protected access specifier allows a child class ... Read More
In this problem, we will see how Python can detect edges of an image or video file. To achieve this, we need the OpenCV library. The OpenCV library is mainly designed for computer vision. It is open source. Originally it was designed by Intel. This is free to use under open-source BSD license. To use the OpenCV functionality, we need to download them using pip.The OpenCV will download the Numpy module. That will also be needed. sudo pip3 install opencv-python As input, in this case, we have used one video file. We can also use our webcam to ... Read More
In 8085 Instruction set, CPI is a mnemonic that stands for “ComPare Immediate with Accumulator” and here d8 stands for any 8-bit data or 1-Byte data. This instruction is used to compare Accumulator with 8-bit immediate data. The result of the comparison will be stored in an internal register not accessible to the programmer. As this internal register is not a GPR (General Purpose Register), so not accessible through any mnemonics. Actually this 8-bit data will get deducted from Accumulators present content and result thus produced will be stored in the internal register. All the flags are affected based on ... Read More
In 8085 Instruction set, there is one mnemonic RLC stands for “Rotate Left Accumulator”. It rotates the Accumulator contents to the left by 1-bit position. The following Fig. shows the operation explicitly. In this fig. it has been depicted that the most significant bit of the Accumulator will come out and left rotate will create an empty space at the least significant bit place and this come out bit will be copied at the empty bit place and also on the Cy bit in the flag register. Thus, Cy flag gets a copy of the bit moved out ... Read More
The nl_langinfo() function has contained information about language and locale. Note − This function won’t work on Windows. Syntax nl_langinfo(ele) Parameters ele − Specify what element to return. Should be any of the following elements − Time and Calendar − ABDAY_(1-7) - Abbreviated name of the numbered day of the week DAY_(1-7) - Name of the numbered day of the week (DAY_1 = Sunday) ABMON_(1-12) - Abbreviated name of the numbered month of the year MON_(1-12) - Name of the numbered month of the year AM_STR - String for Ante meridian PM_STR - String for Post ... Read More
In 8085 Instruction set, there is another mnemonic RAL, which stands or Rotate Accumulator Left and also involving Cy flag in rotation. It rotates the Accumulator contents to the left by 1-bit position. The following Fig. is depicting the execution logic of the instruction.From the Fig. we can see that the due to left rotation the bit which is coming out from the most significant place will be copied to the Cy flag bit. And the previous Cy bit will be moved to least significant bit place of the Accumulator. Thus it is a 9-bit rotation of Accumulator and Cy ... Read More