Skip to content

Instantly share code, notes, and snippets.

View mayankgupta804's full-sized avatar

Mayank Gupta mayankgupta804

View GitHub Profile
@mayankgupta804
mayankgupta804 / Crawler
Created September 10, 2016 11:31 — forked from duggalrahul/Crawler
This is a basic python based web crawler. I have employed breadth first search to go through web pages. A simple regular expression was used to extract http and https hyperlinks from the source code of a web page. Built in python 2.7.5. Just change the start_link variable to the link of the web page from where you want to begin crawling.
import re
import urllib2
from sets import Set
start_link = 'http://precog.iiitd.edu.in/'
urls = Set([start_link])
def findId(source):
l = re.findall(r'"(http[s]*://\S+)"',source)
return l
@mayankgupta804
mayankgupta804 / Stack_ArrayImplementation_OOP.cpp
Last active November 29, 2016 10:31 — forked from mycodeschool/Stack_ArrayImplementation_OOP.cpp
An object oriented implementation of stack using arrays in C++.
// Stack - Object oriented implementation using arrays
#include <iostream>
using namespace std;
#define MAX_SIZE 101
class Stack
{
private:
int A[MAX_SIZE]; // array to store the stack
int top; // variable to mark the top index of stack.
@mayankgupta804
mayankgupta804 / LLMergeSort.java
Last active January 8, 2017 16:38
Wrote a java code to merge two sorted linked lists in O(n) time complexity.
//Program to merge two sorted linked lists.
public class LLMergeSort{
static Node head1;
static Node head2;
static Node newHead;
static class Node{
int data;
Node next;
@mayankgupta804
mayankgupta804 / functional.groovy
Created February 26, 2017 18:18 — forked from anonymous/functional.groovy
Functional Groovy Crashcourse This short Groovy script I wrote to provide my students the most common functional programming techniques of the programming language Groovy in a very condensed form.
// Functional Groovy Crashcourse
//
// This short Groovy script I wrote to provide my students the most common functional
// programming techniques of the programming language Groovy in a very condensed form.
//
// Author: Nane Kratzke (Luebeck University of Applied Sciences)
// License: Free for every one
// Date: 22. March 2013
// Here is how you can define a list in Groovy.
@mayankgupta804
mayankgupta804 / check_link.py
Created July 18, 2017 15:43 — forked from hackerdem/check_link.py
A simple python script to check broken links of a wesite
@mayankgupta804
mayankgupta804 / getimageinfo.py
Created August 8, 2017 12:15 — forked from bmamouri/getimageinfo.py
Source code for getImageInfo function to get the dimension of an image from the header
# coding:utf-8
# From http://code.google.com/p/plsamples/source/browse/trunk/GrandMonde/getimageinfo.py
import StringIO
import struct
from reseekfile import ReseekFile
def getImageInfo(datastream):
datastream = ReseekFile.ReseekFile(datastream)
@mayankgupta804
mayankgupta804 / balance.go
Created January 18, 2018 20:03 — forked from darkhelmet/balance.go
Simple TCP load balancer in Go.
package main
import (
"flag"
"io"
"log"
"net"
"strings"
)