Skip to content

Instantly share code, notes, and snippets.

View cmrmahesh's full-sized avatar

Maheswara Reddy Chennuru cmrmahesh

View GitHub Profile
@cmrmahesh
cmrmahesh / AssemblyLineScheduling.cpp
Created November 10, 2016 07:14
Advanced Algorithms Lab
#include<stdio.h>
#include<conio.h>
#define SZ 20
int k;
main()
{
int i,j,m ,F;
int e[3],a[SZ][SZ],t[SZ][SZ],x[3],n;
printf("This program is for 2 line and maximum 20 station at each line.\n");
printf("Enter number of station \n");
@cmrmahesh
cmrmahesh / 1.c
Created November 7, 2016 09:23
Parallel Processing New
#include<stdio.h>
#include<string.h>
#include "mpi.h"
int main(int argc,char *argv[])
{
int my_rank;
int p;
int source;
int dest;
@cmrmahesh
cmrmahesh / 1.c
Last active November 6, 2016 17:26
Parallel Processing Lab
#include<stdio.h>
#include<string.h>
#include "mpi.h"
int main(int argc,char* argv){
int rnk,src,dest=0,tag=0,p;
char mesg[100010];
MPI_Status stat;
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD,&rnk);
MPI_Comm_size(MPI_COMM_WORLD,&p);
@cmrmahesh
cmrmahesh / 1.cpp
Last active November 2, 2016 19:54
Cryptography Lab
#include<bits/stdc++.h>
#define REP(i,a,b) for(i=a;i<=b;i++)
using namespace std;
int main(){
string plain,cipher="";
int i,n,key;
cin>>plain>>key;
n=plain.length();
REP(i,0,n-1){
cipher+=char((plain[i]-'a'+key)%26+'a');
/*
******************************************************************
** Advanced Encryption Standard implementation in C. **
** By Niyaz PK **
** E-mail: [email protected] **
** Downloaded from Website: www.hoozi.com **
******************************************************************
This is the source code for encryption using the latest AES algorithm.
AES algorithm is also called Rijndael algorithm. AES algorithm is
recommended for non-classified by the National Institute of Standards
@cmrmahesh
cmrmahesh / client.py
Created June 10, 2016 12:04
Simple code to send and receive data by TCP in Python.
import socket
HOST = ''
PORT = 56231
address_family = socket.AF_INET
socket_type = socket.SOCK_STREAM
request_queue_size = 1
@cmrmahesh
cmrmahesh / closure.c
Last active April 15, 2016 07:11
Compiler lab
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int a[20][257],nodes[200],stack[200],top;
void push(int a)
{
stack[top]=a;
top++;
set ns [new Simulator]
set f [open out.tr w]
$ns trace-all $f
setnf [open out.nam w]
$ns namtrace-all $nf
set n0 [$ns node]
set n1 [$ns node]
$ns duplex-link $n0 $n1 1Mb 10ms DropTail
set udp0 [new Agent/UDP]
$ns attach-agent $n0 $udp0
@cmrmahesh
cmrmahesh / ellipse.cc
Last active February 9, 2016 20:40
Graphics
#include <GL/glut.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int h,k;
float a,b;
void display(void)
{
double I,J;
int i,j;