Skip to content

Instantly share code, notes, and snippets.

@gparuthi
gparuthi / country-DAC-UN
Last active December 19, 2015 21:19
Link for xml containing country codes and regions
Link for xml containing country codes and regions
http://opencirce.org/data/country-DAC-UN.xml
@gparuthi
gparuthi / country-DAC-UN_json
Created July 17, 2013 12:45
country-DAC-UN jon Link for xml containing country codes and regions Original source: http://opencirce.org/data/country-DAC-UN.xml Converted using http://www.utilities-online.info/xmltojson/#.UeaQmmQpYeY
{
"countries": {
"country": [
{
"ISO3166": "AF",
"name": "Afghanistan",
"UNRegionCode": "034",
"UNRegionName": "Southern Asia",
"DACRegionCode": "689",
"DACRegionName": "South & Central Asia"
@gparuthi
gparuthi / gist:8967631
Last active August 29, 2015 13:56
Non root installation of the Sci-Py stack

##Install Python

http://www.python.org/getit/

##Install sqlite3

https://sqlite.org/download.html
@gparuthi
gparuthi / consumer cellular android data settings
Last active August 29, 2015 13:56
These are the settings that seem to work with my consumer cellular on a MOTO X device. 4G seems to work.
[2014/2/21] Works with MOTOX:
Name: cc
APN: ccdata
Proxy: [Not set]
Port: [Not set]
Username: [Not set]
Password: [Not set]
Server: http://mmsc.mobile.att.net
MMSC: http://mmsc.mobile.att.net
MMS proxy: 66.209.11.32
@gparuthi
gparuthi / p2p_social_network_everything.mkd
Last active August 29, 2015 14:00
[Idea v0.01] Social Network on the Cloud

##Peer to Peer everything I was thinking about a peer to peer social network earlier. Well, I was actually thinking about peer to peer everything where agents work on your designated machines and work on your behalf to provide- home automation, quantified self, etc. Goal is to ensure privacy, security, etc. You could even sell your data directly instead of letting facebook or google sell your data.

I came across Huggin. Which uses agents to act on your behalf.

##Social network

The first step would be to allow users to use a storage of their choice (local, cloud-storage, etc).

I was digging into this and realized that this would be similar to the Higgins Project. I was wondering if there is progress on this.

@gparuthi
gparuthi / publish_ipy_parallel_redis.py
Last active August 29, 2015 14:00
Python Utilities
# Publish progress to redis
# publish the status of a long running parallel from ipy cluster process to a redis server
# a webservice can then read this and feed it to a javascript visualization
def pub_to_redis(pres, title):
import Redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
n = len(pres)
p = ProgressBar.ProgressBar(n)
while True:
@gparuthi
gparuthi / Output
Created July 10, 2014 17:45 — forked from mitgr81/Output
in upload handler
in file close
..
----------------------------------------------------------------------
Ran 2 tests in 0.021s
OK
@gparuthi
gparuthi / ipynb_variable_inspector.py
Created July 17, 2014 16:50
Variable inspector for ipython notebook
from IPython.html import widgets # Loads the Widget framework.
from IPython.core.magics.namespace import NamespaceMagics
def _fill():
v = _var_name.value
try:
ve = eval(v)
vtype = type(ve).__name__
_modal_body_label.value = str(ve)[:20]
if vtype == 'DataFrame':
@gparuthi
gparuthi / create_multiple_hits.py
Last active August 29, 2015 14:04
Amazon Mturk code for getting things done in python
# This code publishes HITS in same batch on Amazon Mechanical Turk
import mturk # check out https://github.com/ctrlcctrlv/mturk-python
conf = {
"use_sandbox" : True,
"stdout_log" : False,
"verify_mturk_ssl" : True,
"aws_key" : "your_key",
"aws_secret_key" : "your_secret"
}
@gparuthi
gparuthi / Non linear code blocks
Created September 16, 2014 17:31
Ipython notebook ideas
Today, I was imagining Ipython notebooks in a different way.
I was thinking about a non linear way of writing code. The current linear way means we write a code cell and then execute and then write another. If I would like to connect the output of one cell to another, I have to do it manually or create a function.
I wish we could set a cell of code as a code block, that can be easily be found by other notebooks.
So I dont have to copy paste the cell or create a module for the cell.
I wonder if we could also share code cell in an online repository. One starting point would be to make cells out of stackoverflow code blocks.
Stackoverflow search and import inside the notebooks! Thats a good idea.