Skip to content

Instantly share code, notes, and snippets.

Avatar

Ramesh Sampath sampathweb

  • San Francisco, CA
View GitHub Profile
@sampathweb
sampathweb / tic_tac_toe.py
Last active December 29, 2015 23:39
A Fun Game for HackerSchool Application. I had good fun with it and wrote a Javascript Version to have my son play daddy's game. The code is at: github.com/sampathweb/game_toe. The game can be played at http://sampathweb.com/game_toe (hosted via gh-pages)
View tic_tac_toe.py
#! /usr/bin/env python
from random import choice
from collections import defaultdict
def get_player_input(valid_selections):
'''Returns the selected row, col by the Player'''
selected_item = tuple()
while selected_item not in valid_selections:
if selected_item:
print('Your selection of (%s, %s) is not valid: ' % selected_item)
@sampathweb
sampathweb / sudoku_solver_onair.py
Created July 8, 2014 03:42
Sudoku Solver - On the Air
View sudoku_solver_onair.py
import random
def print_puzzle(puzzle):
print('---' * 18)
for row in range(9):
for col in range(9):
pos = row * 9 + col
print(' ', puzzle[pos]['val'], end=' |')
print(end='\n')
if (row + 1) % 3 == 0:
View _.md
View cfa_ex1_violations.py
#!/usr/env/python
from __future__ import print_function
import pandas as pd
# Read the csv
violations_df = pd.read_csv('violations-2012.csv')
# Covert Violations to datetime object
View basic_cal.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Basic Calendar</title>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.0.2/fullcalendar.css' />
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.0.2/fullcalendar.print.css' />
</head>
@sampathweb
sampathweb / README.md
Last active August 29, 2015 20:54
datasana #1
View README.md

hello markdown

@sampathweb
sampathweb / README.md
Last active August 29, 2015 21:07
datasana #circles
View README.md

hello markdown

@sampathweb
sampathweb / README.md
Last active August 30, 2015 05:33
datasana #rects
View README.md

hello markdown

@sampathweb
sampathweb / README.md
Last active October 14, 2015 04:14
Bar Lines - D3 Hackday with Ian
@sampathweb
sampathweb / README.md
Created December 21, 2015 07:16
Bar Chart_beta
View README.md