Skip to content

Instantly share code, notes, and snippets.

View vgangireddyin's full-sized avatar

Venu Gangireddy vgangireddyin

View GitHub Profile
@vgangireddyin
vgangireddyin / bintree_equivalence.go
Created May 11, 2016 12:22
Go Tour: Equivalent Binary Trees
package main
import (
"golang.org/x/tour/tree"
"fmt"
)
func walkrec(t *tree.Tree, ch chan int){
if t == nil {
@vgangireddyin
vgangireddyin / tcp_client.go
Created May 26, 2016 18:24
Simple TCP Server in Golang
package main
import (
"fmt"
"net"
"bufio"
"os"
)
func main() {
package main
import(
"fmt"
"time"
)
func Publish(text string, delay time.Duration) {
/**
* Create a thread at os level and shedule by go sheduler
@vgangireddyin
vgangireddyin / .ctags
Last active May 30, 2016 12:35
My Vim Setup for GoLang
--langdef=Go
--langmap=Go:.go
--regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/f,func/
--regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/v,var/
--regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/t,type/
@vgangireddyin
vgangireddyin / range_tree.cpp
Created June 5, 2016 07:30
Range Tree in CPP
#include <iostream>
#include <vector>
#include <algorithm>
#include <time.h>
#include <math.h>
using namespace std;
struct point
@vgangireddyin
vgangireddyin / kd_tree.cpp
Created June 5, 2016 07:33
KD Tree in CPP
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <math.h>
#define E 0.000001
using namespace std;
struct point
{
@vgangireddyin
vgangireddyin / bplus_tree.cpp
Created June 5, 2016 07:35
BPlus Tree in CPP
#include <vector>
#include <stdio.h>
#include <stack>
#include <stdlib.h>
#include <fstream>
#include <math.h>
#include <time.h>
using namespace std;
@vgangireddyin
vgangireddyin / Makefile
Last active June 5, 2016 16:03
Basic Makefile for Golang
BUILDPATH=$(CURDIR)
GO=$(shell which go)
GOINSTALL=$(GO) install
GOCLEAN=$(GO) clean
GOGET=$(GO) get
EXENAME=main
export GOPATH=$(BUILDPATH)
@vgangireddyin
vgangireddyin / .vimrc
Created November 30, 2016 15:17 — forked from rocarvaj/.vimrc
Minimal .vimrc for C/C++ developers
" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other things.
" Author: Gerhard Gappmeier
"
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
@vgangireddyin
vgangireddyin / rtree.cpp
Last active December 6, 2016 11:16
RTree in CPP
/*
* main.cpp
*
* Created on: 12-Mar-2015
* Author: gangireddy
*
* R-tree implemenatation in cpp
*/
#include <iostream>
#include <vector>