Skip to content

Instantly share code, notes, and snippets.

View cmrmahesh's full-sized avatar

Maheswara Reddy Chennuru cmrmahesh

View GitHub Profile
@cmrmahesh
cmrmahesh / life_the_universe_and_everything.cpp
Created March 23, 2015 15:08
Life, the Universe, and Everything - SPOJ
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
while( 1 )
{
cin >> n ;
if ( n == 42 )
@cmrmahesh
cmrmahesh / GoogleScraper.php
Created May 21, 2015 10:29
Google Scraper using PHP.
<!DOCTYPE HTML>
<head>
</head>
<body>
<form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>" >
Enter the search word:<input type="text" name="qword"><br><br>
<input type="submit" value="Go"><br>
</form>
@cmrmahesh
cmrmahesh / cat.php
Last active February 9, 2016 06:03
CD Project Basics PHP
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var cid;
function get_stores(var_CategoryID)
#include<stdio.h>
int check[100];
int main()
{
int p,r,alloc[100][100],aval[100],want[100],max[100][100],i,j,k;
printf("enter the no of process and the no of resources");
scanf("%d %d",&p,&r);
@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;
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 / 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++;
@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
/*
******************************************************************
** Advanced Encryption Standard implementation in C. **
** By Niyaz PK **
** E-mail: niyazlife@gmail.com **
** 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 / 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');