This file contains hidden or 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
{ | |
"id": 3055235, | |
"regNumber": "14/00001", | |
"purchaseQuarter": "III,IV", | |
"tenderType": { | |
"id": 7, | |
"created": "01.12.2008", | |
"endDate": null, | |
"mdValue": "Cerere a ofertelor de preţuri", | |
"ruValue": "Запрос ценовых оферт", |
This file contains hidden or 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
faqs=document.querySelectorAll('.rule') | |
for(var i=0;i<faqs.length;i++) { | |
var faq = faqs[i]; | |
var divs = faq.getElementsByTagName('div'); | |
console.log(divs[0].outerText.trim()) | |
console.log("==") | |
console.log(divs[3].outerText.trim()) | |
console.log("--------------------------------------") | |
} |
This file contains hidden or 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
# coding=utf-8 | |
# convert the count in the column into multiple rows | |
# e.g. | |
# a,b,c,2,1 | |
# becomes | |
# a,b,c,Male | |
# a,b,c,Male | |
# a,b,c,FeMale |
This file contains hidden or 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
from nltk.corpus import stopwords | |
from nltk.stem import PorterStemmer | |
from nltk.tokenize import WordPunctTokenizer, PunktWordTokenizer | |
import string | |
from os import listdir | |
from os.path import isfile, join | |
import logging | |
logger = logging.getLogger(__name__) |
This file contains hidden or 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
ogr2ogr -f "kml" Baglung.kml NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Baglung'" | |
ogr2ogr -f "kml" Mustang.kml NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Mustang'" | |
ogr2ogr -f "kml" Myagdi.kml NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Myagdi'" | |
ogr2ogr -f "kml" Parbat.kml NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Parbat'" | |
ogr2ogr -f "kml" Bhaktapur.kml NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Bhaktapur'" | |
ogr2ogr -f "kml" Dhading.kml NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Dhading'" | |
ogr2ogr -f "kml" Kathmandu.kml NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Kathmandu'" | |
ogr2ogr -f "kml" Kavrepala |
This file contains hidden or 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
ogr2ogr -f "GeoJSON" Baglung.json NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Baglung'" | |
ogr2ogr -f "GeoJSON" Mustang.json NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Mustang'" | |
ogr2ogr -f "GeoJSON" Myagdi.json NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Myagdi'" | |
ogr2ogr -f "GeoJSON" Parbat.json NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Parbat'" | |
ogr2ogr -f "GeoJSON" Bhaktapur.json NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Bhaktapur'" | |
ogr2ogr -f "GeoJSON" Dhading.json NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Dhading'" | |
ogr2ogr -f "GeoJSON" Kathmandu.json NPL_adm4.shp -sql "select NAME_2 AS ZONE,NAME_3 AS DISTRICT, NAME_4 AS VDC from NPL_adm4 where NAME_3='Kat |
This file contains hidden or 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
""" | |
Basically breaks down the row containing the locations (separated by \n) into multiple rows | |
e.g. location field contain the following text and the script gives 4 rows for that, and copies the same id and title in all 4 rows | |
" - Banke (Nepalgunj) | |
- Dhanusa (Janakpur) | |
- Rupandehi (Bhairahawa) | |
- Sunsari (Inaruwa)" |
This file contains hidden or 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
# csvfix to be installed | |
# All CRS projects zip files available at http://stats.oecd.org/Index.aspx?datasetcode=CRS1# export > related files | |
# here 2011 is used as an example, for other years, you have to update the command content below | |
wget "http://stats.oecd.org/FileView2.aspx?IDFile=d79d2d4e-f15a-41de-83f8-b61a8f5c227a" -O CRS-2011.zip | |
unzip CRS-2011.zip | |
# there's some binary characters which needs to be removed before transformation |
This file contains hidden or 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
curl -XDELETE http://localhost:9200/testcompany/ | |
curl -XPUT 'http://localhost:9200/testcompany/' | |
curl -XPUT 'http://localhost:9200/testcompany/activity1/_mapping' -d '{ | |
"activity" : { | |
"properties" : { | |
"organization" : {"analyzer": "keyword", "type": "string"} | |
} | |
} |
NewerOlder