Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
<html> | |
<head> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script type="text/javascript"> | |
var map = null; | |
function initializeMap() { | |
$.getJSON("http://www.ombord.info/api/jsonp/position/?callback=?", function(gpsData) { | |
var currentPosition = new google.maps.LatLng(gpsData.latitude, gpsData.longitude); | |
map = new google.maps.Map(document.getElementById("map_canvas"), { |
42.50729 1.53414 Europe/Andorra | |
42.50779 1.52109 Europe/Andorra | |
25.56473 55.55517 Asia/Dubai | |
25.78953 55.9432 Asia/Dubai | |
25.33132 56.34199 Asia/Dubai | |
25.25817 55.30472 Asia/Dubai | |
25.61955 56.27291 Asia/Dubai | |
25.35731 55.4033 Asia/Dubai | |
24.11028 52.73056 Asia/Dubai | |
25.11641 56.34141 Asia/Dubai |
""" | |
jQuery templates use constructs like: | |
{{if condition}} print something{{/if}} | |
Or like: | |
{% if condition %} print {%=object.something %}{% endif %} | |
This, of course, completely screws up Django templates, |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/bin/bash -eux | |
# pkgs | |
apt-get update | |
apt-get upgrade -y | |
apt-get install -y curl git-core | |
# chef | |
which chef-solo >/dev/null || \ | |
curl -L http://www.opscode.com/chef/install.sh | bash |
/** | |
* Fetching data from BigQuery and present it in our sheet | |
* Author: Ido Green | |
* Date: 14/12/2013 | |
* | |
* See: http://wp.me/pB1lQ-19i | |
* Misc: https://developers.google.com/bigquery/ | |
*/ | |
// |
import math | |
from dbfpy import dbf | |
import matplotlib.pyplot as plt | |
#create a plot | |
fig = plt.figure(1, figsize = [10,10], dpi=90) | |
axScatter = plt.subplot(111) | |
def candMedian(dataPoints): | |
#Calculate the first candidate median as the geometric mean |
function FBshares(url) { | |
var jsondata = UrlFetchApp.fetch("http://graph.facebook.com/"+url); | |
var object = Utilities.jsonParse(jsondata.getContentText()); | |
return object.shares; | |
} | |
function Tweets(url) { | |
var jsondata = UrlFetchApp.fetch("http://urls.api.twitter.com/1/urls/count.json?url="+url); | |
var object = Utilities.jsonParse(jsondata.getContentText()); | |
return object.count; |
Download Raspbian from the official site
Flash it to the USB drive following the procedure detailed here
Fomat an SD Card 2/4 GB as FAT32
, label "boot"
, flag "lba"
. Generate a UUID. You can use GParted for this task.
Get the UUID of the USB drive and the SD Card partitions using sudo blkid
.