Skip to content

Instantly share code, notes, and snippets.

@GauravBhardwaj
GauravBhardwaj / ParseUIDAIdataset.ipynb
Created September 20, 2014 21:15
UIDAI (Adhar) public Dataset Download and Merge
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.group.ChannelGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.handler.ssl.SslHandler;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import io.netty.util.concurrent.GlobalEventExecutor;
import java.net.InetAddress;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
@GauravBhardwaj
GauravBhardwaj / ChatServer.java
Created April 11, 2014 07:07
NettyServer in version 4.
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
public class ChatServer {
private final int port;
public ChatServer(int port) {
@GauravBhardwaj
GauravBhardwaj / PingHost.java
Created March 21, 2014 21:08
Method to ping a Virtual machine.
public static void pingHost1() throws IOException, InterruptedException{
String strCommand = "ping "+hostip;
Process myProcess = Runtime.getRuntime().exec(strCommand);
myProcess.waitFor();
if(myProcess.exitValue() == 0) {
System.out.println("= ping success =");
} else {
System.out.println("= ping failure =");
@GauravBhardwaj
GauravBhardwaj / StackasLinkedList.cpp
Created February 26, 2014 03:17
Stack operations as Linked list
//************************************************************************
//Author: Gaurav Bhardwaj
//Linked list implementation of stack
//************************************************************************
#include <iostream>
using namespace std;
class Stack{
private:
struct Stackelement
{
@GauravBhardwaj
GauravBhardwaj / stack.cpp
Created February 26, 2014 03:15
Stack operations
//***********************************************
// author: Gaurav Bhardwaj
// Static array implementation of stack
//***********************************************
#include <iostream>
using namespace std;
class Stack
{
private:
@GauravBhardwaj
GauravBhardwaj / Recusrsion.cpp
Created February 26, 2014 03:15
Program to find the maximum element in an list using recursion
***********************************************************************
//Program to find the maximum element in an list using recursion
***********************************************************************
#include <iostream>
using namespace std;
int largest(int list[],int lowerIndex,int UpperIndex)
{
if(lowerIndex==UpperIndex)//base case
return lowerIndex;
@GauravBhardwaj
GauravBhardwaj / QueueLinkedList.cpp
Created February 26, 2014 03:08
Queue implemented as linked list
//*****************************************************
//Author: Gaurav Bhardwaj
//Linked list implementation of Queue
//*****************************************************
#include <iostream>
using namespace std;
class Queue
{