text:
<?php

namespace Yuloh\Ketch;

use FilesystemIterator;
use Mustache_Engine;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use Yuloh\Ketch\Filters;

class Ketch
{
    /**
     * @var array
     */
    private $helpers;

    /**
     * @param array $helpers
     */
    public function __construct(array $helpers = [])
    {
        $this->helpers = $helpers ?: $this->getDefaultHelpers();
    }

    /**
     * @param string $src  The source directory.
     * @param string $dest The destination directory.
     */
    public function generate($src, $dest)
    {
        $files = $this->allFiles($src);

        $mustache = new Mustache_Engine([
            'loader'  => new FileLoader($files),
            'pragmas' => [Mustache_Engine::PRAGMA_FILTERS],
            'helpers' => $this->helpers
        ]);

        $blacklist = array_keys($this->helpers);
        $context   = new AskContext($blacklist);

        $this->createDestinationDirectory($dest);

        foreach ($files as $name => $file) {

            $rendered = $mustache
                ->loadTemplate($name)
                ->render($context);

            $outPathName = $this->getDestinationPathName($src, $dest, $name);
            $this
                ->createAnyIntermediateDirectories($outPathName)
                ->writeRenderedTemplate($outPathName, $rendered);
        }
    }

    /**
     * Register a helper with Ketch.  The helper will be passed directly to Mustache.
     *
     * @param string $name
     * @param mixed  $helper
     */
    public function registerHelper($name, $helper)
    {
        $this->helpers[$name] = $helper;
    }

    /**
     * Get the default helpers used by Ketch.
     *
     * @return array
     */
    private function getDefaultHelpers()
    {
        return [
            'case' => [
                'upper'  => new Filters\UpperCase(),
                'title'  => new Filters\TitleCase(),
                'snake'  => new Filters\SnakeCase(),
                'pascal' => new Filters\PascalCase(),
                'camel'  => new Filters\CamelCase(),
                'kebab'  => new Filters\KebabCase(),
            ]
        ];
    }

    /**
     * Return an array of files in the given path.  The array is indexed
     * by file name.
     *
     * @param string $path
     * @return \SplFileInfo[]
     */
    private function allFiles($path)
    {
        $files = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)
        );

        return iterator_to_array($files);
    }

    /**
     * @param $dest
     */
    private function createDestinationDirectory($dest)
    {
        if (!file_exists($dest)) {
            if (!mkdir($dest, 0777, true)) {
                throw new \RuntimeException('Failed to create the destination directory.');
            }
        }
    }

    /**
     * @param string $src      The source directory.
     * @param string $dest     The destination directory.
     * @param string $filename The filename.
     * @return string
     */
    private function getDestinationPathName($src, $dest, $filename)
    {
        // .gitattributes can't be added to templates or it will
        // cause the files listed to not be exported.  Instead
        // it's added as .gitattributes.dist, so we change it
        // back to .gitattributes when writing the file.
        if (basename($filename) === '.gitattributes.dist') {
            $filename = str_replace('.gitattributes.dist', '.gitattributes', $filename);
        }

        return str_replace($src, $dest, $filename);
    }

    /**
     * @param $outPathName
     * @return $this
     */
    private function createAnyIntermediateDirectories($outPathName)
    {
        $outDir = dirname($outPathName);

        if (!file_exists($outDir)) {
            if (!mkdir($outDir, 0777, true)) {
                throw new \RuntimeException(sprintf('Failed to create the path "%s".', $outDir));
            }
        }

        return $this;
    }

    /**
     * Write the rendered template to the given destination.
     *
     * @param string $destFilename The destination filename.
     * @param string $rendered     The rendered template.
     * @return $this
     */
    private function writeRenderedTemplate($destFilename, $rendered)
    {
        if (file_put_contents($destFilename, $rendered) === false) {
            throw new \RuntimeException(sprintf('Could not create the file "%s".', $destFilename));
        }

        return $this;
    }
}


text:
const path = require('path');
const favicon = require('serve-favicon');
const compress = require('compression');
const cors = require('cors');
const helmet = require('helmet');
const logger = require('winston');

const feathers = require('@feathersjs/feathers');
const configuration = require('@feathersjs/configuration');
const express = require('@feathersjs/express');
const socketio = require('@feathersjs/socketio');

const middleware = require('./middleware');
const services = require('./services');
const appHooks = require('./app.hooks');
const channels = require('./channels');

const mongoose = require('./mongoose');

const authentication = require('./authentication');

const app = express(feathers());

// Load app configuration
app.configure(configuration());
// Enable CORS, security, compression, favicon and body parsing
app.use(cors());
app.use(helmet());
app.use(compress());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', express.static(app.get('public')));

// Set up Plugins and providers

app.configure(socketio());

app.configure(mongoose);

// Configure other middleware (see `middleware/index.js`)
app.configure(middleware);
app.configure(authentication);
// Set up our services (see `services/index.js`)
app.configure(services);
// Set up event channels (see channels.js)
app.configure(channels);

// Configure a middleware for 404s and the error handler
app.use(express.notFound());
app.use(express.errorHandler({ logger }));

app.hooks(appHooks);

// app.service('users').create({
// 	email: 'austin@austinkurpuis.com',
// 	password: 'admin'
// });

module.exports = app;

redpajama_set_name: RedPajamaGithub


text:
#blockly {
  position: fixed;
  bottom: 10px;
}
#editor {
  font-size: 16pt;
  position: fixed !important;
  height: auto !important;
  bottom: 10px;
  border: 1px solid #BBA;
}
#visualization {
  position: relative;
}
#display {
  border: 1px solid #BBA;
  vertical-align: bottom;
}

#playerStatTable {
  width: 406px;
  max-width: 406px;
  margin-left: -2px;
  height: 20px;
}

#playerStatRow>td {
  padding: 0;
  border: 1px solid;
  background: #ccc;
  border-radius: 2px;
}

#playerStatRow>td>div:not(.playerStatHealth) {
  padding: 1px;
}

.playerStatName {
  position: absolute;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playerStatHealth {
  position: absolute;
}

#help pre {
  font-size: large;
}

/* Documentation frame. */
#dialogDocs {
  visibility: hidden;
  background-color: #fff;
  border: 1px solid #ccc;
  position: absolute;
  border-radius: 8px;
  box-shadow: 5px 5px 5px #888;
  padding: 15px 0 5px;
  top: 55px;
  left: 5px;
  width: 406px;
  bottom: 10px;
}

#frameDocs {
  width: 100%;
  height: 100%;
  border: none;
}

#closeDocs {
  position: absolute;
  top: -5px;
  left: 389px;
  cursor: pointer;
  opacity: .7;
}

#closeDocs:hover {
  opacity: 1;
}

/* Sprited icons. */
.icon21 {
  height: 21px;
  width: 21px;
  background-image: url(icons.png);
}
.close {
  background-position: -21px 0px;
}
.link {
  background-position: 0px 0px;
}
.run {
  background-position: 0px -21px;
}
.stop {
  background-position: -21px -21px;
}


text:
package com.microsoft.azure.management.sqlvirtualmachine.v2017_03_01_preview;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
 * Defines values for ClusterManagerType.
 */
public final class ClusterManagerType extends ExpandableStringEnum<ClusterManagerType> {
    /** Static value WSFC for ClusterManagerType. */
    public static final ClusterManagerType WSFC = fromString("WSFC");

    /**
     * Creates or finds a ClusterManagerType from its string representation.
     * @param name a name to look for
     * @return the corresponding ClusterManagerType
     */
    @JsonCreator
    public static ClusterManagerType fromString(String name) {
        return fromString(name, ClusterManagerType.class);
    }

    /**
     * @return known ClusterManagerType values
     */
    public static Collection<ClusterManagerType> values() {
        return values(ClusterManagerType.class);
    }
}


text:
id: 668
title: Potteries Dorkbot
date: 2014-09-17T09:00:37+00:00
author: James Wade
layout: post
guid: /?p=668
permalink: /2014/09/17/potteries-dorkbot/
spacious_page_layout:
  - default_layout
image: /wp-content/uploads/2014/09/2014-09-15-17.07.20.jpg
categories:
  - Announcements
  - Events
tags:
  - dorkbot
  - electricity
  - meet
  - music
  - present
---
If you're interested in doing strange things with electricity then you'll be right at home at Potteries Hackspace as we're planning to host dorkbot meetings for the area as part of our open night.

So what is [dorkbot](http://www.dorkbot.org/)?

<!--more-->

Dorkbot is a group of affiliated organisations worldwide that sponsor grassroots meetings of artists, engineers, designers, scientists, inventors, and anyone else working under the very broad umbrella of electronic art.

The dorkbot motto is “people doing strange things with electricity”.

Started by Douglas Repetto at the Columbia University Computer Music Center in 2000, dorkbot has spread around the world, with hundreds of chapters either planning or actively holding meetings.

The purpose of dorkbot meetings is to nurture a local electronic arts community and to encourage emerging, and established, artists to present new works for informal peer review. While many of the dorkbot groups hold their meetings at universities and students are encouraged to attend, dorkbot meetings are not restricted in any way to the academic community. Dorkbot groups encourage the free exchange of ideas on the electronic arts, and regular attendees of one dorkbot will often visit another when they are travelling, serving as informal ambassadors between groups.

We’re seeking people to host two or three presentations (about 20-30 minutes each) per meeting and sometimes very short “lightening” presentations from audience members.

You’ll find lots more information on [what a dorkbot meeting is all about](http://www.dorkbot.org/startadorkbot/) on the dorkbot website.

If you’d like to present at a dorkbot meeting, [please get in touch!](/contact/)

Edit: Although we’re called “Potteries” and are currently operating out of Newcastle-under-Lyme, we’re really covering the entire of Staffordshire, so don’t be shy, everybody will be welcomed!


text:
	if( memory_copy(
	     ${structure_name}->${member_name},
	     ( (${prefix}_${structure_name}_t *) data )->${member_name},
	     16 ) == NULL )
	{
		libcerror_error_set(
		 error,
		 LIBCERROR_ERROR_DOMAIN_MEMORY,
		 LIBCERROR_MEMORY_ERROR_SET_FAILED,
		 "%s: unable to copy ${member_name_description}.",
		 function );

		return( -1 );
	}


text:
package com.amazonaws.services.frauddetector.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateModelRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The model ID.
     *

     */
    private String modelId;
    /**
     *

     * The model type.
     *

     */
    private String modelType;
    /**
     *

     * The new model description.
     *

     */
    private String description;

    /**
     *

     * The model ID.
     *

     *
     * @param modelId
     *        The model ID.
     */

    public void setModelId(String modelId) {
        this.modelId = modelId;
    }

    /**
     *

     * The model ID.
     *

     *
     * @return The model ID.
     */

    public String getModelId() {
        return this.modelId;
    }

    /**
     *

     * The model ID.
     *

     *
     * @param modelId
     *        The model ID.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateModelRequest withModelId(String modelId) {
        setModelId(modelId);
        return this;
    }

    /**
     *

     * The model type.
     *

     *
     * @param modelType
     *        The model type.
     * @see ModelTypeEnum
     */

    public void setModelType(String modelType) {
        this.modelType = modelType;
    }

    /**
     *

     * The model type.
     *

     *
     * @return The model type.
     * @see ModelTypeEnum
     */

    public String getModelType() {
        return this.modelType;
    }

    /**
     *

     * The model type.
     *

     *
     * @param modelType
     *        The model type.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ModelTypeEnum
     */

    public UpdateModelRequest withModelType(String modelType) {
        setModelType(modelType);
        return this;
    }

    /**
     *

     * The model type.
     *

     *
     * @param modelType
     *        The model type.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ModelTypeEnum
     */

    public UpdateModelRequest withModelType(ModelTypeEnum modelType) {
        this.modelType = modelType.toString();
        return this;
    }

    /**
     *

     * The new model description.
     *

     *
     * @param description
     *        The new model description.
     */

    public void setDescription(String description) {
        this.description = description;
    }

    /**
     *

     * The new model description.
     *

     *
     * @return The new model description.
     */

    public String getDescription() {
        return this.description;
    }

    /**
     *

     * The new model description.
     *

     *
     * @param description
     *        The new model description.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateModelRequest withDescription(String description) {
        setDescription(description);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getModelId() != null)
            sb.append("ModelId: ").append(getModelId()).append(",");
        if (getModelType() != null)
            sb.append("ModelType: ").append(getModelType()).append(",");
        if (getDescription() != null)
            sb.append("Description: ").append(getDescription());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof UpdateModelRequest == false)
            return false;
        UpdateModelRequest other = (UpdateModelRequest) obj;
        if (other.getModelId() == null ^ this.getModelId() == null)
            return false;
        if (other.getModelId() != null && other.getModelId().equals(this.getModelId()) == false)
            return false;
        if (other.getModelType() == null ^ this.getModelType() == null)
            return false;
        if (other.getModelType() != null && other.getModelType().equals(this.getModelType()) == false)
            return false;
        if (other.getDescription() == null ^ this.getDescription() == null)
            return false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getModelId() == null) ? 0 : getModelId().hashCode());
        hashCode = prime * hashCode + ((getModelType() == null) ? 0 : getModelType().hashCode());
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
        return hashCode;
    }

    @Override
    public UpdateModelRequest clone() {
        return (UpdateModelRequest) super.clone();
    }

}


text:
class AddPasswordDigestToAccounts < ActiveRecord::Migration[5.1]
  def change
    add_column :accounts, :password_digest, :string
  end
end


text:
if [ `uname` != "Darwin" ] ; then
    echo "Don't run this script unless you are on Mac OSX"
    exit 1
fi

if [ `which brew` == "" ] ; then
    echo "You need to install Homebrew before running this script."
    echo "See http://brew.sh"
    exit 1
fi

brew update >/dev/null
echo ""
echo "Before my brew installs:"
brew list --versions
brew install ccache
brew install flex bison
brew install ilmbase openexr
brew install boost-python
brew install opencolorio partio
brew install freetype libraw libpng webp
brew install llvm
#brew install homebrew/science/hdf5 --with-threadsafe
#brew install field3d webp ffmpeg openjpeg opencv
echo ""
echo "After brew installs:"
brew list --versions


text:
/**
 * @class EZ3.OBJRequest
 * @extends EZ3.Request
 * @param {String} url
 * @param {Boolean} [cached]
 * @param {Boolean} [crossOrigin]
 */
EZ3.OBJRequest = function(url, cached, crossOrigin) {
  EZ3.Request.call(this, url, new EZ3.Entity(), cached, crossOrigin);
};

EZ3.OBJRequest.prototype = Object.create(EZ3.Request.prototype);
EZ3.OBJRequest.prototype.constructor = EZ3.OBJRequest;

/**
 * @method EZ3.OBJRequest#_processLoadMTL
 * @param {String} baseUrl
 * @param {String} data
 * @param {EZ3.Material[]} materials
 * @param {EZ3.RequestManager} requests
 */
EZ3.OBJRequest.prototype._processLoadMTL = function(baseUrl, data, materials, requests) {
  var that = this;
  var currents;

  function processColor(color) {
    var values = color.split(' ');

    return new EZ3.Vector3(parseFloat(values[0]), parseFloat(values[1]), parseFloat(values[2]));
  }

  function processDiffuse(color) {
    var diffuse = processColor(color);
    var i;

    for (i = 0; i < currents.length; i++)
      currents[i].diffuse = diffuse;
  }

  function processSpecular(color) {
    var specular = processColor(color);
    var i;

    for (i = 0; i < currents.length; i++)
      currents[i].specular = specular;
  }

  function processTransparency(opacity, invert) {
    var i;

    opacity = parseFloat(opacity);

    if (invert)
      opacity = 1 - opacity;

    if (opacity >= 1)
      return;

    for (i = 0; i < currents.length; i++) {
      //currents[i].transparent = true;
      //currents[i].opacity = opacity;
    }
  }

  function processDiffuseMap(url) {
    var texture = new EZ3.Texture2D(requests.addImageRequest(baseUrl + url, that.cached, that.crossOrigin));
    var i;

    for (i = 0; i < currents.length; i++)
      currents[i].diffuseMap = texture;
  }

  function parse() {
    var lines = data.split('\n');
    var line;
    var key;
    var value;
    var i;
    var j;

    for (i = 0; i < lines.length; i++) {
      line = lines[i].trim();

      j = line.indexOf(' ');

      key = (j >= 0) ? line.substring(0, j) : line;
      key = key.toLowerCase();

      value = (j >= 0) ? line.substring(j + 1) : '';
      value = value.trim();

      if (key === 'newmtl')
        currents = materials[value];
      else if (currents) {
        if (key === 'kd')
          processDiffuse(value);
        else if (key === 'ks')
          processSpecular(value);
        else if (key === 'map_kd')
          processDiffuseMap(value);
        else if (key === 'd')
          processTransparency(value);
        else if (key === 'tr')
          processTransparency(value, true);
      }
    }
  }

  parse();
};

/**
 * @method EZ3.OBJRequest#_processLoadOBJ
 * @param {String} data
 * @param {Function} onLoad
 */
EZ3.OBJRequest.prototype._processLoadOBJ = function(data, onLoad) {
  var that = this;
  var indices = [];
  var vertices = [];
  var normals = [];
  var uvs = [];
  var fixedIndices = [];
  var fixedVertices = [];
  var fixedNormals = [];
  var fixedUvs = [];

  function triangulate(face) {
    var data = [];
    var i;

    face = face.split(' ');

    for (i = 1; i < face.length - 1; i++)
      data.push(face[0], face[i], face[i + 1]);

    return data;
  }

  function processVertex(vertex) {
    var i;

    for (i = 1; i < 4; i++)
      vertices.push(parseFloat(vertex[i]));
  }

  function processNormal(normal) {
    var i;

    for (i = 1; i < 4; i++)
      normals.push(parseFloat(normal[i]));
  }

  function processUv(uv) {
    var i;

    for (i = 1; i < 3; i++)
      uvs.push(parseFloat(uv[i]));
  }

  function processVertexIndex(index) {
    index = parseInt(index);

    if (index <= 0)
      return vertices.length / 3 + index;

    return index - 1;
  }

  function processNormalIndex(index) {
    index = parseInt(index);

    if (index <= 0)
      return normals.length / 3 + index;

    return index - 1;
  }

  function processUvIndex(index) {
    index = parseInt(index);

    if (index <= 0)
      return uvs.length / 2 + index;

    return index - 1;
  }

  function processFace1(face) {
    var vertex;
    var index;
    var i;
    var j;

    for (i = 0; i < face.length; i++) {
      vertex = processVertexIndex(face[i]);

      if (indices[vertex] === undefined) {
        index = fixedVertices.length / 3;
        indices[vertex] = index;

        fixedIndices.push(index);

        for (j = 0; j < 3; j++)
          fixedVertices.push(vertices[3 * vertex + j]);
      } else
        fixedIndices.push(indices[vertex]);
    }
  }

  function processFace2(face) {
    var point;
    var vertex;
    var uv;
    var index;
    var count;
    var i;
    var j;

    for (i = 0; i < face.length; i++) {
      point = face[i].split('/');

      vertex = processVertexIndex(point[0]);
      uv = processUvIndex(point[1]);

      index = -1;
      count = fixedVertices.length / 3;

      if (!indices[vertex])
        indices[vertex] = [];

      for (j = 0; j < indices[vertex].length; j++) {
        if (indices[vertex][j].uv === uv) {
          index = indices[vertex][j].index;
          break;
        }
      }

      if (index >= 0)
        fixedIndices.push(index);
      else {
        indices[vertex].push({
          uv: uv,
          index: count
        });

        fixedIndices.push(count);

        for (j = 0; j < 3; j++)
          fixedVertices.push(vertices[3 * vertex + j]);

        fixedUvs.push(uvs[2 * uv]);
        fixedUvs.push(1.0 - uvs[2 * uv + 1]);
      }
    }
  }

  function processFace3(face) {
    var point;
    var vertex;
    var uv;
    var normal;
    var index;
    var count;
    var i;
    var j;

    for (i = 0; i < face.length; i++) {
      point = face[i].split('/');

      vertex = processVertexIndex(point[0]);
      uv = processUvIndex(point[1]);
      normal = processNormalIndex(point[2]);

      index = -1;
      count = fixedVertices.length / 3;

      if (!indices[vertex])
        indices[vertex] = [];

      for (j = 0; j < indices[vertex].length; j++) {
        if (indices[vertex][j].uv === uv && indices[vertex][j].normal === normal) {
          index = indices[vertex][j].index;
          break;
        }
      }

      if (index >= 0)
        fixedIndices.push(index);
      else {
        indices[vertex].push({
          uv: uv,
          normal: normal,
          index: count
        });

        fixedIndices.push(count);

        for (j = 0; j < 3; j++)
          fixedVertices.push(vertices[3 * vertex + j]);

        for (j = 0; j < 3; j++)
          fixedNormals.push(normals[3 * normal + j]);

        fixedUvs.push(uvs[2 * uv]);
        fixedUvs.push(1.0 - uvs[2 * uv + 1]);
      }
    }
  }

  function processFace4(face) {
    var point;
    var vertex;
    var normal;
    var index;
    var count;
    var i;
    var j;

    for (i = 0; i < face.length; i++) {
      point = face[i].split('//');

      vertex = processVertexIndex(point[0]);
      normal = processNormalIndex(point[1]);

      index = -1;
      count = fixedVertices.length / 3;

      if (!indices[vertex])
        indices[vertex] = [];

      for (j = 0; j < indices[vertex].length; j++) {
        if (indices[vertex][j].normal === normal) {
          index = indices[vertex][j].index;
          break;
        }
      }

      if (index >= 0)
        fixedIndices.push(index);
      else {
        indices[vertex].push({
          normal: normal,
          index: count
        });

        fixedIndices.push(count);

        for (j = 0; j < 3; j++)
          fixedVertices.push(vertices[3 * vertex + j]);

        for (j = 0; j < 3; j++)
          fixedNormals.push(normals[3 * normal + j]);
      }
    }
  }

  function processMesh(mesh) {
    if (fixedIndices.length) {
      mesh.geometry.buffers.setTriangles(fixedIndices, (fixedVertices.length / 3) > EZ3.Math.MAX_USHORT);
      mesh.geometry.buffers.setPositions(fixedVertices);

      if (fixedUvs.length) {
        mesh.geometry.buffers.setUVs(fixedUvs);
        fixedUvs = [];
      }

      if (fixedNormals.length) {
        mesh.geometry.buffers.setNormals(fixedNormals);
        fixedNormals = [];
      }

      indices = [];
      fixedIndices = [];
      fixedVertices = [];

      that.asset.add(mesh);

      return new EZ3.Mesh();
    }

    return mesh;
  }

  function processLibraries(libraries, materials) {
    var requests = new EZ3.RequestManager();
    var baseUrl = EZ3.toBaseUrl(that.url);
    var files = [];
    var i;

    for (i = 0; i < libraries.length; i++)
      files.push(requests.addFileRequest(baseUrl + libraries[i], that.cached, that.crossOrigin));

    requests.onComplete.add(function() {
      for (i = 0; i < files.length; i++)
        that._processLoadMTL(baseUrl, files[i].data, materials, requests);

      requests.onComplete.removeAll();
      requests.onComplete.add(function() {
        onLoad(that.url, that.asset);
      });

      requests.start();
    });

    requests.start();
  }

  function parse() {
    var mesh = new EZ3.Mesh();
    var libraries = [];
    var materials = [];
    var lines = data.split('\n');
    var line;
    var result;
    var i;

    for (i = 0; i < lines.length; i++) {
      line = lines[i].trim().replace(/ +(?= )/g, '');

      if (line.length === 0 || line.charAt(0) === '#')
        continue;
      else if ((result = /v( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/.exec(line)))
        processVertex(result);
      else if ((result = /vn( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/.exec(line)))
        processNormal(result);
      else if ((result = /vt( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/.exec(line)))
        processUv(result);
      else if ((result = /f\s(([+-]?\d+\s){2,}[+-]?\d+)/.exec(line)))
        processFace1(triangulate(result[1]));
      else if ((result = /f\s(([+-]?\d+\/[+-]?\d+\s){2,}[+-]?\d+\/[+-]?\d+)/.exec(line)))
        processFace2(triangulate(result[1]));
      else if ((result = /f\s((([+-]?\d+\/[+-]?\d+\/[+-]?\d+\s){2,})[+-]?\d+\/[+-]?\d+\/[+-]?\d+)/.exec(line)))
        processFace3(triangulate(result[1]));
      else if ((result = /f\s(([+-]?\d+\/\/[+-]?\d+\s){2,}[+-]?\d+\/\/[+-]?\d+)/.exec(line)))
        processFace4(triangulate(result[1]));
      else if (/^mtllib/.test(line))
        libraries.push(line.substring(7).trim());
      else if (/^o/.test(line) || /^g/.test(line)) {
        mesh = processMesh(mesh);
        mesh.name = line.substring(2).trim();
      } else if (/^usemtl/.test(line)) {
        mesh = processMesh(mesh);
        mesh.material.name = line.substring(7).trim();

        if (!materials[mesh.material.name])
          materials[mesh.material.name] = [];

        materials[mesh.material.name].push(mesh.material);
      }
    }

    processMesh(mesh);
    processLibraries(libraries, materials);
  }

  parse();
};

/**
 * @method EZ3.OBJRequest#send
 * @param {Function} onLoad
 * @param {Function} onError
 */
EZ3.OBJRequest.prototype.send = function(onLoad, onError) {
  var that = this;
  var requests = new EZ3.RequestManager();

  requests.addFileRequest(this.url, this.crossOrigin);

  requests.onComplete.add(function(assets, failed) {
    if (failed)
      return onError(that.url, true);

    that._processLoadOBJ(assets.get(that.url).data, onLoad);
  });

  requests.send();
};


text:
package org.simpleflatmapper.reflect.meta;

import org.simpleflatmapper.util.ProducerServiceLoader;

public interface AliasProviderProducer extends ProducerServiceLoader.Producer<AliasProvider> {
}


text:
/**
 * @file
 * @brief
 */
#ifndef LINKED_LIST_ITERATOR_H
#define LINKED_LIST_ITERATOR_H

#include "grassroots_util_library.h"
#include "linked_list.h"

struct Iterator;

/**
 * A datatype for abstracting out the method of moving from
 * one entry in a LinkedList to the next. This moves
 * from one ListItem to the next and returns the data
 * starting directly *after* the base ListItem, *not* the
 * ListItem itself.
 *
 * @see LinkedList
 *
 * @ingroup utility_group
 */
typedef struct Iterator
{
	/**
	 * The callback function to move from one entry in a LinkedList
	 * to the next.
	 * @param iterator_p This iterator.
	 */
	void *(*it_get_next_item_fn) (struct Iterator *iterator_p);

} Iterator;

#ifdef __cplusplus
	extern "C" {
#endif

/**
 * Get an Iterator for a LinkedList.
 *
 * @param list_p The LinkedList to get the Iterator for.
 * @return The new Iterator which will be positioned at the
 * beginning of the LinkedList or NULL upon
 * error.
 * @memberof Iterator
 */
GRASSROOTS_UTIL_API Iterator *GetLinkedListIterator (LinkedList *list_p);

/**
 * Get the next entry in the LinkedList associated with an Iterator.
 *
 * @param iterator_p The Iterator to get the next entry from.
 * @return The next entry in the underlying LinkedList or
 * NULL if the end of the LinkedList has been reached. Note that the
 * data returned is that starting directly *after* the base ListItem, *not* the
 * ListItem itself.
 * @memberof Iterator
 */
GRASSROOTS_UTIL_API void *GetNextItemFromIterator (Iterator *iterator_p);

/**
 * Free the Iterator.
 *
 * @param iterator_p The Iterator to free.
 * @memberof Iterator
 */
GRASSROOTS_UTIL_API void FreeIterator (Iterator *iterator_p);

#ifdef __cplusplus
}
#endif

#endif		/* #ifndef LINKED_LIST_ITERATOR_H */


text:
package beagle;

public class GeneralBeagleImpl implements Beagle {

    public static final boolean DEBUG = false;
    public static final boolean SCALING = true;  //this was true XJ

    // These settings are chosen for single precision computation.
    // The single precision exponents go from -126 to 127 (2 ^ x)
    public static final int SCALING_FACTOR_COUNT = 254; // -126, 127
    public static final int SCALING_FACTOR_OFFSET = 126; // the zero point
    private static final int SCALING_EXPONENT_THRESHOLD = 2;

    protected final int tipCount;
    protected final int partialsBufferCount;
    protected final int compactBufferCount;
    protected final int stateCount;
    protected final int patternCount;
    protected final int eigenBufferCount;
    protected final int matrixBufferCount;
    protected final int categoryCount;

    protected int partialsSize;
    protected int matrixSize;

    protected double[][] cMatrices;
    protected double[][] eigenValues;

    protected double[][] stateFrequencies;

    protected double[] categoryRates;
    protected double[][] categoryWeights;

    protected double[] patternWeights;
    protected double[][] partials;
    protected int[][] scalingFactorCounts;

    protected int[][] tipStates;

    protected double[][] matrices;

    double[] tmpPartials;

    protected double[] scalingFactors;
    protected double[] logScalingFactors;

    /**
     * Constructor
     *
     * @param stateCount number of states
     */
    public GeneralBeagleImpl(final int tipCount,
                             final int partialsBufferCount,
                             final int compactBufferCount,
                             final int stateCount,
                             final int patternCount,
                             final int eigenBufferCount,
                             final int matrixBufferCount,
                             final int categoryCount,
                             final int scaleBufferCount) {

        this.tipCount = tipCount;
        this.partialsBufferCount = partialsBufferCount;
        this.compactBufferCount = compactBufferCount;
        this.stateCount = stateCount;
        this.patternCount = patternCount;
        this.eigenBufferCount = eigenBufferCount;
        this.matrixBufferCount = matrixBufferCount;
        this.categoryCount = categoryCount;

//        Logger.getLogger("beagle").info("Constructing double-precision Java BEAGLE implementation.");

        if (patternCount < 1) {
            throw new IllegalArgumentException("Pattern count must be at least 1");
        }

        if (categoryCount < 1) {
            throw new IllegalArgumentException("Category count must be at least 1");
        }

        cMatrices = new double[eigenBufferCount][stateCount * stateCount * stateCount];

        eigenValues = new double[eigenBufferCount][stateCount];

        stateFrequencies = new double[eigenBufferCount][stateCount];

        categoryWeights = new double[eigenBufferCount][categoryCount];
        categoryRates = new double[categoryCount];

        partialsSize = patternCount * stateCount * categoryCount;

        patternWeights = new double[patternCount];

        tipStates = new int[compactBufferCount][];
        partials = new double[partialsBufferCount][];
        for (int i = 0; i < partialsBufferCount; i++) {
            partials[i] = new double[partialsSize];
        }

        if (SCALING) {
            // create the scaling factor accumulation counts.
            // These mirror each partials buffer
            scalingFactorCounts = new int[partialsBufferCount][];
            for (int i = 0; i < partialsBufferCount; i++) {
                scalingFactorCounts[i] = new int[SCALING_FACTOR_COUNT];
            }

            // Create the scaling factor look up tables. These
            // could be statics I guess.
            scalingFactors = new double[SCALING_FACTOR_COUNT];
            logScalingFactors = new double[SCALING_FACTOR_COUNT];
            int exponent = -126;
            for (int i = 0; i < SCALING_FACTOR_COUNT; i++) {
                scalingFactors[i] = Math.pow(2.0, exponent);
                logScalingFactors[i] = Math.log(scalingFactors[i]);
                exponent ++;
            }
        }

        tmpPartials = new double[patternCount * stateCount];

        matrixSize = stateCount * stateCount;

        matrices = new double[matrixBufferCount][categoryCount * matrixSize];
    }

    public void finalize() throws Throwable {
        super.finalize();
    }

    public void setPatternWeights(final double[] patternWeights) {
        System.arraycopy(patternWeights, 0, this.patternWeights, 0, this.patternWeights.length);
    }

    @Override
    public void setPatternPartitions(int partitionCount, int[] patternPartitions) {
        throw new UnsupportedOperationException("Not implemented yet");
    }
    /**
     * Sets partials for a tip - these are numbered from 0 and remain
     * constant throughout the run.
     *
     * @param tipIndex the tip index
     * @param states   an array of patternCount state indices
     */
    public void setTipStates(int tipIndex, int[] states) {
        assert(tipIndex >= 0 && tipIndex < tipCount);
        if (this.tipStates[tipIndex] == null) {
            tipStates[tipIndex] = new int[patternCount];
        }
        int k = 0;
        for (int state : states) {
            this.tipStates[tipIndex][k] = (state < stateCount ? state : stateCount);
            k++;
        }

    }

    public void getTipStates(int tipIndex, int[] states) {
        assert(tipIndex >= 0 && tipIndex < tipCount);
        if (this.tipStates[tipIndex] == null) {
            throw new RuntimeException("Unset tip states");
        }
        System.arraycopy(this.tipStates[tipIndex], 0, states, 0, states.length);
    }

    public void setTipPartials(int tipIndex, double[] inPartials) {
        assert(tipIndex >= 0 && tipIndex < tipCount);
        if (this.partials[tipIndex] == null) {
            this.partials[tipIndex] = new double[partialsSize];
        }
        int k = 0;
        for (int i = 0; i < categoryCount; i++) {
            System.arraycopy(inPartials, 0, this.partials[tipIndex], k, inPartials.length);
            k += inPartials.length;
        }
    }

    public void setRootPrePartials(int[] inbufferIndices, int[] instateFrequenciesIndices, int count){
        if(count == 1){
            int stateFrequenciesIndex = instateFrequenciesIndices[0];
            int bufferIndex = inbufferIndices[0];
            if (this.partials[bufferIndex] == null){
                this.partials[bufferIndex] = new double[partialsSize];
            }
            int k = 0;
            for(int i = 0; i < categoryCount; i++){
                for(int j = 0; j < patternCount; j++){
                    System.arraycopy(this.stateFrequencies[stateFrequenciesIndex], 0, this.partials[bufferIndex], k, stateCount);
                    k += stateCount;
                }
            }
        }
    }

    public void setPartials(final int bufferIndex, final double[] partials) {
        assert(this.partials[bufferIndex] != null);
        System.arraycopy(partials, 0, this.partials[bufferIndex], 0, partialsSize);
    }

    public void getPartials(final int bufferIndex, final int scaleIndex, final double[] partials) {
        System.arraycopy(this.partials[bufferIndex], 0, partials, 0, partialsSize);
    }

    @Override
    public void getLogScaleFactors(int scaleIndex, double[] outFactors) {
        throw new UnsupportedOperationException("Not implemented. Email Marc Suchard if required (offer coauthorship for enhanced service)");
    }

    public void getScaleFactors(final int scaleIndex, final double[] partials) {
        throw new RuntimeException("Not yet implemented.");
    }

    public void setEigenDecomposition(int eigenIndex, double[] eigenVectors, double[] inverseEigenValues, double[] eigenValues) {
        int l =0;
        for (int i = 0; i < stateCount; i++) {
            for (int j = 0; j < stateCount; j++) {
                for (int k = 0; k < stateCount; k++) {
                    cMatrices[eigenIndex][l] = eigenVectors[(i * stateCount) + k] * inverseEigenValues[(k * stateCount) + j];
                    l++;
                }
            }
        }
        System.arraycopy(eigenValues, 0, this.eigenValues[eigenIndex], 0, eigenValues.length);
    }

    public void setStateFrequencies(final int stateFrequenciesIndex, final double[] stateFrequencies) {
        System.arraycopy(stateFrequencies, 0, this.stateFrequencies[stateFrequenciesIndex], 0, stateCount);
    }

    public void setCategoryWeights(final int categoryWeightsIndex, final double[] categoryWeights) {
        System.arraycopy(categoryWeights, 0, this.categoryWeights[categoryWeightsIndex], 0, categoryCount);
    }

    public void setCategoryRates(double[] categoryRates) {
        System.arraycopy(categoryRates, 0, this.categoryRates, 0, this.categoryRates.length);
    }

    public void setCategoryRatesWithIndex(final int categoryRatesIndex, double[] categoryRates) {
        throw new UnsupportedOperationException("setCategoryRatesWithIndex not implemented in GeneralBeagleImpl");
    }

    public void setTransitionMatrix(final int matrixIndex, final double[] inMatrix, final double paddedValue) {
        System.arraycopy(inMatrix, 0, this.matrices[matrixIndex], 0, this.matrixSize);
    }

    public void setDifferentialMatrix(final int matrixIndex, final double[] inMatrix) {
    	setTransitionMatrix(matrixIndex, inMatrix, 0.0);
    }

    public void getTransitionMatrix(final int matrixIndex, final double[] outMatrix) {
        System.arraycopy(this.matrices[matrixIndex],0,outMatrix,0,outMatrix.length);
    }

	// /////////////////////////
	// ---TODO: Epoch model---//
	// /////////////////////////
    public void convolveTransitionMatrices(
            final int[] firstIndices,
            final int[] secondIndices,
            final int[] resultIndices,
            int matrixCount) {

		for (int u = 0; u < matrixCount; u++) {

			  int firstIndex = firstIndices[u];
			  int secondIndex = secondIndices[u];
			  int resultIndex = resultIndices[u];

			     if (DEBUG) {
			    	 System.err.println("Convolving matrix " + firstIndex + " with matrix  " + secondIndex + " into " + resultIndex);
			    	 }

			for (int l = 0; l < categoryCount; l++) {

				for (int i = 0; i < stateCount; i++) {
					for (int j = 0; j < stateCount; j++) {

						for (int k = 0; k < stateCount; k++) {

//							sum +=

						}//END: k loop

					}// END: j loop
				}// END: i loop
			}// /END: l loop

		}// END: u loop

	}// END: convolveTransitionMatrices

    public void addTransitionMatrices(
            final int[] firstIndices,
            final int[] secondIndices,
            final int[] resultIndices,
            int matrixCount) {
        throw new RuntimeException("Not yet implemented");
    }

	public void transposeTransitionMatrices(final int[] inIndices,
											final int[] outIndices,
											int matrixCount) {
		throw new RuntimeException("Not yet implemented");
	}

    public void updateTransitionMatrices(final int eigenIndex,
                                         final int[] probabilityIndices,
                                         final int[] firstDerivativeIndices,
                                         final int[] secondDervativeIndices,
                                         final double[] edgeLengths,
                                         final int count) {
        for (int u = 0; u < count; u++) {
            int matrixIndex = probabilityIndices[u];

            if (DEBUG) System.err.println("Updating matrix for node " + matrixIndex);

            double[] tmp = new double[stateCount];

            int n = 0;
            for (int l = 0; l < categoryCount; l++) {
//	    if (DEBUG) System.err.println("1: Rate "+l+" = "+categoryRates[l]);
                for (int i = 0; i < stateCount; i++) {
                    tmp[i] =  Math.exp(eigenValues[eigenIndex][i] * edgeLengths[u] * categoryRates[l]);
                }
//            if (DEBUG) System.err.println(new dr.math.matrixAlgebra.Vector(tmp));
                //        if (DEBUG) System.exit(-1);

                int m = 0;
                for (int i = 0; i < stateCount; i++) {
                    for (int j = 0; j < stateCount; j++) {
                        double sum = 0.0;
                        for (int k = 0; k < stateCount; k++) {
                            sum += cMatrices[eigenIndex][m] * tmp[k];
                            m++;
                        }
                        //	    if (DEBUG) System.err.println("1: matrices[][]["+n+"] = "+sum);
                        if (sum > 0)
                            matrices[matrixIndex][n] = sum;
                        else
                            matrices[matrixIndex][n] = 0; // TODO Decision: set to -sum (as BEAST does)
                        n++;
                    }
                }

//            if (DEBUG) System.err.println(new dr.math.matrixAlgebra.Vector(matrices[currentMatricesIndices[nodeIndex]][nodeIndex]));
//            if (DEBUG) System.exit(0);
            }
        }
    }

    public void updateTransitionMatricesWithMultipleModels(
                                         final int[] eigenIndices,
                                         final int[] categoryRateIndices,
                                         final int[] probabilityIndices,
                                         final int[] firstDerivativeIndices,
                                         final int[] secondDervativeIndices,
                                         final double[] edgeLengths,
                                         final int count) {
        throw new UnsupportedOperationException("updateTransitionMatricesWithMultipleModels not implemented in GeneralBeagleImpl");
    }

    /**
     * Operations list is a list of 7-tuple integer indices, with one 7-tuple per operation.
     * Format of 7-tuple operation: {destinationPartials,
     *                               destinationScaleWrite,
     *                               destinationScaleRead,
     *                               child1Partials,
     *                               child1TransitionMatrix,
     *                               child2Partials,
     *                               child2TransitionMatrix}
     *
     */
    public void updatePartials(final int[] operations, final int operationCount, final int cumulativeScaleIndex) {

        int x = 0;
        for (int op = 0; op < operationCount; op++) {
            int bufferIndex3 = operations[x];
            int bufferIndex1 = operations[x + 3];
            int matrixIndex1 = operations[x + 4];
            int bufferIndex2 = operations[x + 5];
            int matrixIndex2 = operations[x + 6];

            x += Beagle.OPERATION_TUPLE_SIZE;

            int exponent = 0;

            if (compactBufferCount == 0) {
                exponent = updatePartialsPartials(bufferIndex1, matrixIndex1, bufferIndex2, matrixIndex2, bufferIndex3);
            } else {
                if (bufferIndex1 < tipCount && tipStates[bufferIndex1] != null) {
                    if (bufferIndex2 < tipCount && tipStates[bufferIndex2] != null) {
                        exponent = updateStatesStates(bufferIndex1, matrixIndex1, bufferIndex2, matrixIndex2, bufferIndex3);
                    } else {
                        exponent = updateStatesPartials(bufferIndex1, matrixIndex1, bufferIndex2, matrixIndex2, bufferIndex3);
                    }
                } else {
                    if (bufferIndex2 < tipCount && tipStates[bufferIndex2] != null) {
                        exponent = updateStatesPartials(bufferIndex2, matrixIndex2, bufferIndex1, matrixIndex1, bufferIndex3);
                    } else {
                        exponent = updatePartialsPartials(bufferIndex1, matrixIndex1, bufferIndex2, matrixIndex2, bufferIndex3);
                    }
                }
            }

            if (SCALING) {
                if (exponent > SCALING_EXPONENT_THRESHOLD) {
                    rescalePartials(bufferIndex3);
                }
            }
        }
    }

    /**
     * Operations list is a list of 7-tuple integer indices, with one 7-tuple per operation.
     * Format of 7-tuple operation: {destinationPartials,
     *                               destinationScaleWrite,
     *                               destinationScaleRead,
     *                               pre-order partials of the parent node,
     *                               Ptr matrices of the current node,
     *                               post-order partials of the sibling node,
     *                               Ptr matrices of the sibling node}
     *
     */
    public void updatePrePartials(final int[] operations, final int operationCount, final int cumulativeScaleIndex) {

        int x = 0;
        for (int op = 0; op < operationCount; op++) {
            int bufferIndex3 = operations[x];
            int bufferIndex1 = operations[x + 3];
            int matrixIndex1 = operations[x + 4];
            int bufferIndex2 = operations[x + 5];
            int matrixIndex2 = operations[x + 6];

            x += Beagle.OPERATION_TUPLE_SIZE;

            int exponent = 0;

            exponent = updatePrePartialsPartials(bufferIndex1, matrixIndex1, bufferIndex2, matrixIndex2, bufferIndex3);

            if (SCALING) {
                if (exponent > SCALING_EXPONENT_THRESHOLD) {
                    rescalePartials(bufferIndex3);
                }
            }
        }
    }

    public void updatePrePartialsByPartition(final int[] operations, final int operationCount) {
        throw new BeagleException("updatePrePartialsByPartition", -1);
    }

	@Override
    public void calculateEdgeDifferentials(final int[] postBufferIndices,
                                           final int[] preBufferIndices,
                                           final int[] derivativeMatrixIndices,
                                           final int[] categoryWeightsIndices,
                                           int count,
                                           double[] outDerivatives,
                                           double[] outSumDerivatives,
                                           double[] outSumSquaredDerivatives) {
		throw new RuntimeException("Not yet implemented");
    }

	@Override
    public void calculateCrossProductDifferentials(final int[] postBufferIndices,
                                           		   final int[] preBufferIndices,
                                           		   final int[] categoryRateIndices,
                                           		   final int[] categoryWeightsIndices,
                                           		   final double[] edgeLengths,
                                           		   int count,
                                           		   double[] outSumDerivatives,
                                           		   double[] outSumSquaredDerivatives) {
		throw new RuntimeException("Not yet implemented");
    }

    @Override
    public void calculateEdgeDerivative(int[] postBufferIndices,
    									int[] preBufferIndices,
    									int rootBufferIndex,
    									int[] firstDerivativeIndices,
    									int[] secondDerivativeIndices,
    									int categoryWeightsIndex,
    									int categoryRatesIndex,
    									int stateFrequenciesIndex,
    									int[] cumulativeScaleIndices,
    									int count,
    									double[] outFirstDerivative,
    									double[] outDiagonalSecondDerivative) {
        throw new RuntimeException("Not yet implemented");
    }

    /**
     * Operations list is a list of 9-tuple integer indices, with one 7-tuple per operation.
     * Format of 9-tuple operation: {destinationPartials,
     *                               destinationScaleWrite,
     *                               destinationScaleRead,
     *                               child1Partials,
     *                               child1TransitionMatrix,
     *                               child2Partials,
     *                               child2TransitionMatrix,
     *                               partition,
     *                               cumulativeScaleIndex}
     *
     */
    public void updatePartialsByPartition(final int[] operations, final int operationCount) {
        throw new UnsupportedOperationException("updatePartialsByPartition not implemented in GeneralBeagleImpl");
    }

    private void rescalePartials(final int bufferIndex) {

        double[] partials = this.partials[bufferIndex];
        int[] counts = scalingFactorCounts[bufferIndex];

        if (DEBUG) {
            System.err.println("rescaling buffer "+ bufferIndex);
        }

        int u = 0;
        for (int l = 0; l < categoryCount; l++) {

            for (int k = 0; k < patternCount; k++) {

                double maxValue = partials[u];

                for (int i = 1; i < stateCount; i++) {

                    if (partials[u + i] > maxValue) {
                        maxValue = partials[u + i];
                    }
                }

                // find the exponent for the largest value
                int exponent = Math.getExponent(maxValue);
                if (exponent != 0) {
                    // invert and offset it to get the index of the appropriate scale factor
                    int index = SCALING_FACTOR_OFFSET - exponent;
                    double scalingFactor = scalingFactors[index];

                    // increment the count of how many times this factor has been used
                    counts[index] += patternWeights[k];
                    if (DEBUG) {
                        System.err.println("exponent "+ exponent + ", index " + index + ", factor " + scalingFactor);
                    }

                    // do the rescaling
                    for (int i = 0; i < stateCount; i++) {
                        partials[u] *= scalingFactor;
                        u++;
                    }
                }
            }
        }
    }

    //placeholder for potential implementation
    private void rescalePartialsByPartition(final int bufferIndex) {
        throw new UnsupportedOperationException("rescalePartialsByPartition not implemented in GeneralBeagleImpl");
    }

    public void setCPUThreadCount(int threadCount) {
       throw new UnsupportedOperationException("setCPUThreadCount not implemented in GeneralBeagleImpl");
    }

    public void accumulateScaleFactors(int[] scaleIndices, int count, int outScaleIndex) {
//        throw new UnsupportedOperationException("accumulateScaleFactors not implemented in GeneralBeagleImpl");
    }

    public void removeScaleFactors(int[] scaleIndices, int count, int cumulativeScaleIndex) {
//        throw new UnsupportedOperationException("accumulateScaleFactors not implemented in GeneralBeagleImpl");
    }

    public void copyScaleFactors(int destScalingIndex, int srcScalingIndex) {
//        throw new UnsupportedOperationException("accumulateScaleFactors not implemented in GeneralBeagleImpl");
    }

    public void resetScaleFactors(int cumulativeScaleIndex) {
//        throw new UnsupportedOperationException("accumulateScaleFactors not implemented in GeneralBeagleImpl");
    }

    public void accumulateScaleFactorsByPartition(int[] scaleIndices, int count, int outScaleIndex, int partitionIndex) {
//        throw new UnsupportedOperationException("accumulateScaleFactorsByPartition not implemented in GeneralBeagleImpl");
    }

    public void removeScaleFactorsByPartition(int[] scaleIndices, int count, int cumulativeScaleIndex, int partitionIndex) {
//        throw new UnsupportedOperationException("accumulateScaleFactorsByPartition not implemented in GeneralBeagleImpl");
    }

    public void resetScaleFactorsByPartition(int cumulativeScaleIndex, int partitionIndex) {
//        throw new UnsupportedOperationException("accumulateScaleFactorsByPartition not implemented in GeneralBeagleImpl");
    }

    /**
     * Calculates partial likelihoods at a node when both children have states.
     * @returns the larges absolute exponent
     */
    protected int updateStatesStates(int bufferIndex1, int matrixIndex1, int bufferIndex2, int matrixIndex2, int bufferIndex3)
    {
        double[] matrices1 = matrices[matrixIndex1];
        double[] matrices2 = matrices[matrixIndex2];

        int[] states1 = tipStates[bufferIndex1];
        int[] states2 = tipStates[bufferIndex2];

        double[] partials3 = partials[bufferIndex3];

        if (SCALING) {
            // zero the scaling factor counts for this node (only tips below)
            int[] counts3 = scalingFactorCounts[bufferIndex3];
            for (int i = 0; i < counts3.length; i++) {
                counts3[i] = 0;
            }
        }

        int v = 0;

        for (int l = 0; l < categoryCount; l++) {

            for (int k = 0; k < patternCount; k++) {

                int state1 = states1[k];
                int state2 = states2[k];

                int w = l * matrixSize;

                if (state1 < stateCount && state2 < stateCount) {

                    for (int i = 0; i < stateCount; i++) {

                        partials3[v] = matrices1[w + state1] * matrices2[w + state2];

                        v++;
                        w += stateCount;
                    }

                } else if (state1 < stateCount) {
                    // child 2 has a gap or unknown state so treat it as unknown

                    for (int i = 0; i < stateCount; i++) {

                        partials3[v] = matrices1[w + state1];

                        v++;
                        w += stateCount;
                    }
                } else if (state2 < stateCount) {
                    // child 2 has a gap or unknown state so treat it as unknown

                    for (int i = 0; i < stateCount; i++) {

                        partials3[v] = matrices2[w + state2];

                        v++;
                        w += stateCount;
                    }
                } else {
                    // both children have a gap or unknown state so set partials to 1

                    for (int j = 0; j < stateCount; j++) {
                        partials3[v] = 1.0;
                        v++;
                    }
                }

            }
        }

        return 0; // don't bother checking exponents for cherries
    }

    /**
     * Calculates partial likelihoods at a node when one child has states and one has partials.
     */
    protected int updateStatesPartials(int bufferIndex1, int matrixIndex1, int bufferIndex2, int matrixIndex2, int bufferIndex3)
    {
        double[] matrices1 = matrices[matrixIndex1];
        double[] matrices2 = matrices[matrixIndex2];

        int[] states1 = tipStates[bufferIndex1];
        double[] partials2 = partials[bufferIndex2];

        double[] partials3 = partials[bufferIndex3];

        double sum, tmp;

        int u = 0;
        int v = 0;

        int exponent = 0;

        if (SCALING) {
            int[] counts2 = scalingFactorCounts[bufferIndex2];
            int[] counts3 = scalingFactorCounts[bufferIndex3];
            // only one internal node below so just copy those scaling factor counts
            System.arraycopy(counts2, 0, counts3, 0, counts2.length);
        }

        for (int l = 0; l < categoryCount; l++) {

            for (int k = 0; k < patternCount; k++) {

                int state1 = states1[k];

                int w = l * matrixSize;

                if (state1 < stateCount) {

                    for (int i = 0; i < stateCount; i++) {

                        tmp = matrices1[w + state1];

                        sum = 0.0;
                        for (int j = 0; j < stateCount; j++) {
                            sum += matrices2[w] * partials2[v + j];
                            w++;
                        }

                        partials3[u] = tmp * sum;

                        if (SCALING) {
                            // this is to find the largest absolute exponent
                            exponent |= Math.abs(Math.getExponent(partials3[u]));
                        }

                        u++;
                    }

                    v += stateCount;
                } else {
                    // Child 1 has a gap or unknown state so don't use it

                    for (int i = 0; i < stateCount; i++) {

                        sum = 0.0;
                        for (int j = 0; j < stateCount; j++) {
                            sum += matrices2[w] * partials2[v + j];
                            w++;
                        }

                        partials3[u] = sum;

                        if (SCALING) {
                            exponent |= Math.abs(Math.getExponent(partials3[u]));
                        }

                        u++;
                    }

                    v += stateCount;
                }
            }
        }

        return exponent;
    }

    protected int updatePartialsPartials(int bufferIndex1, int matrixIndex1, int bufferIndex2, int matrixIndex2, int bufferIndex3)
    {
        double[] matrices1 = matrices[matrixIndex1];
        double[] matrices2 = matrices[matrixIndex2];

        double[] partials1 = partials[bufferIndex1];

        double[] partials2 = partials[bufferIndex2];

        double[] partials3 = partials[bufferIndex3];

        double sum1, sum2;

        int exponent = 0;
        if (SCALING) {
            int[] counts1 = scalingFactorCounts[bufferIndex1];
            int[] counts2 = scalingFactorCounts[bufferIndex2];
            int[] counts3 = scalingFactorCounts[bufferIndex3];
            for (int i = 0; i < counts1.length; i++) {
                // The scale factor counts is the sum of the two nodes below
                counts3[i] = counts1[i] + counts2[i];
            }
        }

        int u = 0;
        int v = 0;
        for (int l = 0; l < categoryCount; l++) {

            for (int k = 0; k < patternCount; k++) {

                int w = l * matrixSize;

                for (int i = 0; i < stateCount; i++) {

                    sum1 = sum2 = 0.0;

                    for (int j = 0; j < stateCount; j++) {
                        sum1 += matrices1[w] * partials1[v + j];
                        sum2 += matrices2[w] * partials2[v + j];

                        w++;
                    }

                    partials3[u] = sum1 * sum2;

                    if (SCALING) {
                        // this is to find the largest absolute exponent
                        exponent |= Math.abs(Math.getExponent(partials3[u]));
                    }

                    u++;
                }
                v += stateCount;

            }

            if (DEBUG) {
//    	    	System.err.println("1:PP node = "+nodeIndex3);
//    	    	for(int p=0; p<partials3.length; p++) {
//    	    		System.err.println("1:PP\t"+partials3[p]);
//    	    	}
//                System.err.println("node = "+nodeIndex3);
//                System.err.println(new dr.math.matrixAlgebra.Vector(partials3));
//                System.err.println(new dr.math.matrixAlgebra.Vector(scalingFactors[currentPartialsIndices[nodeIndex3]][nodeIndex3]));
                //System.exit(-1);
            }
        }

        return exponent;
    }

    protected int updatePrePartialsPartials(int bufferIndex1, int matrixIndex1, int bufferIndex2, int matrixIndex2, int bufferIndex3)
    {
        double[] matrices1 = matrices[matrixIndex1];  // Ptr matrices of the current node
        double[] matrices2 = matrices[matrixIndex2];  // Ptr matrices of the sibling node

        double[] partials1 = partials[bufferIndex1];  // pre-order partials of the parent node

        double[] partials2 = partials[bufferIndex2];  // post-order partials of the sibling node

        double[] partials3 = partials[bufferIndex3];  //destPartials

        double sum2, MjPj;

        int exponent = 0;
        if (SCALING) {
            int[] counts1 = scalingFactorCounts[bufferIndex1];
            int[] counts2 = scalingFactorCounts[bufferIndex2];
            int[] counts3 = scalingFactorCounts[bufferIndex3];
            for (int i = 0; i < counts1.length; i++) {
                // The scale factor counts is the sum of the two nodes below
                counts3[i] = counts1[i] + counts2[i];
            }
        }

        int u = 0;
        int v = 0;
        for (int l = 0; l < categoryCount; l++) {

            for (int k = 0; k < patternCount; k++) {

                int w = l * matrixSize;

                for (int i = 0; i < stateCount; i++) {

                    sum2 = 0.0;

                    for (int j = 0; j < stateCount; j++) {
                        sum2 += matrices2[w] * partials2[v + j];
                        w++;
                    }

                    // sum2 = M_j P_j
                    // now 2nd loop

                    MjPj = sum2 * partials1[v + i];

                    w = l * matrixSize;
                    for (int j = 0; j < stateCount; j++){
                        partials3[v + j] += matrices1[w] * MjPj;
                        w++;
                    }

//                    if (SCALING) {
//                        // this is to find the largest absolute exponent
//                        exponent |= Math.abs(Math.getExponent(partials3[u]));
//                    }

                    u++;
                }
                v += stateCount;

            }

            if (DEBUG) {
//    	    	System.err.println("1:PP node = "+nodeIndex3);
//    	    	for(int p=0; p<partials3.length; p++) {
//    	    		System.err.println("1:PP\t"+partials3[p]);
//    	    	}
//                System.err.println("node = "+nodeIndex3);
//                System.err.println(new dr.math.matrixAlgebra.Vector(partials3));
//                System.err.println(new dr.math.matrixAlgebra.Vector(scalingFactors[currentPartialsIndices[nodeIndex3]][nodeIndex3]));
                //System.exit(-1);
            }
        }

        return exponent;
    }

    public void calculateRootLogLikelihoods(final int[] bufferIndices, final int[] categoryWeightsIndices, final int[] stateFrequenciesIndices, final int[] cumulativeScaleIndices, final int count, final double[] outSumLogLikelihood) {

        assert(count == 1); // @todo implement integration across multiple subtrees

        double[] rootPartials = partials[bufferIndices[0]];

        int u = 0;
        int v = 0;
        for (int k = 0; k < patternCount; k++) {

            for (int i = 0; i < stateCount; i++) {

                tmpPartials[u] = rootPartials[v] * categoryWeights[categoryWeightsIndices[0]][0];
                u++;
                v++;
            }
        }

        for (int l = 1; l < categoryCount; l++) {
            u = 0;

            for (int k = 0; k < patternCount; k++) {

                for (int i = 0; i < stateCount; i++) {

                    tmpPartials[u] += rootPartials[v] *  categoryWeights[categoryWeightsIndices[0]][l];
                    u++;
                    v++;
                }
            }
        }

        u = 0;
        outSumLogLikelihood[0] = 0.0;
        for (int k = 0; k < patternCount; k++) {

            double sum = 0.0;
            for (int i = 0; i < stateCount; i++) {

                sum += stateFrequencies[stateFrequenciesIndices[0]][i] * tmpPartials[u];
                u++;
            }

            outSumLogLikelihood[0] += Math.log(sum) * patternWeights[k];
        }

        if (SCALING) {
            int[] rootCounts = scalingFactorCounts[bufferIndices[0]];
            for (int i = 0; i < SCALING_FACTOR_COUNT; i++) {
                // we multiplied the scaling factors in so now subtract the logs
                outSumLogLikelihood[0] -= (logScalingFactors[i] * rootCounts[i]);
            }
        }

    }

    public void calculateRootLogLikelihoodsByPartition(final int[] bufferIndices, final int[] categoryWeightsIndices, final int[] stateFrequenciesIndices, final int[] cumulativeScaleIndices, final int[] partitionIndices, final int partitionCount, final int count, final double[] outSumLogLikelihoodByPartition, final double[] outSumLogLikelihood) {
        throw new UnsupportedOperationException("calculateRootLogLikelihoodsByPartition not implemented in GeneralBeagleImpl");
    }

    public void calculateEdgeLogLikelihoods(final int[] parentBufferIndices, final int[] childBufferIndices, final int[] probabilityIndices, final int[] firstDerivativeIndices, final int[] secondDerivativeIndices, final int[] categoryWeightsIndices, final int[] stateFrequenciesIndices, final int[] cumulativeScaleIndices, final int count, final double[] outSumLogLikelihood, final double[] outSumFirstDerivative, final double[] outSumSecondDerivative) {
        throw new UnsupportedOperationException("calculateEdgeLogLikelihoods not implemented in GeneralBeagleImpl");
    }

    public void getSiteLogLikelihoods(final double[] outLogLikelihoods) {
        throw new UnsupportedOperationException("getSiteLogLikelihoods not implemented in GeneralBeagleImpl");
    }

    public InstanceDetails getDetails() {
        InstanceDetails details = new InstanceDetails();
        details.setResourceNumber(0);
        details.setFlags(BeagleFlag.PRECISION_DOUBLE.getMask());
        return details;
    }

}


text:
package com.coolweather.app.model;

public class County {

	private int countyId;
	private int county_cId;
	private String countyName;
	private String countyCode;

	public int getCountyId() {
		return countyId;
	}
	public void setCountyId(int countyId) {
		this.countyId = countyId;
	}
	public String getCountyName() {
		return countyName;
	}
	public void setCountyName(String countyName) {
		this.countyName = countyName;
	}
	public String getCountyCode() {
		return countyCode;
	}
	public void setCountyCode(String countyCode) {
		this.countyCode = countyCode;
	}
	public int getCounty_cId() {
		return county_cId;
	}
	public void setCounty_cId(int county_cId) {
		this.county_cId = county_cId;
	}

}


text:
Módulo 0 - Estructura de un programa

Estructura básica de un programa

          Ya conocemos cómo manejar los datos y qué operaciones hacer con ellos. Incluso hemos visto algunas instrucciones de ejemplo.
          Llegados a este punto prácticamente podemos empezar a escribir nuestros primeros programas, pero antes es necesario conocer
          la estructura de un programa Pascal.

          Según lo que hemos aprendido, podemos dividir los programas en tres partes: cabecera, zona
          de declaraciones y  cuerpo del programa.

          En la cabecera establecemos un título identificativo para nuestro programa.

PROGRAM KilometrosAMetros ;

          En la zona de declaraciones definimos las variables y constantes que queremos usar en el programa.

VAR

kilometros, metro: INTEGER ;

          En el cuerpo del programa es donde escribimos todas las instrucciones y cálculos. Empieza con BEGIN
          y termina con END. .

BEGIN

kilometros := 14

metros := kilometros * 1000

END.

          Un programa sencillo, ¿Verdad? A partir del siguiente módulo veremos que se pueden hacer cosas muy interesantes
          con un poco de imaginación y nuevas herramientas. ¡Ahora practica y prueba lo que has aprendido realizando un test
          de autoevaluación!

     Variables y constantes <fa name="hand-o-left" size="lg"></fa>
     Test autoevaluación <fa name="hand-o-right" size="lg"></fa>


text:
namespace pw::rpc::internal {

NanopbServerCall::NanopbServerCall(const LockedCallContext& context,
                                   MethodType type)
    PW_EXCLUSIVE_LOCKS_REQUIRED(rpc_lock())
    : internal::ServerCall(context, type),
      serde_(&static_cast<const internal::NanopbMethod&>(context.method())
                  .serde()) {}

Status NanopbServerCall::SendServerStream(const void* payload) {
  if (!active()) {
    return Status::FailedPrecondition();
  }
  return NanopbSendStream(*this, payload, serde_->response());
}

}  // namespace pw::rpc::internal


text:
package org.elasticsearch.index.snapshots.blobstore;

import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.Version;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.ToXContentFragment;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.store.StoreFileMetaData;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Shard snapshot metadata
 */
public class BlobStoreIndexShardSnapshot implements ToXContentFragment {

    /**
     * Information about snapshotted file
     */
    public static class FileInfo {
        private static final String UNKNOWN_CHECKSUM = "_na_";

        private final String name;
        private final ByteSizeValue partSize;
        private final long partBytes;
        private final long numberOfParts;
        private final StoreFileMetaData metadata;

        /**
         * Constructs a new instance of file info
         *
         * @param name         file name as stored in the blob store
         * @param metaData  the files meta data
         * @param partSize     size of the single chunk
         */
        public FileInfo(String name, StoreFileMetaData metaData, ByteSizeValue partSize) {
            this.name = name;
            this.metadata = metaData;

            long partBytes = Long.MAX_VALUE;
            if (partSize != null && partSize.getBytes() > 0) {
                partBytes = partSize.getBytes();
            }

            long totalLength = metaData.length();
            long numberOfParts = totalLength / partBytes;
            if (totalLength % partBytes > 0) {
                numberOfParts++;
            }
            if (numberOfParts == 0) {
                numberOfParts++;
            }
            this.numberOfParts = numberOfParts;
            this.partSize = partSize;
            this.partBytes = partBytes;
        }

        /**
         * Returns the base file name
         *
         * @return file name
         */
        public String name() {
            return name;
        }

        /**
         * Returns part name if file is stored as multiple parts
         *
         * @param part part number
         * @return part name
         */
        public String partName(long part) {
            if (numberOfParts > 1) {
                return name + ".part" + part;
            } else {
                return name;
            }
        }

        /**
         * Returns base file name from part name
         *
         * @param blobName part name
         * @return base file name
         */
        public static String canonicalName(String blobName) {
            if (blobName.contains(".part")) {
                return blobName.substring(0, blobName.indexOf(".part"));
            }
            return blobName;
        }

        /**
         * Returns original file name
         *
         * @return original file name
         */
        public String physicalName() {
            return metadata.name();
        }

        /**
         * File length
         *
         * @return file length
         */
        public long length() {
            return metadata.length();
        }

        /**
         * Returns part size
         *
         * @return part size
         */
        public ByteSizeValue partSize() {
            return partSize;
        }

        /**
         * Returns the size (in bytes) of a given part
         *
         * @return the size (in bytes) of a given part
         */
        public long partBytes(int part) {
            if (numberOfParts == 1) {
                return length();
            }
            // First and last-but-one parts have a size equal to partBytes
            if (part < (numberOfParts - 1)) {
                return partBytes;
            }
            // Last part size is deducted from the length and the number of parts
            return length() - (partBytes * (numberOfParts-1));
        }

        /**
         * Returns number of parts
         *
         * @return number of parts
         */
        public long numberOfParts() {
            return numberOfParts;
        }

        /**
         * Returns file md5 checksum provided by {@link org.elasticsearch.index.store.Store}
         *
         * @return file checksum
         */
        public String checksum() {
            return metadata.checksum();
        }

        /**
         * Returns the StoreFileMetaData for this file info.
         */
        public StoreFileMetaData metadata() {
            return metadata;
        }

        /**
         * Checks if a file in a store is the same file
         *
         * @param md file in a store
         * @return true if file in a store this this file have the same checksum and length
         */
        public boolean isSame(StoreFileMetaData md) {
            return metadata.isSame(md);
        }

        /**
         * Checks if a file in a store is the same file
         *
         * @param fileInfo file in a store
         * @return true if file in a store this this file have the same checksum and length
         */
        public boolean isSame(FileInfo fileInfo) {
            if (numberOfParts != fileInfo.numberOfParts) {
                return false;
            }
            if (partBytes != fileInfo.partBytes) {
                return false;
            }
            if (!name.equals(fileInfo.name)) {
                return false;
            }
            if (partSize != null) {
                if (!partSize.equals(fileInfo.partSize)) {
                    return false;
                }
            } else {
                if (fileInfo.partSize != null) {
                    return false;
                }
            }
            return metadata.isSame(fileInfo.metadata);
        }

        /**
         * Checks if the checksum for the file is unknown. This only is possible on an empty shard's
         * segments_N file which was created in older Lucene versions.
         */
        public boolean hasUnknownChecksum() {
            return metadata.checksum().equals(UNKNOWN_CHECKSUM);
        }

        static final String NAME = "name";
        static final String PHYSICAL_NAME = "physical_name";
        static final String LENGTH = "length";
        static final String CHECKSUM = "checksum";
        static final String PART_SIZE = "part_size";
        static final String WRITTEN_BY = "written_by";
        static final String META_HASH = "meta_hash";

        /**
         * Serializes file info into JSON
         *
         * @param file    file info
         * @param builder XContent builder
         * @param params  parameters
         */
        public static void toXContent(FileInfo file, XContentBuilder builder, ToXContent.Params params) throws IOException {
            builder.startObject();
            builder.field(NAME, file.name);
            builder.field(PHYSICAL_NAME, file.metadata.name());
            builder.field(LENGTH, file.metadata.length());
            if (file.metadata.checksum().equals(UNKNOWN_CHECKSUM) == false) {
                builder.field(CHECKSUM, file.metadata.checksum());
            }
            if (file.partSize != null) {
                builder.field(PART_SIZE, file.partSize.getBytes());
            }

            if (file.metadata.writtenBy() != null) {
                builder.field(WRITTEN_BY, file.metadata.writtenBy());
            }

            if (file.metadata.hash() != null && file.metadata().hash().length > 0) {
                builder.field(META_HASH, file.metadata.hash());
            }
            builder.endObject();
        }

        /**
         * Parses JSON that represents file info
         *
         * @param parser parser
         * @return file info
         */
        public static FileInfo fromXContent(XContentParser parser) throws IOException {
            XContentParser.Token token = parser.currentToken();
            String name = null;
            String physicalName = null;
            long length = -1;
            String checksum = null;
            ByteSizeValue partSize = null;
            Version writtenBy = null;
            String writtenByStr = null;
            BytesRef metaHash = new BytesRef();
            if (token == XContentParser.Token.START_OBJECT) {
                while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
                    if (token == XContentParser.Token.FIELD_NAME) {
                        String currentFieldName = parser.currentName();
                        token = parser.nextToken();
                        if (token.isValue()) {
                            if (NAME.equals(currentFieldName)) {
                                name = parser.text();
                            } else if (PHYSICAL_NAME.equals(currentFieldName)) {
                                physicalName = parser.text();
                            } else if (LENGTH.equals(currentFieldName)) {
                                length = parser.longValue();
                            } else if (CHECKSUM.equals(currentFieldName)) {
                                checksum = parser.text();
                            } else if (PART_SIZE.equals(currentFieldName)) {
                                partSize = new ByteSizeValue(parser.longValue());
                            } else if (WRITTEN_BY.equals(currentFieldName)) {
                                writtenByStr = parser.text();
                                writtenBy = Lucene.parseVersionLenient(writtenByStr, null);
                            } else if (META_HASH.equals(currentFieldName)) {
                                metaHash.bytes = parser.binaryValue();
                                metaHash.offset = 0;
                                metaHash.length = metaHash.bytes.length;
                            } else {
                                throw new ElasticsearchParseException("unknown parameter [{}]", currentFieldName);
                            }
                        } else {
                            throw new ElasticsearchParseException("unexpected token  [{}]", token);
                        }
                    } else {
                        throw new ElasticsearchParseException("unexpected token [{}]",token);
                    }
                }
            }

            // Verify that file information is complete
            if (name == null || Strings.validFileName(name) == false) {
                throw new ElasticsearchParseException("missing or invalid file name [" + name + "]");
            } else if (physicalName == null || Strings.validFileName(physicalName) == false) {
                throw new ElasticsearchParseException("missing or invalid physical file name [" + physicalName + "]");
            } else if (length < 0) {
                throw new ElasticsearchParseException("missing or invalid file length");
            } else if (writtenBy == null) {
                throw new ElasticsearchParseException("missing or invalid written_by [" + writtenByStr + "]");
            } else if (checksum == null) {
                throw new ElasticsearchParseException("missing checksum for name [" + name + "]");
            }
            return new FileInfo(name, new StoreFileMetaData(physicalName, length, checksum, writtenBy, metaHash), partSize);
        }

        @Override
        public String toString() {
            return "[name: " + name +
                       ", numberOfParts: " + numberOfParts +
                       ", partSize: " + partSize +
                       ", partBytes: " + partBytes +
                       ", metadata: " + metadata + "]";
        }
    }

    private final String snapshot;

    private final long indexVersion;

    private final long startTime;

    private final long time;

    private final int numberOfFiles;

    private final long totalSize;

    private final List<FileInfo> indexFiles;

    /**
     * Constructs new shard snapshot metadata from snapshot metadata
     *
     * @param snapshot      snapshot id
     * @param indexVersion  index version
     * @param indexFiles    list of files in the shard
     * @param startTime     snapshot start time
     * @param time          snapshot running time
     * @param numberOfFiles number of files that where snapshotted
     * @param totalSize     total size of all files snapshotted
     */
    public BlobStoreIndexShardSnapshot(String snapshot, long indexVersion, List<FileInfo> indexFiles, long startTime, long time,
                                       int numberOfFiles, long totalSize) {
        assert snapshot != null;
        assert indexVersion >= 0;
        this.snapshot = snapshot;
        this.indexVersion = indexVersion;
        this.indexFiles = Collections.unmodifiableList(new ArrayList<>(indexFiles));
        this.startTime = startTime;
        this.time = time;
        this.numberOfFiles = numberOfFiles;
        this.totalSize = totalSize;
    }

    /**
     * Special constructor for the prototype
     */
    private BlobStoreIndexShardSnapshot() {
        this.snapshot = "";
        this.indexVersion = 0;
        this.indexFiles = Collections.emptyList();
        this.startTime = 0;
        this.time = 0;
        this.numberOfFiles = 0;
        this.totalSize = 0;
    }

    /**
     * Returns index version
     *
     * @return index version
     */
    public long indexVersion() {
        return indexVersion;
    }

    /**
     * Returns snapshot id
     *
     * @return snapshot id
     */
    public String snapshot() {
        return snapshot;
    }

    /**
     * Returns list of files in the shard
     *
     * @return list of files
     */
    public List<FileInfo> indexFiles() {
        return indexFiles;
    }

    /**
     * Returns snapshot start time
     */
    public long startTime() {
        return startTime;
    }

    /**
     * Returns snapshot running time
     */
    public long time() {
        return time;
    }

    /**
     * Returns number of files that where snapshotted
     */
    public int numberOfFiles() {
        return numberOfFiles;
    }

    /**
     * Returns total size of all files that where snapshotted
     */
    public long totalSize() {
        return totalSize;
    }

    private static final String NAME = "name";
    private static final String INDEX_VERSION = "index_version";
    private static final String START_TIME = "start_time";
    private static final String TIME = "time";
    private static final String NUMBER_OF_FILES = "number_of_files";
    private static final String TOTAL_SIZE = "total_size";
    private static final String FILES = "files";

    private static final ParseField PARSE_NAME = new ParseField("name");
    private static final ParseField PARSE_INDEX_VERSION = new ParseField("index_version", "index-version");
    private static final ParseField PARSE_START_TIME = new ParseField("start_time");
    private static final ParseField PARSE_TIME = new ParseField("time");
    private static final ParseField PARSE_NUMBER_OF_FILES = new ParseField("number_of_files");
    private static final ParseField PARSE_TOTAL_SIZE = new ParseField("total_size");
    private static final ParseField PARSE_FILES = new ParseField("files");

    /**
     * Serializes shard snapshot metadata info into JSON
     *
     * @param builder  XContent builder
     * @param params   parameters
     */
    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        builder.field(NAME, snapshot);
        builder.field(INDEX_VERSION, indexVersion);
        builder.field(START_TIME, startTime);
        builder.field(TIME, time);
        builder.field(NUMBER_OF_FILES, numberOfFiles);
        builder.field(TOTAL_SIZE, totalSize);
        builder.startArray(FILES);
        for (FileInfo fileInfo : indexFiles) {
            FileInfo.toXContent(fileInfo, builder, params);
        }
        builder.endArray();
        return builder;
    }

    /**
     * Parses shard snapshot metadata
     *
     * @param parser parser
     * @return shard snapshot metadata
     */
    public static BlobStoreIndexShardSnapshot fromXContent(XContentParser parser) throws IOException {
        String snapshot = null;
        long indexVersion = -1;
        long startTime = 0;
        long time = 0;
        int numberOfFiles = 0;
        long totalSize = 0;

        List<FileInfo> indexFiles = new ArrayList<>();
        if (parser.currentToken() == null) { // fresh parser? move to the first token
            parser.nextToken();
        }
        XContentParser.Token token = parser.currentToken();
        if (token == XContentParser.Token.START_OBJECT) {
            while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
                if (token == XContentParser.Token.FIELD_NAME) {
                    String currentFieldName = parser.currentName();
                    token = parser.nextToken();
                    if (token.isValue()) {
                        if (PARSE_NAME.match(currentFieldName, parser.getDeprecationHandler())) {
                            snapshot = parser.text();
                        } else if (PARSE_INDEX_VERSION.match(currentFieldName, parser.getDeprecationHandler())) {
                            // The index-version is needed for backward compatibility with v 1.0
                            indexVersion = parser.longValue();
                        } else if (PARSE_START_TIME.match(currentFieldName, parser.getDeprecationHandler())) {
                            startTime = parser.longValue();
                        } else if (PARSE_TIME.match(currentFieldName, parser.getDeprecationHandler())) {
                            time = parser.longValue();
                        } else if (PARSE_NUMBER_OF_FILES.match(currentFieldName, parser.getDeprecationHandler())) {
                            numberOfFiles = parser.intValue();
                        } else if (PARSE_TOTAL_SIZE.match(currentFieldName, parser.getDeprecationHandler())) {
                            totalSize = parser.longValue();
                        } else {
                            throw new ElasticsearchParseException("unknown parameter [{}]", currentFieldName);
                        }
                    } else if (token == XContentParser.Token.START_ARRAY) {
                        if (PARSE_FILES.match(currentFieldName, parser.getDeprecationHandler())) {
                            while ((parser.nextToken()) != XContentParser.Token.END_ARRAY) {
                                indexFiles.add(FileInfo.fromXContent(parser));
                            }
                        } else {
                            throw new ElasticsearchParseException("unknown parameter [{}]", currentFieldName);
                        }
                    } else {
                        throw new ElasticsearchParseException("unexpected token  [{}]", token);
                    }
                } else {
                    throw new ElasticsearchParseException("unexpected token [{}]", token);
                }
            }
        }
        return new BlobStoreIndexShardSnapshot(snapshot, indexVersion, Collections.unmodifiableList(indexFiles),
                                               startTime, time, numberOfFiles, totalSize);
    }
}


text:
workload_folder=`dirname "$0"`
workload_folder=`cd "$workload_folder"; pwd`
workload_root=${workload_folder}/..
. "${workload_root}/../../bin/functions/load-bench-config.sh"

# generate seed data1 by hive
enter_bench HadoopPrepareDatafile1 ${workload_root} ${workload_folder}
show_bannar start

rmr-hdfs $STREAMING_DATA_DIR || true
echo -e "${On_Blue}Pages:${PAGES}, USERVISITS:${USERVISITS}${Color_Off}"

OPTION="-t hive \
        -b ${STREAMING_DATA_DIR} \
        -n ${STREAMING_DATA1_NAME} \
        -m ${NUM_MAPS} \
        -r ${NUM_REDS} \
        -p ${PAGES} \
        -v ${USERVISITS}"

START_TIME=`timestamp`
run-hadoop-job ${DATATOOLS} HiBench.DataGen ${OPTION} ${DATATOOLS_COMPRESS_OPT}
END_TIME=`timestamp`
SIZE="0"

show_bannar finish
leave_bench

# generate seed data2 by kmeans
enter_bench HadoopPrepareDatafile2 ${workload_root} ${workload_folder}
show_bannar start

rmr-hdfs $STREAMING_DATA2_SAMPLE_DIR || true
OPTION="-sampleDir ${STREAMING_DATA2_SAMPLE_DIR} -clusterDir ${STREAMING_DATA2_CLUSTER_DIR} -numClusters ${NUM_OF_CLUSTERS} -numSamples ${NUM_OF_SAMPLES} -samplesPerFile ${SAMPLES_PER_INPUTFILE} -sampleDimension ${DIMENSIONS} -textOutput"
export HADOOP_CLASSPATH=`${MAHOUT_HOME}/bin/mahout classpath`
export_withlog HADOOP_CLASSPATH
run-hadoop-job ${DATATOOLS} org.apache.mahout.clustering.kmeans.GenKMeansDataset -D hadoop.job.history.user.location=${STREAMING_DATA2_SAMPLE_DIR} ${OPTION}
END_TIME=`timestamp`

show_bannar finish
leave_bench


text:
#pragma once

/**
 *  @file ReadbackBufferDX12.h
 *  @date May 14, 2016
 *  @author Jeremiah
 *
 *  @brief A Readback buffer can be used to read the data from a GPU buffer.
 */

#include "../ReadbackBuffer.h"
#include "BufferDX12.h"

namespace Graphics
{
    class ReadbackBufferDX12 : public BufferDX12, public virtual ReadbackBuffer
    {
    public:
        ReadbackBufferDX12( std::shared_ptr<DeviceDX12> device, size_t bufferSize );
        virtual ~ReadbackBufferDX12();

        virtual void SetName( const std::wstring& name ) override
        {
            BufferDX12::SetName( name );
        }

        virtual ResourceState GetResourceState() const
        {
            return BufferDX12::GetResourceState();
        }

        /**
        * To read the content of a GPU buffer, you must first copy the default GPU buffer
        * into a readback buffer using CopyCommandBuffer::CopyResource. After copying the source
        * buffer into a readback buffer, the contents of the readback buffer can be
        * read using GetData.
        * @param dstBuffer A CPU buffer that is large enough to store the contents of the
        * readback buffer. It is up to the application to ensure there is enough space
        * to copy the contents of the readback buffer.
        * @param offset The offset in bytes to start reading from.
        * @param size The number of bytes to read. By default, the entire buffer is read.
        */
        virtual void GetData( void* dstBuffer, size_t offset = 0, size_t size = std::numeric_limits<size_t>::max() ) const override;

    protected:

    private:
        size_t m_BufferSize;

    };
}


text:
using System.Collections.Generic;
using System.Linq;

namespace StackExchange.Opserver
{
    public class CloudFlareSettings : Settings<CloudFlareSettings>
    {
        public override bool Enabled => Email.HasValue() && APIKey.HasValue();
        public List<DataCenter> DataCenters { get; set; } = new List<DataCenter>();

        /// <summary>
        /// Email for the CloudFlare account
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// APIKey for the CloudFlare account
        /// </summary>
        public string APIKey { get; set; }

        public class DataCenter : ISettingsCollectionItem
        {
            /// <summary>
            /// The name for this data center
            /// </summary>
            public string Name { get; set; }

            /// <summary>
            /// The IP ranges for this data center, in CIDR format
            /// </summary>
            public List<string> Ranges { get; set; } = new List<string>();

            /// <summary>
            /// The masked IP ranges for this data center, in CIDR format
            /// </summary>
            public List<string> MaskedRanges { get; set; } = new List<string>();
        }
    }
}