Skip to content

Instantly share code, notes, and snippets.

View agr-shrn's full-sized avatar

Sharan Agrawal agr-shrn

  • New York University
  • Jersey City, New Jersey
View GitHub Profile
@agr-shrn
agr-shrn / ABC
Created December 6, 2014 09:26
test gist #ideabin
This is just a test
1. Add these repositories manually to /etc/apt/sources.list file. To do so
From command line enter
sudo gedit /etc/apt/sources.list
And add these two lines at the end of the file
deb http://ppa.launchpad.net/abogani/realtime/ubuntu precise main
deb-src http://ppa.launchpad.net/abogani/realtime/ubuntu precise main
@agr-shrn
agr-shrn / DNS
Last active August 29, 2015 14:21
In localhost
1. WE NEED TO CHANGE ENTRIES OF /ETC/HOSTS FILE
127.0.0.1 localhost
127.0.0.1 localhost
10.2.0.30 cit
#include <iostream>
#include <string.h>
using namespace std;
void removeDuplicate ( char s [])
{
int len = strlen ( s );
if ( len < 2 ) return ;
bool c [ 256 ];
memset ( c , 0 , sizeof ( c ));
#include<iostream>
#include<stdio.h>
using namespace std;
bool isAnagram1 ( string s , string t )
{
if ( s == "" || t == "" )
return false;
if ((s . length ()) != (t . length ()))
#include <iostream>
#include <String>
using namespace std ;
bool issubstring ( string S1 , string S2 ) {
if ( (S1.find ( S2 )) != string :: npos ) return true ;
else return false ;
}
bool isRotation ( string S1 , string S2 ) {
if ( (S1 . length ()) != S2 . length () || S1 . length () <= 0 )
#include<iostream>
using namespace std;
struct node
{
int data;
struct node *next;
};
------SIMPLE DFA ACCEPTING------
#include <iostream>
#include <fstream>
using namespace std;
int main()
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
fstream obj;
char ch,str[30],input;
int k=0,initial=9,final[5],num_stats=0,num_inputs=0,num_final,q_prev,q_new,i=0,j=0,mat[5][5];
#include<stdio.h>
#include<string.h>
#include<ctype.h>
char mat[30][30][30];
char fin[30];
char inp[30];
int no_st,no_out,maxj=0,len;
void read()