This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gist.IO make this pretty | |
pretty please. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'mo kakwan' | |
import sys | |
import csv | |
import json | |
import time | |
if len(sys.argv) <= 1: | |
print("USAGE: input.csv output.json") | |
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In the example solr project when you start it up by calling the following line: | |
java -jar start | |
You are starting a Jetty server on your local machine that's going to serve the solr results. This server is not able to do CORS (Cross Origin Resource Sharing). Which means that if you tried to do an AJAX call from a webpage of a different origin than the server itself you would be denied a response. | |
To fix this you first need to get the apropriate jars to allow for cross-domain resource sharing. | |
I used the following jar: | |
http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-servlets/8.1.10.v20130312/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'mkakwan' | |
import sys | |
def clense(row, headers): | |
i=0 | |
clensedkey = "year_cleansed" | |
newAnnualReportsClensedValue = None; | |
for key in row: |