text:
using System;
using System.Diagnostics;
using Irony.Interpreter.Ast;
using Workbench.Core.Models;
using Workbench.Core.Nodes;

namespace Workbench.Core.Repeaters
{
    /// <summary>
    /// Interpreter for the visualizer property update language.
    /// </summary>
    internal class PropertyUpdateInterpreter
    {
        private readonly SolutionSnapshot _snapshot;

        internal PropertyUpdateInterpreter(PropertyUpdateContext theContext)
        {
            _snapshot = theContext.Snapshot;
        }

        internal object Process(PropertyUpdateExpressionModel theExpression)
        {
            switch (theExpression.Node.InnerExpression)
            {
                case StatementNode statementNode:
                    return ProcessStatement(statementNode);

                default:
                    throw new NotImplementedException("Unknown property update statement type.");
            }
        }

        private object ProcessStatement(StatementNode statementNode)
        {
            switch (statementNode.InnerStatement)
            {
                case IfStatementNode ifStatement:
                    return ProcessIfStatement(ifStatement);

                case VisualizerExpressionNode expression:
                    return ProcessExpression(expression.InnerExpression);

                default:
                    throw new NotImplementedException("Unknown statement not implemented.");
            }
        }

        private object ProcessIfStatement(IfStatementNode ifStatementNode)
        {
            if (EvaluateIfStatementCondition(ifStatementNode.Expression))
            {
                return ProcessExpression(ifStatementNode.Statement);
            }

            return string.Empty;
        }

        private object ProcessExpression(AstNode statement)
        {
            switch (statement)
            {
                case ValueReferenceStatementNode valueReferenceStatement:
                    return EvaluateValueReferenceExpression(valueReferenceStatement);

                case IntegerLiteralNode numberLiteral:
                    return Convert.ToString(numberLiteral.Value);

                case CharacterLiteralNode characterLiteral:
                    return Convert.ToString(characterLiteral.Value);

                default:
                    throw new NotImplementedException("Unknown statement.");
            }
        }

        private bool EvaluateIfStatementCondition(VisualizerBinaryExpressionNode binaryExpressionNode)
        {
            var leftValue = EvaluateExpression(binaryExpressionNode.LeftExpression);
            var rightValue = EvaluateExpression(binaryExpressionNode.RightExpression);

            return EvaluateBinaryExpression(binaryExpressionNode.Operator, leftValue, rightValue);
        }

        private object EvaluateExpression(VisualizerExpressionNode theExpression)
        {
            switch (theExpression.InnerExpression)
            {
                case NumberLiteralNode numberLiteralNode:
                    return numberLiteralNode.Value;

                case ValueReferenceStatementNode valueReferenceStatementNode:
                    return EvaluateValueReferenceExpression(valueReferenceStatementNode);

                case ItemNameNode itemNameNode:
                    return itemNameNode.Value;

                case CharacterLiteralNode characterLiteralNode:
                    return characterLiteralNode.Value;

                default:
                    throw new NotImplementedException("Unknown visualizer expression");
            }
        }

        private object EvaluateValueReferenceExpression(ValueReferenceStatementNode theValueReferenceExpression)
        {
            if (theValueReferenceExpression.IsSingletonValue)
            {
                var singletonVariableName = theValueReferenceExpression.VariableName;
                var singletonValue = _snapshot.GetSingletonLabelByVariableName(singletonVariableName.Name);
                return singletonValue.Value;
            }
            else if (theValueReferenceExpression.IsAggregateValue)
            {
                var aggregateVariableName = theValueReferenceExpression.VariableName;
                var aggregateVariableOffset = theValueReferenceExpression.ValueOffset;
                Debug.Assert(aggregateVariableOffset.IsLiteral);
                var offsetValue = aggregateVariableOffset.Literal.Value;
                var aggregateValue = _snapshot.GetAggregateLabelByVariableName(aggregateVariableName.Name);
                return aggregateValue.GetValueAt(offsetValue - 1);
            }
            else
            {
                throw new NotImplementedException();
            }
        }

        private bool EvaluateBinaryExpression(OperatorType theOperator, object leftValue, object rightValue)
        {
            switch (leftValue)
            {
                case int leftValueAsInt:
                    return EvaluateNumberBinaryExpression(theOperator, leftValueAsInt, rightValue);

                case char leftValueAsChar:
                    return EvaluateCharBinaryExpression(theOperator, leftValueAsChar, rightValue);

                case string leftValueAsString:
                    return EvaluateStringBinaryExpression(theOperator, leftValueAsString, rightValue);

                default:
                    throw new NotImplementedException("Unknown value type.");
            }
        }

        private bool EvaluateStringBinaryExpression(OperatorType theOperator, string leftString, object rightValue)
        {
            var rightString = rightValue.ToString();

            switch (theOperator)
            {
                case OperatorType.Equals:
                    return leftString == rightString;

                case OperatorType.NotEqual:
                    return leftString != rightString;

                default:
                    throw new NotImplementedException("Unknown operator.");
            }
        }

        private bool EvaluateCharBinaryExpression(OperatorType theOperator, int leftChar, object rightValue)
        {
            if (!char.TryParse(rightValue.ToString(), out char rightChar)) return false;

            switch (theOperator)
            {
                case OperatorType.Equals:
                    return leftChar == rightChar;

                case OperatorType.NotEqual:
                    return leftChar != rightChar;

                case OperatorType.Greater:
                    return leftChar > rightChar;

                case OperatorType.GreaterThanOrEqual:
                    return leftChar >= rightChar;

                case OperatorType.Less:
                    return leftChar < rightChar;

                case OperatorType.LessThanOrEqual:
                    return leftChar <= rightChar;

                default:
                    throw new NotImplementedException("Unknown operator.");
            }
        }

        private bool EvaluateNumberBinaryExpression(OperatorType theOperator, int leftNumber, object rightValue)
        {
            if (!Int32.TryParse(rightValue.ToString(), out int rightNumber)) return false;

            switch (theOperator)
            {
                case OperatorType.Equals:
                    return leftNumber == rightNumber;

                case OperatorType.NotEqual:
                    return leftNumber != rightNumber;

                case OperatorType.Greater:
                    return leftNumber > rightNumber;

                case OperatorType.GreaterThanOrEqual:
                    return leftNumber >= rightNumber;

                case OperatorType.Less:
                    return leftNumber < rightNumber;

                case OperatorType.LessThanOrEqual:
                    return leftNumber <= rightNumber;

                default:
                    throw new NotImplementedException("Unknown operator.");
            }
        }
    }
}


text:
<?php

?>
<select multiple="multiple" name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>[]" id="<?php echo esc_attr( $key ); ?>" class="multiselect <?php echo ! empty( $field['class'] ) ? $field['class'] : ''; ?>" <?php if ( ! empty( $field['required'] ) ) echo 'required'; ?>>
	<?php foreach ( $field['options'] as $key => $value ) : ?>
		<option value="<?php echo esc_attr( $key ); ?>" <?php if ( ! empty( $field['value'] ) && is_array( $field['value'] ) ) selected( in_array( $key, $field['value'] ), true ); ?>><?php echo esc_html( $value ); ?></option>
	<?php endforeach; ?>
</select>
<?php if ( ! empty( $field['description'] ) ) : ?><small class="description"><?php echo $field['description']; ?></small><?php endif; ?>

redpajama_set_name: RedPajamaGithub


text:
/**
 * JSON handler, that handles JSON as well as a JavaScript object retrieved in responseJSON
 */
Aria.classDefinition({
    $classpath : "aria.modules.requestHandler.JSONRequestHandler",
    $extends : "aria.modules.requestHandler.RequestHandler",
    $implements : ["aria.modules.requestHandler.IRequestHandler"],
    $statics : {
        PARSING_ERROR : "Response text could not be evaluated as JSON."
    },
    $constructor : function () {
        this.$RequestHandler.constructor.call(this);

        /**
         * Request Headers to be used
         * @type Object
         */
        this.headers = {
            "Content-Type" : "application/json"
        };
    },
    $prototype : {
        /**
         * Expect JSON as response type
         * @type String
         */
        expectedResponseType : "json",

        /**
         * Handles the response from the server, and call the associated callback
         * @param {aria.modules.RequestBeans:SuccessResponse} successResponse
         * @param {aria.modules.RequestBeans:Request} request
         * @param {aria.core.CfgBeans:Callback} callback to call with the response
         */
        processSuccess : function (successResponse, request, callback) {
            var res = {};
            if (successResponse.responseJSON) {
                res.response = successResponse.responseJSON;
            } else if (successResponse.responseText) {
                res.response = aria.utils.Json.load(successResponse.responseText, this, this.PARSING_ERROR);
                if (!res.response) {
                    res.error = true;
                }
                if (res.error) {
                    res.errorData = {
                        "messageBean" : {
                            "localizedMessage" : this.PARSING_ERROR,
                            "type" : "PARSINGERROR"
                        }
                    };
                }
            } else {
                // no data : no error
                res.response = null;
            }
            this.$callback(callback, res);
        }
    }
});


text:
module GM
  module Parallax

    # Moves views relative to the `contentOffset` of a scroll view. You can move
    # the views faster or slower than the other elements to create a parallax
    # effect, or you can link two scroll views, so that scrolling one also
    # scrolls the other.
    #
    # If you assign link two `UIScrollView`s, the `contentOffset` will be
    # adjusted, not its frame position.  If you really want to adjust its
    # position, put it in an empty `UIView` and adjust that.
    #
    # Rules
    # -----
    # You can use booleans, numbers, or your own arbitrary formula.
    #
    # Numeric => the rate at which scaling should occur vertically.
    # true => the view will scroll with the view, useful to have views that are
    #   outside the scroll view move with scrolling in one direction or another
    # false => "fixes" the object, so that it stays in place during scrolling.
    # Array => [x_rate, y_rate] => the rate at which scaling should occur in
    #   both directions
    # Hash => {x: x_rate, y:y_rate} => same as Array, but more explicit
    # CGPoint => used as an offset.  only useful when using a lambda, below
    # ->(offset){ CGPoint.new(offset.x + 1, offset.y + 1) } => receives the
    #                          content offset and returns a new x, y offset
    # ->(offset){ nil } => do nothing
    #
    # Examples
    # --------
    #
    # @example
    #     # these are all view objects of some sort.  this example shows how to
    #     # configure them to respond to scroll movements:
    #     #
    #     #   button => should not move with the window
    #     #   bg_image => should scroll past 2x faster (parallax)
    #     #   diagonal => moves left-to-right, which has the appearance of moving diagonally
    #     #   moving_thing => moves from right to left, when the contentOffset is between 1000 and 1400
    #     #   another_scroller => the y offset is tracked, the left is not
    #     prepare_parallax(scroll_view,
    #       button   => false,
    #       bg_image => 2,
    #       diagonal => ->(offset) { [offset.x, 0] }
    #       moving_thing => ->(offset) { (1000..1500) === contentOffset.y ? [contentOffset.y - 1000, 0] : nil },
    #       another_scroller => [0, 1],  # contentOffset.y will be the same when scroll_view is changed
    #       )
    #     prepare_parallax(another_scroller,
    #       scroll_view: [0, 1]  # for now, you need to establish the scrolling
    #       # relationship on both scroll views
    #       )
    def prepare_parallax(scroll_view, view_rules)
      scroll_view.delegate = self

      @parallax_views ||= {}
      @parallax_views[scroll_view] ||= {}
      @parallax_views[scroll_view].merge!(view_rules)

      @parallax_view_origins ||= {}
      view_rules.each do |view, rule|
        @parallax_view_origins[view] = view.frame.origin
      end
    end

    ##|
    ##|  SCROLLING
    ##|
    def scrollViewDidScroll(scroll_view)
      content_offset = scroll_view.contentOffset

      @parallax_views[scroll_view].each do |view, rule|
        x_rule = nil
        y_rule = nil
        point = nil

        if rule.is_a?(Proc)
          rule = rule.call(content_offset)
        end

        case rule
        when true
          # the view will move at the same rate as the scroll view.  for views
          # inside the scroll_view, this does absolutely nothing, but views
          # outside the scroll_view will be adjusted
          if view.isDescendantOfView(scroll_view)
            x_rule = 0
            y_rule = 0
          else
            x_rule = 1
            y_rule = 1
          end
        when false
          # fixes the view, which means it only needs to be moved if it is a
          # child view of the scroll_view
          if view.isDescendantOfView(scroll_view)
            x_rule = -1
            y_rule = -1
          else
            x_rule = 0
            y_rule = 0
          end
        when Numeric
          x_rule = rule
          y_rule = rule
        when Array
          x_rule = rule[0]
          y_rule = rule[1]
        when Hash
          x_rule = rule[:x]
          y_rule = rule[:y]
        when CGPoint
          point = rule
        when nil
          # cool, do nothing
        else
          raise "Unknown rule #{rule.inspect} in GM::Parallax"
        end

        if view.is_a?(UIScrollView)
          offset = view.contentOffset
          if x_rule
            offset.x = content_offset.x * x_rule
          end
          if y_rule
            offset.y = content_offset.y * y_rule
          end
          view.contentOffset = offset
        else
          f = view.frame
          origin = @parallax_view_origins[view]

          if point
            f.origin = CGPoint.new(origin.x + point.x, origin.y + point.y)
          else
            if x_rule
              f.origin.x = origin.x - content_offset.x * x_rule
            end
            if y_rule
              f.origin.y = origin.y - content_offset.y * y_rule
            end
          end

          view.frame = f
        end
      end
    end

  end
end


text:
namespace ginseng::util::concurrent::schedulers
{
	namespace implementation
	{
		Scheduler::Pointer shared_computational = nullptr;
	}

	Scheduler::Pointer computational_pool()
	{
		if (!implementation::shared_computational)
			implementation::shared_computational = shared(computational());

		return implementation::shared_computational;
	}
}


text:
namespace WarMachines.Models
{
    using System.Text;
    using WarMachines.Interfaces;
    public class Tank : Machine,IMachine,ITank
    {
        private const int AttackPointChange = 40;
        private const int DefensePointChange = 30;
        private const double initialHealthPoints = 100;
        public Tank(string name, double attackPoints, double defensePoints)
            : base(name, attackPoints, defensePoints,initialHealthPoints)
        {
            this.ToggleDefenseMode();
        }

        public bool DefenseMode { get; private set; }

        public void ToggleDefenseMode()
        {
            this.DefenseMode = !this.DefenseMode;
            if (this.DefenseMode == true )
            {
                this.DefensePoints += DefensePointChange;
                this.AttackPoints -= AttackPointChange;
            }
            else
            {
                this.DefensePoints -= DefensePointChange;
                this.AttackPoints += AttackPointChange;
            }
        }
        public override string ToString()
        {
            var baseString = base.ToString();
            var result = new StringBuilder();
            result.Append(baseString);
            result.Append(string.Format(" *Defense: {0}",this.DefenseMode ? "ON" : "OFF"));
            return result.ToString();
        }
    }
}


text:
var sys = require('pex-sys');
var glu = require('pex-glu');
var materials = require('pex-materials');
var color = require('pex-color');
var gen = require('pex-gen');
var geom = require('pex-geom');

var Platform = sys.Platform;
var Cube = gen.Cube;
var Mesh = glu.Mesh;
var Diffuse = materials.Diffuse;
var PerspectiveCamera = glu.PerspectiveCamera;
var Arcball = glu.Arcball;
var Color = color.Color;
var RenderTarget = glu.RenderTarget;
var Texture2D = glu.Texture2D;
var ScreenImage = glu.ScreenImage;
var Vec3 = geom.Vec3;

var MRTMaterial = require('./MRTMaterial');

sys.Window.create({
  settings: {
    width: 768,
    height: 256,
    type: '3d',
    fullscreen: sys.Platform.isBrowser
  },
  init: function() {
    if (Platform.isBrowser) {
      var webglDrawBuffersExt = this.gl.getExtension('WEBGL_draw_buffers');
      if (!webglDrawBuffersExt) {
        throw 'WEBGL_draw_buffers not supported';
      }
    }

    var cube = new Cube(0.5);
    this.mesh = new Mesh(cube, new MRTMaterial( { diffuseColor: Color.Grey, ambientColor: Color.DarkGrey }));
    this.meshRight = new Mesh(cube, new MRTMaterial( { diffuseColor: Color.Red, ambientColor: Color.DarkGrey }));
    this.meshRight.position = new Vec3(1, 0, 0);
    this.meshTop = new Mesh(cube, new MRTMaterial( { diffuseColor: Color.Green, ambientColor: Color.DarkGrey }));
    this.meshTop.position = new Vec3(0, 1, 0);
    this.meshFront = new Mesh(cube, new MRTMaterial( { diffuseColor: Color.Blue, ambientColor: Color.DarkGrey }));
    this.meshFront.position = new Vec3(0, 0, 1);

    var rtWidth = this.height;
    var rtHeight = this.height;

    //create textures for offscreen rendering
    var colorBuf0 = Texture2D.create(rtWidth, rtHeight, { format: this.gl.RGBA, type: this.gl.UNSIGNED_BYTE });
    var colorBuf1 = Texture2D.create(rtWidth, rtHeight, { format: this.gl.RGBA, bbp: 32 });
    var depthBuf = Texture2D.create(rtWidth, rtHeight, { format: this.gl.DEPTH_COMPONENT, type: this.gl.UNSIGNED_SHORT });

    this.renderTarget = new RenderTarget(rtWidth, rtHeight, { color: [colorBuf0, colorBuf1], depth: depthBuf });

    //create two ScreenImages to display rendered texture and depth buf on the screen
    this.screenImageColor0 = new ScreenImage(colorBuf0, 0, 0, rtWidth, rtHeight, this.width, this.height);
    this.screenImageColor1 = new ScreenImage(colorBuf1, rtWidth, 0, rtWidth, rtHeight, this.width, this.height);
    this.screenImageDepth = new ScreenImage(depthBuf, rtWidth*2, 0, rtWidth, rtHeight, this.width, this.height);

    this.camera = new PerspectiveCamera(60, rtWidth / rtHeight, 1, 10);
    this.arcball = new Arcball(this, this.camera);
    this.arcball.setPosition(new Vec3(1, 2, 3));
  },
  draw: function() {
    glu.clearColorAndDepth(Color.DarkGrey);
    glu.enableDepthReadAndWrite(true);

    //always set the viewport to the size of the offscreen rendering
    glu.viewport(0, 0, this.renderTarget.width, this.renderTarget.height);
    this.renderTarget.bind();
    glu.clearColorAndDepth(Color.Black);
    this.mesh.draw(this.camera);
    this.meshRight.draw(this.camera);
    this.meshTop.draw(this.camera);
    this.meshFront.draw(this.camera);
    this.renderTarget.unbind();

    //set the viewport back to the full screen size after you are done
    glu.viewport(0, 0, this.width, this.height);

    this.screenImageColor0.draw();
    this.screenImageColor1.draw();
    this.screenImageDepth.draw();
  }
});


text:
@class ZXWallpaperModel;
@class ZXPictureModel;

typedef void(^BLOCK)(ZXPictureModel *pictureModel);

@interface ZXWallPaperCell : UITableViewCell

@property (strong,nonatomic)NSArray *pictureView_array;

@property(nonatomic, strong)ZXWallpaperModel *myModel;

+(ZXWallPaperCell *)cellWithTableView:(UITableView *)tableView;

@property(nonatomic, strong)BLOCK   myBlock;
+(ZXWallPaperCell *)cellWithTableView:(UITableView *)tableView andBlock:(BLOCK)myBlock;

@end


text:
import axios from 'axios';
import urls from './urls';

const http = axios.create({
    headers: {
        'X-Requested-With': 'XMLHttpRequest',
        'Cache-control': 'no-cache',
        'If-Modified-Since': 'Mon, 26 Jul 1997 05:00:00 GMT',
        Pragma: 'no-cache'
    },

    withCredentials: true
});

export const auth = {
    login(user) {
        return http.post(urls.request('auth/login'), user);
    }
};

export default {
    auth
};


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.containerservice.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

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

    /** Static value AvailabilitySet for AgentPoolType. */
    public static final AgentPoolType AVAILABILITY_SET = fromString("AvailabilitySet");

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

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


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache</groupId>
    <artifactId>sqoop</artifactId>
    <version>1.99.1-cdh4.2.1</version>
  </parent>

  <groupId>org.apache.sqoop</groupId>
  <artifactId>sqoop-client</artifactId>
  <name>Sqoop Client</name>

  <dependencies>
    <dependency>
      <groupId>org.apache.sqoop</groupId>
      <artifactId>sqoop-common</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>1.2</version>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
    </dependency>
    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-client</artifactId>
      <version>1.11</version>
    </dependency>
    <dependency>
      <groupId>jline</groupId>
      <artifactId>jline</artifactId>
      <version>0.9.94</version>
    </dependency>
    <dependency>
      <groupId>org.fusesource.jansi</groupId>
      <artifactId>jansi</artifactId>
      <version>1.7</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>1.8.5</version>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>dist</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}/lib</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>


text:
.filter-bar-backdrop {
  -webkit-transition: opacity 150ms ease-in-out;
  transition: opacity 150ms ease-in-out;
  opacity: 0;
  background-color: rgba(0, 0, 0, 0.4);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; }
  .filter-bar-backdrop.active {
    z-index: 10;
    opacity: 1; }

.filter-bar {
  position: fixed;
  width: 100%;
  height: 44px;
  z-index: 10; }
  .filter-bar .filter-bar-wrapper {
    z-index: 11;
    position: absolute;
    top: 0;
    right: 0;
    width: 100%; }
    .filter-bar .filter-bar-wrapper .item-input-inset .icon.placeholder-icon:before {
      padding-top: 3px;
      font-size: 16px; }
    .filter-bar .filter-bar-wrapper .item-input-inset .item-input-wrapper {
      background: #fff;
      height: 28px; }
      .filter-bar .filter-bar-wrapper .item-input-inset .item-input-wrapper .filter-bar-clear {
        padding: 0 2px 0 0; }
        .filter-bar .filter-bar-wrapper .item-input-inset .item-input-wrapper .filter-bar-clear:before {
          color: #aaa;
          font-size: 18px;
          padding-top: 1px; }

.platform-android .filter-bar .filter-bar-light .item-input-wrapper {
  border-bottom: 1px solid #ccc;
  background: white; }
  .platform-android .filter-bar .filter-bar-light .item-input-wrapper input[type="search"] {
    color: #444; }
    .platform-android .filter-bar .filter-bar-light .item-input-wrapper input[type="search"]::-moz-placeholder {
      color: #aaaaaa; }
    .platform-android .filter-bar .filter-bar-light .item-input-wrapper input[type="search"]:-ms-input-placeholder {
      color: #aaaaaa; }
    .platform-android .filter-bar .filter-bar-light .item-input-wrapper input[type="search"]::-webkit-input-placeholder {
      color: #aaaaaa;
      text-indent: 0; }
  .platform-android .filter-bar .filter-bar-light .item-input-wrapper .filter-bar-clear:before {
    color: #444; }
.platform-android .filter-bar .filter-bar-stable .item-input-wrapper {
  border-bottom: 1px solid #a2a2a2;
  background: #f8f8f8; }
  .platform-android .filter-bar .filter-bar-stable .item-input-wrapper input[type="search"] {
    color: #444; }
    .platform-android .filter-bar .filter-bar-stable .item-input-wrapper input[type="search"]::-moz-placeholder {
      color: #aaaaaa; }
    .platform-android .filter-bar .filter-bar-stable .item-input-wrapper input[type="search"]:-ms-input-placeholder {
      color: #aaaaaa; }
    .platform-android .filter-bar .filter-bar-stable .item-input-wrapper input[type="search"]::-webkit-input-placeholder {
      color: #aaaaaa;
      text-indent: 0; }
  .platform-android .filter-bar .filter-bar-stable .item-input-wrapper .filter-bar-clear:before {
    color: #444; }
.platform-android .filter-bar .filter-bar-positive .item-input-wrapper {
  border-bottom: 1px solid #0c60ee;
  background: #387ef5; }
  .platform-android .filter-bar .filter-bar-positive .item-input-wrapper input[type="search"] {
    color: #fff; }
    .platform-android .filter-bar .filter-bar-positive .item-input-wrapper input[type="search"]::-moz-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-positive .item-input-wrapper input[type="search"]:-ms-input-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-positive .item-input-wrapper input[type="search"]::-webkit-input-placeholder {
      color: white;
      text-indent: 0; }
  .platform-android .filter-bar .filter-bar-positive .item-input-wrapper .filter-bar-clear:before {
    color: #fff; }
.platform-android .filter-bar .filter-bar-calm .item-input-wrapper {
  border-bottom: 1px solid #0a9dc7;
  background: #11c1f3; }
  .platform-android .filter-bar .filter-bar-calm .item-input-wrapper input[type="search"] {
    color: #fff; }
    .platform-android .filter-bar .filter-bar-calm .item-input-wrapper input[type="search"]::-moz-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-calm .item-input-wrapper input[type="search"]:-ms-input-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-calm .item-input-wrapper input[type="search"]::-webkit-input-placeholder {
      color: white;
      text-indent: 0; }
  .platform-android .filter-bar .filter-bar-calm .item-input-wrapper .filter-bar-clear:before {
    color: #fff; }
.platform-android .filter-bar .filter-bar-assertive .item-input-wrapper {
  border-bottom: 1px solid #e42112;
  background: #ef473a; }
  .platform-android .filter-bar .filter-bar-assertive .item-input-wrapper input[type="search"] {
    color: #fff; }
    .platform-android .filter-bar .filter-bar-assertive .item-input-wrapper input[type="search"]::-moz-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-assertive .item-input-wrapper input[type="search"]:-ms-input-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-assertive .item-input-wrapper input[type="search"]::-webkit-input-placeholder {
      color: white;
      text-indent: 0; }
  .platform-android .filter-bar .filter-bar-assertive .item-input-wrapper .filter-bar-clear:before {
    color: #fff; }
.platform-android .filter-bar .filter-bar-balanced .item-input-wrapper {
  border-bottom: 1px solid #28a54c;
  background: #33cd5f; }
  .platform-android .filter-bar .filter-bar-balanced .item-input-wrapper input[type="search"] {
    color: #fff; }
    .platform-android .filter-bar .filter-bar-balanced .item-input-wrapper input[type="search"]::-moz-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-balanced .item-input-wrapper input[type="search"]:-ms-input-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-balanced .item-input-wrapper input[type="search"]::-webkit-input-placeholder {
      color: white;
      text-indent: 0; }
  .platform-android .filter-bar .filter-bar-balanced .item-input-wrapper .filter-bar-clear:before {
    color: #fff; }
.platform-android .filter-bar .filter-bar-energized .item-input-wrapper {
  border-bottom: 1px solid #e6b500;
  background: #ffc900; }
  .platform-android .filter-bar .filter-bar-energized .item-input-wrapper input[type="search"] {
    color: #fff; }
    .platform-android .filter-bar .filter-bar-energized .item-input-wrapper input[type="search"]::-moz-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-energized .item-input-wrapper input[type="search"]:-ms-input-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-energized .item-input-wrapper input[type="search"]::-webkit-input-placeholder {
      color: white;
      text-indent: 0; }
  .platform-android .filter-bar .filter-bar-energized .item-input-wrapper .filter-bar-clear:before {
    color: #fff; }
.platform-android .filter-bar .filter-bar-royal .item-input-wrapper {
  border-bottom: 1px solid #6b46e5;
  background: #886aea; }
  .platform-android .filter-bar .filter-bar-royal .item-input-wrapper input[type="search"] {
    color: #fff; }
    .platform-android .filter-bar .filter-bar-royal .item-input-wrapper input[type="search"]::-moz-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-royal .item-input-wrapper input[type="search"]:-ms-input-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-royal .item-input-wrapper input[type="search"]::-webkit-input-placeholder {
      color: white;
      text-indent: 0; }
  .platform-android .filter-bar .filter-bar-royal .item-input-wrapper .filter-bar-clear:before {
    color: #fff; }
.platform-android .filter-bar .filter-bar-dark .item-input-wrapper {
  border-bottom: 1px solid #000;
  background: #444444; }
  .platform-android .filter-bar .filter-bar-dark .item-input-wrapper input[type="search"] {
    color: #fff; }
    .platform-android .filter-bar .filter-bar-dark .item-input-wrapper input[type="search"]::-moz-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-dark .item-input-wrapper input[type="search"]:-ms-input-placeholder {
      color: white; }
    .platform-android .filter-bar .filter-bar-dark .item-input-wrapper input[type="search"]::-webkit-input-placeholder {
      color: white;
      text-indent: 0; }
  .platform-android .filter-bar .filter-bar-dark .item-input-wrapper .filter-bar-clear:before {
    color: #fff; }
.platform-android .filter-bar .filter-bar-default .item-input-wrapper {
  border-bottom: 1px solid #ccc;
  background: white; }
  .platform-android .filter-bar .filter-bar-default .item-input-wrapper input[type="search"] {
    color: #444; }
    .platform-android .filter-bar .filter-bar-default .item-input-wrapper input[type="search"]::-moz-placeholder {
      color: #aaaaaa; }
    .platform-android .filter-bar .filter-bar-default .item-input-wrapper input[type="search"]:-ms-input-placeholder {
      color: #aaaaaa; }
    .platform-android .filter-bar .filter-bar-default .item-input-wrapper input[type="search"]::-webkit-input-placeholder {
      color: #aaaaaa;
      text-indent: 0; }
  .platform-android .filter-bar .filter-bar-default .item-input-wrapper .filter-bar-clear:before {
    color: #444; }
.platform-android .filter-bar-wrapper .item-input-inset {
  padding-right: 24px; }
  .platform-android .filter-bar-wrapper .item-input-inset .filter-bar-cancel {
    padding-left: 0; }
    .platform-android .filter-bar-wrapper .item-input-inset .filter-bar-cancel:before {
      font-size: 24px; }
  .platform-android .filter-bar-wrapper .item-input-inset .item-input-wrapper {
    border-radius: 0;
    padding-left: 0;
    margin-left: 10px; }
    .platform-android .filter-bar-wrapper .item-input-inset .item-input-wrapper input[type="search"] {
      font-weight: 500; }
    .platform-android .filter-bar-wrapper .item-input-inset .item-input-wrapper .filter-bar-clear:before {
      font-size: 20px; }

.filter-bar-transition-horizontal {
  -webkit-transition: -webkit-transform cubic-bezier(.25, .45, .05, 1) 300ms;
  transition: transform cubic-bezier(.25, .45, .05, 1) 300ms;
  -webkit-transform: translate3d(100%, 0, 0);
  transform: translate3d(100%, 0, 0); }

.filter-bar-transition-vertical {
  -webkit-transition: -webkit-transform cubic-bezier(.25, .45, .05, 1) 350ms;
  transition: transform cubic-bezier(.25, .45, .05, 1) 350ms;
  -webkit-transform: translate3d(0, -100%, 0);
  transform: translate3d(0, -100%, 0); }

.filter-bar-transition-fade {
  -webkit-transition: opacity 250ms ease-in-out;
  transition: opacity 250ms ease-in-out;
  opacity: 0; }

.filter-bar-in {
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  opacity: 1; }

.filter-bar-modal .item.item-input {
  padding-right: 16px; }
.filter-bar-modal .list-right-editing .item.item-input {
  opacity: .5; }
.filter-bar-modal .button.button-icon.ion-ios-checkmark-empty:before {
  font-size: 42px; }

.filter-bar-element-hide {
  display: none; }


text:
namespace EasyPost._base
{
    public abstract class EasyPostService : WithClient, IEasyPostService
    {
        internal EasyPostService(EasyPostClient client)
        {
            Client = client;
        }
    }

    public interface IEasyPostService
    {
    }
}


text:
module OffsitePayments #:nodoc:
  module Integrations #:nodoc:
    module DirecPay
      mattr_accessor :production_url, :test_url

      self.production_url = "https://www.timesofmoney.com/direcpay/secure/dpMerchantTransaction.jsp"
      self.test_url       = "https://test.direcpay.com/direcpay/secure/dpMerchantTransaction.jsp"

      def self.service_url
        mode = OffsitePayments.mode
        case mode
        when :production
          self.production_url
        when :test
          self.test_url
        else
          raise StandardError, "Integration mode set to an invalid value: #{mode}"
        end
      end

      def self.notification(post, options = {})
        Notification.new(post)
      end

      def self.return(query_string, options = {})
        Return.new(query_string, options)
      end

      def self.request_status_update(mid, transaction_id, notification_url)
        Status.new(mid).update(transaction_id, notification_url)
      end

      class Helper < OffsitePayments::Helper
        mapping :account,  'MID'
        mapping :order,    'Merchant Order No'
        mapping :amount,   'Amount'
        mapping :currency, 'Currency'
        mapping :country,  'Country'

        mapping :billing_address,  :city     => 'custCity',
                                   :address1 => 'custAddress',
                                   :state    => 'custState',
                                   :zip      => 'custPinCode',
                                   :country  => 'custCountry',
                                   :phone    => 'custMobileNo'

        mapping :shipping_address, :name     => 'deliveryName',
                                   :city     => 'deliveryCity',
                                   :address1 => 'deliveryAddress',
                                   :state    => 'deliveryState',
                                   :zip      => 'deliveryPinCode',
                                   :country  => 'deliveryCountry',
                                   :phone    => 'deliveryMobileNo'

        mapping :customer, :name  => 'custName',
                           :email => 'custEmailId'

        mapping :description, 'otherNotes'
        mapping :edit_allowed, 'editAllowed'

        mapping :return_url, 'Success URL'
        mapping :failure_url, 'Failure URL'

        mapping :operating_mode, 'Operating Mode'
        mapping :other_details, 'Other Details'
        mapping :collaborator, 'Collaborator'

        OPERATING_MODE = 'DOM'
        COUNTRY        = 'IND'
        CURRENCY       = 'INR'
        OTHER_DETAILS  = 'NULL'
        EDIT_ALLOWED   = 'Y'

        PHONE_CODES = {
          'IN' => '91',
          'US' => '01',
          'CA' => '01'
        }

        ENCODED_PARAMS = [ :account, :operating_mode, :country, :currency, :amount, :order, :other_details, :return_url, :failure_url, :collaborator ]

        def initialize(order, account, options = {})
          super
          collaborator = OffsitePayments.mode == :test || options[:test] ? 'TOML' : 'DirecPay'
          add_field(mappings[:collaborator], collaborator)
          add_field(mappings[:country], 'IND')
          add_field(mappings[:operating_mode], OPERATING_MODE)
          add_field(mappings[:other_details], OTHER_DETAILS)
          add_field(mappings[:edit_allowed], EDIT_ALLOWED)
        end

        def customer(params = {})
          add_field(mappings[:customer][:name], full_name(params))
          add_field(mappings[:customer][:email], params[:email])
        end

        # Need to format the amount to have 2 decimal places
        def amount=(money)
          cents = money.respond_to?(:cents) ? money.cents : money
          raise ArgumentError, "amount must be a Money object or an integer" if money.is_a?(String)
          raise ActionViewHelperError, "amount must be greater than $0.00" if cents.to_i <= 0

          add_field(mappings[:amount], sprintf("%.2f", cents.to_f/100))
        end

        def shipping_address(params = {})
          super(update_address(:shipping_address, params))
        end

        def billing_address(params = {})
          super(update_address(:billing_address, params))
        end

        def form_fields
          add_failure_url
          add_request_parameters

          unencoded_parameters
        end

        private

        def add_request_parameters
          params = ENCODED_PARAMS.map{ |param| fields[mappings[param]] }
          encoded = encode_value(params.join('|'))

          add_field('requestparameter', encoded)
        end

        def unencoded_parameters
          params = fields.dup
          # remove all encoded params from exported fields
          ENCODED_PARAMS.each{ |param| params.delete(mappings[param]) }
          # remove all special characters from each field value
          params = params.collect{|name, value| [name, remove_special_characters(value)] }
          Hash[params]
        end

        def add_failure_url
          if fields[mappings[:failure_url]].nil?
            add_field(mappings[:failure_url], fields[mappings[:return_url]])
          end
        end

        def update_address(address_type, params)
          params = params.dup
          address = params[:address1]
          address = "#{address} #{params[:address2]}" if params[:address2].present?
          address = "#{params[:company]} #{address}" if params[:company].present?
          params[:address1] = address

          params[:phone] = normalize_phone_number(params[:phone])
          add_land_line_phone_for(address_type, params)

          if address_type == :shipping_address
            shipping_name = full_name(params) || fields[mappings[:customer][:name]]
            add_field(mappings[:shipping_address][:name], shipping_name)
          end
          params
        end

        # Split a single phone number into the country code, area code and local number as best as possible
        def add_land_line_phone_for(address_type, params)
          address_field = address_type == :billing_address ? 'custPhoneNo' : 'deliveryPhNo'

          if params.has_key?(:phone2)
            phone = normalize_phone_number(params[:phone2])
            phone_country_code, phone_area_code, phone_number = nil

            if params[:country] == 'IN' && phone =~ /(91)? *(\d{3}) *(\d{4,})$/
              phone_country_code, phone_area_code, phone_number = $1, $2, $3
            else
              numbers = phone.split(' ')
              case numbers.size
              when 3
                phone_country_code, phone_area_code, phone_number = numbers
              when 2
                phone_area_code, phone_number = numbers
              else
                phone =~ /(\d{3})(\d+)$/
                phone_area_code, phone_number = $1, $2
              end
            end

            add_field("#{address_field}1", phone_country_code || phone_code_for_country(params[:country]) || '91')
            add_field("#{address_field}2", phone_area_code)
            add_field("#{address_field}3", phone_number)
          end
        end

        def normalize_phone_number(phone)
          phone.gsub(/[^\d ]+/, '') if phone
        end

        # Special characters are NOT allowed while posting transaction parameters on DirecPay system
        def remove_special_characters(string)
          string.gsub(/[~"'&#%]/, '-')
        end

        def encode_value(value)
          encoded = Base64.strict_encode64(value)
          string_to_encode = encoded[0, 1] + "T" + encoded[1, encoded.length]
          Base64.strict_encode64(string_to_encode)
        end

        def decode_value(value)
          decoded = Base64.decode64(value)
          string_to_decode = decoded[0, 1] + decoded[2, decoded.length]
          Base64.decode64(string_to_decode)
        end

        def phone_code_for_country(country)
          PHONE_CODES[country]
        end

        def full_name(params)
          return if params[:name].blank? && params[:first_name].blank? && params[:last_name].blank?

          params[:name] || "#{params[:first_name]} #{params[:last_name]}"
        end
      end

      class Notification < OffsitePayments::Notification
        RESPONSE_PARAMS = ['DirecPay Reference ID', 'Flag', 'Country', 'Currency', 'Other Details', 'Merchant Order No', 'Amount']

        def acknowledge(authcode = nil)
          true
        end

        def complete?
          status == 'Completed' || status == 'Pending'
        end

        def status
          case params['Flag']
          when 'SUCCESS'
            'Completed'
          when 'PENDING'
            'Pending'
          when 'FAIL'
            'Failed'
          else
            'Error'
          end
        end

        def item_id
          params['Merchant Order No']
        end

        def transaction_id
          params['DirecPay Reference ID']
        end

        # the money amount we received in X.2 decimal
        def gross
          params['Amount']
        end

        def currency
          params['Currency']
        end

        def country
          params['Country']
        end

        def other_details
          params['Other Details']
        end

        def test?
          false
        end

        # Take the posted data and move the relevant data into a hash
        def parse(post)
          super

          values = params['responseparams'].to_s.split('|')
          response_params = values.size == 3 ? ['DirecPay Reference ID', 'Flag', 'Error message'] : RESPONSE_PARAMS
          response_params.each_with_index do |name, index|
            params[name] = values[index]
          end
          params
        end
      end

      class Return < OffsitePayments::Return
        def initialize(post_data, options = {})
          @notification = Notification.new(post_data, options)
        end

        def success?
          notification.complete?
        end

        def message
          notification.status
        end
      end

      class Status
        include ActiveUtils::PostsData

        STATUS_TEST_URL = 'https://test.direcpay.com/direcpay/secure/dpMerchantTransaction.jsp'
        STATUS_LIVE_URL = 'https://www.timesofmoney.com/direcpay/secure/dpPullMerchAtrnDtls.jsp'

        attr_reader :account, :options

        def initialize(account, options = {})
          @account, @options = account, options
        end

        # Use this method to manually request a status update to the provided notification_url
        def update(authorization, notification_url)
          url = test? ? STATUS_TEST_URL : STATUS_LIVE_URL
          parameters = [ authorization, account, notification_url ]
          data = ActiveUtils::PostData.new
          data[:requestparams] = parameters.join('|')

          response = ssl_get("#{url}?#{data.to_post_data}")
        end

        def test?
          OffsitePayments.mode == :test || options[:test]
        end
      end
    end
  end
end


text:
{% extends "base.html" %}

{% block header %}

    {% if HEADER_COVER %}

    {% else %}

    {% endif %}

{{ SITENAME }}

                        {{ SITESUBTITLE }}

{% endblock header %}

{% block content %}
    {% for article in articles_page.object_list %}

                    {{ article.title }}

            {% if article.summary %}
                {{ article.summary|truncate(140) }}
            {% endif %}

Posted by
                {% for author in article.authors %}
                    {{ author }}
                {% endfor %}
                 on {{ article.locale_date }}
                 {% include 'comments.html' %}

    {% endfor %}

    {% include "pagination.html" %}

{% endblock content %}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.08.28 at 12:21:55 AM EDT
//

package com.es.manager.meter;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for typeOfMeter.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="typeOfMeter">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="Coal Anthracite"/>
 *     <enumeration value="Coal Bituminous"/>
 *     <enumeration value="Coke"/>
 *     <enumeration value="Diesel"/>
 *     <enumeration value="District Chilled Water - Absorption Chiller using Natural Gas"/>
 *     <enumeration value="District Chilled Water - Electric-Driven Chiller"/>
 *     <enumeration value="District Chilled Water - Engine-Driven Chiller using Natural Gas"/>
 *     <enumeration value="District Chilled Water - Other"/>
 *     <enumeration value="District Hot Water"/>
 *     <enumeration value="District Steam"/>
 *     <enumeration value="Electric"/>
 *     <enumeration value="Electric on Site Solar"/>
 *     <enumeration value="Electric on Site Wind"/>
 *     <enumeration value="Fuel Oil No 1"/>
 *     <enumeration value="Fuel Oil No 2"/>
 *     <enumeration value="Fuel Oil No 4"/>
 *     <enumeration value="Fuel Oil No 5 or 6"/>
 *     <enumeration value="Kerosene"/>
 *     <enumeration value="Natural Gas"/>
 *     <enumeration value="Other (Energy)"/>
 *     <enumeration value="Propane"/>
 *     <enumeration value="Wood"/>
 *     <enumeration value="IT Equipment Input Energy (meters on each piece of equipment)"/>
 *     <enumeration value="Power Distribution Unit (PDU) Input Energy"/>
 *     <enumeration value="Power Distribution Unit (PDU) Output Energy"/>
 *     <enumeration value="Uninterruptible Power Supply (UPS) Output Energy"/>
 *     <enumeration value="Alternative Water Generated On-Site - All"/>
 *     <enumeration value="Alternative Water Generated On-Site - Indoor"/>
 *     <enumeration value="Alternative Water Generated On-Site - Outdoor"/>
 *     <enumeration value="Municipally Supplied Potable Water - All"/>
 *     <enumeration value="Municipally Supplied Potable Water - Indoor"/>
 *     <enumeration value="Municipally Supplied Potable Water - Outdoor"/>
 *     <enumeration value="Municipally Supplied Reclaimed Water - All"/>
 *     <enumeration value="Municipally Supplied Reclaimed Water - Indoor"/>
 *     <enumeration value="Municipally Supplied Reclaimed Water - Outdoor"/>
 *     <enumeration value="Other - All (Water)"/>
 *     <enumeration value="Other - Outdoor"/>
 *     <enumeration value="Other - Indoor"/>
 *     <enumeration value="Average Influent Flow"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "typeOfMeter")
@XmlEnum
public enum TypeOfMeter {

    @XmlEnumValue("Coal Anthracite")
    COAL_ANTHRACITE("Coal Anthracite"),
    @XmlEnumValue("Coal Bituminous")
    COAL_BITUMINOUS("Coal Bituminous"),
    @XmlEnumValue("Coke")
    COKE("Coke"),
    @XmlEnumValue("Diesel")
    DIESEL("Diesel"),
    @XmlEnumValue("District Chilled Water - Absorption Chiller using Natural Gas")
    DISTRICT_CHILLED_WATER_ABSORPTION_CHILLER_USING_NATURAL_GAS("District Chilled Water - Absorption Chiller using Natural Gas"),
    @XmlEnumValue("District Chilled Water - Electric-Driven Chiller")
    DISTRICT_CHILLED_WATER_ELECTRIC_DRIVEN_CHILLER("District Chilled Water - Electric-Driven Chiller"),
    @XmlEnumValue("District Chilled Water - Engine-Driven Chiller using Natural Gas")
    DISTRICT_CHILLED_WATER_ENGINE_DRIVEN_CHILLER_USING_NATURAL_GAS("District Chilled Water - Engine-Driven Chiller using Natural Gas"),
    @XmlEnumValue("District Chilled Water - Other")
    DISTRICT_CHILLED_WATER_OTHER("District Chilled Water - Other"),
    @XmlEnumValue("District Hot Water")
    DISTRICT_HOT_WATER("District Hot Water"),
    @XmlEnumValue("District Steam")
    DISTRICT_STEAM("District Steam"),
    @XmlEnumValue("Electric")
    ELECTRIC("Electric"),
    @XmlEnumValue("Electric on Site Solar")
    ELECTRIC_ON_SITE_SOLAR("Electric on Site Solar"),
    @XmlEnumValue("Electric on Site Wind")
    ELECTRIC_ON_SITE_WIND("Electric on Site Wind"),
    @XmlEnumValue("Fuel Oil No 1")
    FUEL_OIL_NO_1("Fuel Oil No 1"),
    @XmlEnumValue("Fuel Oil No 2")
    FUEL_OIL_NO_2("Fuel Oil No 2"),
    @XmlEnumValue("Fuel Oil No 4")
    FUEL_OIL_NO_4("Fuel Oil No 4"),
    @XmlEnumValue("Fuel Oil No 5 or 6")
    FUEL_OIL_NO_5_OR_6("Fuel Oil No 5 or 6"),
    @XmlEnumValue("Kerosene")
    KEROSENE("Kerosene"),
    @XmlEnumValue("Natural Gas")
    NATURAL_GAS("Natural Gas"),
    @XmlEnumValue("Other (Energy)")
    OTHER_ENERGY("Other (Energy)"),
    @XmlEnumValue("Propane")
    PROPANE("Propane"),
    @XmlEnumValue("Wood")
    WOOD("Wood"),
    @XmlEnumValue("IT Equipment Input Energy (meters on each piece of equipment)")
    IT_EQUIPMENT_INPUT_ENERGY_METERS_ON_EACH_PIECE_OF_EQUIPMENT("IT Equipment Input Energy (meters on each piece of equipment)"),
    @XmlEnumValue("Power Distribution Unit (PDU) Input Energy")
    POWER_DISTRIBUTION_UNIT_PDU_INPUT_ENERGY("Power Distribution Unit (PDU) Input Energy"),
    @XmlEnumValue("Power Distribution Unit (PDU) Output Energy")
    POWER_DISTRIBUTION_UNIT_PDU_OUTPUT_ENERGY("Power Distribution Unit (PDU) Output Energy"),
    @XmlEnumValue("Uninterruptible Power Supply (UPS) Output Energy")
    UNINTERRUPTIBLE_POWER_SUPPLY_UPS_OUTPUT_ENERGY("Uninterruptible Power Supply (UPS) Output Energy"),
    @XmlEnumValue("Alternative Water Generated On-Site - All")
    ALTERNATIVE_WATER_GENERATED_ON_SITE_ALL("Alternative Water Generated On-Site - All"),
    @XmlEnumValue("Alternative Water Generated On-Site - Indoor")
    ALTERNATIVE_WATER_GENERATED_ON_SITE_INDOOR("Alternative Water Generated On-Site - Indoor"),
    @XmlEnumValue("Alternative Water Generated On-Site - Outdoor")
    ALTERNATIVE_WATER_GENERATED_ON_SITE_OUTDOOR("Alternative Water Generated On-Site - Outdoor"),
    @XmlEnumValue("Municipally Supplied Potable Water - All")
    MUNICIPALLY_SUPPLIED_POTABLE_WATER_ALL("Municipally Supplied Potable Water - All"),
    @XmlEnumValue("Municipally Supplied Potable Water - Indoor")
    MUNICIPALLY_SUPPLIED_POTABLE_WATER_INDOOR("Municipally Supplied Potable Water - Indoor"),
    @XmlEnumValue("Municipally Supplied Potable Water - Outdoor")
    MUNICIPALLY_SUPPLIED_POTABLE_WATER_OUTDOOR("Municipally Supplied Potable Water - Outdoor"),
    @XmlEnumValue("Municipally Supplied Reclaimed Water - All")
    MUNICIPALLY_SUPPLIED_RECLAIMED_WATER_ALL("Municipally Supplied Reclaimed Water - All"),
    @XmlEnumValue("Municipally Supplied Reclaimed Water - Indoor")
    MUNICIPALLY_SUPPLIED_RECLAIMED_WATER_INDOOR("Municipally Supplied Reclaimed Water - Indoor"),
    @XmlEnumValue("Municipally Supplied Reclaimed Water - Outdoor")
    MUNICIPALLY_SUPPLIED_RECLAIMED_WATER_OUTDOOR("Municipally Supplied Reclaimed Water - Outdoor"),
    @XmlEnumValue("Other - All (Water)")
    OTHER_ALL_WATER("Other - All (Water)"),
    @XmlEnumValue("Other - Outdoor")
    OTHER_OUTDOOR("Other - Outdoor"),
    @XmlEnumValue("Other - Indoor")
    OTHER_INDOOR("Other - Indoor"),
    @XmlEnumValue("Average Influent Flow")
    AVERAGE_INFLUENT_FLOW("Average Influent Flow");
    private final String value;

    TypeOfMeter(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static TypeOfMeter fromValue(String v) {
        for (TypeOfMeter c: TypeOfMeter.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }

}


text:
No Products found for this category

{{ product.name }}

{{ product.description }}

                  {{ product.display_price }}

              Select a size

              <button class="product-sizeButton">S</button>
              <button class="product-sizeButton">M</button>
              <button class="product-sizeButton">L</button>
              <button class="product-sizeButton">XL</button>
              <button class="product-sizeButton">XXL</button>

                {{pageTranslator.addToBag}}


text:
namespace net {

// A OnceCallback specialization that takes a single int parameter. Usually this
// is used to report a byte count or network error code.
using CompletionOnceCallback = base::OnceCallback<void(int)>;

// 64bit version of the OnceCallback specialization that takes a single int64_t
// parameter. Usually this is used to report a file offset, size or network
// error code.
using Int64CompletionOnceCallback = base::OnceCallback<void(int64_t)>;

using CancelableCompletionOnceCallback =
    base::CancelableOnceCallback<void(int)>;

}  // namespace net

#endif  // NET_BASE_COMPLETION_ONCE_CALLBACK_H_


text:
/*
 * Do not modify this file. This file is generated from the cloudformation-2010-05-15.normal.json service model.
 */

using System;

using Amazon.Runtime;

namespace Amazon.CloudFormation
{

    /// <summary>
    /// Constants used for properties of type Capability.
    /// </summary>
    public class Capability : ConstantClass
    {

        /// <summary>
        /// Constant CAPABILITY_IAM for Capability
        /// </summary>
        public static readonly Capability CAPABILITY_IAM = new Capability("CAPABILITY_IAM");

        /// <summary>
        /// Default Constructor
        /// </summary>
        public Capability(string value)
            : base(value)
        {
        }

        /// <summary>
        /// Finds the constant for the unique value.
        /// </summary>
        /// <param name="value">The unique value for the constant</param>
        /// <returns>The constant for the unique value</returns>
        public static Capability FindValue(string value)
        {
            return FindValue<Capability>(value);
        }

        /// <summary>
        /// Utility method to convert strings to the constant class.
        /// </summary>
        /// <param name="value">The string value to convert to the constant class.</param>
        /// <returns></returns>
        public static implicit operator Capability(string value)
        {
            return FindValue(value);
        }
    }

    /// <summary>
    /// Constants used for properties of type OnFailure.
    /// </summary>
    public class OnFailure : ConstantClass
    {

        /// <summary>
        /// Constant DELETE for OnFailure
        /// </summary>
        public static readonly OnFailure DELETE = new OnFailure("DELETE");
        /// <summary>
        /// Constant DO_NOTHING for OnFailure
        /// </summary>
        public static readonly OnFailure DO_NOTHING = new OnFailure("DO_NOTHING");
        /// <summary>
        /// Constant ROLLBACK for OnFailure
        /// </summary>
        public static readonly OnFailure ROLLBACK = new OnFailure("ROLLBACK");

        /// <summary>
        /// Default Constructor
        /// </summary>
        public OnFailure(string value)
            : base(value)
        {
        }

        /// <summary>
        /// Finds the constant for the unique value.
        /// </summary>
        /// <param name="value">The unique value for the constant</param>
        /// <returns>The constant for the unique value</returns>
        public static OnFailure FindValue(string value)
        {
            return FindValue<OnFailure>(value);
        }

        /// <summary>
        /// Utility method to convert strings to the constant class.
        /// </summary>
        /// <param name="value">The string value to convert to the constant class.</param>
        /// <returns></returns>
        public static implicit operator OnFailure(string value)
        {
            return FindValue(value);
        }
    }

    /// <summary>
    /// Constants used for properties of type ResourceSignalStatus.
    /// </summary>
    public class ResourceSignalStatus : ConstantClass
    {

        /// <summary>
        /// Constant FAILURE for ResourceSignalStatus
        /// </summary>
        public static readonly ResourceSignalStatus FAILURE = new ResourceSignalStatus("FAILURE");
        /// <summary>
        /// Constant SUCCESS for ResourceSignalStatus
        /// </summary>
        public static readonly ResourceSignalStatus SUCCESS = new ResourceSignalStatus("SUCCESS");

        /// <summary>
        /// Default Constructor
        /// </summary>
        public ResourceSignalStatus(string value)
            : base(value)
        {
        }

        /// <summary>
        /// Finds the constant for the unique value.
        /// </summary>
        /// <param name="value">The unique value for the constant</param>
        /// <returns>The constant for the unique value</returns>
        public static ResourceSignalStatus FindValue(string value)
        {
            return FindValue<ResourceSignalStatus>(value);
        }

        /// <summary>
        /// Utility method to convert strings to the constant class.
        /// </summary>
        /// <param name="value">The string value to convert to the constant class.</param>
        /// <returns></returns>
        public static implicit operator ResourceSignalStatus(string value)
        {
            return FindValue(value);
        }
    }

    /// <summary>
    /// Constants used for properties of type ResourceStatus.
    /// </summary>
    public class ResourceStatus : ConstantClass
    {

        /// <summary>
        /// Constant CREATE_COMPLETE for ResourceStatus
        /// </summary>
        public static readonly ResourceStatus CREATE_COMPLETE = new ResourceStatus("CREATE_COMPLETE");
        /// <summary>
        /// Constant CREATE_FAILED for ResourceStatus
        /// </summary>
        public static readonly ResourceStatus CREATE_FAILED = new ResourceStatus("CREATE_FAILED");
        /// <summary>
        /// Constant CREATE_IN_PROGRESS for ResourceStatus
        /// </summary>
        public static readonly ResourceStatus CREATE_IN_PROGRESS = new ResourceStatus("CREATE_IN_PROGRESS");
        /// <summary>
        /// Constant DELETE_COMPLETE for ResourceStatus
        /// </summary>
        public static readonly ResourceStatus DELETE_COMPLETE = new ResourceStatus("DELETE_COMPLETE");
        /// <summary>
        /// Constant DELETE_FAILED for ResourceStatus
        /// </summary>
        public static readonly ResourceStatus DELETE_FAILED = new ResourceStatus("DELETE_FAILED");
        /// <summary>
        /// Constant DELETE_IN_PROGRESS for ResourceStatus
        /// </summary>
        public static readonly ResourceStatus DELETE_IN_PROGRESS = new ResourceStatus("DELETE_IN_PROGRESS");
        /// <summary>
        /// Constant DELETE_SKIPPED for ResourceStatus
        /// </summary>
        public static readonly ResourceStatus DELETE_SKIPPED = new ResourceStatus("DELETE_SKIPPED");
        /// <summary>
        /// Constant UPDATE_COMPLETE for ResourceStatus
        /// </summary>
        public static readonly ResourceStatus UPDATE_COMPLETE = new ResourceStatus("UPDATE_COMPLETE");
        /// <summary>
        /// Constant UPDATE_FAILED for ResourceStatus
        /// </summary>
        public static readonly ResourceStatus UPDATE_FAILED = new ResourceStatus("UPDATE_FAILED");
        /// <summary>
        /// Constant UPDATE_IN_PROGRESS for ResourceStatus
        /// </summary>
        public static readonly ResourceStatus UPDATE_IN_PROGRESS = new ResourceStatus("UPDATE_IN_PROGRESS");

        /// <summary>
        /// Default Constructor
        /// </summary>
        public ResourceStatus(string value)
            : base(value)
        {
        }

        /// <summary>
        /// Finds the constant for the unique value.
        /// </summary>
        /// <param name="value">The unique value for the constant</param>
        /// <returns>The constant for the unique value</returns>
        public static ResourceStatus FindValue(string value)
        {
            return FindValue<ResourceStatus>(value);
        }

        /// <summary>
        /// Utility method to convert strings to the constant class.
        /// </summary>
        /// <param name="value">The string value to convert to the constant class.</param>
        /// <returns></returns>
        public static implicit operator ResourceStatus(string value)
        {
            return FindValue(value);
        }
    }

    /// <summary>
    /// Constants used for properties of type StackStatus.
    /// </summary>
    public class StackStatus : ConstantClass
    {

        /// <summary>
        /// Constant CREATE_COMPLETE for StackStatus
        /// </summary>
        public static readonly StackStatus CREATE_COMPLETE = new StackStatus("CREATE_COMPLETE");
        /// <summary>
        /// Constant CREATE_FAILED for StackStatus
        /// </summary>
        public static readonly StackStatus CREATE_FAILED = new StackStatus("CREATE_FAILED");
        /// <summary>
        /// Constant CREATE_IN_PROGRESS for StackStatus
        /// </summary>
        public static readonly StackStatus CREATE_IN_PROGRESS = new StackStatus("CREATE_IN_PROGRESS");
        /// <summary>
        /// Constant DELETE_COMPLETE for StackStatus
        /// </summary>
        public static readonly StackStatus DELETE_COMPLETE = new StackStatus("DELETE_COMPLETE");
        /// <summary>
        /// Constant DELETE_FAILED for StackStatus
        /// </summary>
        public static readonly StackStatus DELETE_FAILED = new StackStatus("DELETE_FAILED");
        /// <summary>
        /// Constant DELETE_IN_PROGRESS for StackStatus
        /// </summary>
        public static readonly StackStatus DELETE_IN_PROGRESS = new StackStatus("DELETE_IN_PROGRESS");
        /// <summary>
        /// Constant ROLLBACK_COMPLETE for StackStatus
        /// </summary>
        public static readonly StackStatus ROLLBACK_COMPLETE = new StackStatus("ROLLBACK_COMPLETE");
        /// <summary>
        /// Constant ROLLBACK_FAILED for StackStatus
        /// </summary>
        public static readonly StackStatus ROLLBACK_FAILED = new StackStatus("ROLLBACK_FAILED");
        /// <summary>
        /// Constant ROLLBACK_IN_PROGRESS for StackStatus
        /// </summary>
        public static readonly StackStatus ROLLBACK_IN_PROGRESS = new StackStatus("ROLLBACK_IN_PROGRESS");
        /// <summary>
        /// Constant UPDATE_COMPLETE for StackStatus
        /// </summary>
        public static readonly StackStatus UPDATE_COMPLETE = new StackStatus("UPDATE_COMPLETE");
        /// <summary>
        /// Constant UPDATE_COMPLETE_CLEANUP_IN_PROGRESS for StackStatus
        /// </summary>
        public static readonly StackStatus UPDATE_COMPLETE_CLEANUP_IN_PROGRESS = new StackStatus("UPDATE_COMPLETE_CLEANUP_IN_PROGRESS");
        /// <summary>
        /// Constant UPDATE_IN_PROGRESS for StackStatus
        /// </summary>
        public static readonly StackStatus UPDATE_IN_PROGRESS = new StackStatus("UPDATE_IN_PROGRESS");
        /// <summary>
        /// Constant UPDATE_ROLLBACK_COMPLETE for StackStatus
        /// </summary>
        public static readonly StackStatus UPDATE_ROLLBACK_COMPLETE = new StackStatus("UPDATE_ROLLBACK_COMPLETE");
        /// <summary>
        /// Constant UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS for StackStatus
        /// </summary>
        public static readonly StackStatus UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS = new StackStatus("UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS");
        /// <summary>
        /// Constant UPDATE_ROLLBACK_FAILED for StackStatus
        /// </summary>
        public static readonly StackStatus UPDATE_ROLLBACK_FAILED = new StackStatus("UPDATE_ROLLBACK_FAILED");
        /// <summary>
        /// Constant UPDATE_ROLLBACK_IN_PROGRESS for StackStatus
        /// </summary>
        public static readonly StackStatus UPDATE_ROLLBACK_IN_PROGRESS = new StackStatus("UPDATE_ROLLBACK_IN_PROGRESS");

        /// <summary>
        /// Default Constructor
        /// </summary>
        public StackStatus(string value)
            : base(value)
        {
        }

        /// <summary>
        /// Finds the constant for the unique value.
        /// </summary>
        /// <param name="value">The unique value for the constant</param>
        /// <returns>The constant for the unique value</returns>
        public static StackStatus FindValue(string value)
        {
            return FindValue<StackStatus>(value);
        }

        /// <summary>
        /// Utility method to convert strings to the constant class.
        /// </summary>
        /// <param name="value">The string value to convert to the constant class.</param>
        /// <returns></returns>
        public static implicit operator StackStatus(string value)
        {
            return FindValue(value);
        }
    }

}


text:
var mouseX = 0, mouseY = 0,

windowHalfX = window.innerWidth / 2,
windowHalfY = window.innerHeight / 2,

SEPARATION = 200,
AMOUNTX = 10,
AMOUNTY = 10,

camera, scene, renderer;

init();
animate();

function init() {

  var container, separation = 100, amountX = 50, amountY = 50;

  container = document.createElement('div');
  document.body.appendChild(container);

  camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
  camera.position.z = 100;

  scene = new THREE.Scene();

  scene.add( camera );

  renderer = new THREE.CanvasRenderer();
  renderer.setSize( window.innerWidth, window.innerHeight );
  container.appendChild( renderer.domElement );

  // Nodes

  var geometry = new THREE.SphereGeometry( 50, 8, 7, false );
  var material = new THREE.MeshNormalMaterial();

  group = new THREE.Object3D();

  for (n in gon.nodes) {

    var mesh = new THREE.Mesh( geometry, material );
    mesh.position.x = gon.nodes[n].position_x;
    mesh.position.y = gon.nodes[n].position_y;
    mesh.position.z = gon.nodes[n].position_z;
    mesh.rotation.x = gon.nodes[n].rotation_x;
    mesh.rotation.y = gon.nodes[n].rotation_y;
    mesh.matrixAutoUpdate = false;
    mesh.updateMatrix();
    group.add( mesh );

  }

  scene.add( group );

  // Edges

  for (n in gon.edges) {
    var line_segment = new THREE.Geometry();
    line_segment.vertices.push( new THREE.Vertex( group.children[gon.edges[n].source - 1].position ) );
    line_segment.vertices.push( new THREE.Vertex( group.children[gon.edges[n].target - 1].position ) );
    var line = new THREE.Line( line_segment, new THREE.LineBasicMaterial( { color: Math.random() * 0xffffff , opacity: 0.5 } ) );

    scene.add(line)
  }

  document.addEventListener( 'mousemove',  onDocumentMouseMove,  false );
  document.addEventListener( 'touchstart', onDocumentTouchStart, false );
  document.addEventListener( 'touchmove',  onDocumentTouchMove,  false );
}

//

function onDocumentMouseMove(event) {

  mouseX = event.clientX - windowHalfX;
  mouseY = event.clientY - windowHalfY;
}

function onDocumentTouchStart( event ) {

  if ( event.touches.length > 1 ) {

    event.preventDefault();

    mouseX = event.touches[ 0 ].pageX - windowHalfX;
    mouseY = event.touches[ 0 ].pageY - windowHalfY;

  }

}

function onDocumentTouchMove( event ) {

  if ( event.touches.length == 1 ) {

    event.preventDefault();

    mouseX = event.touches[ 0 ].pageX - windowHalfX;
    mouseY = event.touches[ 0 ].pageY - windowHalfY;

  }

}

//

function animate() {

  requestAnimationFrame( animate );

  render();

}

function render() {

  camera.position.x += ( mouseX - camera.position.x ) * .05;
  camera.position.y += ( - mouseY + 200 - camera.position.y ) * .05;
  camera.lookAt( scene.position );

  renderer.render( scene, camera );

}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/bg_addcity"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/copy_right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:padding="12dip"
        android:text="@string/all_rights_reserved"
        android:textColor="@android:color/white"
        android:textSize="11sp" />

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="50.0dip"
            android:orientation="vertical" >

            <ImageView
                android:layout_width="70.0dip"
                android:layout_height="70.0dip"
                android:layout_gravity="center_horizontal"
                android:src="@drawable/ic_launcher" />

            <TextView
                android:id="@+id/app_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="10.0dip"
                android:padding="6dip"
                android:text="@string/app_name"
                android:textColor="@android:color/white"
                android:textSize="24sp" />

            <TextView
                android:id="@+id/version_name"
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:gravity="bottom"
                android:paddingBottom="6dip"
                android:text="@string/app_version"
                android:layout_gravity="center_horizontal"
                android:textSize="14sp" />

            <ProgressBar
                android:id="@+id/refresh_list_footer_progressbar"
                android:layout_width="16dip"
                android:layout_height="16dip"
                android:layout_gravity="center"
                android:layout_marginTop="20dip"
                android:indeterminate="true"
                android:indeterminateBehavior="repeat"
                android:indeterminateDrawable="@drawable/common_loading4" />
        </LinearLayout>
    </RelativeLayout>

</RelativeLayout>


text:
module Azure::CostManagement::Mgmt::V2019_01_01
  module Models
    #
    # The configuration of dataset in the query.
    #
    class QueryDatasetConfiguration

      include MsRestAzure

      # @return [Array<String>] Array of column names to be included in the
      # query. Any valid query column name is allowed. If not provided, then
      # query includes all columns.
      attr_accessor :columns

      #
      # Mapper for QueryDatasetConfiguration class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'QueryDatasetConfiguration',
          type: {
            name: 'Composite',
            class_name: 'QueryDatasetConfiguration',
            model_properties: {
              columns: {
                client_side_validation: true,
                required: false,
                serialized_name: 'columns',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'StringElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
package org.apache.xmlgraphics.io;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;

import javax.xml.transform.Source;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

import org.xml.sax.InputSource;

import org.apache.commons.io.IOUtils;

import org.apache.xmlgraphics.image.loader.ImageSource;
import org.apache.xmlgraphics.image.loader.util.ImageInputStreamAdapter;
import org.apache.xmlgraphics.image.loader.util.ImageUtil;

/**
 * A utility class for handling {@link Source} objects, more specficially the streams that back
 * the {@link Source}.
 */
public final class XmlSourceUtil {

    private XmlSourceUtil() {
    }

    /**
     * Returns the {@link InputStream} that is backing the given {@link Source} object.
     *
     * @param src is backed by an {@link InputStream}
     * @return the input stream
     */
    public static InputStream getInputStream(Source src) {
        try {
            if (src instanceof StreamSource) {
                return ((StreamSource) src).getInputStream();
            } else if (src instanceof DOMSource) {
                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                StreamResult xmlSource = new StreamResult(outStream);
                TransformerFactory.newInstance().newTransformer().transform(src, xmlSource);
                return new ByteArrayInputStream(outStream.toByteArray());
            } else if (src instanceof SAXSource) {
                return ((SAXSource) src).getInputSource().getByteStream();
            } else if (src instanceof ImageSource) {
                return new ImageInputStreamAdapter(((ImageSource) src).getImageInputStream());
            }
        } catch (Exception e) {
            // TODO: How do we want to handle these? They all come from the TransformerFactory
        }
        return null;
    }

    /**
     * Returns the InputStream of a Source object. This method throws an IllegalArgumentException
     * if there's no InputStream instance available from the Source object.
     * @param src the Source object
     * @return the InputStream
     */
    public static InputStream needInputStream(Source src) {
        InputStream in = getInputStream(src);
        if (in != null) {
            return in;
        } else {
            throw new IllegalArgumentException("Source must be a StreamSource with an InputStream"
                    + " or an ImageSource");
        }
    }

    /**
     * Indicates whether the Source object has a Reader instance.
     * @param src the Source object
     * @return true if an Reader is available
     */
    public static boolean hasReader(Source src) {
        if (src instanceof StreamSource) {
            Reader reader = ((StreamSource) src).getReader();
            return (reader != null);
        } else if (src instanceof SAXSource) {
            InputSource is = ((SAXSource) src).getInputSource();
            if (is != null) {
                return (is.getCharacterStream() != null);
            }
        }
        return false;
    }

    /**
     * Removes any references to InputStreams or Readers from the given Source to prohibit
     * accidental/unwanted use by a component further downstream.
     * @param src the Source object
     */
    public static void removeStreams(Source src) {
        if (src instanceof ImageSource) {
            ImageSource isrc = (ImageSource) src;
            isrc.setImageInputStream(null);
        } else if (src instanceof StreamSource) {
            StreamSource ssrc = (StreamSource) src;
            ssrc.setInputStream(null);
            ssrc.setReader(null);
        } else if (src instanceof SAXSource) {
            InputSource is = ((SAXSource) src).getInputSource();
            if (is != null) {
                is.setByteStream(null);
                is.setCharacterStream(null);
            }
        }
    }

    /**
     * Closes the InputStreams or ImageInputStreams of Source objects. Any exception occurring
     * while closing the stream is ignored.
     * @param src the Source object
     */
    public static void closeQuietly(Source src) {
        if (src instanceof StreamSource) {
            StreamSource streamSource = (StreamSource) src;
            IOUtils.closeQuietly(streamSource.getReader());
        } else if (src instanceof ImageSource) {
            if (ImageUtil.getImageInputStream(src) != null) {
                try {
                    ImageUtil.getImageInputStream(src).close();
                } catch (IOException ioe) {
                    // ignore
                }
            }
        } else if (src instanceof SAXSource) {
            InputSource is = ((SAXSource) src).getInputSource();
            if (is != null) {
                IOUtils.closeQuietly(is.getByteStream());
                IOUtils.closeQuietly(is.getCharacterStream());
            }
        }
        removeStreams(src);
    }

    /**
     * Indicates whether the Source object has an InputStream instance.
     * @param src the Source object
     * @return true if an InputStream is available
     */
    public static boolean hasInputStream(Source src) {
        return getInputStream(src) != null;
    }
}


text:
@implementation BankObject2
//重写getter方法
- (NSString *)accountForBank {

    return [NSString stringWithFormat:@"account for %@ is %d", self.bankCodeEn, self.accountBalance];
}
//定义了这种依赖关系后,我们就需要以某种方式告诉KVO,当我们的被依赖属性修改时,会发送accountForBank属性被修改的通知。
//当两个属性之中的一个改变,就会激发kvo
+ (NSSet *)keyPathsForValuesAffectingAccountForBank {

    return [NSSet setWithObjects:@"accountBalance", @"bankCodeEn", nil];
}
@end


text:
import agms
from distutils.core import setup
setup(
    name="agms",
    version=agms.version.Version,
    description="Avant-Garde Gateway Python Library",
    author="AGMS",
    author_email="support@agms.com",
    url="https://www.onlinepaymentprocessing.com/docs/python",
    packages=["agms"],
    install_requires=["requests>=2.5.3,<3.0"],
    zip_safe=False
)


text:
using System;
using UniRx.Operators;

namespace UniRx.Operators
{
    internal class RefCountObservable<T> : OperatorObservableBase<T>
    {
        readonly IConnectableObservable<T> source;
        readonly object gate = new object();
        int refCount = 0;
        IDisposable connection;

        public RefCountObservable(IConnectableObservable<T> source)
            : base(source.IsRequiredSubscribeOnCurrentThread())
        {
            this.source = source;
        }

        protected override IDisposable SubscribeCore(IObserver<T> observer, IDisposable cancel)
        {
            return new RefCount(this, observer, cancel).Run();
        }

        class RefCount : OperatorObserverBase<T, T>
        {
            readonly RefCountObservable<T> parent;

            public RefCount(RefCountObservable<T> parent, IObserver<T> observer, IDisposable cancel) : base(observer, cancel)
            {
                this.parent = parent;
            }

            public IDisposable Run()
            {
                IDisposable subcription = parent.source.Subscribe(this);

                lock (parent.gate)
                {
                    if (++parent.refCount == 1)
                    {
                        parent.connection = parent.source.Connect();
                    }
                }

                return Disposable.Create(() =>
                {
                    subcription.Dispose();

                    lock (parent.gate)
                    {
                        if (--parent.refCount == 0)
                        {
                            parent.connection.Dispose();
                        }
                    }
                });
            }

            public override void OnNext(T value)
            {
                base.observer.OnNext(value);
            }

            public override void OnError(Exception error)
            {
                try { observer.OnError(error); }
                finally { Dispose(); }
            }

            public override void OnCompleted()
            {
                try { observer.OnCompleted(); }
                finally { Dispose(); }
            }
        }
    }
}


text:
module.exports = function(config){
  config.set({
    basePath: '.',

    files : [
      'dist/vendor.js',
      'dist-test/index.js',
      {pattern: 'dist-test/*', watched: true, included: false, served: true},
      {pattern: 'dist/*', watched: true, included: false, served: true}
    ],

    autoWatch : true,

    autoWatchBatchDelay: 1000, // Try not to race with gulp build

    frameworks: ['mocha', 'chai'],

    browsers : ['Firefox'],
    // browsers : ['Firefox', 'Chrome'],

    reporters: ['spec'],

    plugins : [
      'karma-firefox-launcher',
      'karma-chrome-launcher',
      'karma-mocha',
      'karma-chai',
      'karma-spec-reporter'
    ],
  });
};


text:
package org.knowm.xchange.independentreserve.util;

/**
 * Author: Kamil Zbikowski Date: 4/13/15
 */
public enum ExchangeEndpoint {
  GET_ACCOUNTS("GetAccounts"), GET_OPEN_ORDERS("GetOpenOrders"), PLACE_LIMIT_ORDER("PlaceLimitOrder"), CANCEL_ORDER("CancelOrder")
  , GET_TRADES("GetTrades"), GET_TRANSACTIONS("GetTransactions");

  private String endpointName;

  ExchangeEndpoint(String endpointName) {
    this.endpointName = endpointName;
  }

  public final static String getUrlBasingOnEndpoint(String sslUri, ExchangeEndpoint endpoint) {
    return sslUri + "/Private/" + endpoint.endpointName;

  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>CustomFixityPlugin</title>
<meta name="date" content="2015-06-15">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.exlibris.dps.repository.plugin

Interface CustomFixityPlugin

public interface CustomFixityPlugin

Plugin for user defined fixity (checksum).

This plugin interface only supports java implementation.

Author:

PeterK

Method Summary

Methods

Modifier and Type
Method and Description

java.lang.String
getAgent()

Returns the agent name.

java.lang.String
getAlgorithm()

Returns the fixity algorithm.

java.util.List<java.lang.String>
getErrors()

Returns list of mismatches detected during fixity calculation.

java.lang.String
getFixity(java.lang.String filePath,
         java.lang.String oldFixity)

Calculates and returns fixity for the given file.

Method Detail

getFixity

java.lang.String getFixity(java.lang.String filePath,
                         java.lang.String oldFixity)
                           throws java.lang.Exception

Calculates and returns fixity for the given file.
 If the old fixity isn't null and the new fixity doesn't match it, it is possible to add a list of detailed errors
 to help identify the source of the problem.

Parameters:

filePath - the path to the file

oldFixity - the value of the previous fixity on this file, null if this is the first time this type of fixity
                is calculated on the file

Returns:

the new fixity

Throws:

java.lang.Exception - on any error during the actual fixity calculation

getAlgorithm

java.lang.String getAlgorithm()

Returns the fixity algorithm.

Returns:

The name of the algorithm this plugin calculates

getAgent

java.lang.String getAgent()

Returns the agent name.

Returns:

The agent of the plugin type

getErrors

java.util.List<java.lang.String> getErrors()

Returns list of mismatches detected during fixity calculation.
 These errors should include additional information when the checksum values mismatch.
 For example: checksum diff or possible location of file difference.

 Any other errors (like IOException during checksum calculation) should be thrown.

Returns:

list of mismatches detected during fixity calculation.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
from django.db import models

class ResultError(models.Model):
    exception_type = models.CharField(max_length=100)
    message = models.TextField(null=True, blank=True)
    stacktrace = models.TextField(null=True, blank=True)
    stdout = models.TextField(null=True, blank=True)
    stderr = models.TextField(null=True, blank=True)

    class Meta:
        ordering = ['id']

    def __str__(self):
        return self.exception_type


text:
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInsight.daemon.impl.analysis.encoding;

import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
import com.intellij.psi.injection.ReferenceInjector;
import com.intellij.util.ProcessingContext;
import org.jetbrains.annotations.NotNull;

/**
 * @author peter
 */
public class EncodingReferenceInjector extends ReferenceInjector {
  @Override
  public PsiReference @NotNull [] getReferences(@NotNull PsiElement element, @NotNull ProcessingContext context, @NotNull TextRange range) {
    return new PsiReference[]{new EncodingReference(element, range.substring(element.getText()), range)};
  }

  @NotNull
  @Override
  public String getId() {
    return "encoding-reference";
  }

  @NotNull
  @Override
  public String getDisplayName() {
    return CodeInsightBundle.message("label.encoding.name");
  }
}