Skip to content

Instantly share code, notes, and snippets.

View sanketsudake's full-sized avatar

Sanket Sudake sanketsudake

View GitHub Profile
;;This configuration works for emacs 24
;;Indenting code (for me it works for python ,ruby, c , c++)
(electric-indent-mode t)
;;Auto pairing for opening and closing brackets and such more stuff
(electric-pair-mode t)
;;Removing blank spaces and
(electric-layout-mode t)
@sanketsudake
sanketsudake / Emacs init.el
Created September 9, 2012 14:09
My init.el
;;@@Requirements
(add-to-list 'load-path "~/.emacs.d/plugins/")
(add-to-list 'load-path "~/.emacs.d/plugins/rinari/")
;;Ido-mode
;;*********************************************************
(require 'ido)
(ido-mode t)
;;*********************************************************
@sanketsudake
sanketsudake / server.py
Created September 16, 2012 13:47
Simple python script to run server
#
# run script by python server.py
# open browser with http://127.0.0.1:8000/
# this will open index.html in current directory as default
#
#
import sys
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
@sanketsudake
sanketsudake / iter_func.py
Created October 20, 2012 08:30
Iterating Cycle in Python
import itertools
'''
Here some functios a, b, c, d
which if we can run recursively
using itertools
'''
def a():
print "hello"
def b():
@sanketsudake
sanketsudake / ml_notes.py
Created May 24, 2013 16:46
Python script to download Lecture notes for machine learning from http://cs229.stanford.edu/materials.html
"""
Description:
Get Lecture notes for machine learning
from http://cs229.stanford.edu/materials.html
Usage:
python ml_notes.py
"""
import urllib2
import os
Install pound
sudo apt-get install pound
Configure pound to start
sudo /etc/default/pound
set start=1
#!/bin/sh
sudo echo "Acquire::http { Proxy "http://172.21.14.100:3142"; };" > sudo /etc/apt/apt.conf
APPS="gcc g++ python flex bison vim git emacs24 python-pip python-easygui python-tk openssh-server"
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install $APPS
#!/usr/bin/python3
"""
File :aitictac.py
Arficital Intelligence to play tictac toe
Using MinMax n-ply search algorithm
"""
class Board:
def __init__(self, board=[]):
self.boardvisual = {2: '-', 3:'X', 5: 'O' }
if board:
#include <iostream>
#include <cstdlib>
using namespace std;
int poss_win(int *board,char choice)
{
int val, check;
if(choice == 'X')
val = 18;
else
val = 50;
class Conv:
def __init__(self):
# self.x_start = int(input())
# self.x_n = [ int(i) for i in raw_input().split(' ')]
# self.h_start = int(input())
# self.h_n = [ int(i) for i in raw_input().split(' ')]
self.x_start = 0
self.x_n = [1, 2, 3, 1]
self.h_start = 1
self.h_n = [1, 2, 1, -1]