How to send an email using python

Following are the steps to send an email using python: import smtplib to = ’email-to’  #enter the email id of the person whom you want to send email gmail_user = ‘Your email id’ gmail_pwd = ‘Your Password’ smtpserver = smtplib.SMTP(“smtp.gmail.com”,587) #hostname and port smtpserver.ehlo() smtpserver.starttls() smtpserver.ehlo smtpserver.login(gmail_user, gmail_pwd)   #If you get an authentication error: […]

Read More

Data Communication Networks-IMP Questions with answers

Compare and Contrast Analog and Digital Transmission Wave Structure –          Analog o   an analog waveform o   similar to sound and light –          Digital o   a square waveform o   only two voltage levels, each representing binary 1s and 0s Transmission –          Analog o   Transmits by modulating a carrier wave’s frequency, amplitude, or phase o   Bandwidth will […]

Read More

Socket Programming-UDP

UDP Program to print welcome Create 2 Files: 1)dsender.java 2)dreceiver.java dsender.java import java.net.*; //for java programming we have to use this package public class dsender //class name should be name as file name { public static void main(String args[]) throws Exception //throws exception should be written { DatagramSocket ds = new DatagramSocket(); //socket will create […]

Read More

RMI basic program-Add 2 numbers

1. Create Calculator.java file.Write following code in it. import java.rmi.Remote; import java.rmi.RemoteException; public interface Calculator extends Remote { public long add(long a,long b)throws RemoteException; }  2. Create CalculatorImpl.java file.Write following code in it. import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; public class CalculatorImpl extends UnicastRemoteObject implements Calculator { protected CalculatorImpl() throws RemoteException { super(); } public long add(long […]

Read More

Bubble sort,Insertion sort,Selection sort programs

Q-1: write a program to implement sorting with BUBBLESORT METHOD. ANS : #include <stdio.h> #include <conio.h> Void main() { Int i,j,n,a[20],temp; Clrscr(); Printf(“enter the number of elements:”); Scanf(“%d”,&n); Printf(“enter the elements of array:”); Scanf(“%d”,&a[i]); For(i=0;i<n;i++) { Scanf(“%d”,&a[i]); } For(i=0;i<n-i;i++) { For(j=0;j<n-i;j++) { If(a[j]>a[j+1]) { Temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } } Printf (“the ascending order is:n”); […]

Read More