Skip to content

Instantly share code, notes, and snippets.

import math
import mmh3
class Optimizely(object):
config = {}
OPTIMIZELY_URL = "http://%s.log.optimizely.com/event"
CONFIG_URL = "http://cdn.optimizely.com/json/%s.json"
def __init__(self, project_id):
"""
import math
import mmh3
class Optimizely(object):
config = {}
OPTIMIZELY_URL = "http://%s.log.optimizely.com/event"
CONFIG_URL = "http://cdn.optimizely.com/json/%s.json"
def __init__(self, project_id):
"""
def __init__(self, project_id):
"""
Used to construct an Optimizely object that will have access to the following:
1. Provided configuration in the form of a python dictionary
2. Activate method for bucketing users
3. Track event method for impression and conversion tracking
Args:
project_id: optimizely project_id for current project
Returns:
## Color Tracking v1.0
## Copyright (c) 2013-2014 Abid K and Jay Edry
## You may use, redistribute and/or modify this program it under the terms of the MIT license (https://github.com/abidrahmank/MyRoughWork/blob/master/license.txt).
''' v 0.1 - It tracks two objects of blue and yellow color each '''
import cv2
import numpy as np
total = 0;
length = $("li").length;
$("li").each(
function(index) {
total += parseInt(this.textContent[1])
}
)
alert("Your average is: " + total/length)