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
function _confidence(ups, downs) { | |
var n = ups + downs; | |
if(n === 0) { | |
return 0; | |
} | |
var z = 1.281551565545; | |
var p = parseFloat(ups) / n; | |
var left = p + 1 / (2 * n) * z * z; |
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
# My solution, using Typhoeus gem | |
p "-------Ian\'s Solution---------" | |
require 'typhoeus' | |
request = Typhoeus::Request.new("https://api.admoda.com/v1/advertiser/stats/campaigns.csv?date=2015-03-11", | |
method: :get, | |
headers: { 'Authorization' => 'Token api_token_here' }) | |
response = request.run | |
puts response.body |
NewerOlder