Skip to content

Instantly share code, notes, and snippets.

@vumaasha
vumaasha / python-mrjob-demo.ipynb
Last active May 3, 2023 13:01
python-mrjob-demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vumaasha
vumaasha / python-mrjob-demo.ipynb
Created May 3, 2023 11:10
python-mrjob-demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vumaasha
vumaasha / install_solr_in_jetty_9.sh
Created September 29, 2013 20:51
Installing solr on jetty 9. Downloads jetty and solr from the given urls and installs the sample core collection1 in solr in jetty 9. Also creates a use for jetty and installs jetty as a service. *Run the script as super user or using sudo in ubuntu.*
#!/bin/sh
# set the configuration variables below, before running the script
# get the solr nightly build download link from https://builds.apache.org/job/Solr-Artifacts-4.x/lastSuccessfulBuild/artifact/solr/package/
JETTY_URL="http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.0.5.v20130815.tar.gz&r=1"
JETTY_HOME="/opt/jetty"
JAVA='/usr/local/jdk1.7.0_09/bin/java'
JETTY_PORT=8085
JETTY_HOST=127.0.0.1
@vumaasha
vumaasha / mergesort.py
Created March 8, 2012 06:05
Merge Sort in python also calculates inversions
def mergeSort(A):
if len(A)>1:
[x1,x2]=divide(A)
#print x1,x2
x1,leftInv=mergeSort(x1)
x2,rightInv=mergeSort(x2)
#print leftInv,rightInv
merged,splitInv=merge(x1,x2)
#print splitInv
@vumaasha
vumaasha / randomizedquicksort.py
Created March 8, 2012 02:51 — forked from anonymous/randomizedquicksort.py
Randomized Quick Sort in python
from random import randint
def inPlaceQuickSort(A,start,end):
if start<end:
pivot=randint(start,end)
temp=A[end]
A[end]=A[pivot]
A[pivot]=temp
p=inPlacePartition(A,start,end)