Skip to content

Instantly share code, notes, and snippets.

Mayank Gupta mayankgupta804

Block or report user

Report or block mayankgupta804

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mayankgupta804
mayankgupta804 / balance.go
Created Jan 18, 2018 — forked from darkhelmet/balance.go
Simple TCP load balancer in Go.
View balance.go
package main
import (
"flag"
"io"
"log"
"net"
"strings"
)
@mayankgupta804
mayankgupta804 / getimageinfo.py
Created Aug 8, 2017 — forked from bmamouri/getimageinfo.py
Source code for getImageInfo function to get the dimension of an image from the header
View getimageinfo.py
# 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 / check_link.py
Created Jul 18, 2017 — forked from hackerdem/check_link.py
A simple python script to check broken links of a wesite
View check_link.py
@mayankgupta804
mayankgupta804 / functional.groovy
Created Feb 26, 2017 — 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.
View 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.
//
// 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 / LLMergeSort.java
Last active Jan 8, 2017
Wrote a java code to merge two sorted linked lists in O(n) time complexity.
View LLMergeSort.java
//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 / Stack_ArrayImplementation_OOP.cpp
Last active Nov 29, 2016 — forked from mycodeschool/Stack_ArrayImplementation_OOP.cpp
An object oriented implementation of stack using arrays in C++.
View Stack_ArrayImplementation_OOP.cpp
// 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 / Crawler
Created Sep 10, 2016 — 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.
View Crawler
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
You can’t perform that action at this time.