text:
(Key:

 - `[x]` available in data protocol/documented in spec and implemented
 - `[-]` available in data protocol/documented in spec but *not* yet implemented
 - `[?]` unknown whether available in data protocol/documented in spec; *not* yet implemented
 - `*[ ]` TODO: needs implementation!
 - `[ ]` unavailable in data protocol and/or not documented in spec and not yet implemented)

### Required if Present

#### Basals

  - `[x]` scheduled basal
    - `[x]` basal rate intervals with a start time, duration, and rate delivered
    - `[ ]` name of basal schedule on each scheduled basal rate interval
    - `[?]` if basal schedule is a single (flat) rate all day, pump records a new basal rate interval every midnight
  - `[x]` manual temp basal
    - `[x]` basal rate intervals with a start time, duration, and rate delivered
    - `[x]` object representing suppressed scheduled basal *for each segment of the basal schedule that the temp basal intersects*
  - `[x]` percentage temp basal
    - `[x]` basal rate intervals with a start time, duration, percent
        - `[x]` rate provided directly OR
        - `[ ]` rate computed from percent x suppressed.rate
    - `[x]` object representing suppressed scheduled basal *for each segment of the basal schedule that the temp basal intersects*
  - `[x]` "suspended" basals (see [status - suspends & resumes](#device-events) below)
    - `[x]` basal interval with a start time and duration but no rate (b/c suspended)
    - `[x]` object representing suppressed scheduled basal *for each segment of the basal schedule that the suspension of insulin delivery intersects*
  - `[x]` final (most recent) basal
    - `[x]` basal rate interval with a start time, duration "guessed" from settings, rate delivered, and an annotation re: the "guessed" duration OR
    - `[ ]` basal rate interval with a start time and rate, no (= zero) duration

Device-specific? (Add any device-specific notes/additions here.)

#### Boluses

  - `[x]` normal bolus
    - `[x]` amount of insulin delivered
    - `[x]` amount of insulin delivery programmed (if differs from actual delivery, in case of bolus interruption, cancellation, etc.)
  - `[x]` extended bolus
    - `[x]` amount of insulin delivered
    - `[x]` duration of insulin delivery
    - `[x]` amount of insulin delivery programmed (if differs from actual delivery, in case of bolus interruption, cancellation, etc.)
    - `[x]` duration of insulin delivery programmed (if differs from actual duration, in case of bolus interruption, cancellation, etc.)
    - `*[-]` extended bolus that crosses midnight is split into two records
  - `[x]` combo/dual bolus
    - `[x]` amount of insulin delivered - immediate (normal)
    - `[x]` amount of insulin delivered - extended
    - `[x]` duration of extended insulin delivery
    - `[x]` amount of immediate insulin delivery programmed (if differs from actual delivery, in case of bolus interruption, cancellation, etc.)
    - `[x]` amount of extended insulin delivery programmed (if differs from actual delivery, in case of bolus interruption, cancellation, etc.)
    - `[x]` duration of extended insulin delivery programmed (if differs from actual duration, in case of bolus interruption, cancellation, etc.)
    - `*[-]` extended portion of combo bolus that crosses midnight is split into two records
  - bolus cancellations/interruptions
    - `[x]` represented by a separate event in the device's data log OR
    - `[ ]` result in modifications to a bolus event in the device's data log
  - `[x]` link to "wizard"/calculator entry (via log entry ID or similar)

No Tidepool data model yet:

  - bolus cancellations/interruptions
    - `[ ]` agent/reason for bolus cancellation

Device-specific? (Add any device-specific notes/additions here.)

#### CBG

(See [the CGM checklist](CGMChecklist.md) instead.)

#### Device Events

  - alarms:
    - `[x]` low insulin
    - `[x]` no insulin
        - `[x]` needed to infer a suspend (stoppage of all insulin delivery)
    - `[ ]` low power
    - `[ ]` no power
        - `[ ]` needed to infer a suspend (stoppage of all insulin delivery)
    - `[x]` occlusion
        - `[x]` needed to infer a suspend (stoppage of all insulin delivery)
    - `[ ]` no delivery
        - `[ ]` needed to infer a suspend (stoppage of all insulin delivery)
    - `[x]` auto-off
        - `[x]` needed to infer a suspend (stoppage of all insulin delivery)
    - `[ ]` over limit (i.e., max bolus exceeded through override)
    - `[x]` other alarm types (details to be provided in `payload` object)
  - `[ ]` prime events
    - `[ ]` prime target = tubing
    - `[ ]` prime target = cannula
    - `[ ]` prime targets not differentiated
    - `[ ]` prime volume in units of insulin
  - `[x]` reservoir change (or reservoir rewind)
    - `[ ]` needed to infer a suspend (stoppage of all insulin delivery)
  - `[x]` status events (i.e., suspend & resume)
    - `[ ]` suspensions of insulin delivery are represented as (interval) events with a duration OR
    - `[x]` suspensions of insulin delivery are represented as pairs of point-in-time events: a suspension and a resumption
    - `[ ]` reason/agent of suspension (`automatic` or `manual`)
    - `[ ]` reason/agent of resumption (`automatic` or `manual`)
  - calibrations: see [the CGM checklist](CGMChecklist.md) instead
  - `[x]` time changes (presence of which is also in the [BtUTC section](#bootstrapping-to-utc) below)
    - `[x]` device display time `from` (before change) and `to` (result of change)
    - `[x]` agent of change (`automatic` or `manual`)
    - `[ ]` timezone
    - `[ ]` reason for change (read from device)

Device-specific? (Add any device-specific notes/additions here.)

#### SMBG

  - `[x]` blood glucose value
  - `[x]` subType (`linked` or `manual`)
  - `[ ]` units of value (read from device, not hard-coded)
  - `[x]` out-of-range values (LO or HI)
  - `[x]` out-of-range value thresholds (e.g., often 20 for low and 600 for high on BGMs)

No Tidepool data model yet:

  - `[-]` meal tag (i.e., pre- or post-meal)
  - `[-]` other/freeform tags
  - `[-]` categorization of value according to BG target(s) from settings

Device-specific? (Add any device-specific notes/additions here.)

#### Settings

  - `[x]` basal schedules
    - `[x]` name of basal schedule OR
    - `[ ]` name of settings profile
    - `[x]` each schedule as a set of objects each with a rate and a start time
  - `[x]` name of currently active basal schedule
  - `[x]` units of all blood glucose-related fields (read from device, not hard-coded)
  - `[ ]` units of all carb-related fields (read from device, not hard-coded)
  - `[x]` carb ratio(s)
    - `[ ]` name of settings profile
    - `[x]` (one or more) set(s) of objects each with a ratio (amount) and a start time
  - `[x]` insulin sensitivity factor(s)
    - `[ ]` name of settings profile
    - `[x]` (one or more) set(s) of objects each with an amount and a start time
  - `[x]` blood glucose target(s)
    - `[ ]` name of settings profile
    - `[x]` (one or more) set(s) of objects each with a target and a start time
    - target shape:
        - `[ ]` shape `{low: 80, high: 120}` OR
        - `[ ]` shape `{target: 100}` OR
        - `[ ]` shape `{target: 100, range: 20}` OR
        - `[x]` shape `{target: 100, high: 120}`

Settings history:

  - `[ ]` device stores all changes to settings OR
  - `[x]` device only returns current settings at time of upload

No Tidepool data model yet:

  - `[-]` low insulin alert threshold
  - auto-off:
    - `[-]` enabled
    - `[-]` threshold
  - `[-]` language
  - reminders:
    - `[-]` BG reminder
    - `[ ]` bolus reminder
  - `[-]` alert settings (volume or vibration-only; whether enabled)
  - basal features:
    - `[-]` temp basal type (`manual` or `percentage`)
    - `[-]` max basal (as a u/hr rate)
  - bolus features:
    - `[-]` bolus "wizard"/calculator enabled
    - `[-]` bolus increment for non-"quick"/manual boluses
    - `[-]` extended boluses enabled
    - `[-]` extended bolus type (`manual` or `percentage`)
    - `[-]` min BG to allow calculation of bolus delivery
    - `[-]` reverse correction enabled
    - `[-]` max bolus
    - "quick"/manual bolus:
        - `[ ]` enabled
        - `[ ]` increment
  - `[-]` insulin action time
  - `[ ]` clock display preference (12h vs 24h format)

Device-specific? (Add any device-specific notes/additions here.)

  - `[-]` threshold for pod expiration alerts

#### Wizard

  - `[x]` recommended bolus dose
    - `[x]` recommendation for carbohydrates
    - `[x]` recommendation for correction (calculation from BG input)
    - net recommendation
        - `[ ]` net recommendation provided directly in data OR
        - `[ ]` net recommendation is just `recommended.carb` + `recommended.correction` OR
        - `[ ]` method for calculating net recommendation documented in data spec OR
        - `[x]` method for calculating net recommendation reverse-engineered from pump manuals/test data
  - `[x]` input blood glucose value
  - `[x]` carbohydrate input in grams
  - `[x]` insulin on board
  - `[x]` insulin-to-carb ratio
  - `[x]` insulin sensitivity factor (with units)
  - `[x]` blood glucose target
    - `[ ]` shape `{low: 80, high: 120}` OR
    - `[ ]` shape `{target: 100}` OR
    - `[ ]` shape `{target: 100, range: 20}` OR
    - `[x]` shape `{target: 100, high: 120}`
  - `[ ]` units of BG input and related fields (read from device, not hard-coded; related fields are `bgInput`, `bgTarget`, `insulinSensitivityFactor`)
  - `[ ]` link to bolus delivered as a result of wizard (via log entry ID or similar)

Device-specific? (Add any device-specific notes/additions here.)

The OmniPod represents programmed and actual delivered bolus amounts in terms of for-carb and for-correction buckets too, not just the suggestions. This is somewhat odd, and we don't do anything with the info (other than total up the two for programmed and delivered insulin amounts).

#### "Bootstrapping" to UTC

  - `[x]` index
    - `[ ]` UTC timestamp (*Hey, one can dream!*) OR
    - `[x]` internal timestamp or persistent log index (across device communication sessions) to order all pump events (regardless of type), independent of device display time OR
    - `[ ]` ephemeral log index (does not persist across device communication sessions) to order all pump events (regardless of type), independent of device display time
  - `[x]` date & time settings changes

Device-specific? (Add any device-specific notes/additions here.)

### No Tidepool Data Model Yet

> **NB:** You can and should add to this section if there are other data types documented in the device's data protocol specification but not part of Tidepool's data model (yet).

  - `[ ]` activity/exercise
  - `[ ]` food (e.g., from a food database built into the pump)
  - `[ ]` notes/other events


text:
package com.suscipio_solutions.consecro_mud.core.intermud.i3.server;
import com.suscipio_solutions.consecro_mud.core.Log;
import com.suscipio_solutions.consecro_mud.core.intermud.i3.packets.ImudServices;
import com.suscipio_solutions.consecro_mud.core.intermud.i3.packets.ShutdownPacket;

/**
 * The Server class is the mudlib's interface to the
 * Imaginary Mud Server.  It is responsible with knowing all
 * internal information about the server.
 * Last Update: 960921
 * @author George Reese
 * @version 1.0
 */
public class I3Server {
	static private ServerThread serverClient = null;
	static private boolean started = false;

	/**
	 * Creates a server thread if one has not yet been
	 * created.
	 * @exception DatabaseException thrown if the database is unreachable
	 * for some reason
	 * @exception ServerSecurityException thrown if an attempt to call start()
	 * is made once the server is running.
	 * @param mud the name of the mud being started
	 */
	static public void start(String mud,
							 int port,
							 ImudServices imud)
	{
		try
		{
			if( started )
			{
				throw new ServerSecurityException("Illegal attempt to start Server.");
			}
			started = true;
			serverClient = new ServerThread(mud, port, imud);
			Log.sysOut("I3Server", "InterMud3 Core (c)1996 George Reese");
			serverClient.start();
		}
		catch(final Exception e)
		{
			serverClient=null;
			Log.errOut("I3Server",e);
		}
	}

	/**
	 * Returns a distinct copy of the class identified.
	 * @exception ObjectLoadException thrown when a problem occurs loading the object
	 * @param file the name of the class being loaded
	 */
	static public ServerObject copyObject(String file) throws ObjectLoadException {
		return serverClient.copyObject(file);
	}

	static public ServerObject findObject(String file) throws ObjectLoadException {
		return serverClient.findObject(file);
	}

	static public ServerUser[] getInteractives()
	{
		return serverClient.getInteractives();
	}

	static public String getMudName()
	{
		return serverClient.getMudName();
	}

	static public int getPort()
	{
		return serverClient.getPort();
	}

	static public void shutdown()
	{
		try
		{
			try
			{
				final ShutdownPacket shutdown=new ShutdownPacket();
				shutdown.send();
			}catch(final Exception e){}
		serverClient.shutdown();
		started=false;
		}catch(final Exception e){}
	}

	static public void removeObject(ServerObject ob)
	{
		if( !ob.getDestructed() )
		{
			return;
		}
		serverClient.removeObject(ob);
	}
}

redpajama_set_name: RedPajamaGithub


text:
module Sinatra
  # A poor man's ActiveSupport::HashWithIndifferentAccess, with all the Rails-y
  # stuff removed.
  #
  # Implements a hash where keys <tt>:foo</tt> and <tt>"foo"</tt> are
  # considered to be the same.
  #
  #   rgb = Sinatra::IndifferentHash.new
  #
  #   rgb[:black]    =  '#000000' # symbol assignment
  #   rgb[:black]  # => '#000000' # symbol retrieval
  #   rgb['black'] # => '#000000' # string retrieval
  #
  #   rgb['white']   =  '#FFFFFF' # string assignment
  #   rgb[:white]  # => '#FFFFFF' # symbol retrieval
  #   rgb['white'] # => '#FFFFFF' # string retrieval
  #
  # Internally, symbols are mapped to strings when used as keys in the entire
  # writing interface (calling e.g. <tt>[]=</tt>, <tt>merge</tt>). This mapping
  # belongs to the public interface. For example, given:
  #
  #   hash = Sinatra::IndifferentHash.new(:a=>1)
  #
  # You are guaranteed that the key is returned as a string:
  #
  #   hash.keys # => ["a"]
  #
  # Technically other types of keys are accepted:
  #
  #   hash = Sinatra::IndifferentHash.new(:a=>1)
  #   hash[0] = 0
  #   hash # => { "a"=>1, 0=>0 }
  #
  # But this class is intended for use cases where strings or symbols are the
  # expected keys and it is convenient to understand both as the same. For
  # example the +params+ hash in Sinatra.
  class IndifferentHash < Hash
    def self.[](*args)
      new.merge!(Hash[*args])
    end

    def initialize(*args)
      args.map!(&method(:convert_value))

      super(*args)
    end

    def default(*args)
      args.map!(&method(:convert_key))

      super(*args)
    end

    def default=(value)
      super(convert_value(value))
    end

    def assoc(key)
      super(convert_key(key))
    end

    def rassoc(value)
      super(convert_value(value))
    end

    def fetch(key, *args)
      args.map!(&method(:convert_value))

      super(convert_key(key), *args)
    end

    def [](key)
      super(convert_key(key))
    end

    def []=(key, value)
      super(convert_key(key), convert_value(value))
    end

    alias_method :store, :[]=

    def key(value)
      super(convert_value(value))
    end

    def key?(key)
      super(convert_key(key))
    end

    alias_method :has_key?, :key?
    alias_method :include?, :key?
    alias_method :member?, :key?

    def value?(value)
      super(convert_value(value))
    end

    alias_method :has_value?, :value?

    def delete(key)
      super(convert_key(key))
    end

    def dig(key, *other_keys)
      super(convert_key(key), *other_keys)
    end

    def fetch_values(*keys)
      keys.map!(&method(:convert_key))

      super(*keys)
    end

    def slice(*keys)
      keys.map!(&method(:convert_key))

      self.class[super(*keys)]
    end

    def values_at(*keys)
      keys.map!(&method(:convert_key))

      super(*keys)
    end

    def merge!(*other_hashes)
      other_hashes.each do |other_hash|
        if other_hash.is_a?(self.class)
          super(other_hash)
        else
          other_hash.each_pair do |key, value|
            key = convert_key(key)
            value = yield(key, self[key], value) if block_given? && key?(key)
            self[key] = convert_value(value)
          end
        end
      end

      self
    end

    alias_method :update, :merge!

    def merge(*other_hashes, &block)
      dup.merge!(*other_hashes, &block)
    end

    def replace(other_hash)
      super(other_hash.is_a?(self.class) ? other_hash : self.class[other_hash])
    end

    def transform_values(&block)
      dup.transform_values!(&block)
    end

    def transform_values!
      super
      super(&method(:convert_value))
    end

    def transform_keys(&block)
      dup.transform_keys!(&block)
    end

    def transform_keys!
      super
      super(&method(:convert_key))
    end

    def select(*args, &block)
      return to_enum(:select) unless block_given?
      dup.tap { |hash| hash.select!(*args, &block) }
    end

    def reject(*args, &block)
      return to_enum(:reject) unless block_given?
      dup.tap { |hash| hash.reject!(*args, &block) }
    end

    def compact
      dup.tap(&:compact!)
    end if method_defined?(:compact) # Added in Ruby 2.4

    private

    def convert_key(key)
      key.is_a?(Symbol) ? key.to_s : key
    end

    def convert_value(value)
      case value
      when Hash
        value.is_a?(self.class) ? value : self.class[value]
      when Array
        value.map(&method(:convert_value))
      else
        value
      end
    end
  end
end


text:
import logging
import subprocess

class NGINX:
    def __init__(self):
        self._start_nginx()

    def _parse_output(self, process):
        for line in iter(process.stdout.readline, b''):
            log = line.decode('utf-8')
            print(log)

    def _start_nginx(self):
        logging.info("Starting NGINX.")
        cmd = '/usr/sbin/nginx -c /etc/nginx/nginx.conf -t && exec /usr/sbin/nginx -c /etc/nginx/nginx.conf -g "daemon off;"'
        process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1, shell=True)
        self._parse_output(process)


text:
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/paper-card/paper-card.html">
<link rel="import" href="bower_components/iron-flex-layout/classes/iron-flex-layout.html">

<dom-module id="my-contact-info">
<template>

    <paper-card heading="Contact Info">

      Phone: 555-XIX-XIXI

      E-mail: someone@gmail.com

  </paper-card>

</template>

</dom-module>


text:
module GimmeWikidata

  ##
  # Models a Claim on Wikidata, which consists of a Property and a value
  #
  # Note that the value can be of any type (example: a number, a date), and is often another Item on Wikidata.
  #
  # For more details, please see: https://www.wikidata.org/wiki/Wikidata:Glossary#Claims_and_statements
  class Claim

    ##
    # The Property that the Claim is about
    attr_reader :property

    ##
    # The value that the Property is claimed to have
    attr_reader :value

    ##
    # The type of value.  Current types:
    # - item
    # - property
    # - wikidata_time
    # - external_id
    # - media
    # - text
    # - url
    # - gps_coordinates
    # - quantity
    attr_reader :value_type

    def initialize(property = nil, value = nil, value_type = nil)
      @property = property
      @value = value
      @value_type = value_type
    end

    ##
    # Returns a simple hash form of the claim.
    #
    # Example: {sex_or_gender: "Male"}
    def simplify
      property = @property.label
      value = simplify_value
      return {property: property, value: value}
    end

    ##
    # Simplifies the value
    #
    # TODO: DOCUMENT THIS FUNCTION BETTER
    def simplify_value
      case @value_type
      when :item, :property
        return "#{@value.label} (#{@value.id})"
      when :carbon_date
        return @value.to_s
      when :external_id, :media, :text, :url, :gps_coordinates, :quantity
        return @value
      else
        return nil # TODO: Consider throwing an exception here
      end
    end
  end
end


text:
// -----------------------------------------------------------------------
//  <copyright file="ControllerExtensions.cs" company="">
//      Copyright (c) 2014-2015 OSky. All rights reserved.
//  </copyright>
//  <last-editor>Lmf</last-editor>
//  <last-date>2015-07-16 4:10</last-date>
// -----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

using OSky.Utility.Extensions;

namespace OSky.Web.Mvc.Extensions
{
    /// <summary>
    /// Controller相关扩展方法
    /// </summary>
    public static class ControllerContextExtensions
    {
        /// <summary>
        /// 获取Area名
        /// </summary>
        /// <param name="context">MVC控制器上下文</param>
        /// <returns></returns>
        public static string GetAreaName(this ControllerContext context)
        {
            string area = null;
            object value;
            if (context.RequestContext.RouteData.DataTokens.TryGetValue("area", out value))
            {
                area = (string)value;
                if (area.IsNullOrWhiteSpace())
                {
                    area = null;
                }
            }
            return area;
        }

        /// <summary>
        /// 获取Controller名
        /// </summary>
        /// <param name="context">MVC控制器上下文</param>
        /// <returns></returns>
        public static string GetControllerName(this ControllerContext context)
        {
            return context.RequestContext.RouteData.Values["controller"].ToString();
        }

        /// <summary>
        /// 获取Action名
        /// </summary>
        /// <param name="context">MVC控制器上下文</param>
        /// <returns></returns>
        public static string GetActionName(this ControllerContext context)
        {
            return context.RequestContext.RouteData.Values["action"].ToString();
        }
    }
}


text:
module Time where

import Data.Time
import Data.Time.Format
import Data.Time.Clock.POSIX
import Data.UnixTime

-- Time standards
understandTime :: String -> Int
understandTime s = (fromIntegral . round . utcTimeToPOSIXSeconds) $ parseTimeOrError True defaultTimeLocale "%Y-%m-%d" s

-- Helper functions
str2epoch :: String -> Int
str2epoch s
  | '-' `elem` s = understandTime s
  | otherwise = read s :: Int


text:
namespace Graphics
{
    class ENGINE_DLL Camera
    {
    public:
        enum class Space
        {
            Local,
            World
        };

        Camera();
        virtual ~Camera()
        {};

        // TODO: Viewports belong in the rasterizer state.. not the camera.
        // Set view port parameters
        void SetViewport( const Graphics::Viewport& viewport );
        const Graphics::Viewport& GetViewport() const;

        // Set projection parameters
        void SetProjection( float fovy, float aspect, float zNear, float zFar );

        float GetNearClipPlane() const;
        float GetFarClipPlane() const;
        float GetFOV() const;

        // Set an orthographic projection using screen space coordinates.
        void SetOrthographic( float left, float right, float top, float bottom );

        // Add this pitch (rotation about the X-axis) in degrees
        // to the current camera's pitch
        void AddPitch( float fPitch, Space space = Space::Local );
        // Add this yaw (rotation about the Y-axis) in degrees
        // to the current camera's yaw
        void AddYaw( float fYaw, Space space = Space::Local );
        // Add this roll (rotation about the Z-axis) in degrees
        // to the current camera's roll
        void AddRoll( float fRoll, Space space = Space::Local );

        // Set Euler angles (in degrees)
        void SetEulerAngles( const glm::vec3& eulerAngles );

        // Add rotation to the current rotation (always in local space)
        void AddRotation( const glm::quat& rot );

        // Translate the the camera's X-axis
        void TranslateX( float x, Space space = Space::Local );
        // Translate the camera's Y-axis
        void TranslateY( float y, Space space = Space::Local );
        // Translate the camera's Z-axis
        void TranslateZ( float z, Space space = Space::Local );

        // Set the current translation of the camera, replacing the current translation.
        void SetTranslate( const glm::vec3& translate );
        // Set the current rotation from Euler angles in degrees, replacing the current rotation.
        void SetRotate( float pitch, float yaw, float roll );
        // Set the current rotation from Euler angles in degrees, replacing the current rotation.
        void SetRotate( const glm::vec3& rotate );
        void SetRotate( const glm::quat& rot );

        // If the pivot distance > 0 then the camera will rotate around a pivot point
        // that is pivotDistance along the lookAt vector of the camera.
        void SetPivotDistance( float pivotDistance );
        float GetPivotDistance() const;

        // Get the camera's pivot point in world space
        glm::vec3 GetPivotPoint() const;

        glm::vec3 GetTranslation() const;
        glm::quat GetRotation() const;

        // Get the current rotation of the camera in Euler angles (degrees)
        glm::vec3 GetEulerAngles() const;

        // Directly set the view matrix
        void        SetViewMatrix( const glm::mat4& viewMatrix );
        glm::mat4   GetViewMatrix() const;
        glm::mat4   GetInverseViewMatrix() const;

        // Directly set the projection matrix
        void        SetProjectionMatrix( const glm::mat4& projectionMatrix );
        glm::mat4   GetProjectionMatrix() const;

        // Get the view projection inverse matrix (useful for picking)
        glm::mat4   GetViewProjectionInverseMatrix() const;

        // Converts a screen point to a ray in world space.
        Graphics::Ray   ScreenPointToRay( const glm::vec2& screenPoint ) const;

        // For arcball camera, call this function with client-space coordinates
        // when the mouse is clicked on the screen.
        void OnMousePressed( Core::MouseButtonEventArgs& e );
        void OnMouseMoved( Core::MouseMotionEventArgs& e );

    protected:

        glm::vec3 ProjectOntoUnitSphere( glm::ivec2 screenPos );

        virtual void UpdateViewMatrix();
        virtual void UpdateViewProjectionInverse();

        // View port parameters
        Graphics::Viewport    m_Viewport;

        // Projection parameters
        float       m_fVFOV;
        float       m_fAspect;
        float       m_fNear;
        float       m_fFar;

        // World space parameters
        glm::vec3   m_Translate;
        glm::quat   m_Rotate;

        // Used for arcball camera
        glm::vec3   m_PreviousPoint;
        float       m_PivotDistance;

        // View matrix
        glm::mat4   m_ViewMatrix;
        // Inverse view matrix
        glm::mat4   m_InverseViewMatrix;
        // Projection matrix.
        glm::mat4   m_ProjectionMatrix;

        glm::mat4	m_ViewProjectionInverse;

        // True if the view matrix needs to be updated.
        bool        m_bViewDirty;
        // True if the view projection inverse matrix needs to be updated.
        bool        m_bViewProjectionInverseDirty;

    private:

    };
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.apps.adrcotfas.goodtime">
    <!--For the IAP-->
    <uses-permission android:name="com.android.vending.BILLING" />
</manifest>


text:
/**
 * Stylesheet
 *
 * @namespace Lungo.Theme
 * @class Default
 *
 * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
 */
/*@import url("http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700");*/
/* -------------------------- THEME -------------------------- */
@media screen and (orientation:portrait) {
  html{
    font-size: 5vw!important;
  }
}
@media screen and (orientation:landscape) {
  html{
    font-size: 5vh!important;
  }
}
@media only screen and (min-resolution: 90dpi) and (min-width: 540px){
  html{
    font-size: 150%!important;
  }
  .notification .window.growl.show{
    transform: scale(1.5);
    font-size: .8rem;
  }
}
body {
  background-color: #222;
  font-family: "mozTT", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 200;
  line-height: 1rem;
  font-size: 1rem;
  /* NEW
  letter-spacing: -.05em;
  */
}
.theme,
li.theme,
a.theme {
  background-color: THEME-light;
}
.theme:active,
li.theme:active,
a.theme:active {
  background-color: #0093d5;
}
[data-control="pull"] {
  color: #666;
  -webkit-text-shadow: 0 1px 0 #fff;
  -moz-text-shadow: 0 1px 0 #fff;
  text-shadow: 0 1px 0 #fff;
}
section:not(#dialog) > header > span.title{
  text-align: left!important;
  left: 2rem!important;
  font-size: 1.3rem;
  line-height: 1.3rem;
  letter-spacing: -.05em;
  top: .9rem;
  #text-transform: uppercase;
  font-weight: 700;
}
/* -------------------------- LAYOUT COLORS -------------------------- */
section:not(#dialog) > header {
  height: 3.2rem;
  background-color: #333;
  color: #F9F9F9;
  /* new
  -webkit-border-radius: .4rem .4rem 0 0;
  -moz-border-radius: .4rem .4rem 0 0;
  border-radius: .4rem .4rem 0 0;
  */
  z-index: 2;
}
section > footer,
section nav.groupbar {
  background-color: #222;
  -webkit-box-shadow: inset 0 3px 0 #1d1d1d;
  -moz-box-shadow: inset 0 3px 0 #1d1d1d;
  box-shadow: inset 0 3px 0 #1d1d1d;
}
section > article,
section > [data-control="pull"] {
  /* top: 3.2rem!important; */
  background-color: #f4f5f5;
  color: #000;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
section > article.splash,
section > [data-control="pull"].splash {
  background: #222;
  color: #fff;
}
section.aside {
  -webkit-box-shadow: -1px 0 2px rgba(0,0,0,0.2);
  -moz-box-shadow: -1px 0 2px rgba(0,0,0,0.2);
  box-shadow: -1px 0 2px rgba(0,0,0,0.2);
}
section.aside.right {
  -webkit-box-shadow: 1px 0 2px rgba(0,0,0,0.2);
  -moz-box-shadow: 1px 0 2px rgba(0,0,0,0.2);
  box-shadow: 1px 0 2px rgba(0,0,0,0.2);
}
section.aside:not(.small){
  transform: translateX(16rem)!important;
}
aside {
  background-color: #1d1d1d;
  color: #fff;
  width: 16rem;
}
aside > header,
aside > footer {
  background-color: #181818;
  font-size: 1rem;
  line-height: 1rem;
  height: 3.15rem;
  padding-top: .2rem;
}
aside > header {
  -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.25), inset 0 1px 0 #222, inset 0 -1px 0 #141414;
  -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.25), inset 0 1px 0 #222, inset 0 -1px 0 #141414;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25), inset 0 1px 0 #222, inset 0 -1px 0 #141414;
}
aside > header span.title{
  margin-top: 1rem;
}
aside > article{
  top: 3.5rem!important;
}
aside > article ul li{
  padding: .8rem!important;
  cursor: pointer;
}
aside > article ul li:active{
  background-color: #51af00;
}
aside > article ul li a span.icon{
  margin-right: .5rem;
  color: rgba(255, 255, 255, .4)!important;
}
/* -------------------------- NAVIGATION -------------------------- */
section > header > nav a:not(.button) {
  position: relative;
  color: #999;
  width: 2rem;
  height: 3rem;
  line-height: 3rem;
  text-align: center;
}
section > header > nav a:not(.button):active {
  background: rgba(0, 0, 0, .1)!important;
  color: #51af00;
}
section > header > nav a:not(.button).active {
  color: #51af00;
}
section > header > nav a span.icon{
  font-size: 1.3rem!important;
}
section > header > nav a.left{
  width: 1.8rem;
  padding: 0 .2rem!important;
}
section > nav.groupbar > a.active {
  -webkit-box-shadow: inset 0 -3px 0 #0093d5;
  -moz-box-shadow: inset 0 -3px 0 #0093d5;
  box-shadow: inset 0 -3px 0 #0093d5;
}
section > footer > nav > a,
nav.groupbar > a {
  color: #888;
}
section > footer > nav > a.active,
nav.groupbar > a.active {
  color: #fff;
}
section > footer > nav > a {
  -webkit-box-shadow: 1px 0 0 #1d1d1d;
  -moz-box-shadow: 1px 0 0 #1d1d1d;
  box-shadow: 1px 0 0 #1d1d1d;
}
section > footer > nav > a.active {
  color: #fff;
  background-color: #1d1d1d;
  -webkit-box-shadow: inset 0 3px 0 #0093d5;
  -moz-box-shadow: inset 0 3px 0 #0093d5;
  box-shadow: inset 0 3px 0 #0093d5;
}
aside nav a {
  color: #4e4e4e;
}
aside nav a:active {
  color: #919191;
}
/* -------------------------- LISTS -------------------------- */
section .list li {
  background: #fff;
}
section .list li:not(.anchor) {
  border-bottom: inset 1px #ebebeb;
}
section .list li.secondary {
  -webkit-box-shadow: inset 4px 0px 0px #bfbfbf;
  -moz-box-shadow: inset 4px 0px 0px #bfbfbf;
  box-shadow: inset 4px 0px 0px #bfbfbf;
}
section .list li.accept {
  -webkit-box-shadow: inset 4px 0px 0px #3fb58e;
  -moz-box-shadow: inset 4px 0px 0px #3fb58e;
  box-shadow: inset 4px 0px 0px #3fb58e;
}
section .list li.cancel {
  -webkit-box-shadow: inset 4px 0px 0px #ee6557;
  -moz-box-shadow: inset 4px 0px 0px #ee6557;
  box-shadow: inset 4px 0px 0px #ee6557;
}
section .list li,
section .list li a {
  color: #333;
}
section .list li.anchor,
section .list li a.anchor {
  background: #222;
}
section .list li.dark,
section .list li a.dark {
  background: #595959;
}
section .list li.selectable:active,
section .list li a.selectable:active,
section .list li.theme,
section .list li a.theme,
section .list li.active,
section .list li a.active {
  background: #03b1ff;
}
section .list li.light,
section .list li a.light {
  background: #ebebeb;
  color: #7a7a7a;
}
section .list li.dark,
section .list li a.dark,
section .list li.selectable:active,
section .list li a.selectable:active,
section .list li.theme,
section .list li a.theme,
section .list li.anchor,
section .list li a.anchor,
section .list li.dark small,
section .list li a.dark small,
section .list li.selectable:active small,
section .list li a.selectable:active small,
section .list li.theme small,
section .list li a.theme small,
section .list li.anchor small,
section .list li a.anchor small,
section .list li.dark .right:not(.tag),
section .list li a.dark .right:not(.tag),
section .list li.selectable:active .right:not(.tag),
section .list li a.selectable:active .right:not(.tag),
section .list li.theme .right:not(.tag),
section .list li a.theme .right:not(.tag),
section .list li.anchor .right:not(.tag),
section .list li a.anchor .right:not(.tag) {
  color: #fff;
}
section .list li small,
section .list li a small,
section .list li .right:not(.tag),
section .list li a .right:not(.tag) {
  color: #7a7a7a;
}
.list:not(.indented) li.dark,
.list:not(.indented) li.theme,
.list:not(.indented) li.light {
  border-bottom-color: rgba(0,0,0,0.1);
}
aside .list li {
  background: none;
}
aside .list li:not(:first-child) {
  border-top: solid 1px #222;
}
aside .list li:not(:last-child) {
  border-bottom: solid 1px #141414;
}
aside .list li.active {
  background: #0093d5;
  border-color: transparent;
}
aside .list li.active strong,
aside .list li.active small,
aside .list li.active .icon {
  color: #fff;
}
aside .list li strong {
  color: #999;
}
aside .list li small,
aside .list li .icon {
  color: #666;
}
/* -------------------------- TAG -------------------------- */
.tag:not(.icon) {
  color: #fff;
  -webkit-border-radius: 2px;
  -moz-border-radius: 2px;
  border-radius: 2px;
  font-weight: 700 !important;
}
.tag:not(.icon).count {
  background-color: #0093d5;
}
.tag:not(.icon) header .count {
  background-color: THEME-dark !important;
}
footer .tag:not(.icon) {
  -webkit-box-shadow: inset 0 1px 1px rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.5);
  -moz-box-shadow: inset 0 1px 1px rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.5);
}
/* -------------------------- NOTIFICATION -------------------------- */
.notification {
  color: #fff;
}
.notification .window.growl {
  background: rgba(0,0,0,0.8);
}
.notification .window:not(.growl) {
  background: #e6e6e6;
  color: #222;
  -webkit-box-shadow: 0 0 8px #000;
  -moz-box-shadow: 0 0 8px #000;
  box-shadow: 0 0 8px #000;
}
.notification .window:not(.growl) button,
.notification .window:not(.growl) .button {
  background: #fff !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
  box-shadow: none !important;
  color: #007db5 !important;
  -webkit-border-radius: 0px !important;
  -moz-border-radius: 0px !important;
  border-radius: 0px !important;
  border: none !important;
  margin-bottom: 1px;
}
.notification .window:not(.growl).error {
  background: #dd2916;
  color: #fff;
}
.notification .window:not(.growl).success {
  background: #2f886b;
  color: #fff;
}
/* -------------------------- BUTTONS -------------------------- */
header .button,
header button {
  background-color: #007db5;
  -webkit-box-shadow: 0 1px 0 #03b1ff, inset 0 1px 0 #00608a;
  -moz-box-shadow: 0 1px 0 #03b1ff, inset 0 1px 0 #00608a;
  box-shadow: 0 1px 0 #03b1ff, inset 0 1px 0 #00608a;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
}
header .button:active,
header button:active {
  background-color: #005880;
}
article .button,
article button {
  -webkit-border-radius: FORM-border-radius;
  -moz-border-radius: FORM-border-radius;
  border-radius: FORM-border-radius;
  color: #fff;
  -webkit-border-radius: 2px;
  -moz-border-radius: 2px;
  border-radius: 2px;
  -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  border: solid 1px rgba(0,0,0,0.1);
}
article .button:active,
article button:active {
  -webkit-box-shadow: inset 0 0 128px rgba(0,0,0,0.25);
  -moz-box-shadow: inset 0 0 128px rgba(0,0,0,0.25);
  box-shadow: inset 0 0 128px rgba(0,0,0,0.25);
  border-color: none;
}
article .button.secondary,
article button.secondary {
  color: #666 !important;
}
article .button[disabled],
article button[disabled] {
  background-color: #000;
}
article button,
article .button,
article .tag:not(.icon) {
  background-color: #51af00;
}
article button.secondary,
article .button.secondary,
article .tag:not(.icon).secondary {
  background-color: #bfbfbf;
}
article button.accept,
article .button.accept,
article .tag:not(.icon).accept {
  background-color: #3fb58e;
}
article button.cancel,
article .button.cancel,
article .tag:not(.icon).cancel {
  background-color: #ee6557;
}
/* -------------------------- BUTTONS -------------------------- */
form label,
.form label {
  color: #aaa;
  font-weight: 300;
}
form fieldset,
.form fieldset {
  background: #fff;
  border-bottom: solid 1px #eee;
}
form fieldset .icon,
.form fieldset .icon {
  color: #ccc;
}
form [data-pretend="input-text"]{
  padding: 0 .3rem;
  line-height: 2rem;
  margin-bottom: .3rem;
}
form [data-pretend="input-text"],
form input[type="text"],
.form input[type="text"],
form input[type="password"],
.form input[type="password"],
form input[type="date"],
.form input[type="date"],
form input[type="datetime"],
.form input[type="datetime"],
form input[type="email"],
.form input[type="email"],
form input[type="number"],
.form input[type="number"],
form input[type="search"],
.form input[type="search"],
form input[type="tel"],
.form input[type="tel"],
form input[type="time"],
.form input[type="time"],
form input[type="url"],
.form input[type="url"],
form select,
.form select,
form textarea,
.form textarea {
  height: 2rem;
  background-color: #fff;
  color: rgba(0,0,0,0.75);
  border: .05rem solid #ddd;
  -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  -webkit-border-radius: .2rem;
  -moz-border-radius: .2rem;
  border-radius: .2rem;
  font-size: 1em;
  font-weight: 300;
  position: relative;
  left: 0;
  width: calc(100vw - 3.8rem);
  transition: all .5s ease;
}
form select {
  width: calc(100vw - 3.1rem);
  padding: .2rem;
}
form input[type="text"].error,
.form input[type="text"].error,
form input[type="password"].error,
.form input[type="password"].error,
form input[type="date"].error,
.form input[type="date"].error,
form input[type="datetime"].error,
.form input[type="datetime"].error,
form input[type="email"].error,
.form input[type="email"].error,
form input[type="number"].error,
.form input[type="number"].error,
form input[type="search"].error,
.form input[type="search"].error,
form input[type="tel"].error,
.form input[type="tel"].error,
form input[type="time"].error,
.form input[type="time"].error,
form input[type="url"].error,
.form input[type="url"].error,
form select.error,
.form select.error,
form textarea.error,
.form textarea.error,
form input[type="text"]:required,
.form input[type="text"]:required,
form input[type="password"]:required,
.form input[type="password"]:required,
form input[type="date"]:required,
.form input[type="date"]:required,
form input[type="datetime"]:required,
.form input[type="datetime"]:required,
form input[type="email"]:required,
.form input[type="email"]:required,
form input[type="number"]:required,
.form input[type="number"]:required,
form input[type="search"]:required,
.form input[type="search"]:required,
form input[type="tel"]:required,
.form input[type="tel"]:required,
form input[type="time"]:required,
.form input[type="time"]:required,
form input[type="url"]:required,
.form input[type="url"]:required,
form select:required,
.form select:required,
form textarea:required,
.form textarea:required {
  border-color: color_alert;
  color: color_alert;
  background-color: rgba(198,15,19,0.1);
}
form [data-pretend="input-text"]:focus,
form input[type="text"]:focus,
.form input[type="text"]:focus,
form input[type="password"]:focus,
.form input[type="password"]:focus,
form input[type="date"]:focus,
.form input[type="date"]:focus,
form input[type="datetime"]:focus,
.form input[type="datetime"]:focus,
form input[type="email"]:focus,
.form input[type="email"]:focus,
form input[type="number"]:focus,
.form input[type="number"]:focus,
form input[type="search"]:focus,
.form input[type="search"]:focus,
form input[type="tel"]:focus,
.form input[type="tel"]:focus,
form input[type="time"]:focus,
.form input[type="time"]:focus,
form input[type="url"]:focus,
.form input[type="url"]:focus,
form select:focus,
.form select:focus,
form textarea:focus,
.form textarea:focus {
  background: #fafafa;
  border-color: #51af00;
  color: rgba(0,0,0,0.75);
}
form input[type="text"][disabled],
.form input[type="text"][disabled],
form input[type="password"][disabled],
.form input[type="password"][disabled],
form input[type="date"][disabled],
.form input[type="date"][disabled],
form input[type="datetime"][disabled],
.form input[type="datetime"][disabled],
form input[type="email"][disabled],
.form input[type="email"][disabled],
form input[type="number"][disabled],
.form input[type="number"][disabled],
form input[type="search"][disabled],
.form input[type="search"][disabled],
form input[type="tel"][disabled],
.form input[type="tel"][disabled],
form input[type="time"][disabled],
.form input[type="time"][disabled],
form input[type="url"][disabled],
.form input[type="url"][disabled],
form select[disabled],
.form select[disabled],
form textarea[disabled],
.form textarea[disabled] {
  background: #eee;
  border-color: #aaa;
  color: #999;
}
form .select:after,
.form .select:after {
  background: #d0d4c6;
  color: #fff;
  border-top-right-radius: 1px;
  border-bottom-right-radius: 1px;
}
form input[type=range],
.form input[type=range] {
  -webkit-box-shadow: 'inset 0 1px 2px rgba(0,0,0,0.1)';
  -moz-box-shadow: 'inset 0 1px 2px rgba(0,0,0,0.1)';
  box-shadow: 'inset 0 1px 2px rgba(0,0,0,0.1)';
}

form input[type=range]::-webkit-slider-thumb,
.form input[type=range]::-webkit-slider-thumb {
  -webkit-border-radius: 2px;
  -moz-border-radius: 2px;
  border-radius: 2px;
  background-color: #e7eae2;
  border: solid 1px #d0d4c6;
}
form input[type=range]::-webkit-slider-thumb::after,
.form input[type=range]::-webkit-slider-thumb::after {
  background: #d0d4c6;
}
form .progress .bar,
.form .progress .bar {
  background-color: #ddd;
}
form .progress .bar .value,
.form .progress .bar .value {
  background-color: #03b1ff;
}


text:
<?php

$noforcelogin = 1;
include("cdash/config.php");
require_once("cdash/pdo.php");
include('login.php');
include_once("cdash/common.php");
include("cdash/version.php");

@$buildid = $_GET["buildid"];
if ($buildid != NULL)
  {
  $buildid = pdo_real_escape_numeric($buildid);
  }
@$date = $_GET["date"];
if ($date != NULL)
  {
  $date = htmlspecialchars(pdo_real_escape_string($date));
  }

// Checks
if(!isset($buildid) || !is_numeric($buildid))
  {
  echo "Not a valid buildid!";
  return;
  }

$db = pdo_connect("$CDASH_DB_HOST", "$CDASH_DB_LOGIN","$CDASH_DB_PASS");
pdo_select_db("$CDASH_DB_NAME",$db);

$build_array = pdo_fetch_array(pdo_query("SELECT * FROM build WHERE id='$buildid'"));
$projectid = $build_array["projectid"];
checkUserPolicy(@$_SESSION['cdash']['loginid'],$projectid);

$siteid = $build_array["siteid"];
$buildtype = $build_array["type"];
$buildname = $build_array["name"];
$starttime = $build_array["starttime"];

$project_array = pdo_fetch_array(pdo_query("SELECT * FROM project WHERE id='$projectid'"));
$projectname = $project_array["name"];

$xml = begin_XML_for_XSLT();
$xml .= "<title>CDash : ".$projectname."</title>";

$date = get_dashboard_date_from_build_starttime($build_array["starttime"],$project_array["nightlytime"]);
$xml .= get_cdash_dashboard_xml_by_name($projectname,$date);

// Menu
$xml .= "<menu>";
$xml .= add_XML_value("back","index.php?project=".urlencode($projectname)."&date=".$date);
$previousbuildid = get_previous_buildid($projectid,$siteid,$buildtype,$buildname,$starttime);
if($previousbuildid>0)
  {
  $xml .= add_XML_value("previous","viewNotes.php?buildid=".$previousbuildid);
  }
else
  {
  $xml .= add_XML_value("noprevious","1");
  }
$xml .= add_XML_value("current","viewNotes.php?buildid=".get_last_buildid($projectid,$siteid,$buildtype,$buildname,$starttime));
$nextbuildid = get_next_buildid($projectid,$siteid,$buildtype,$buildname,$starttime);
if($nextbuildid>0)
  {
  $xml .= add_XML_value("next","viewNotes.php?buildid=".$nextbuildid);
  }
else
  {
  $xml .= add_XML_value("nonext","1");
  }
$xml .= "</menu>";

// Build
$xml .= "<build>";

$site_array = pdo_fetch_array(pdo_query("SELECT name FROM site WHERE id='$siteid'"));
$xml .= add_XML_value("site",$site_array["name"]);
$xml .= add_XML_value("siteid",$siteid);
$xml .= add_XML_value("buildname",$buildname);
$xml .= add_XML_value("buildid",$buildid);
$xml .= add_XML_value("stamp",$build_array["stamp"]);
$xml .= "</build>";

$build2note = pdo_query("SELECT noteid,time FROM build2note WHERE buildid='$buildid'");
while($build2note_array = pdo_fetch_array($build2note))
  {
  $noteid = $build2note_array["noteid"];
  $note_array = pdo_fetch_array(pdo_query("SELECT * FROM note WHERE id='$noteid'"));
  $xml .= "<note>";
  $xml .= add_XML_value("name",$note_array["name"]);
  $xml .= add_XML_value("text",$note_array["text"]);
  $xml .= add_XML_value("time",$build2note_array["time"]);
  $xml .= "</note>";
  $text = $note_array["text"];
  $name = $note_array["name"];
  }

$xml .= "</cdash>";

// Now doing the xslt transition
generate_XSLT($xml,"viewNotes");
?>


text:
$(function(){
  var opened_index = null;
  function open_item(grid, i) {
    grid = $(grid);
    var rows = grid.find('.content-details');
    var items = grid.find('.content-details-item');
    if (i < 0 || items.length <= i) return;
    rows.hide();
    items.hide();
    var item = $(items[i]);
    var row = item.parents('.content-details');
    row.show();
    item.show();
    $('html,body').animate({
      scrollTop: row.offset().top - 150
    }, 500);
    opened_index = i;
  }
  $('.content-entry').click(function(e){
    var entry = $(e.delegateTarget);
    var grid = entry.parents('.content-grid');
    open_item(grid, grid.find('.content-entry').index(entry));
  });
  $('.content-details-controls-x').click(function(e){
    $(e.delegateTarget).parents('.content-details').hide();
  });
  $('.content-details-controls-prev').click(function(e){
    var grid = $(e.delegateTarget).parents('.content-grid');
    open_item(grid, opened_index - 1);
  });
  $('.content-details-controls-next').click(function(e){
    var grid = $(e.delegateTarget).parents('.content-grid');
    open_item(grid, opened_index + 1);
  });
});


text:
package org.apache.solr.response.transform;

/**
 *
 * @since solr 4.0
 */
@Deprecated
public abstract class TransformerWithContext extends DocTransformer
{
  @Override
  public void setContext( TransformContext context ) {
    this.context = context;
  }
}


text:
import { IntlMessageFormat } from './src/core';
export * from './src/formatters';
export * from './src/core';
export * from './src/error';
export default IntlMessageFormat;
//# sourceMappingURL=index.d.ts.map


text:
<!-- toc -->
- [Release Signoff Checklist](#release-signoff-checklist)
- [Summary](#summary)
- [Motivation](#motivation)
  - [Goals](#goals)
  - [Non-Goals](#non-goals)
- [Proposal](#proposal)
  - [User Stories](#user-stories)
    - [Volumes with close capacity are preferred](#volumes-with-close-capacity-are-preferred)
    - [Different weights for different classes](#different-weights-for-different-classes)
- [Design Details](#design-details)
  - [Configuring the utilization shape points](#configuring-the-utilization-shape-points)
  - [Configuring the weight of storage class](#configuring-the-weight-of-storage-class)
  - [Test Plan](#test-plan)
  - [Graduation Criteria](#graduation-criteria)
    - [Alpha](#alpha)
    - [Beta](#beta)
    - [GA](#ga)
- [Alternatives](#alternatives)
  - [Maintain multiple storage classes for different storage capacities](#maintain-multiple-storage-classes-for-different-storage-capacities)
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
  - [Feature enablement and rollback](#feature-enablement-and-rollback)
  - [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning)
  - [Monitoring requirements](#monitoring-requirements)
  - [Dependencies](#dependencies)
  - [Scalability](#scalability)
  - [Troubleshooting](#troubleshooting)
- [Implementation History](#implementation-history)
- [Drawbacks](#drawbacks)
<!-- /toc -->

## Release Signoff Checklist

Items marked with (R) are required *prior to targeting to a milestone / release*.

- [x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
- [ ] (R) KEP approvers have approved the KEP status as `implementable`
- [ ] (R) Design details are appropriately documented
- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
- [ ] (R) Graduation criteria is in place
- [ ] (R) Production readiness review completed
- [ ] Production readiness review approved
- [ ] "Implementation History" section is up-to-date for milestone
- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
- [ ] Supporting documentation e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes

[kubernetes.io]: https://kubernetes.io/
[kubernetes/enhancements]: https://git.k8s.io/enhancements
[kubernetes/kubernetes]: https://git.k8s.io/kubernetes
[kubernetes/website]: https://git.k8s.io/website

## Summary

With [volume topology-aware
scheduling](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/volume-topology-scheduling.md) in place,
the scheduler filters nodes considering volume topology constraints. However, scheduler picks
the smallest matching volumes in each topology but does not try to prioritize
nodes in different topologies based on volume capacity. This leads to a waste
of resources which we should avoid.

This KEP continues the work proposed [here](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/volume-topology-scheduling.md#priority), to enable the scheduler to favor the node which has the most fit PV.

## Motivation

Because we didn't take volume capacity into account when scheduling a pod that
can run in multiple topologies. A large PV may be used by a PVC with a small
capacity request, even if there are many suitable small PVs in other
topologies. PVCs with a large capacity request may not find feasible PVs to use
if too many large PVs are consumed by PVCs with a small capacity request.

Like CPU, Memory resources, the scheduler should take volume capacity into
account in scheduling pods to ensure balanced resource usage.

### Goals

- Prioritizing nodes based on the best matching size of statically provisioned
  PVs
- Support arbitrary PV topology domain (e.g. hostname, zone, rack)

### Non-Goals

- Prioritizing nodes based on the total available capacity of statically provisioned
  PVs
- Prioritizing nodes based on the total available number of statically provisioned
  PVs
- Prioritizing nodes based on the total available capacity for dynamic
  provisioning PVCs

## Proposal

### User Stories

#### Volumes with close capacity are preferred

As a cluster administrator, I need to prepare some local PVs with different
storage capacities (e.g. 10Gi, 100Gi, 1Ti) as different workloads may have
different storage requirements.

A PV with 1Ti capacity on one node has the same chance as a PV on another node
with 10Gi capacity to be bound with a 10Gi request PVC in scheduling. If nodes
of topology in which volumes with close capacity are always preferred, we can
achieve better storage resource usage.

See https://github.com/kubernetes/kubernetes/issues/83323.

#### Different weights for different classes

Given a cluster which has two kinds of local storage classes:

- hdd
- ssd

Workloads may request two disks, one from `hdd` and one from `ssd`. As
the ssd storage resource may be relatively scarce, the administrator can
configure a relatively larger weight for storage class `ssd` and hope it's more
balanced.

This applies to any other storage with topology constraints.

## Design Details

We have a scheduler plugin called
[VolumeBinding](https://github.com/kubernetes/kubernetes/tree/master/pkg/scheduler/framework/plugins/volumebinding)
to filter the nodes based on volume topology constraints. After the filter
phase, there is a reduced set of nodes that can fit a pod and filtered smallest
statically provisioned PV(s) in each node topology.

We can add  `Score` interfaces to score nodes based on pod's unbound PVCs and
filtered PVs.

The score is calculated in two steps:

1) First, we group pod's unbound PVCs and corresponding statically provisioned PVs
by storage class. For PVCs/PVs in each storage class, we calculate requested to
capacity ratio using the following formula:

```
[UtilizationPerClass] = [MaxUtilization] * ([RequestPerClass] / [CapacityPerClass])
```

The utilization ranges from 0 to 100.

We can tune this formula by applying utilization shape points, which is used in
[`RequestedToCapacityRatio`](https://github.com/kubernetes/kubernetes/blob/master/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go).

By default, we use this shape points to get linear scores between [0,
100] utilization.

```
- utilization: 0
  score: 0
- utilization: 100
  score: config.MaxCustomPriorityScore
```

The score ranges from 0 to `MaxNodeScore` (100).

Optionally, users can configure customized utilization shape points, e.g.

```
- utilization: 50
  score: 0
- utilization: 80
  score: 3
- utilization: 100
  score: 5
```

The score of utilization below 50 will be 0, and the score of utilization of 90
will be 4 (`3 + (5 - 3) * (90 - 80) / (100 - 80)`).

2) Then, we add them together and divides by the number of storage classes.

### Configuring the utilization shape points

We can add a field `Shape` to specify the shape points which defines the score
function shape.

```
// VolumeBindingArgs holds arguments used to configure the VolumeBinding plugin.
type VolumeBindingArgs struct {
		...
    // Shape specifies the shape points defining score function shape
    Shape []UtilizationShapePoint
}
```

The definition of `UtilizationShapePoint` is [here](https://github.com/kubernetes/kubernetes/blob/73fa63a86d1d47d82b435ca85c2f350da06b08b9/pkg/scheduler/apis/config/types_pluginargs.go#L115-L121).

### Configuring the weight of storage class

Optionally, we can allow users to configure the weight of storage class. If
weights of storage classes are evolved, the formula will be:

```
[NodeScore] = Sum([ScorePerClass] * [WeightPerClass]) / Sum([WeightPerClass])
```

In the initial stage, we treat all storage classes equal to avoid introducing
complexity to Kubernetes. If there are real use cases in Beta/GA, we can
consider supporting it.

```
<<[UNRESOLVED]>>

Possible solutions:

1) annotation in storage class object

We can read the weight from the storage class annotation, e.g.

```
storageclass.kubernetes.io/weight: "5"
```

Pros:

- No need to update the configuration of the kube-scheduler
- The change can be applied on the fly

Cons:

- Weights are configured in different objects

2) configure in plugin args:

```
storageClassWeights:
- local-ssd: "5"
- local-hdd: "3"
```

Pros:

- Weights are configured in one place

Cons:

- Need to update and reload the configuration of the kube-scheduler

<<[/UNRESOLVED]>>
```

### Test Plan

- **Unit Tests:** All code will be covered by unit tests.
- **Integration Tests** Typical user cases will be covered in scheduler
  integration tests with this feature enabled.
- **Benchmark Tests** Add benchmarking tests for VolumeBinding with this
  feature enabled. (This is required in Beta and GA)

### Graduation Criteria

#### Alpha

Target: v1.21

- [ ] Add `VolumeCapacityPriority` feature gate
- [ ] Add priority extension point implementation for VolumeBinding plugin
- [ ] Able to prioritizing nodes based on the best matching size of statically
  provisioned PVs
- [ ] Arg struct for `VolumeBindingArgs.Shape`
- [ ] Tests for basic functionalities

#### Beta

Target: v1.22

- [ ] Add benchmarking tests
- [ ] Turn algorithm based on feedback from developers and users
- [ ] Decide to support storage class weighting or not (if we should, implement
  it)

#### GA

Target: TBD

- [ ] Code is thoroughly tested
- TBD

## Alternatives

### Maintain multiple storage classes for different storage capacities

System administrator can create multiple storage classes for different storage
capacities, e.g.

- local-storage-1G
- local-storage-10G
- local-storage-100G
- local-storage-1T
- ...

Then workloads can select best fit storage by specifying the desired storage
class in PVCs.

However, this is not flexible as it's a hard scheduling requirement. Cluster
storage are split into pieces, large PVs cannot be consumed by pods that has a
small storage class configured in PVCs.

## Production Readiness Review Questionnaire

### Feature enablement and rollback

* **How can this feature be enabled / disabled in a live cluster?**
  - [x] Feature gate (also fill in values in `kep.yaml`)
    - Feature gate name: VolumeCapacityPriority
    - Components depending on the feature gate: kube-scheduler

* **Does enabling the feature change any default behavior?**

  Basically not, but scheduler may make different decision for the same soft
  (preferred) scheduling requirements, because it takes volume capacity into
  account in scoring nodes.

* **Can the feature be disabled once it has been enabled (i.e. can we rollback
  the enablement)?**

  The feature can be disabled in Alpha and Beta versions. When it's graduated to
  GA, this feature will be enabled by default.

* **What happens if we reenable the feature if it was previously rolled back?**

  N/A.

* **Are there any tests for feature enablement/disablement?**

  Unit tests with and without the feature are necessary to verify we can achieve
  better resource usage with this feature.

### Rollout, Upgrade and Rollback Planning

* **How can a rollout fail? Can it impact already running workloads?**

  When the feature gate is enabled on the kube-scheduler, all unscheduled and
  future pods which reference delay binding PVCs will be applied this priority
  policy.

  This does not impact running workloads.

* **What specific metrics should inform a rollback?**

  - A spike on metric `schedule_attempts_total{result="error|unschedulable"}`
    when this feature gate is enabled.

* **Were upgrade and rollback tested? Was upgrade->downgrade->upgrade path tested?**

  N/A.

* **Is the rollout accompanied by any deprecations and/or removals of features,
  APIs, fields of API types, flags, etc.?**

  No.

### Monitoring requirements

* **How can an operator determine if the feature is in use by workloads?**

  If enabled, this feature applies to all workloads which uses delay binding
  PVCs. Also non-zero value of metric
  `plugin_execution_duration_seconds{plugin="VolumeBinding",extension_point="Score"}`
  is a sign indicating this feature is in use.

* **What are the SLIs (Service Level Indicators) an operator can use to
  determine the health of the service?**

  This feature is implemented in scheduler VolumeBinding plugin. Metric
  `plugin_execution_duration_seconds{plugin="VolumeBinding",extension_point=~"(Score|ScoreExtensionNormalize)"}`
  can used to to indicate the scheduling latency for a pod using this feature.

* **What are the reasonable SLOs (Service Level Objectives) for the above SLIs?**

  - Metric `plugin_execution_duration_seconds{plugin="VolumeBinding",extension_point=~"(Score|ScoreExtensionNormalize)"}`
    <= 100ms on 90-percentile.

* **Are there any missing metrics that would be useful to have to improve
  observability if this feature?**

  N/A.

### Dependencies

* **Does this feature depend on any specific services running in the cluster?**

  No.

### Scalability

* **Will enabling / using this feature result in any new API calls?**

  No

* **Will enabling / using this feature result in introducing new API types?**

  No.

* **Will enabling / using this feature result in any new calls to cloud
  provider?**

  No.

* **Will enabling / using this feature result in increasing size or count
  of the existing API objects?**

  No.

* **Will enabling / using this feature result in increasing time taken by any
  operations covered by [existing SLIs/SLOs][]?**

  This feature needs additional computation, so it's expected to see an
  increased latency on
  `plugin_execution_duration_seconds{plugin="VolumeBinding"}` - comparing to
  other plugin latency. But workloads which does not use delay binding PVCs
  won't get penalties.

* **Will enabling / using this feature result in non-negligible increase of
  resource usage (CPU, RAM, disk, IO, ...) in any components?**

  No.

### Troubleshooting

* **How does this feature react if the API server and/or etcd is unavailable?**

  Running pods won't be impacted. Unscheduled pods using this feature will
  not be scheduled as the API server and/or etcd is unavailable.

* **What are other known failure modes?**

  N/A.

* **What steps should be taken if SLOs are not being met to determine the problem?**

  N/A.

## Implementation History

- 2020-06-04 Initial KEP sent out for review

## Drawbacks

- Users can create PVs with fake capacity or sharing capacity of a filesystem
  volume (e.g. multiple local PVs sharing a filesystem by creating multiple
  subdirectories). In these scenarios, the calculated scores can't reflect the
  actual situation.


text:
<title>Requirements - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Installing-GDB.html#Installing-GDB" title="Installing GDB">
<link rel="next" href="Running-Configure.html#Running-Configure" title="Running Configure">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

Next: Running Configure,
Up: Installing GDB

C.1 Requirements for Building gdb

Building gdb requires various tools and packages to be available.
Other packages will be used only if they are found.

Tools/Packages Necessary for Building gdb

ISO C90 compiler
gdb is written in ISO C90.  It should be buildable with any
working C90 compiler, e.g. GCC.

Tools/Packages Optional for Building gdb

Expat

gdb can use the Expat XML parsing library.  This library may be
included with your operating system distribution; if it is not, you
can get the latest version from http://expat.sourceforge.net.
The <samp>configure</samp> script will search for this library in several
standard locations; if it is installed in an unusual path, you can
use the <samp>--with-libexpat-prefix</samp> option to specify its location.

Expat is used for:

Remote protocol memory maps (see Memory Map Format)

Target descriptions (see Target Descriptions)

Remote shared library lists (See Library List Format,
or alternatively see Library List Format for SVR4 Targets)

MS-Windows shared libraries (see Shared Libraries)

Traceframe info (see Traceframe Info Format)

Branch trace (see Branch Trace Format)

zlib
gdb will use the `<samp>zlib</samp>' library, if available, to read
compressed debug sections.  Some linkers, such as GNU gold, are capable
of producing binaries with compressed debug sections.  If gdb
is compiled with `<samp>zlib</samp>', it will be able to read the debug
information in such binaries.

The `<samp>zlib</samp>' library is likely included with your operating system
distribution; if it is not, you can get the latest version from
http://zlib.net.

iconv
gdb's features related to character sets (see Character Sets) require a functioning iconv implementation.  If you are
on a GNU system, then this is provided by the GNU C Library.  Some
other systems also provide a working iconv.

If gdb is using the iconv program which is installed
in a non-standard place, you will need to tell gdb where to find it.
This is done with <samp>--with-iconv-bin</samp> which specifies the
directory that contains the iconv program.

On systems without iconv, you can install GNU Libiconv.  If you
have previously installed Libiconv, you can use the
<samp>--with-libiconv-prefix</samp> option to configure.

gdb's top-level <samp>configure</samp> and <samp>Makefile</samp> will
arrange to build Libiconv if a directory named <samp>libiconv</samp> appears
in the top-most source directory.  If Libiconv is built this way, and
if the operating system does not provide a suitable iconv
implementation, then the just-built library will automatically be used
by gdb.  One easy way to set this up is to download GNU
Libiconv, unpack it, and then rename the directory holding the
Libiconv source code to `<samp>libiconv</samp>'.


text:
package hudson.init;

import org.jvnet.hudson.annotation_indexer.Indexed;
import org.jvnet.hudson.reactor.Task;

import java.lang.annotation.Documented;
import static java.lang.annotation.ElementType.METHOD;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;

import static hudson.init.InitMilestone.STARTED;
import static hudson.init.InitMilestone.COMPLETED;

/**
 * Placed on static methods to indicate that this method is to be run during the Jenkins start up to perform
 * some sort of initialization tasks.
 *
 *
Example

 *

 @Initializer(after=JOB_LOADED)
 public static void init() throws IOException {
 ....
 }
 *

 *
 * @author Kohsuke Kawaguchi
 */
@Indexed
@Documented
@Retention(RUNTIME)
@Target(METHOD)
public @interface Initializer {
    /**
     * Indicates that the specified milestone is necessary before executing this initializer.
     *
     *

     * This has the identical purpose as {@link #requires()}, but it's separated to allow better type-safety
     * when using {@link InitMilestone} as a requirement (since enum member definitions need to be constant.)
     */
    InitMilestone after() default STARTED;

    /**
     * Indicates that this initializer is a necessary step before achieving the specified milestone.
     *
     *

     * This has the identical purpose as {@link #attains()}. See {@link #after()} for why there are two things
     * to achieve the same goal.
     */
    InitMilestone before() default COMPLETED;

    /**
     * Indicates the milestones necessary before executing this initializer.
     */
    String[] requires() default {};

    /**
     * Indicates the milestones that this initializer contributes to.
     *
     * A milestone is considered attained if all the initializers that attains the given milestone
     * completes. So it works as a kind of join.
     */
    String[] attains() default {};

    /**
     * Key in <tt>Messages.properties</tt> that represents what this task is about. Used for rendering the progress.
     * Defaults to "${short class name}.${method Name}".
     */
    String displayName() default "";

    /**
     * Should the failure in this task prevent Hudson from starting up?
     *
     * @see Task#failureIsFatal()
     */
    boolean fatal() default true;
}


text:
package git4idea.history.wholeTree;

import com.google.common.collect.Sets;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Consumer;
import git4idea.history.browser.ChangesFilter;
import org.jetbrains.annotations.Nullable;

import java.util.*;

/**
 * @author irengrig
 *         Date: 2/1/11
 *         Time: 7:27 PM
 */
public class GitLogFilters {
  @Nullable
  private final ChangesFilter.Comment myCommentFilter;
  @Nullable
  private final Set<ChangesFilter.Filter> myCommitterFilters;
  @Nullable
  private final Set<ChangesFilter.Filter> myDateFilters;
  @Nullable
  private final Map<VirtualFile, ChangesFilter.Filter> myStructureFilters;
  @Nullable
  private final List<String> myPossibleReferencies;
  private boolean myUseOnlyHashes;

  public GitLogFilters() {
    this(null, null, null, null, null);
  }

  public GitLogFilters(@Nullable ChangesFilter.Comment commentFilter,
                       @Nullable Set<ChangesFilter.Filter> committerFilters,
                       Set<ChangesFilter.Filter> filters,
                       @Nullable Map<VirtualFile, ChangesFilter.Filter> structureFilters,
                       @Nullable List<String> possibleReferencies) {
    myCommentFilter = commentFilter;
    myCommitterFilters = committerFilters;
    myDateFilters = filters;
    myStructureFilters = structureFilters;
    myPossibleReferencies = possibleReferencies;
  }

  public void callConsumer(final Consumer<List<ChangesFilter.Filter>> consumer, boolean takeComment, final VirtualFile root) {
    final List<Set<ChangesFilter.Filter>> filters = new ArrayList<Set<ChangesFilter.Filter>>();
    if (takeComment && myCommentFilter != null) {
      filters.add(Collections.<ChangesFilter.Filter, ChangesFilter.Filter>singletonMap(myCommentFilter, myCommentFilter).keySet());
    }
    if (myCommitterFilters != null) {
      filters.add(myCommitterFilters);
    }
    if (myStructureFilters != null) {
      final ChangesFilter.Filter filter = myStructureFilters.get(root);
      if (filter != null) {
        filters.add(Collections.singleton(filter));
      }
    }
    if (myDateFilters != null) {
      filters.add(Collections.<ChangesFilter.Filter>singleton(
          new ChangesFilter.And(myDateFilters.toArray(new ChangesFilter.Filter[myDateFilters.size()]))));
    }
    final Set<List<ChangesFilter.Filter>> cartesian = Sets.cartesianProduct(filters);
    if (cartesian.isEmpty()) {
      consumer.consume(Collections.<ChangesFilter.Filter>emptyList());
    } else {
      for (List<ChangesFilter.Filter> list : cartesian) {
        consumer.consume(list);
      }
    }
  }

  @Nullable
  public ChangesFilter.Comment getCommentFilter() {
    return myCommentFilter;
  }

  @Nullable
  public Set<ChangesFilter.Filter> getCommitterFilters() {
    return myCommitterFilters;
  }

  public boolean haveCommitterOrCommentFilters() {
    return (myCommitterFilters != null && ! myCommitterFilters.isEmpty()) || (myCommentFilter != null);
  }

  @Nullable
  public Map<VirtualFile,ChangesFilter.Filter> getStructureFilters() {
    return myStructureFilters;
  }

  public boolean isEmpty() {
    return myCommentFilter == null && (myCommitterFilters == null || myCommitterFilters.isEmpty()) &&
           (myStructureFilters == null || myStructureFilters.isEmpty()) && (myDateFilters == null || myDateFilters.isEmpty());
  }

  public boolean haveDisordering() {
    return ! isEmpty();
    // seems ordering by time does not coinside with structure -> dates filter also forbids tree. maybe should allow if "after" is used...
    /*return myCommentFilter != null || (myCommitterFilters != null && ! myCommitterFilters.isEmpty()) ||
           (myStructureFilters != null && ! myStructureFilters.isEmpty());*/
  }

  @Nullable
  public List<String> getPossibleReferencies() {
    return myPossibleReferencies;
  }

  public boolean haveStructureFilter() {
    return myStructureFilters != null;
  }

  public boolean haveStructuresForRoot(VirtualFile root) {
    return haveStructureFilter() && myStructureFilters.containsKey(root);
  }

  public boolean isUseOnlyHashes() {
    return myUseOnlyHashes;
  }

  public void setUseOnlyHashes(boolean useOnlyHashes) {
    myUseOnlyHashes = useOnlyHashes;
  }
}


text:
// This file is automatically generated.

package adila.db;

/*
 * Alcatel A564C
 *
 * DEVICE: Yaris5NA
 * MODEL: ALCATEL A564C
 */
final class yaris5na_alcatel20a564c {
    public static final String DATA = "Alcatel|A564C|";
}


text:
package com.amazonaws.services.pinpoint.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.pinpoint.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * JourneyExecutionActivityMetricsResponse JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class JourneyExecutionActivityMetricsResponseJsonUnmarshaller implements Unmarshaller<JourneyExecutionActivityMetricsResponse, JsonUnmarshallerContext> {

    public JourneyExecutionActivityMetricsResponse unmarshall(JsonUnmarshallerContext context) throws Exception {
        JourneyExecutionActivityMetricsResponse journeyExecutionActivityMetricsResponse = new JourneyExecutionActivityMetricsResponse();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return null;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("ActivityType", targetDepth)) {
                    context.nextToken();
                    journeyExecutionActivityMetricsResponse.setActivityType(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("ApplicationId", targetDepth)) {
                    context.nextToken();
                    journeyExecutionActivityMetricsResponse.setApplicationId(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("JourneyActivityId", targetDepth)) {
                    context.nextToken();
                    journeyExecutionActivityMetricsResponse.setJourneyActivityId(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("JourneyId", targetDepth)) {
                    context.nextToken();
                    journeyExecutionActivityMetricsResponse.setJourneyId(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("LastEvaluatedTime", targetDepth)) {
                    context.nextToken();
                    journeyExecutionActivityMetricsResponse.setLastEvaluatedTime(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("Metrics", targetDepth)) {
                    context.nextToken();
                    journeyExecutionActivityMetricsResponse.setMetrics(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context
                            .getUnmarshaller(String.class)).unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return journeyExecutionActivityMetricsResponse;
    }

    private static JourneyExecutionActivityMetricsResponseJsonUnmarshaller instance;

    public static JourneyExecutionActivityMetricsResponseJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new JourneyExecutionActivityMetricsResponseJsonUnmarshaller();
        return instance;
    }
}


text:
Pizzicato.Sound = function(description, callback) {
	var self = this;
	var util = Pizzicato.Util;
	var descriptionError = getDescriptionError(description);
	var hasOptions = util.isObject(description) && util.isObject(description.options);
	var defaultAttack = 0.04;
	var defaultRelease = 0.04;

	if (descriptionError) {
		console.error(descriptionError);
		throw new Error('Error initializing Pizzicato Sound: ' + descriptionError);
	}

	this.detached = hasOptions && description.options.detached;
	this.masterVolume = Pizzicato.context.createGain();
	this.fadeNode = Pizzicato.context.createGain();
	this.fadeNode.gain.value = 0;

	if (!this.detached)
		this.masterVolume.connect(Pizzicato.masterGainNode);

	this.lastTimePlayed = 0;
	this.effects = [];
	this.effectConnectors = [];
	this.playing = this.paused = false;
	this.loop = hasOptions && description.options.loop;
	this.attack = hasOptions && util.isNumber(description.options.attack) ? description.options.attack : defaultAttack;
	this.volume = hasOptions && util.isNumber(description.options.volume) ? description.options.volume : 1;

	if (hasOptions && util.isNumber(description.options.release)) {
		this.release = description.options.release;
	} else if (hasOptions && util.isNumber(description.options.sustain)) {
		console.warn('\'sustain\' is deprecated. Use \'release\' instead.');
		this.release = description.options.sustain;
	} else {
		this.release = defaultRelease;
	}

	if (!description)
		(initializeWithWave.bind(this))({}, callback);

	else if (util.isString(description))
		(initializeWithUrl.bind(this))(description, callback);

	else if (util.isFunction(description))
		(initializeWithFunction.bind(this))(description, callback);

	else if (description.source === 'file')
		(initializeWithUrl.bind(this))(description.options.path, callback);

	else if (description.source === 'wave')
		(initializeWithWave.bind(this))(description.options, callback);

	else if (description.source === 'input')
		(initializeWithInput.bind(this))(description, callback);

	else if (description.source === 'script')
		(initializeWithFunction.bind(this))(description.options, callback);

	else if (description.source === 'sound')
		(initializeWithSoundObject.bind(this))(description.options, callback);

	function getDescriptionError(description) {
		var supportedSources = ['wave', 'file', 'input', 'script', 'sound'];

		if (description && (!util.isFunction(description) && !util.isString(description) && !util.isObject(description)))
			return 'Description type not supported. Initialize a sound using an object, a function or a string.';

		if (util.isObject(description)) {

			if (!util.isString(description.source) || supportedSources.indexOf(description.source) === -1)
				return 'Specified source not supported. Sources can be wave, file, input or script';

			if (description.source === 'file' && (!description.options || !description.options.path))
				return 'A path is needed for sounds with a file source';

			if (description.source === 'script' && (!description.options || !description.options.audioFunction))
				return 'An audio function is needed for sounds with a script source';
		}
	}

	function initializeWithWave(waveOptions, callback) {
		waveOptions = waveOptions || {};
		this.getRawSourceNode = function() {
			var frequency = this.sourceNode ? this.sourceNode.frequency.value : waveOptions.frequency;
			var node = Pizzicato.context.createOscillator();
			node.type = waveOptions.type || 'sine';
			node.frequency.value = (frequency || 440);

			return node;
		};
		this.sourceNode = this.getRawSourceNode();
		this.sourceNode.gainSuccessor = Pz.context.createGain();
		this.sourceNode.connect(this.sourceNode.gainSuccessor);

		if (util.isFunction(callback))
			callback();
	}

	function initializeWithUrl(paths, callback) {
		paths = util.isArray(paths) ? paths : [paths];

		var request = new XMLHttpRequest();
		request.open('GET', paths[0], true);
		request.responseType = 'arraybuffer';

		request.onload = function(progressEvent) {

			Pizzicato.context.decodeAudioData(progressEvent.target.response, (function(buffer) {

				self.getRawSourceNode = function() {
					var node = Pizzicato.context.createBufferSource();
					node.loop = this.loop;
					node.buffer = buffer;
					return node;
				};
				if (util.isFunction(callback))
					callback();

			}).bind(self), (function(error) {

				console.error('Error decoding audio file ' + paths[0]);

				if (paths.length > 1) {
					paths.shift();
					initializeWithUrl(paths, callback);
					return;
				}

				error = error || new Error('Error decoding audio file ' + paths[0]);

				if (util.isFunction(callback))
					callback(error);

			}).bind(self));

		};
		request.onreadystatechange = function(event) {

			if (request.readyState === 4 && request.status !== 200) {
				console.error('Error while fetching ' + paths[0] + '. ' + request.statusText);
			}
		};
		request.send();
	}

	function initializeWithInput(options, callback) {
		navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);

		if (!navigator.getUserMedia && (!navigator.mediaDevices || ! !navigator.mediaDevices.getUserMedia)) {
			console.error('Your browser does not support getUserMedia. Note that the current document must be loaded securely for this to work');
			return;
		}

		var handleStream = (function(stream) {
			self.getRawSourceNode = function() {
				return Pizzicato.context.createMediaStreamSource(stream);
			};
			if (util.isFunction(callback))
				callback();
		}).bind(self);

		var handleError = function(error) {
			if (util.isFunction(callback))
				callback(error);
		};

		if (!!navigator.mediaDevices.getUserMedia)
			navigator.mediaDevices.getUserMedia({ audio: true }).then(handleStream).catch(handleError);
		else
			navigator.getUserMedia({ audio: true }, handleStream, handleError);
	}

	function initializeWithFunction(options, callback) {
		var audioFunction = util.isFunction(options) ? options : options.audioFunction;
		var bufferSize = util.isObject(options) && options.bufferSize ? options.bufferSize : null;

		if (!bufferSize) {
			try { // Webkit does not automatically chose the buffer size
				var test = Pizzicato.context.createScriptProcessor();
			} catch (e) {
				bufferSize = 2048;
			}
		}

		this.getRawSourceNode = function() {
			var node = Pizzicato.context.createScriptProcessor(bufferSize, 1, 1);
			node.onaudioprocess = audioFunction;
			return node;
		};
	}

	function initializeWithSoundObject(options, callback) {
		this.getRawSourceNode = options.sound.getRawSourceNode;

		if (options.sound.sourceNode && Pz.Util.isOscillator(options.sound.sourceNode)) {
			this.sourceNode = this.getRawSourceNode();
			this.frequency = options.sound.frequency;
		}
	}
};

Pizzicato.Sound.prototype = Object.create(Pizzicato.Events, {

	play: {
		enumerable: true,

		value: function(when, offset) {

			if (this.playing)
				return;

			if (!Pz.Util.isNumber(offset))
				offset = this.offsetTime || 0;

			if (!Pz.Util.isNumber(when))
				when = 0;

			this.playing = true;
			this.paused = false;
			this.sourceNode = this.getSourceNode();

			this.applyAttack();

			if (Pz.Util.isFunction(this.sourceNode.start)) {
				this.lastTimePlayed = Pizzicato.context.currentTime - offset;
				this.sourceNode.start(Pz.context.currentTime + when, offset);
			}

			this.trigger('play');
		}
	},

	stop: {
		enumerable: true,

		value: function() {
			if (!this.paused && !this.playing)
				return;

			this.paused = this.playing = false;
			this.stopWithRelease();

			this.offsetTime = 0;
			this.trigger('stop');
		}
	},

	pause: {
		enumerable: true,

		value: function() {
			if (this.paused || !this.playing)
				return;

			this.paused = true;
			this.playing = false;

			this.stopWithRelease();

			var elapsedTime = Pz.context.currentTime - this.lastTimePlayed;

			// If we are using a buffer node - potentially in loop mode - we need to
			// know where to re-start the sound independently of the loop it is in.
			if (this.sourceNode.buffer)
				this.offsetTime = elapsedTime % (this.sourceNode.buffer.length / Pz.context.sampleRate);
			else
				this.offsetTime = elapsedTime;

			this.trigger('pause');
		}
	},

	clone: {
		enumerable: true,

		value: function() {
			var clone = new Pizzicato.Sound({
				source: 'sound',
				options: {
					loop: this.loop,
					attack: this.attack,
					release: this.release,
					volume: this.volume,
					sound: this
				}
			});

			for (var i = 0; i < this.effects.length; i++)
				clone.addEffect(this.effects[i]);

			return clone;
		}
	},

	onEnded: {
		enumerable: true,

		value: function(node) {
			return function() {
				// This function may've been called from the release
				// end. If in that time the Sound has been played again,
				// no action should be taken.
				if (!!this.sourceNode && this.sourceNode !== node)
					return;

				if (this.playing)
					this.stop();
				if (!this.paused)
					this.trigger('end');
			};
		}
	},

	/**
	 * Adding effects will create a graph in which there will be a
	 * gain node (effectConnector) in between every effect added. For example:
	 * [fadeNode]--->[effect 1]->[connector 1]--->[effect 2]->[connector 2]--->[masterGain]
	 *
	 * Connectors are used to know what nodes to disconnect and not disrupt the
	 * connections of another Pz.Sound object using the same effect.
	 */
	addEffect: {
		enumerable: true,

		value: function(effect) {
			if (!Pz.Util.isEffect(effect)) {
				console.error('The object provided is not a Pizzicato effect.');
				return this;
			}

			this.effects.push(effect);

			// Connects effect in the last position
			var previousNode = this.effectConnectors.length > 0 ? this.effectConnectors[this.effectConnectors.length - 1] : this.fadeNode;
			previousNode.disconnect();
			previousNode.connect(effect);

			// Creates connector for the newly added effect
			var gain = Pz.context.createGain();
			this.effectConnectors.push(gain);
			effect.connect(gain);
			gain.connect(this.masterVolume);

			return this;
		}
	},

	/**
	 * When removing effects, the graph in which there will be a
	 * gain node (effectConnector) in between every effect should be
	 * conserved. For example:
	 * [fadeNode]--->[effect 1]->[connector 1]--->[effect 2]->[connector 2]--->[masterGain]
	 *
	 * Connectors are used to know what nodes to disconnect and not disrupt the
	 * connections of another Pz.Sound object using the same effect.
	 */
	removeEffect: {
		enumerable: true,

		value: function(effect) {

			var index = this.effects.indexOf(effect);

			if (index === -1) {
				console.warn('Cannot remove effect that is not applied to this sound.');
				return this;
			}

			var shouldResumePlaying = this.playing;

			if (shouldResumePlaying)
				this.pause();

			var previousNode = (index === 0) ? this.fadeNode : this.effectConnectors[index - 1];
			previousNode.disconnect();

			// Disconnect connector and effect
			var effectConnector = this.effectConnectors[index];
			effectConnector.disconnect();
			effect.disconnect(effectConnector);

			// Remove connector and effect from our arrays
			this.effectConnectors.splice(index, 1);
			this.effects.splice(index, 1);

			var targetNode;
			if (index > this.effects.length - 1 || this.effects.length === 0)
				targetNode = this.masterVolume;
			else
				targetNode = this.effects[index];

			previousNode.connect(targetNode);

			if (shouldResumePlaying)
				this.play();

			return this;
		}
	},

	connect: {
		enumerable: true,

		value: function(audioNode) {
			this.masterVolume.connect(audioNode);
			return this;
		}
	},

	disconnect: {
		enumerable: true,

		value: function(audioNode) {
			this.masterVolume.disconnect(audioNode);
			return this;
		}
	},

	connectEffects: {
		enumerable: true,

		value: function() {

			var connectors = [];

			for (var i = 0; i < this.effects.length; i++) {

				var isLastEffect = i === this.effects.length - 1;
				var destinationNode = isLastEffect ? this.masterVolume : this.effects[i + 1].inputNode;

				connectors[i] = Pz.context.createGain();

				this.effects[i].outputNode.disconnect(this.effectConnectors[i]);

				this.effects[i].outputNode.connect(destinationNode);
			}
		}
	},

	volume: {
		enumerable: true,

		get: function() {
			if (this.masterVolume)
				return this.masterVolume.gain.value;
		},

		set: function(volume) {
			if (Pz.Util.isInRange(volume, 0, 1) && this.masterVolume)
				this.masterVolume.gain.value = volume;
		}
	},

	frequency: {
		enumerable: true,

		get: function() {
			if (this.sourceNode && Pz.Util.isOscillator(this.sourceNode)) {
				return this.sourceNode.frequency.value;
			}

			return null;
		},

		set: function(frequency) {
			if (this.sourceNode && Pz.Util.isOscillator(this.sourceNode)) {
				this.sourceNode.frequency.value = frequency;
			}
		}
	},

	/**
 	 * @deprecated - Use "release"
	 */
	sustain: {
		enumerable: true,

		get: function() {
			console.warn('\'sustain\' is deprecated. Use \'release\' instead.');
			return this.release;
		},

		set: function(sustain){
			console.warn('\'sustain\' is deprecated. Use \'release\' instead.');

			if (Pz.Util.isInRange(sustain, 0, 10))
				this.release = sustain;
		}
	},

	/**
	 * Returns the node that produces the sound. For example, an oscillator
	 * if the Sound object was initialized with a wave option.
	 */
	getSourceNode: {
		enumerable: true,

		value: function() {
			if (!!this.sourceNode) {

				// Directly disconnecting the previous source node causes a
				// 'click' noise, especially noticeable if the sound is played
				// while the release is ongoing. To address this, we fadeout the
				// old source node before disonnecting it.

				var previousSourceNode = this.sourceNode;
				previousSourceNode.gainSuccessor.gain.setValueAtTime(previousSourceNode.gainSuccessor.gain.value, Pz.context.currentTime);
				previousSourceNode.gainSuccessor.gain.linearRampToValueAtTime(0.0001, Pz.context.currentTime + 0.2);
				setTimeout(function() {
					previousSourceNode.disconnect();
					previousSourceNode.gainSuccessor.disconnect();
				}, 200);
			}

			var sourceNode = this.getRawSourceNode();

			// A gain node will be placed after the source node to avoid
			// clicking noises (by fading out the sound)
			sourceNode.gainSuccessor = Pz.context.createGain();
			sourceNode.connect(sourceNode.gainSuccessor);
			sourceNode.gainSuccessor.connect(this.fadeNode);
			this.fadeNode.connect(this.getInputNode());

			if (Pz.Util.isAudioBufferSourceNode(sourceNode))
				sourceNode.onended = this.onEnded(sourceNode).bind(this);

			return sourceNode;
		}
	},

	/**
	 * Returns the first node in the graph. When there are effects,
	 * the first node is the input node of the first effect.
	 */
	getInputNode: {
		enumerable: true,

		value: function() {
			if (this.effects.length > 0)
				return this.effects[0].inputNode;

			return this.masterVolume;
		}
	},

	/**
	 * Will take the current source node and work up the volume
	 * gradually in as much time as specified in the attack property
	 * of the sound.
	 */
	applyAttack: {
		enumerable: false,

		value: function() {
			var currentValue = this.fadeNode.gain.value;
			this.fadeNode.gain.cancelScheduledValues(Pz.context.currentTime);

			if (!this.attack) {
				this.fadeNode.gain.setTargetAtTime(1.0, Pz.context.currentTime, 0.001);
				return;
			}

			// We can't calculate the remaining attack time
			// in Firefox due to https://bugzilla.mozilla.org/show_bug.cgi?id=893020
			var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
			var remainingAttackTime = this.attack;

			if (!isFirefox)
				remainingAttackTime = (1 - this.fadeNode.gain.value) * this.attack;

			this.fadeNode.gain.setTargetAtTime(1.0, Pz.context.currentTime, remainingAttackTime * 2);
		}
	},

	/**
	 * Will take the current source node and work down the volume
	 * gradually in as much time as specified in the release property
	 * of the sound before stopping the source node.
	 */
	stopWithRelease: {
		enumerable: false,

		value: function(callback) {

			var node = this.sourceNode;
			var stopSound = function() {
				return Pz.Util.isFunction(node.stop) ? node.stop(0) : node.disconnect();
			};

			var currentValue = this.fadeNode.gain.value;
			this.fadeNode.gain.cancelScheduledValues(Pz.context.currentTime);

			if (!this.release) {
				this.fadeNode.gain.setTargetAtTime(0.0, Pz.context.currentTime, 0.001);
				stopSound();
				return;
			}

			// We can't calculate the remaining attack time
			// in Firefox due to https://bugzilla.mozilla.org/show_bug.cgi?id=893020
			var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
			var remainingReleaseTime = this.release;

			if (!isFirefox)
				remainingReleaseTime = this.fadeNode.gain.value * this.release;

			this.fadeNode.gain.setTargetAtTime(0.00001, Pz.context.currentTime, remainingReleaseTime / 5);

			window.setTimeout(function() {
				stopSound();
			}, remainingReleaseTime * 1000);
		}
	}
});


text:
from pprint import pprint

from django import forms

from o2.forms.widget_attrs import FormWidgetAttrs

class SugestaoForm(forms.Form):
    a = FormWidgetAttrs()

    codigo = forms.CharField(
        label='Código (matrícula)',
        required=True, min_length=1, max_length=5,
        widget=forms.TextInput(attrs={
            **a.autofocus, **a.number}))


text:
namespace web_cache {

// This class implements the Mojo interface mojom::WebCache.
class WebCacheImpl : public mojom::WebCache {
 public:
  WebCacheImpl();

  WebCacheImpl(const WebCacheImpl&) = delete;
  WebCacheImpl& operator=(const WebCacheImpl&) = delete;

  ~WebCacheImpl() override;

  void BindReceiver(mojo::PendingReceiver<mojom::WebCache> web_cache_receiver);

  // Needs to be called by RenderViews in case of navigations to execute
  // any 'clear cache' commands that were delayed until the next navigation.
  void ExecutePendingClearCache();

 private:
  enum State {
    kInit,
    kNavigate_Pending,
    kClearCache_Pending,
  };

  // mojom::WebCache methods:
  void SetCacheCapacity(uint64_t capacity) override;
  // If |on_navigation| is true, the clearing is delayed until the next
  // navigation event.
  void ClearCache(bool on_navigation) override;

  // Records status regarding the sequence of navigation event and
  // ClearCache(true) call, to ensure delayed 'clear cache' command always
  // get executed on navigation.
  State clear_cache_state_ = kInit;

  mojo::ReceiverSet<mojom::WebCache> receivers_;

  absl::optional<base::MemoryPressureListener> memory_pressure_listener_;
};

}  // namespace web_cache

#endif  // COMPONENTS_WEB_CACHE_RENDERER_WEB_CACHE_IMPL_H_