Commits

Matthew Turk committed 4f964a3

Initial import of talk on yt

  • Participants

Comments (0)

Files changed (6)

PopIII_5000AU.png

Added
New image

allsky.png

Added
New image
+<!DOCTYPE html>
+
+<!--
+  Google HTML5 slide template
+
+  Authors: Luke Mahé (code)
+           Marcin Wichary (code and design)
+           
+           Dominic Mazzoni (browser compatibility)
+           Charles Chen (ChromeVox support)
+
+  URL: http://code.google.com/p/html5slides/
+-->
+
+<html>
+  <head>
+    <title>Viz Capability</title>
+
+    <meta charset='utf-8'>
+    <!--<script src='http://html5slides.googlecode.com/svn/trunk/slides.js'></script>-->
+    <script src='slides.js'></script>
+  </head>
+  
+  <style>
+    /* Your individual styles here, or just use inline styles if that’s
+       what you want. */
+    
+    
+  </style>
+
+  <body style='display: none'>
+
+    <section class='slides layout-regular template-default'>
+      
+      <!-- Your slides (<article>s) go here. Delete or comment out the
+           slides below. -->
+        
+        
+      
+      <article>
+        <h1>
+          Astrophysically Aware Data Handling
+        </h1>
+        <h2>
+          (a library for simulation analysis)
+        </h2>
+        <p>
+          Matthew Turk
+          <br>
+          August 11, 2011
+        </p>
+      </article>
+      <article>
+        <ul>
+          <li>Python, Cython, C, C++</li>
+          <li>Mostly home-grown implementations</li>
+          <li>Acts as glue code for external routines</li>
+          <li>Mostly parallel</li>
+          <li>Works with multiple codes</li>
+          <li>Focuses on <i>both</i> analysis and viz</li>
+          <li><a href="http://yt.enzotools.org/">yt.enzotools.org</a></li>
+          <li>20 or so developers, 100 or so users</li>
+        </ul>
+        <h2>Factsheet</h2>
+      </article>
+      <article>
+        <iframe
+          src="http://hg.enzotools.org/yt/wiki/CodeSupportLevels#!levels-of-support-for-various-codes"></iframe>
+      </article>
+      <article>
+        <ol class="build">
+          <li>Data I/O from disk</li>
+          <li>Coherent data structures</li>
+          <li>Fundamental operations</li>
+          <li>Canned analysis and viz tasks</li>
+        </ol>
+        <h2>Component architecture for pipeline construction.</h2>
+      </article>
+      <article>
+        <qnq>
+          Perform rich analysis on data, independent of source.
+        </qnq>
+      </article>
+      <article>
+        <ol class="build">
+          <li>Scripting interface</li>
+          <li>Small, targeted GUIs</li>
+          <li>Web utilities</li>
+          <li>ParaView plugin</li>
+        </ol>
+        <h2>API-driven development encourages multiple access points</h2>
+      </article>
+      <article>
+        <pre>from yt.mods import *
+import yt.visualization.volume_rendering.camera as camera
+pf = load("RedshiftOutput0010.dir/RedshiftOutput0010")
+cam = camera.HEALpixCamera([0.5, 0.5, 0.5], 50./pf['mpc'], 
+nside = 64, pf = pf,
+log_fields = [False])
+bitmap = cam.snapshot("allsky.png") </pre>
+      <center><img src="allsky.png" height=300></center>
+      </article>
+      <article>
+        <iframe src="http://localhost:7000" frameborder="0" allowfullscreen>
+        </iframe>
+      </article>
+      <article>
+        <iframe width="425" height="349"
+          src="http://www.youtube.com/embed/cOv4Ob2q1fM" frameborder="0"
+          allowfullscreen></iframe>
+        <h2>API-driven development encourages multiple access points</h2>
+      </article>
+      <article>
+        <qnq>Set up systems of objects and query them for data.</qnq>
+      </article>
+      <article>
+        <ul>
+          <li>Profiles (1-, 2-, 3-D)</li>
+          <li>Projections (on- and off-axis)</li>
+          <li>Querying objects for data</li>
+          <li>SEDs and PopSyn</li>
+          <li>Volume rendering</li>
+          <li>Halo finding</li>
+          <li>Light-cones</li>
+          <li>Pencil beams</li>
+        </ul>
+        <h2>Some "canned" analysis</h2>
+      </article>
+      <article>
+        <pre>@derived_field
+        def Dinosaurs(field, data):
+            return data["BioMass"] * data["ExtinctionConstant"]</pre>
+        <h2>Transparently derived fields</h2>
+      </article>
+      <article>
+        <pre>@derived_field
+def DivV(field, data):
+    ds = 2.0 * data['dx'].flat[0]
+    f  = data["x-velocity"][2:,1:-1,1:-1]/ds
+    f -= data["x-velocity"][:-2 ,1:-1,1:-1]/ds
+    ds = 2.0 * data['dy'].flat[0]
+    f += data["y-velocity"][1:-1,2:,1:-1]/ds
+    f -= data["y-velocity"][1:-1,:-2 ,1:-1]/ds
+    ds = 2.0 * data['dz'].flat[0]
+    f += data["z-velocity"][1:-1,1:-1,2:]/ds
+    f -= data["z-velocity"][1:-1,1:-1,:-2 ]/ds
+    new_field = na.zeros(data["x-velocity"].shape, dtype='float64')
+    new_field[1:-1,1:-1,1:-1] = f
+    return new_field</pre>
+        <h2>Transparently derived fields</h2>
+      </article>
+      <article>
+        <qnq>From components, pipelines can be constructed</qnq>
+      </article>
+      <article class="smaller">
+      <pre>from yt.mods import *
+
+fn = "RedshiftOutput0005" # parameter file to load
+pf = load(fn) # load data
+
+# First we run our halo finder to identify all the halos in the dataset.  This
+# can take arguments, but the default are pretty sane.
+halos = HaloFinder(pf)
+
+f = open("%s_halo_info.txt" % pf, "w")
+
+# Now, for every halo, we get the baryon data and examine it.
+for halo in halos:
+    # The halo has a property called 'get_sphere' that obtains a sphere
+    # centered on the point of maximum density (or the center of mass, if that
+    # argument is supplied) and with the radius the maximum particle radius of
+    # that halo.
+    sphere = halo.get_sphere()
+    # We use the quantities[] method to get the total mass in baryons and in
+    # particles.
+    baryon_mass, particle_mass = sphere.quantities["TotalQuantity"](
+            ["CellMassMsun", "ParticleMassMsun"], lazy_reader=True)
+    # Now we print out this information, along with the ID.
+    f.write("Total mass in HOP group %s is %0.5e (gas = %0.5e / particles = %0.5e)\n" % \
+            (halo.id, baryon_mass + particle_mass, baryon_mass, particle_mass))
+f.close()</pre>
+      </article>
+      <article>
+        <h3>It's Documented!</h3>
+        <iframe src="http://yt.enzotools.org/doc/" width="100%"></iframe>
+      </article>
+      <article>
+        <img src="halo_0029.png" width="100%"/>
+      </article>
+      <article>
+        <img src="plot.png" width="100%"/>
+      </article>
+      <article>
+        <center><img src="PopIII_5000AU.png" height="100%"/></center>
+      </article>
+      <article>
+      <object type="application/x-shockwave-flash" width="640" height="540"
+        data="http://vimeo.com/hubnut/?user_id=user3192834&amp;color=FFFFFF&amp;background=000000&amp;fullscreen=1&amp;slideshow=1&amp;stream=group&amp;id=34915&amp;server=vimeo.com"> 
+        <param name="quality" value="best" />       <param
+        name="allowfullscreen"
+        value="true" />     <param name="allowscriptaccess" value="always" />
+        <param
+        name="scale" value="showAll" /> <param name="movie"
+        value="http://vimeo.com/hubnut/?user_id=user3192834&amp;color=FFFFFF&amp;background=000000&amp;fullscreen=1&amp;slideshow=1&amp;stream=group&amp;id=34915&amp;server=vimeo.com"
+        /></object> 
+      </article>
+      <article>
+        <h2>Shortcomings</h2>
+        <ul>
+          <li>Not great with N-body datasets</li>
+          <li>Octree support needs improvement</li>
+          <li>Still growing our developer community!</li>
+        </ul>
+      </article>
+      <article>
+        <h2>Future Directions</h2>
+        <ul>
+          <li>Further, multi-level parallelism</li>
+          <li>Workshop/conference possible in 2012</li>
+          <li>Inline physics modules and evolution</li>
+          <li>Greater integration as an "astrophysics library"</li>
+          <li>Better support for particles and octree codes</li>
+          <li>Closer integration with Planetaria output formats</li>
+        </ul>
+      </article>
+      <article>
+        <h2>Thank you.</h2>
+      </article>
+    </section>
+  </body>
+</html>

plot.png

Added
New image
+/*
+  Google HTML5 slides template
+
+  Authors: Luke Mahé (code)
+           Marcin Wichary (code and design)
+
+           Dominic Mazzoni (browser compatibility)
+           Charles Chen (ChromeVox support)
+
+  URL: http://code.google.com/p/html5slides/
+*/
+
+var PERMANENT_URL_PREFIX = '';
+/*'http://html5slides.googlecode.com/svn/trunk/';*/
+
+var SLIDE_CLASSES = ['far-past', 'past', 'current', 'next', 'far-next'];
+
+var PM_TOUCH_SENSITIVITY = 15;
+
+var curSlide;
+
+/* ---------------------------------------------------------------------- */
+/* classList polyfill by Eli Grey 
+ * (http://purl.eligrey.com/github/classList.js/blob/master/classList.js) */
+
+if (typeof document !== "undefined" && !("classList" in document.createElement("a"))) {
+
+(function (view) {
+
+var
+    classListProp = "classList"
+  , protoProp = "prototype"
+  , elemCtrProto = (view.HTMLElement || view.Element)[protoProp]
+  , objCtr = Object
+    strTrim = String[protoProp].trim || function () {
+    return this.replace(/^\s+|\s+$/g, "");
+  }
+  , arrIndexOf = Array[protoProp].indexOf || function (item) {
+    for (var i = 0, len = this.length; i < len; i++) {
+      if (i in this && this[i] === item) {
+        return i;
+      }
+    }
+    return -1;
+  }
+  // Vendors: please allow content code to instantiate DOMExceptions
+  , DOMEx = function (type, message) {
+    this.name = type;
+    this.code = DOMException[type];
+    this.message = message;
+  }
+  , checkTokenAndGetIndex = function (classList, token) {
+    if (token === "") {
+      throw new DOMEx(
+          "SYNTAX_ERR"
+        , "An invalid or illegal string was specified"
+      );
+    }
+    if (/\s/.test(token)) {
+      throw new DOMEx(
+          "INVALID_CHARACTER_ERR"
+        , "String contains an invalid character"
+      );
+    }
+    return arrIndexOf.call(classList, token);
+  }
+  , ClassList = function (elem) {
+    var
+        trimmedClasses = strTrim.call(elem.className)
+      , classes = trimmedClasses ? trimmedClasses.split(/\s+/) : []
+    ;
+    for (var i = 0, len = classes.length; i < len; i++) {
+      this.push(classes[i]);
+    }
+    this._updateClassName = function () {
+      elem.className = this.toString();
+    };
+  }
+  , classListProto = ClassList[protoProp] = []
+  , classListGetter = function () {
+    return new ClassList(this);
+  }
+;
+// Most DOMException implementations don't allow calling DOMException's toString()
+// on non-DOMExceptions. Error's toString() is sufficient here.
+DOMEx[protoProp] = Error[protoProp];
+classListProto.item = function (i) {
+  return this[i] || null;
+};
+classListProto.contains = function (token) {
+  token += "";
+  return checkTokenAndGetIndex(this, token) !== -1;
+};
+classListProto.add = function (token) {
+  token += "";
+  if (checkTokenAndGetIndex(this, token) === -1) {
+    this.push(token);
+    this._updateClassName();
+  }
+};
+classListProto.remove = function (token) {
+  token += "";
+  var index = checkTokenAndGetIndex(this, token);
+  if (index !== -1) {
+    this.splice(index, 1);
+    this._updateClassName();
+  }
+};
+classListProto.toggle = function (token) {
+  token += "";
+  if (checkTokenAndGetIndex(this, token) === -1) {
+    this.add(token);
+  } else {
+    this.remove(token);
+  }
+};
+classListProto.toString = function () {
+  return this.join(" ");
+};
+
+if (objCtr.defineProperty) {
+  var classListPropDesc = {
+      get: classListGetter
+    , enumerable: true
+    , configurable: true
+  };
+  try {
+    objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
+  } catch (ex) { // IE 8 doesn't support enumerable:true
+    if (ex.number === -0x7FF5EC54) {
+      classListPropDesc.enumerable = false;
+      objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
+    }
+  }
+} else if (objCtr[protoProp].__defineGetter__) {
+  elemCtrProto.__defineGetter__(classListProp, classListGetter);
+}
+
+}(self));
+
+}
+/* ---------------------------------------------------------------------- */
+
+/* Slide movement */
+
+function getSlideEl(no) {
+  if ((no < 0) || (no >= slideEls.length)) { 
+    return null;
+  } else {
+    return slideEls[no];
+  }
+};
+
+function updateSlideClass(slideNo, className) {
+  var el = getSlideEl(slideNo);
+  
+  if (!el) {
+    return;
+  }
+  
+  if (className) {
+    el.classList.add(className);
+  }
+    
+  for (var i in SLIDE_CLASSES) {
+    if (className != SLIDE_CLASSES[i]) {
+      el.classList.remove(SLIDE_CLASSES[i]);
+    }
+  }
+};
+
+function updateSlides() {
+  for (var i = 0; i < slideEls.length; i++) {
+    switch (i) {
+      case curSlide - 2:
+        updateSlideClass(i, 'far-past');
+        break;
+      case curSlide - 1:
+        updateSlideClass(i, 'past');
+        break;
+      case curSlide: 
+        updateSlideClass(i, 'current');
+        break;
+      case curSlide + 1:
+        updateSlideClass(i, 'next');      
+        break;
+      case curSlide + 2:
+        updateSlideClass(i, 'far-next');      
+        break;
+      default:
+        updateSlideClass(i);
+        break;
+    }
+  }
+
+  triggerLeaveEvent(curSlide - 1);
+  triggerEnterEvent(curSlide);
+
+  window.setTimeout(function() {
+    // Hide after the slide
+    disableSlideFrames(curSlide - 2);
+  }, 301);
+
+  enableSlideFrames(curSlide - 1);
+  enableSlideFrames(curSlide + 2);
+  
+  if (isChromeVoxActive()) {
+    speakAndSyncToNode(slideEls[curSlide]);
+  }  
+
+  updateHash();
+};
+
+function buildNextItem() {
+  var toBuild  = slideEls[curSlide].querySelectorAll('.to-build');
+
+  if (!toBuild.length) {
+    return false;
+  }
+
+  toBuild[0].classList.remove('to-build', '');
+
+  if (isChromeVoxActive()) {
+    speakAndSyncToNode(toBuild[0]);
+  }
+
+  return true;
+};
+
+function prevSlide() {
+  if (curSlide > 0) {
+    curSlide--;
+
+    updateSlides();
+  }
+};
+
+function nextSlide() {
+  if (buildNextItem()) {
+    return;
+  }
+
+  if (curSlide < slideEls.length - 1) {
+    curSlide++;
+
+    updateSlides();
+  }
+};
+
+/* Slide events */
+
+function triggerEnterEvent(no) {
+  var el = getSlideEl(no);
+  if (!el) {
+    return;
+  }
+
+  var onEnter = el.getAttribute('onslideenter');
+  if (onEnter) {
+    new Function(onEnter).call(el);
+  }
+
+  var evt = document.createEvent('Event');
+  evt.initEvent('slideenter', true, true);
+  evt.slideNumber = no + 1; // Make it readable
+
+  el.dispatchEvent(evt);
+};
+
+function triggerLeaveEvent(no) {
+  var el = getSlideEl(no);
+  if (!el) {
+    return;
+  }
+
+  var onLeave = el.getAttribute('onslideleave');
+  if (onLeave) {
+    new Function(onLeave).call(el);
+  }
+
+  var evt = document.createEvent('Event');
+  evt.initEvent('slideleave', true, true);
+  evt.slideNumber = no + 1; // Make it readable
+  
+  el.dispatchEvent(evt);
+};
+
+/* Touch events */
+
+function handleTouchStart(event) {
+  if (event.touches.length == 1) {
+    touchDX = 0;
+    touchDY = 0;
+
+    touchStartX = event.touches[0].pageX;
+    touchStartY = event.touches[0].pageY;
+
+    document.body.addEventListener('touchmove', handleTouchMove, true);
+    document.body.addEventListener('touchend', handleTouchEnd, true);
+  }
+};
+
+function handleTouchMove(event) {
+  if (event.touches.length > 1) {
+    cancelTouch();
+  } else {
+    touchDX = event.touches[0].pageX - touchStartX;
+    touchDY = event.touches[0].pageY - touchStartY;
+  }
+};
+
+function handleTouchEnd(event) {
+  var dx = Math.abs(touchDX);
+  var dy = Math.abs(touchDY);
+
+  if ((dx > PM_TOUCH_SENSITIVITY) && (dy < (dx * 2 / 3))) {
+    if (touchDX > 0) {
+      prevSlide();
+    } else {
+      nextSlide();
+    }
+  }
+  
+  cancelTouch();
+};
+
+function cancelTouch() {
+  document.body.removeEventListener('touchmove', handleTouchMove, true);
+  document.body.removeEventListener('touchend', handleTouchEnd, true);  
+};
+
+/* Preloading frames */
+
+function disableSlideFrames(no) {
+  var el = getSlideEl(no);
+  if (!el) {
+    return;
+  }
+
+  var frames = el.getElementsByTagName('iframe');
+  for (var i = 0, frame; frame = frames[i]; i++) {
+    disableFrame(frame);
+  }
+};
+
+function enableSlideFrames(no) {
+  var el = getSlideEl(no);
+  if (!el) {
+    return;
+  }
+
+  var frames = el.getElementsByTagName('iframe');
+  for (var i = 0, frame; frame = frames[i]; i++) {
+    enableFrame(frame);
+  }
+};
+
+function disableFrame(frame) {
+  frame.src = 'about:blank';
+};
+
+function enableFrame(frame) {
+  var src = frame._src;
+
+  if (frame.src != src && src != 'about:blank') {
+    frame.src = src;
+  }
+};
+
+function setupFrames() {
+  var frames = document.querySelectorAll('iframe');
+  for (var i = 0, frame; frame = frames[i]; i++) {
+    frame._src = frame.src;
+    disableFrame(frame);
+  }
+  
+  enableSlideFrames(curSlide);
+  enableSlideFrames(curSlide + 1);
+  enableSlideFrames(curSlide + 2);  
+};
+
+function setupInteraction() {
+  /* Clicking and tapping */
+  
+  var el = document.createElement('div');
+  el.className = 'slide-area';
+  el.id = 'prev-slide-area';  
+  el.addEventListener('click', prevSlide, false);
+  document.querySelector('section.slides').appendChild(el);
+
+  var el = document.createElement('div');
+  el.className = 'slide-area';
+  el.id = 'next-slide-area';  
+  el.addEventListener('click', nextSlide, false);
+  document.querySelector('section.slides').appendChild(el);  
+  
+  /* Swiping */
+  
+  document.body.addEventListener('touchstart', handleTouchStart, false);
+}
+
+/* ChromeVox support */
+
+function isChromeVoxActive() {
+  if (typeof(cvox) == 'undefined') {
+    return false;
+  } else {
+    return true;
+  }
+};
+
+function speakAndSyncToNode(node) {
+  if (!isChromeVoxActive()) {
+    return;
+  }
+  
+  cvox.ChromeVox.navigationManager.switchToStrategy(
+      cvox.ChromeVoxNavigationManager.STRATEGIES.LINEARDOM, 0, true);  
+  cvox.ChromeVox.navigationManager.syncToNode(node);
+  cvox.ChromeVoxUserCommands.finishNavCommand('');
+  var target = node;
+  while (target.firstChild) {
+    target = target.firstChild;
+  }
+  cvox.ChromeVox.navigationManager.syncToNode(target);
+};
+
+function speakNextItem() {
+  if (!isChromeVoxActive()) {
+    return;
+  }
+  
+  cvox.ChromeVox.navigationManager.switchToStrategy(
+      cvox.ChromeVoxNavigationManager.STRATEGIES.LINEARDOM, 0, true);
+  cvox.ChromeVox.navigationManager.next(true);
+  if (!cvox.DomUtil.isDescendantOfNode(
+      cvox.ChromeVox.navigationManager.getCurrentNode(), slideEls[curSlide])){
+    var target = slideEls[curSlide];
+    while (target.firstChild) {
+      target = target.firstChild;
+    }
+    cvox.ChromeVox.navigationManager.syncToNode(target);
+    cvox.ChromeVox.navigationManager.next(true);
+  }
+  cvox.ChromeVoxUserCommands.finishNavCommand('');
+};
+
+function speakPrevItem() {
+  if (!isChromeVoxActive()) {
+    return;
+  }
+  
+  cvox.ChromeVox.navigationManager.switchToStrategy(
+      cvox.ChromeVoxNavigationManager.STRATEGIES.LINEARDOM, 0, true);
+  cvox.ChromeVox.navigationManager.previous(true);
+  if (!cvox.DomUtil.isDescendantOfNode(
+      cvox.ChromeVox.navigationManager.getCurrentNode(), slideEls[curSlide])){
+    var target = slideEls[curSlide];
+    while (target.lastChild){
+      target = target.lastChild;
+    }
+    cvox.ChromeVox.navigationManager.syncToNode(target);
+    cvox.ChromeVox.navigationManager.previous(true);
+  }
+  cvox.ChromeVoxUserCommands.finishNavCommand('');
+};
+
+/* Hash functions */
+
+function getCurSlideFromHash() {
+  var slideNo = parseInt(location.hash.substr(1));
+
+  if (slideNo) {
+    curSlide = slideNo - 1;
+  } else {
+    curSlide = 0;
+  }
+};
+
+function updateHash() {
+  location.replace('#' + (curSlide + 1));
+};
+
+/* Event listeners */
+
+function handleBodyKeyDown(event) {
+  switch (event.keyCode) {
+    case 39: // right arrow
+    case 13: // Enter
+    case 32: // space
+    case 34: // PgDn
+      nextSlide();
+      event.preventDefault();
+      break;
+
+    case 37: // left arrow
+    case 8: // Backspace
+    case 33: // PgUp
+      prevSlide();
+      event.preventDefault();
+      break;
+
+    case 40: // down arrow
+      if (isChromeVoxActive()) {
+        speakNextItem();
+      } else {
+        nextSlide();
+      }
+      event.preventDefault();
+      break;
+
+    case 38: // up arrow
+      if (isChromeVoxActive()) {
+        speakPrevItem();
+      } else {
+        prevSlide();
+      }
+      event.preventDefault();
+      break;
+  }
+};
+
+function addEventListeners() {
+  document.addEventListener('keydown', handleBodyKeyDown, false);  
+};
+
+/* Initialization */
+
+function addPrettify() {
+  var els = document.querySelectorAll('pre');
+  for (var i = 0, el; el = els[i]; i++) {
+    if (!el.classList.contains('noprettyprint')) {
+      el.classList.add('prettyprint');
+    }
+  }
+  
+  var el = document.createElement('script');
+  el.type = 'text/javascript';
+  el.src = PERMANENT_URL_PREFIX + 'prettify.js';
+  el.onload = function() {
+    prettyPrint();
+  }
+  document.body.appendChild(el);
+};
+
+function addFontStyle() {
+  var el = document.createElement('link');
+  el.rel = 'stylesheet';
+  el.type = 'text/css';
+  el.href = 'http://fonts.googleapis.com/css?family=' +
+            'Open+Sans:regular,semibold,italic,italicsemibold|Droid+Sans+Mono|Inconsolata';
+
+  document.body.appendChild(el);
+};
+
+function addGeneralStyle() {
+  var el = document.createElement('link');
+  el.rel = 'stylesheet';
+  el.type = 'text/css';
+  el.href = PERMANENT_URL_PREFIX + 'styles.css';
+  document.body.appendChild(el);
+  
+  var el = document.createElement('meta');
+  el.name = 'viewport';
+  el.content = 'width=1100,height=750';
+  document.querySelector('head').appendChild(el);
+  
+  var el = document.createElement('meta');
+  el.name = 'apple-mobile-web-app-capable';
+  el.content = 'yes';
+  document.querySelector('head').appendChild(el);
+};
+
+function makeBuildLists() {
+  for (var i = curSlide, slide; slide = slideEls[i]; i++) {
+    var items = slide.querySelectorAll('.build > *');
+    for (var j = 0, item; item = items[j]; j++) {
+      if (item.classList) {
+        item.classList.add('to-build');
+      }
+    }
+  }
+};
+
+function handleDomLoaded() {
+  slideEls = document.querySelectorAll('section.slides > article');
+
+  setupFrames();
+
+  addFontStyle();
+  addGeneralStyle();
+  addPrettify();
+  addEventListeners();
+
+  updateSlides();
+
+  setupInteraction();
+  makeBuildLists();
+
+  document.body.classList.add('loaded');
+};
+
+function initialize() {
+  getCurSlideFromHash();
+
+  if (window['_DEBUG']) {
+    PERMANENT_URL_PREFIX = '../';
+  }
+
+  if (window['_DCL']) {
+    handleDomLoaded();
+  } else {
+    document.addEventListener('DOMContentLoaded', handleDomLoaded, false);
+  }
+}
+
+// If ?debug exists then load the script relative instead of absolute
+if (!window['_DEBUG'] && document.location.href.indexOf('?debug') !== -1) {
+  document.addEventListener('DOMContentLoaded', function() {
+    // Avoid missing the DomContentLoaded event
+    window['_DCL'] = true
+  }, false);
+
+  window['_DEBUG'] = true;
+  var script = document.createElement('script');
+  script.type = 'text/javascript';
+  script.src = '../slides.js';
+  var s = document.getElementsByTagName('script')[0];
+  s.parentNode.insertBefore(script, s);
+
+  // Remove this script
+  s.parentNode.removeChild(s);
+} else {
+  initialize();
+}
+/*
+  Google HTML5 slides template
+
+  Authors: Luke Mahé (code)
+           Marcin Wichary (code and design)
+           
+           Dominic Mazzoni (browser compatibility)
+           Charles Chen (ChromeVox support)
+
+  URL: http://code.google.com/p/html5slides/
+*/
+
+/* Framework */
+
+html {
+  height: 100%;
+}
+
+body {
+  margin: 0;
+  padding: 0;
+
+  display: block !important;
+
+  height: 100%;
+  min-height: 740px;
+  
+  overflow-x: hidden;
+  overflow-y: auto;
+
+  background: rgb(215, 215, 215);
+  background: -o-radial-gradient(rgb(240, 240, 240), rgb(190, 190, 190));
+  background: -moz-radial-gradient(rgb(240, 240, 240), rgb(190, 190, 190));
+  background: -webkit-radial-gradient(rgb(240, 240, 240), rgb(190, 190, 190));
+  background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 500, from(rgb(240, 240, 240)), to(rgb(190, 190, 190)));
+
+  -webkit-font-smoothing: antialiased;
+}
+
+.slides {
+  width: 100%;
+  height: 100%;
+  left: 0;
+  top: 0;
+  
+  position: absolute;
+
+  -webkit-transform: translate3d(0, 0, 0);
+}
+
+.slides > article {
+  display: block;
+
+  position: absolute;
+  overflow: hidden;
+
+  width: 900px;
+  height: 700px;
+
+  left: 50%;
+  top: 50%;
+
+  margin-left: -450px;
+  margin-top: -350px;
+  
+  padding: 40px 60px;
+
+  box-sizing: border-box;
+  -o-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  -webkit-box-sizing: border-box;
+
+  border-radius: 10px;
+  -o-border-radius: 10px;
+  -moz-border-radius: 10px;
+  -webkit-border-radius: 10px;
+
+  background-color: white;
+
+  box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
+  border: 1px solid rgba(0, 0, 0, .3);
+
+  transition: transform .3s ease-out;
+  -o-transition: -o-transform .3s ease-out;
+  -moz-transition: -moz-transform .3s ease-out;
+  -webkit-transition: -webkit-transform .3s ease-out;
+}
+.slides.layout-widescreen > article {
+  margin-left: -550px;
+  width: 1100px;
+}
+.slides.layout-faux-widescreen > article {
+  margin-left: -550px;
+  width: 1100px;
+  
+  padding: 40px 160px;
+}
+
+.slides.template-default > article:not(.nobackground):not(.biglogo) {
+  background: url(images/google-logo-small.png) 710px 625px no-repeat;  
+  
+  background-color: white;  
+} 
+
+.slides.template-io2011 > article:not(.nobackground):not(.biglogo) {
+  background: url(images/colorbar.png) 0 600px repeat-x,
+              url(images/googleio-logo.png) 640px 625px no-repeat;
+
+  background-size: 100%, 225px;  
+
+  background-color: white;  
+}
+.slides.layout-widescreen > article:not(.nobackground):not(.biglogo),
+.slides.layout-faux-widescreen > article:not(.nobackground):not(.biglogo) {
+  background-position-x: 0, 840px;
+}
+
+/* Clickable/tappable areas */
+
+.slide-area {
+  z-index: 1000;
+
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 150px;
+  height: 700px;  
+
+  left: 50%;
+  top: 50%;
+
+  cursor: pointer;  
+  margin-top: -350px;  
+  
+  tap-highlight-color: transparent;
+  -o-tap-highlight-color: transparent;
+  -moz-tap-highlight-color: transparent;
+  -webkit-tap-highlight-color: transparent;
+}
+#prev-slide-area {
+  margin-left: -550px;
+}
+#next-slide-area {
+  margin-left: 400px;
+}
+.slides.layout-widescreen #prev-slide-area,
+.slides.layout-faux-widescreen #prev-slide-area {
+  margin-left: -650px;
+}
+.slides.layout-widescreen #next-slide-area,
+.slides.layout-faux-widescreen #next-slide-area {
+  margin-left: 500px;
+}
+
+/* Slide styles */
+
+.slides.template-default article.biglogo {
+  /*background: white url(driving.jpg) 50% 50% no-repeat;*/
+}
+
+.slides.template-io2011 article.biglogo {
+  background: white url(images/googleio-logo.png) 50% 50% no-repeat;
+
+  background-size: 600px;
+}
+
+/* Slides */
+
+.slides > article {
+  display: none;
+}
+.slides > article.far-past {
+  display: block;
+  transform: translate(-2040px);
+  -o-transform: translate(-2040px);
+  -moz-transform: translate(-2040px);
+  -webkit-transform: translate3d(-2040px, 0, 0);
+}
+.slides > article.past {
+  display: block;
+  transform: translate(-1020px);
+  -o-transform: translate(-1020px);
+  -moz-transform: translate(-1020px);
+  -webkit-transform: translate3d(-1020px, 0, 0);
+}
+.slides > article.current {
+  display: block;
+  transform: translate(0);
+  -o-transform: translate(0);
+  -moz-transform: translate(0);
+  -webkit-transform: translate3d(0, 0, 0);
+}
+.slides > article.next {
+  display: block;
+  transform: translate(1020px);
+  -o-transform: translate(1020px);
+  -moz-transform: translate(1020px);
+  -webkit-transform: translate3d(1020px, 0, 0);
+}
+.slides > article.far-next {
+  display: block;
+  transform: translate(2040px);
+  -o-transform: translate(2040px);
+  -moz-transform: translate(2040px);
+  -webkit-transform: translate3d(2040px, 0, 0);
+}
+
+.slides.layout-widescreen > article.far-past,
+.slides.layout-faux-widescreen > article.far-past {
+  display: block;
+  transform: translate(-2260px);
+  -o-transform: translate(-2260px);
+  -moz-transform: translate(-2260px);
+  -webkit-transform: translate3d(-2260px, 0, 0);
+}
+.slides.layout-widescreen > article.past,
+.slides.layout-faux-widescreen > article.past {
+  display: block;
+  transform: translate(-1130px);
+  -o-transform: translate(-1130px);
+  -moz-transform: translate(-1130px);
+  -webkit-transform: translate3d(-1130px, 0, 0);
+}
+.slides.layout-widescreen > article.current,
+.slides.layout-faux-widescreen > article.current {
+  display: block;
+  transform: translate(0);
+  -o-transform: translate(0);
+  -moz-transform: translate(0);
+  -webkit-transform: translate3d(0, 0, 0);
+}
+.slides.layout-widescreen > article.next,
+.slides.layout-faux-widescreen > article.next {
+  display: block;
+  transform: translate(1130px);
+  -o-transform: translate(1130px);
+  -moz-transform: translate(1130px);
+  -webkit-transform: translate3d(1130px, 0, 0);
+}
+.slides.layout-widescreen > article.far-next,
+.slides.layout-faux-widescreen > article.far-next {
+  display: block;
+  transform: translate(2260px);
+  -o-transform: translate(2260px);
+  -moz-transform: translate(2260px);
+  -webkit-transform: translate3d(2260px, 0, 0);
+}
+
+/* Styles for slides */
+
+.slides > article {
+  font-family: 'Open Sans', Arial, sans-serif;
+
+  color: rgb(102, 102, 102);
+  text-shadow: 0 1px 1px rgba(0, 0, 0, .1);
+
+  font-size: 30px;
+  line-height: 36px;
+
+  letter-spacing: -1px;
+}
+
+b {
+  font-weight: 600;
+}
+
+.blue {
+  color: rgb(0, 102, 204);
+}
+.yellow {
+  color: rgb(255, 211, 25);
+}
+.green {
+  color: rgb(0, 138, 53);
+}
+.red {
+  color: rgb(255, 0, 0);
+}
+.black {
+  color: black;
+}
+.white {
+  color: white;
+}
+
+a {
+  color: rgb(0, 102, 204);
+}
+a:visited {
+  color: rgba(0, 102, 204, .75);
+}
+a:hover {
+  color: black;
+}
+a.url {
+  font-family: "Inconsolata", monospace;
+}
+p {
+  margin: 0;
+  padding: 0;
+
+  margin-top: 20px;
+}
+p:first-child {
+  margin-top: 0;
+}
+
+h1 {
+  font-size: 60px;
+  line-height: 60px;
+
+  padding: 0;
+  margin: 0;
+  margin-top: 200px;
+  padding-right: 40px;
+
+  font-weight: 600;
+
+  letter-spacing: -3px;
+
+  color: rgb(51, 51, 51);
+}
+
+h2 {
+  font-size: 45px;
+  line-height: 45px;
+
+  position: absolute;
+  bottom: 150px;
+
+  padding: 0;
+  margin: 0;
+  padding-right: 40px;
+
+  font-weight: 600;
+
+  letter-spacing: -2px;
+
+  color: rgb(51, 51, 51);
+}
+
+h3 {
+  font-size: 30px;
+  line-height: 36px;
+
+  padding: 0;
+  margin: 0;
+  padding-right: 40px;
+
+  font-weight: 600;
+
+  letter-spacing: -1px;
+
+  color: rgb(51, 51, 51);
+}
+
+article.fill h3 {
+  background: rgba(255, 255, 255, .75);
+  padding-top: .2em;
+  padding-bottom: .3em;
+  margin-top: -.2em;
+  margin-left: -60px;
+  padding-left: 60px;
+  margin-right: -60px;
+  padding-right: 60px;
+}
+
+ul {
+  list-style: none;
+  margin: 0;
+  padding: 0;
+
+  margin-top: 40px;
+
+  margin-left: .75em;
+}
+ul:first-child {
+  margin-top: 0;
+}
+ul ul {
+  margin-top: .5em;
+}
+li {
+  padding: 0;
+  margin: 0;
+
+  margin-bottom: .5em;
+}
+li::before {
+  content: '·';
+
+  width: .75em;
+  margin-left: -.75em;
+
+  position: absolute;
+}
+
+pre {
+  font-family: 'Droid Sans Mono', 'Courier New', monospace;
+
+  font-size: 20px;
+  line-height: 28px;
+  padding: 5px 10px;
+  
+  letter-spacing: -1px;
+
+  margin-top: 40px;
+  margin-bottom: 40px;
+
+  color: black;
+  background: rgb(240, 240, 240);
+  border: 1px solid rgb(224, 224, 224);
+  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .1);
+  
+  overflow: hidden;
+}
+
+code {
+  font-size: 95%;
+  font-family: 'Droid Sans Mono', 'Courier New', monospace;
+
+  color: black;
+}
+
+iframe {
+  width: 100%;
+
+  height: 620px;
+
+  background: white;
+  border: 1px solid rgb(192, 192, 192);
+  margin: -1px;
+  /*box-shadow: inset 0 2px 6px rgba(0, 0, 0, .1);*/
+}
+
+h3 + iframe {
+  margin-top: 40px;
+  height: 540px;
+}
+
+article.fill iframe {
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+
+  border: 0;
+  margin: 0;
+
+  border-radius: 10px;
+  -o-border-radius: 10px;
+  -moz-border-radius: 10px;
+  -webkit-border-radius: 10px;
+
+  z-index: -1;
+}
+
+article.fill img {
+  position: absolute;
+  left: 0;
+  top: 0;
+  min-width: 100%;
+  min-height: 100%;
+
+  border-radius: 10px;
+  -o-border-radius: 10px;
+  -moz-border-radius: 10px;
+  -webkit-border-radius: 10px;
+
+  z-index: -1;
+}
+img.centered {
+  margin: 0 auto;
+  display: block;
+}
+
+table {
+  width: 100%;
+  border-collapse: collapse;
+  margin-top: 40px;
+}
+th {
+  font-weight: 600;
+  text-align: left;
+}
+td,
+th {
+  border: 1px solid rgb(224, 224, 224);
+  padding: 5px 10px;
+  vertical-align: top;
+}
+
+.source {
+  position: absolute;
+  left: 60px;
+  top: 644px;
+  padding-right: 175px;
+  
+  font-size: 15px;
+  letter-spacing: 0;  
+  line-height: 18px;
+}
+qnq {
+  display: block;
+  font-size: 60px;
+  line-height: 72px;
+  
+  margin-left: 20px;
+  
+  margin-top: 100px;
+  margin-right: 150px;    
+}
+q {
+  display: block;
+  font-size: 60px;
+  line-height: 72px;
+  
+  margin-left: 20px;
+  
+  margin-top: 100px;
+  margin-right: 150px;    
+}
+q::before {
+  content: '“';
+  
+  position: absolute;
+  display: inline-block;
+  margin-left: -2.1em;
+  width: 2em;
+  text-align: right;
+  
+  font-size: 90px;
+  color: rgb(192, 192, 192);
+}
+q::after {
+  content: '”';
+
+  position: absolute;  
+  margin-left: .1em;
+
+  font-size: 90px;
+  color: rgb(192, 192, 192);  
+}
+div.author {
+  text-align: right;  
+  font-size: 40px;
+  
+  margin-top: 20px;
+  margin-right: 150px;    
+}
+div.author::before {
+  content: '—';
+}
+
+/* Size variants */
+
+article.smaller p,
+article.smaller ul {
+  font-size: 20px;
+  line-height: 24px;
+  letter-spacing: 0;
+}
+article.smaller table {
+  font-size: 20px;
+  line-height: 24px;
+  letter-spacing: 0;
+}
+article.smaller pre {
+  font-size: 15px;
+  line-height: 20px;
+  letter-spacing: 0;
+}
+article.smaller q {
+  font-size: 40px;
+  line-height: 48px;
+}
+article.smaller q::before,
+article.smaller q::after {
+  font-size: 60px;
+}
+
+/* Builds */
+
+.build > * {
+  transition: opacity 0.5s ease-in-out 0.2s;
+  -o-transition: opacity 0.5s ease-in-out 0.2s;
+  -moz-transition: opacity 0.5s ease-in-out 0.2s;
+  -webkit-transition: opacity 0.5s ease-in-out 0.2s;
+}
+
+.to-build {
+  opacity: 0;
+}
+
+/* Pretty print */
+
+.prettyprint .str, /* string content */
+.prettyprint .atv { /* a markup attribute value */
+  color: rgb(0, 138, 53); 
+}  
+.prettyprint .kwd, /* a keyword */
+.prettyprint .tag { /* a markup tag name */
+  color: rgb(0, 102, 204);
+}
+.prettyprint .com { /* a comment */
+  color: rgb(127, 127, 127); 
+  font-style: italic; 
+}  
+.prettyprint .lit { /* a literal value */
+  color: rgb(127, 0, 0);
+}  
+.prettyprint .pun, /* punctuation, lisp open bracket, lisp close bracket */
+.prettyprint .opn, 
+.prettyprint .clo { 
+  color: rgb(127, 127, 127); 
+}
+.prettyprint .typ, /* a type name */
+.prettyprint .atn, /* a markup attribute name */ 
+.prettyprint .dec, 
+.prettyprint .var { /* a declaration; a variable name */
+  color: rgb(127, 0, 127);
+}