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
response = {} | |
someAsyncCall().then(function(rows){ | |
_.forEach(rows, function(row){ | |
if(typeof response[row.key] === 'undefined'){ | |
response[row.key] = {count1:0,count2: row.count} | |
} | |
else{ | |
response[row.key][count2]+=row.count | |
} | |
} |
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
from elasticsearch import Elasticsearch | |
import re | |
es = Elasticsearch([{'host': 'localhost', 'port': 9200}]) | |
csvfile=open("/home/gaurav/Affiliate_feed.csv","r") | |
fields=csvfile.readline() | |
fields=fields.split(",") | |
jsonobj={} | |
i=0 | |
for line in csvfile: |
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
var add=function() | |
{ | |
if(arguments.length==0) | |
{return 0 | |
} | |
else{ | |
let args=[].slice.call(arguments,0) | |
args.splice(0,1) | |
return arguments[0]+add.apply(this,args)//needtoreadaboutapply |
NewerOlder