Skip to content

Instantly share code, notes, and snippets.

@shantanuo
shantanuo / syllabify-with-index.py
Created May 1, 2011 13:06 — forked from santhoshtr/syllabify-with-index.py
syllabify with word and syllable index
#!/usr/bin/python
# -*- coding: utf-8 -*-
texts =[u"वाराणसी", u"भौगोलिक", u"उपदर्शन"]
signs = [
u'\u0902', u'\u0903', u'\u093e', u'\u093f', u'\u0940', u'\u0941',
u'\u0942', u'\u0943', u'\u0944', u'\u0946', u'\u0947', u'\u0948',
u'\u094a', u'\u094b', u'\u094c', u'\u094d']
limiters = ['.','\"','\'','`','!',';',',','?']
virama = u'\u094d'
@shantanuo
shantanuo / syllabify-with-index.py
Created February 10, 2012 07:10 — forked from santhoshtr/syllabify-with-index.py
syllabify with word and syllable index
#!/usr/bin/python
# -*- coding: utf-8 -*-
# texts =[u"वाराणसी", u"भौगोलिक", u"उपदर्शन"]
# CREATE TABLE syllabalize (id int(11) DEFAULT NULL, seqn int(11) DEFAULT NULL, akshar varchar(10) DEFAULT NULL) DEFAULT CHARSET=utf8
import codecs
f = codecs.open('testfile.txt', encoding='utf-8')
texts = f.read().split()
signs = [
u'\u0902', u'\u0903', u'\u093e', u'\u093f', u'\u0940', u'\u0941',
# encoding: utf-8
import os
import shelve
import boto.glacier
import boto
from boto.glacier.exceptions import UnexpectedHTTPResponseError
ACCESS_KEY_ID = "XXXXXXXXXXXXX"
SECRET_ACCESS_KEY = "XXXXXXXXXXX"
SHELVE_FILE = os.path.expanduser("~/.glaciervault.db")
# encoding: utf-8
import os
import shelve
import boto.glacier
import boto
from boto.glacier.exceptions import UnexpectedHTTPResponseError
ACCESS_KEY_ID = "XXXXXXXXXXXXX"
SECRET_ACCESS_KEY = "XXXXXXXXXXX"
SHELVE_FILE = os.path.expanduser("~/.glaciervault.db")
<?php
/*
POST / HTTP/1.1
Host: kinesis.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=content-type;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
@shantanuo
shantanuo / index.html
Created February 10, 2014 08:20 — forked from insin/index.html
<!DOCTYPE html>
<html>
<head>
<title>tableToExcel Demo</title>
<script src="tableToExcel.js"></script>
</head>
<body>
<h1>tableToExcel Demo</h1>
<p>Exporting the W3C Example Table</p>
@shantanuo
shantanuo / index.html
Created February 10, 2014 08:45 — forked from insin/index.html
<!DOCTYPE html>
<html>
<head>
<title>tableToExcel Demo</title>
<script src="tableToExcel.js"></script>
</head>
<body>
<h1>tableToExcel Demo</h1>
<p>Exporting the W3C Example Table</p>
-- Provide a log file debugging statement.
SELECT 'DROP PROCEDURE IF EXISTS dropForeignKeys';
-- Conditionally drop the procedure.
DROP PROCEDURE IF EXISTS dropForeignKeys;
-- Provide a log file debugging statement.
SELECT 'CREATE PROCEDURE dropForeignKeys';
-- Change delimiter to create procedure.
#! /usr/bin/env python
import json
import requests
def process(obj, ds):
data = {}
values = obj[ds]['value']
index = obj[ds]['dimension'][obj[ds]['dimension']['id'][1]]['category']['index']
labels = obj[ds]['dimension'][obj[ds]['dimension']['id'][1]]['category']['label']
#! /usr/bin/env python
import json
import requests
def process(obj, ds):
data = {}
values = obj[ds]['value']
index = obj[ds]['dimension'][obj[ds]['dimension']['id'][1]]['category']['index']
labels = obj[ds]['dimension'][obj[ds]['dimension']['id'][1]]['category']['label']