In any case, I don't have any major new insights to report regarding kettlebells. It's the new year and I'm ready to start training in earnest. I also started to eat a Paleo Diet
Look for another update sometime this month.
<script type="text/javascript">
//for the session timeout
session_timeout = {{session_timeout}};
page_load_time = new Date().getTime();
function check_session_timeout(){
// check timeout
active_seconds = (new Date().getTime() - page_load_time) / 1000;
if (active_seconds >= session_timeout){
window.location = '/logout/';
}else{
setTimeout('check_session_timeout()', 5000)
}
}
//Start checking for session timeout
check_session_timeout();
</script>
def get_address_info(**kwargs):
#expects to receive address fields, bumps
#them up against Google, and returns the
#validation status
geocode_options = settings.GEOCODE_OPTIONS
address_string = ' '.join([
kwargs['street_line1'],
kwargs['street_line2'],
kwargs['city'],
kwargs['state'],
kwargs['postal_code'],
kwargs['country']]
).encode('utf-8')
geocode_options['q'] = address_string
try:
output = urlopen("%s?%s" % (settings.GEOCODE_URL, urlencode(geocode_options)))
except Exception, ex:
return False
geocode = simplejson.loads(output.read())
result = {
'latitude': '',
'longitude': '',
'accuracy': 0,
'address': '',
'multiple': False,
}
#if Google returned something juicy
if 'Placemark' in geocode:
if len(geocode['Placemark']) > 1:
result['multiple'] = True
result['accuracy'] = geocode['Placemark'][0]['AddressDetails']['Accuracy']
try:
result['address'] = geocode['Placemark'][0]['address']
except Exception, ex:
log.debug("Exception adding address to result dict: %s" % (ex,))
if (len(geocode['Placemark']) == 1 and result['accuracy'] >= 8):
result['latitude'] = geocode['Placemark'][0]['Point']['coordinates'][0]
result['longitude'] = geocode['Placemark'][0]['Point']['coordinates'][1]
return result