text:
'use strict';

var _ = require('lodash');

var deps = ['config', 'menu', '$scope', '$rootScope'];
function IncludesCtrl(config, menu, $scope, $rootScope) {

  var allIncludes = [];
  function updateScope() {
    // If this is a subpage, we use the page defined in parent scope
    // Otherwise we use the active page
    var isSubpage = !!$scope.$parent.page;
    var page = $scope.$parent.page || menu.activePage;
    if ( page ) {
      page.recurseChildren(function(child){
        if ( child.id !== page.id ) {
          allIncludes.push(child);
        }
      });
    }
    allIncludes.sort(function(a,b){
      return a.ord > b.ord ? 1 : a.ord === b.ord ? 0 : -1;
    });
    $scope.limit = isSubpage ? Infinity : $scope.feature.initialLimit || 1;
    $scope.includes = _.first(allIncludes, $scope.limit);
  }

  // When user scrolls or view updates, we check if we need to add more content to the page
  function updateLimit() {
    var newValue = $rootScope.assBroadcastScrollPosition;
    if ( newValue >= 0 && $scope.includes.length < allIncludes.length ) {
      // Limit
      $scope.limit += 1;
      $scope.includes = _.first(allIncludes, $scope.limit);
      $scope.isNotFullyDisplayed = $scope.includes.length < allIncludes.length;
    }
  }
  $rootScope.$watch('assBroadcastScrollPosition', updateLimit);

  $scope.template = 'features/includes/includes.html';
  $scope.includes = [];

  // Make sure that toc is updated on all menu updates
  $scope.$on('activate:page', updateScope);
  menu.promises.isComplete.then(updateScope);
}
module.exports = deps.concat(IncludesCtrl);


text:
'''

New Integration Test for migrate between clusters

@author: quarkonics
'''

import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.net_operations as net_ops
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.zstack_test.zstack_test_vm as test_vm_header
import time
import os

vm = None
test_stub = test_lib.lib_get_test_stub()

def test():
    global vm
    vm = test_stub.create_vm('multicluster_basic_vm', os.environ.get('imageName_s'), os.environ.get('l3VlanNetworkName1'))

    test_lib.lib_set_allow_live_migration_local_storage('true')
    test_stub.migrate_vm_to_differnt_cluster(vm)

    vm.check()

    vm.destroy()
    test_util.test_pass('migrate between clusters Test Success')

#Will be called only if exception happens in test().
def error_cleanup():

    #time.sleep(5)
    global vm
    if vm:
        try:
            vm.destroy()
        except:
            pass

redpajama_set_name: RedPajamaGithub


text:
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

/*
 * error logging/reporting facilities
 * stolen from /usr/libexec/mail.local via ypserv
 */

#include <sys/types.h>
#include <stdio.h>
#include <stdarg.h>
#include <syslog.h>
#include "yp_extern.h"

int debug;
extern int _rpcpmstart;

extern char *progname;

static void __verr(const char *fmt, va_list ap) __printflike(1, 0);

static void __verr(const char *fmt, va_list ap)
{
	if (debug && !_rpcpmstart) {
		fprintf(stderr,"%s: ",progname);
		vfprintf(stderr, fmt, ap);
		fprintf(stderr, "\n");
	} else {
		vsyslog(LOG_NOTICE, fmt, ap);
	}
}

void
yp_error(const char *fmt, ...)
{
	va_list ap;
	va_start(ap, fmt);
	__verr(fmt,ap);
	va_end(ap);
}


text:
/* The original from which this derives bore the following: */

/*

   Derby - Class org.apache.derby.impl.sql.compile.TernaryOperatorNode

   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.

 */

package com.foundationdb.sql.parser;

import com.foundationdb.sql.StandardException;
import com.foundationdb.sql.types.ValueClassName;

/**
 * A TernaryOperatorNode represents a built-in ternary operators.
 * This covers  built-in functions like substr().
 * Java operators are not represented here: the JSQL language allows Java
 * methods to be called from expressions, but not Java operators.
 *
 */

public class TernaryOperatorNode extends ValueNode
{
    public static enum OperatorType {
        LOCATE("LOCATE", "locate",
               ValueClassName.NumberDataValue,
               new String[] { ValueClassName.StringDataValue,
                              ValueClassName.StringDataValue,
                              ValueClassName.NumberDataValue }),
        SUBSTRING("substring" , "substring",
                  ValueClassName.ConcatableDataValue,
                  new String[] { ValueClassName.ConcatableDataValue,
                                 ValueClassName.NumberDataValue,
                                 ValueClassName.NumberDataValue }),
        LIKE("like", "like",
             ValueClassName.BooleanDataValue,
             new String[] { ValueClassName.DataValueDescriptor,
                            ValueClassName.DataValueDescriptor,
                            ValueClassName.DataValueDescriptor }),
        TIMESTAMPADD("TIMESTAMPADD", "timestampAdd",
                     ValueClassName.DateTimeDataValue,
                     // time.timestampadd(interval, count)
                     new String[] { ValueClassName.DateTimeDataValue,
                                    "java.lang.Integer",
                                    ValueClassName.NumberDataValue }),
        TIMESTAMPDIFF("TIMESTAMPDIFF", "timestampDiff",
                      ValueClassName.NumberDataValue,
                      // time2.timestampDiff(interval, time1)
                      new String[] {"java.lang.Integer",
                                     ValueClassName.DateTimeDataValue,
                                     ValueClassName.DateTimeDataValue });

        String operator, methodName;
        String resultType;
        String[] argTypes;
        OperatorType(String operator, String methodName,
                     String resultType, String[] argTypes) {
            this.operator = operator;
            this.methodName = methodName;
            this.resultType = resultType;
            this.argTypes = argTypes;
        }
    }

    protected String operator;
    protected String methodName;
    protected OperatorType operatorType;
    protected ValueNode receiver;

    protected ValueNode leftOperand;
    protected ValueNode rightOperand;

    protected String resultInterfaceType;
    protected String receiverInterfaceType;
    protected String leftInterfaceType;
    protected String rightInterfaceType;

    // TODO: Could be enum, but note how passed as Integer constant.
    public static final int YEAR_INTERVAL = 0;
    public static final int QUARTER_INTERVAL = 1;
    public static final int MONTH_INTERVAL = 2;
    public static final int WEEK_INTERVAL = 3;
    public static final int DAY_INTERVAL = 4;
    public static final int HOUR_INTERVAL = 5;
    public static final int MINUTE_INTERVAL = 6;
    public static final int SECOND_INTERVAL = 7;
    public static final int FRAC_SECOND_INTERVAL = 8;

    /**
     * Initializer for a TernaryOperatorNode
     *
     * @param receiver The receiver (eg, string being operated on in substr())
     * @param leftOperand The left operand of the node
     * @param rightOperand The right operand of the node
     * @param operatorType The type of the operand
     */

    public void init(Object receiver,
                     Object leftOperand,
                     Object rightOperand,
                     Object operatorType,
                     Object trimType) {
        this.receiver = (ValueNode)receiver;
        this.leftOperand = (ValueNode)leftOperand;
        this.rightOperand = (ValueNode)rightOperand;
        this.operatorType = (OperatorType)operatorType;
        this.operator = this.operatorType.operator;
        this.methodName = this.operatorType.methodName;
        this.resultInterfaceType = this.operatorType.resultType;
        this.receiverInterfaceType = this.operatorType.argTypes[0];
        this.leftInterfaceType = this.operatorType.argTypes[1];
        this.rightInterfaceType = this.operatorType.argTypes[2];
    }

    /**
     * Fill this node with a deep copy of the given node.
     */
    public void copyFrom(QueryTreeNode node) throws StandardException {
        super.copyFrom(node);

        TernaryOperatorNode other = (TernaryOperatorNode)node;
        this.operator = other.operator;
        this.methodName = other.methodName;
        this.operatorType = other.operatorType;
        this.receiver = (ValueNode)getNodeFactory().copyNode(other.receiver,
                                                             getParserContext());
        this.leftOperand = (ValueNode)getNodeFactory().copyNode(other.leftOperand,
                                                                getParserContext());
        this.rightOperand = (ValueNode)getNodeFactory().copyNode(other.rightOperand,
                                                                 getParserContext());
        this.resultInterfaceType = other.resultInterfaceType;
        this.receiverInterfaceType = other.receiverInterfaceType;
        this.leftInterfaceType = other.leftInterfaceType;
        this.rightInterfaceType = other.rightInterfaceType;
    }

    /**
     * Convert this object to a String.  See comments in QueryTreeNode.java
     * for how this should be done for tree printing.
     *
     * @return This object as a String
     */

    public String toString() {
        return "operator: " + operator + "\n" +
            "methodName: " + methodName + "\n" +
            "resultInterfaceType: " + resultInterfaceType + "\n" +
            "receiverInterfaceType: " + receiverInterfaceType + "\n" +
            "leftInterfaceType: " + leftInterfaceType + "\n" +
            "rightInterfaceType: " + rightInterfaceType + "\n" +
            super.toString();
    }

    /**
     * Prints the sub-nodes of this object.  See QueryTreeNode.java for
     * how tree printing is supposed to work.
     *
     * @param depth The depth of this node in the tree
     */

    public void printSubNodes(int depth) {
        super.printSubNodes(depth);

        if (receiver != null) {
            printLabel(depth, "receiver: ");
            receiver.treePrint(depth + 1);
        }

        if (leftOperand != null) {
            printLabel(depth, "leftOperand: ");
            leftOperand.treePrint(depth + 1);
        }

        if (rightOperand != null) {
            printLabel(depth, "rightOperand: ");
            rightOperand.treePrint(depth + 1);
        }
    }

    public String getOperator() {
        return operator;
    }

    public String getMethodName() {
        return methodName;
    }

    public ValueNode getReceiver() {
        return receiver;
    }

    public void setReceiver(ValueNode receiver) {
        this.receiver = receiver;
    }

    /**
     * Set the leftOperand to the specified ValueNode
     *
     * @param newLeftOperand The new leftOperand
     */
    public void setLeftOperand(ValueNode newLeftOperand) {
        leftOperand = newLeftOperand;
    }

    /**
     * Get the leftOperand
     *
     * @return The current leftOperand.
     */
    public ValueNode getLeftOperand() {
        return leftOperand;
    }

    /**
     * Set the rightOperand to the specified ValueNode
     *
     * @param newRightOperand The new rightOperand
     */
    public void setRightOperand(ValueNode newRightOperand) {
        rightOperand = newRightOperand;
    }

    /**
     * Get the rightOperand
     *
     * @return The current rightOperand.
     */
    public ValueNode getRightOperand() {
        return rightOperand;
    }

    /**
     * Accept the visitor for all visitable children of this node.
     *
     * @param v the visitor
     *
     * @exception StandardException on error
     */
    void acceptChildren(Visitor v) throws StandardException {
        super.acceptChildren(v);

        if (receiver != null) {
            receiver = (ValueNode)receiver.accept(v);
        }

        if (leftOperand != null) {
            leftOperand = (ValueNode)leftOperand.accept(v);
        }

        if (rightOperand != null) {
            rightOperand = (ValueNode)rightOperand.accept(v);
        }
    }

    protected boolean isEquivalent(ValueNode o) throws StandardException {
        if (isSameNodeType(o)) {
            TernaryOperatorNode other = (TernaryOperatorNode)o;

            /*
             * SUBSTR function can either have 2 or 3 arguments.    In the
             * 2-args case, rightOperand will be null and thus needs
             * additional handling in the equivalence check.
             */
            return (other.methodName.equals(methodName)
                    && other.receiver.isEquivalent(receiver)
                    && other.leftOperand.isEquivalent(leftOperand)
                    && ( (rightOperand == null && other.rightOperand == null) ||
                         (other.rightOperand != null &&
                          other.rightOperand.isEquivalent(rightOperand)) ) );
        }
        return false;
    }

}


text:
// Copyright (c) 2004, Open Cloud Limited.

package com.amazon.redshift.core.v3;

import com.amazon.redshift.core.ParameterList;

import java.sql.SQLException;

/**
 * Common interface for all V3 parameter list implementations.
 *
 * @author Oliver Jowett (oliver@opencloud.com)
 */
interface V3ParameterList extends ParameterList {
  /**
   * Ensure that all parameters in this list have been assigned values. Return silently if all is
   * well, otherwise throw an appropriate exception.
   *
   * @throws SQLException if not all parameters are set.
   */
  void checkAllParametersSet() throws SQLException;

  /**
   * Convert any function output parameters to the correct type (void) and set an ignorable value
   * for it.
   */
  void convertFunctionOutParameters();

  /**
   * Return a list of the SimpleParameterList objects that make up this parameter list. If this
   * object is already a SimpleParameterList, returns null (avoids an extra array construction in
   * the common case).
   *
   * @return an array of single-statement parameter lists, or null if this object is
   *         already a single-statement parameter list.
   */
  SimpleParameterList[] getSubparams();

  /**
   * Return the parameter type information.
   * @return an array of {@link com.amazon.redshift.core.Oid} type information
   */
  int[] getParamTypes();

  /**
   * Return the flags for each parameter.
   * @return an array of bytes used to store flags.
   */
  byte[] getFlags();

  /**
   * Return the encoding for each parameter.
   * @return nested byte array of bytes with encoding information.
   */
  byte[][] getEncoding();
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Decision Tree: Member List</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

Decision Tree
    0.2

Implementation of various decision tree algorithms.

Main Page

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

DataSet< T > Member List

This is the complete list of members for DataSet< T >, including all inherited members.

copyData(const DataSet< T > &rhs)	DataSet< T >

copyHeaders(const DataSet< T > &rhs)	DataSet< T >

entropy(unsigned int attr) const 	DataSet< T >

getMatchingVectors(DataSet< T > &dataMatch, unsigned int attr, T match) const 	DataSet< T >

getMostCommonValue(unsigned int attr) const 	DataSet< T >

getTValueCounts(unsigned int attr, map< T, unsigned int > &counts) const 	DataSet< T >

getUniqueValues(unsigned int attr, vector< T > &values) const 	DataSet< T >

load(const string &path)	DataSet< T >

m_d	DataSet< T >

m_n	DataSet< T >

NEG	DataSet< T >

operator=(const DataSet< T > &rhs)	DataSet< T >

POS	DataSet< T >

print()	DataSet< T >

pure(unsigned int attr, T match) const 	DataSet< T >

varianceImpurity(unsigned int target) const 	DataSet< T >

 All Classes Files Functions Variables

Generated on Fri Feb 10 2012 20:52:01 for Decision Tree by

     1.7.5.1


text: To Integrate wechat login/auth into local;   A module of fusion.


text:
ZSpanSliderWithSpinBox::ZSpanSliderWithSpinBox(int lowerValue, int upperValue, int min, int max,
                                               int singleStep, bool tracking, QWidget *parent)
  : QWidget(parent)
{
  createWidget(lowerValue, upperValue, min, max, singleStep, tracking);
}

void ZSpanSliderWithSpinBox::setLowerValue(int lower)
{
  m_slider->setLowerValue(lower);
  m_lowerSpinBox->setValue(lower);
}

void ZSpanSliderWithSpinBox::setUpperValue(int upper)
{
  m_slider->setUpperValue(upper);
  m_upperSpinBox->setValue(upper);
}

void ZSpanSliderWithSpinBox::setDataRange(int min, int max)
{
  m_slider->setRange(min, max);
  m_lowerSpinBox->setRange(m_slider->minimum(), m_slider->upperValue());
  m_lowerSpinBox->setValue(m_slider->lowerValue());
  m_upperSpinBox->setRange(m_slider->lowerValue(), m_slider->maximum());
  m_upperSpinBox->setValue(m_slider->upperValue());
}

void ZSpanSliderWithSpinBox::lowerValueChangedFromSlider(int l)
{
  m_lowerSpinBox->blockSignals(true);
  m_lowerSpinBox->setValue(l);
  m_lowerSpinBox->blockSignals(false);
  m_upperSpinBox->setMinimum(l);
  emit lowerValueChanged(l);
}

void ZSpanSliderWithSpinBox::upperValueChangedFromSlider(int u)
{
  m_upperSpinBox->blockSignals(true);
  m_upperSpinBox->setValue(u);
  m_upperSpinBox->blockSignals(false);
  m_lowerSpinBox->setMaximum(u);
  emit upperValueChanged(u);
}

void ZSpanSliderWithSpinBox::valueChangedFromLowerSpinBox(int l)
{
  m_slider->blockSignals(true);
  m_slider->setLowerValue(l);
  m_slider->blockSignals(false);
  emit lowerValueChanged(l);
}

void ZSpanSliderWithSpinBox::valueChangedFromUpperSpinBox(int u)
{
  m_slider->blockSignals(true);
  m_slider->setUpperValue(u);
  m_slider->blockSignals(false);
  emit upperValueChanged(u);
}

void ZSpanSliderWithSpinBox::createWidget(int lowerValue, int upperValue, int min, int max, int singleStep, bool tracking)
{
  m_slider = new QxtSpanSlider(Qt::Horizontal);
  m_slider->setRange(min, max);
  m_slider->setLowerValue(lowerValue);
  m_slider->setUpperValue(upperValue);
  m_slider->setSingleStep(singleStep);
  m_slider->setTracking(tracking);
  m_slider->setHandleMovementMode(QxtSpanSlider::NoCrossing);
  m_slider->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
  m_lowerSpinBox = new ZSpinBox();
  m_lowerSpinBox->setRange(min, upperValue);
  m_lowerSpinBox->setValue(lowerValue);
  m_lowerSpinBox->setSingleStep(singleStep);
  m_upperSpinBox = new ZSpinBox();
  m_upperSpinBox->setRange(lowerValue, max);
  m_upperSpinBox->setValue(upperValue);
  m_upperSpinBox->setSingleStep(singleStep);
  QHBoxLayout* lo = new QHBoxLayout(this);
  lo->setContentsMargins(0,0,0,0);
  lo->addWidget(m_lowerSpinBox);
  lo->addWidget(m_slider);
  lo->addWidget(m_upperSpinBox);
  connect(m_slider, SIGNAL(lowerValueChanged(int)), this, SLOT(lowerValueChangedFromSlider(int)));
  connect(m_slider, SIGNAL(upperValueChanged(int)), this, SLOT(upperValueChangedFromSlider(int)));
  connect(m_lowerSpinBox, SIGNAL(valueChanged(int)), this, SLOT(valueChangedFromLowerSpinBox(int)));
  connect(m_upperSpinBox, SIGNAL(valueChanged(int)), this, SLOT(valueChangedFromUpperSpinBox(int)));
}

ZDoubleSpanSliderWithSpinBox::ZDoubleSpanSliderWithSpinBox(double lowerValue, double upperValue, double min, double max,
                                                           double singleStep, int decimal, bool tracking, QWidget *parent)
  : QWidget(parent), m_lowerValue(lowerValue), m_upperValue(upperValue), m_min(min),
    m_max(max), m_step(singleStep), m_decimal(decimal), m_tracking(tracking)
{
  m_sliderMaxValue = static_cast<int>(std::max(500000.0, (m_max-m_min)/m_step));
  createWidget();
}

void ZDoubleSpanSliderWithSpinBox::setLowerValue(double lower)
{
  double l = (lower - m_min) / (m_max - m_min) * m_sliderMaxValue;
  m_slider->setLowerValue(l);
  m_lowerSpinBox->setValue(lower);
}

void ZDoubleSpanSliderWithSpinBox::setUpperValue(double upper)
{
  double u = (upper - m_min) / (m_max - m_min) * m_sliderMaxValue;
  m_slider->setUpperValue(u);
  m_upperSpinBox->setValue(upper);
}

void ZDoubleSpanSliderWithSpinBox::setDataRange(double min, double max)
{
  m_min = min;
  m_max = max;
  m_sliderMaxValue = static_cast<int>(std::max(50000.0, (m_max-m_min)/m_step));
  m_slider->setRange(0, m_sliderMaxValue);
  double l = m_slider->lowerValue() / (double)m_sliderMaxValue * (m_max-m_min) + m_min;
  double u = m_slider->upperValue() / (double)m_sliderMaxValue * (m_max-m_min) + m_min;
  m_lowerSpinBox->setRange(m_min, u);
  m_lowerSpinBox->setValue(l);
  m_upperSpinBox->setRange(l, m_max);
  m_upperSpinBox->setValue(u);
}

void ZDoubleSpanSliderWithSpinBox::lowerValueChangedFromSlider(int l)
{
  m_lowerValue = l / (double)m_sliderMaxValue * (m_max - m_min) + m_min;
  m_lowerSpinBox->blockSignals(true);
  m_lowerSpinBox->setValue(m_lowerValue);
  m_lowerSpinBox->blockSignals(false);
  m_upperSpinBox->setMinimum(m_lowerValue);
  emit lowerValueChanged(m_lowerValue);
}

void ZDoubleSpanSliderWithSpinBox::upperValueChangedFromSlider(int u)
{
  m_upperValue = u / (double)m_sliderMaxValue * (m_max - m_min) + m_min;
  m_upperSpinBox->blockSignals(true);
  m_upperSpinBox->setValue(m_upperValue);
  m_upperSpinBox->blockSignals(false);
  m_lowerSpinBox->setMaximum(m_upperValue);
  emit upperValueChanged(m_upperValue);
}

void ZDoubleSpanSliderWithSpinBox::valueChangedFromLowerSpinBox(double l)
{
  m_lowerValue = l;
  int sliderPos = static_cast<int>((m_lowerValue - m_min) / (m_max - m_min) * m_sliderMaxValue);
  m_slider->blockSignals(true);
  m_slider->setLowerValue(sliderPos);
  m_slider->blockSignals(false);
  emit lowerValueChanged(m_lowerValue);
}

void ZDoubleSpanSliderWithSpinBox::valueChangedFromUpperSpinBox(double u)
{
  m_upperValue = u;
  int sliderPos = static_cast<int>((m_upperValue - m_min) / (m_max - m_min) * m_sliderMaxValue);
  m_slider->blockSignals(true);
  m_slider->setLowerValue(sliderPos);
  m_slider->blockSignals(false);
  emit upperValueChanged(m_upperValue);
}

void ZDoubleSpanSliderWithSpinBox::createWidget()
{
  m_slider = new QxtSpanSlider(Qt::Horizontal);
  m_slider->setRange(0, m_sliderMaxValue);
  m_slider->setLowerValue(static_cast<int>((m_lowerValue - m_min) / (m_max - m_min) * m_sliderMaxValue));
  m_slider->setUpperValue(static_cast<int>((m_upperValue - m_min) / (m_max - m_min) * m_sliderMaxValue));
  m_slider->setSingleStep(std::max(1, static_cast<int>(m_step*m_sliderMaxValue/(m_max-m_min))));
  m_slider->setTracking(m_tracking);
  m_slider->setHandleMovementMode(QxtSpanSlider::NoCrossing);
  m_slider->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
  m_lowerSpinBox = new ZDoubleSpinBox();
  m_lowerSpinBox->setRange(m_min, m_upperValue);
  m_lowerSpinBox->setValue(m_lowerValue);
  m_lowerSpinBox->setSingleStep(m_step);
  m_lowerSpinBox->setDecimals(m_decimal);
  m_upperSpinBox = new ZDoubleSpinBox();
  m_upperSpinBox->setRange(m_lowerValue, m_max);
  m_upperSpinBox->setValue(m_upperValue);
  m_upperSpinBox->setSingleStep(m_step);
  m_upperSpinBox->setDecimals(m_decimal);
  QHBoxLayout* lo = new QHBoxLayout(this);
  lo->setContentsMargins(0,0,0,0);
  lo->addWidget(m_lowerSpinBox);
  lo->addWidget(m_slider);
  lo->addWidget(m_upperSpinBox);
  connect(m_slider, SIGNAL(lowerValueChanged(int)), this, SLOT(lowerValueChangedFromSlider(int)));
  connect(m_slider, SIGNAL(upperValueChanged(int)), this, SLOT(upperValueChangedFromSlider(int)));
  connect(m_lowerSpinBox, SIGNAL(valueChanged(double)), this, SLOT(valueChangedFromLowerSpinBox(double)));
  connect(m_upperSpinBox, SIGNAL(valueChanged(double)), this, SLOT(valueChangedFromUpperSpinBox(double)));
}


text:
using System.Runtime.Serialization;

namespace Citrina
{
    /// <summary>
    /// Type of requested objects listed in 'ids' parameter: *ad — ads,, *campaign — campaigns,, *client — clients,, *office — account.
    /// </summary>
    public enum AdsStatisticsIdsType
    {
        [EnumMember(Value = "ad")]
        Ad,
        [EnumMember(Value = "campaign")]
        Campaign,
        [EnumMember(Value = "client")]
        Client,
        [EnumMember(Value = "office")]
        Office,
    }
}


text:
namespace ash {

// Used to indicate no shell window id.
const int kShellWindowId_Invalid = -1;

// A higher-level container that holds all of the containers stacked below
// kShellWindowId_LockScreenContainer.  Only used by PowerButtonController for
// animating lower-level containers.
const int kShellWindowId_NonLockScreenContainersContainer = 0;

// A higher-level container that holds containers that hold lock-screen
// windows.  Only used by PowerButtonController for animating lower-level
// containers.
const int kShellWindowId_LockScreenContainersContainer = 1;

// A higher-level container that holds containers that hold lock-screen-related
// windows (which we want to display while the screen is locked; effectively
// containers stacked above kShellWindowId_LockSystemModalContainer).  Only used
// by PowerButtonController for animating lower-level containers.
const int kShellWindowId_LockScreenRelatedContainersContainer = 2;

// A container used for windows of WINDOW_TYPE_CONTROL that have no parent.
// This container is not visible.
const int kShellWindowId_UnparentedControlContainer = 3;

// The desktop background window.
const int kShellWindowId_DesktopBackgroundContainer = 4;

// The virtual keyboard container.
// NOTE: this is lazily created.
const int kShellWindowId_VirtualKeyboardContainer = 5;

// The container for standard top-level windows.
const int kShellWindowId_DefaultContainer = 6;

// The container for top-level windows with the 'always-on-top' flag set.
const int kShellWindowId_AlwaysOnTopContainer = 7;

// The container for windows docked to either side of the desktop.
const int kShellWindowId_DockedContainer = 8;

// The container for the shelf.
const int kShellWindowId_ShelfContainer = 9;

// The container for bubbles which float over the shelf.
const int kShellWindowId_ShelfBubbleContainer = 10;

// The container for panel windows.
const int kShellWindowId_PanelContainer = 11;

// The container for the app list.
const int kShellWindowId_AppListContainer = 12;

// The container for user-specific modal windows.
const int kShellWindowId_SystemModalContainer = 13;

// The container for the lock screen background.
const int kShellWindowId_LockScreenBackgroundContainer = 14;

// The container for the lock screen.
const int kShellWindowId_LockScreenContainer = 15;

// The container for the lock screen modal windows.
const int kShellWindowId_LockSystemModalContainer = 16;

// The container for the status area.
const int kShellWindowId_StatusContainer = 17;

// A parent container that holds the virtual keyboard container and ime windows
// if any. This is to ensure that the virtual keyboard or ime window is stacked
// above most containers but below the mouse cursor and the power off animation.
const int kShellWindowId_ImeWindowParentContainer = 18;

// The container for menus.
const int kShellWindowId_MenuContainer = 19;

// The container for drag/drop images and tooltips.
const int kShellWindowId_DragImageAndTooltipContainer = 20;

// The container for bubbles briefly overlaid onscreen to show settings changes
// (volume, brightness, input method bubbles, etc.).
const int kShellWindowId_SettingBubbleContainer = 21;

// The container for special components overlaid onscreen, such as the
// region selector for partial screenshots.
const int kShellWindowId_OverlayContainer = 22;

// ID of the window created by PhantomWindowController or DragWindowController.
const int kShellWindowId_PhantomWindow = 23;

// The container for mouse cursor.
const int kShellWindowId_MouseCursorContainer = 24;

// The topmost container, used for power off animation.
const int kShellWindowId_PowerButtonAnimationContainer = 25;

const int kShellWindowId_Min = 0;
const int kShellWindowId_Max = kShellWindowId_PowerButtonAnimationContainer;

// These are the list of container ids of containers which may contain windows
// that need to be activated.
ASH_EXPORT extern const int kActivatableShellWindowIds[];
ASH_EXPORT extern const size_t kNumActivatableShellWindowIds;

// Returns true if |id| is in |kActivatableShellWindowIds|.
ASH_EXPORT bool IsActivatableShellWindowId(int id);

}  // namespace ash

#endif  // ASH_COMMON_SHELL_WINDOW_IDS_H_


text:
vde.App.controller('LayersCtrl', function($scope, $rootScope, $timeout, timeline, Vis, iVis, $filter) {
  $scope.gMdl = { // General catch-all model for scoping
    pipelines: Vis.pipelines,
    editVis: false,
    sortableOpts: {
      update: function() {
        $timeout(function() {
          Vis.render().then(function() { timeline.save(); });
        }, 1);
      },
      axis: 'y'
    },
    fonts: ['Helvetica', 'Verdana', 'Georgia', 'Palatino', 'Garamond', 'Trebuchet MS'],
    interpolation: ['linear', 'step-before', 'step-after', 'basis', 'basis-open', 'cardinal', 'cardinal-open', 'monotone']
  };

  $rootScope.groupOrder = Vis.groupOrder;

  $rootScope.reparse = function() { Vis.render(); };

  $rootScope.toggleGroup = function(group) {
    if($rootScope.activeVisual &&
        $rootScope.activeVisual.type == 'group' && $rootScope.activeVisual != group)
      $rootScope.activeVisual = null;

    if(group.isLayer()) {
      if($rootScope.activeLayer == group) {
        //We always want an activeLayer...
        //$rootScope.activeLayer = $rootScope.activeGroup = null;
      } else {
        $rootScope.activeGroup = group;
        $rootScope.activeLayer = group;
      }
    } else {
      if($rootScope.activeGroup == group) {
        $rootScope.activeGroup = null;
      } else {
        $rootScope.activeGroup = group;
        $rootScope.activeLayer = group.group();
      }
    }
  };

  $rootScope.toggleVisual = function(v, key, show) {
    if($rootScope.activeVisual == v && !show) {
      $rootScope.activeVisual = null;
      iVis.activeMark = null;
    } else {
      $rootScope.activeVisual = v;

      var group = v.type == 'group' ? v : v.group();
      if(group.isLayer()) {
        $rootScope.activeGroup = group;
        $rootScope.activeLayer = group;
      } else {
        $rootScope.activeGroup = group;
        $rootScope.activeLayer = group.group();
      }

      $rootScope.activePipeline = v.pipelineName ? v.pipeline() : $rootScope.activePipeline;
      $scope.gMdl.activeVisualPipeline = (v.pipeline() || {}).name;

      iVis.activeMark = v;
      iVis.activeItem = key || 0;
    }

    iVis.show('selected');
  };

  $scope.setPipeline = function() {
    var p = $scope.gMdl.activeVisualPipeline;
    if(p === '') $scope.activeVisual.pipelineName = null;
    else if(p == 'vdeNewPipeline') {
      var pipeline = new Vis.Pipeline();
      $scope.activeVisual.pipelineName = pipeline.name;
      $rootScope.activePipeline = pipeline;
      $scope.gMdl.activeVisualPipeline = pipeline.name;
    }
    else {
      $scope.activeVisual.pipelineName = p;
      $rootScope.activePipeline = Vis.pipelines[p];
    }

    return Vis.render().then(function() { timeline.save(); });
  };

  $scope.addGroup = function() {
    var g = new Vis.marks.Group();
    return Vis.render().then(function() {
      $rootScope.toggleVisual(g);
      timeline.save();
    });
  };

  $scope.addAxis = function(group) {
    var axis = new Vis.Axis('', group.isLayer() ? group.name : group.group().name,
        !group.isLayer() ? group.name : null);
    $rootScope.activeVisual = axis;

    timeline.save();
  };

  $rootScope.removeVisual = function(type, name, group, noCnf) {
    if(!noCnf) {
      var cnf = confirm("Are you sure you wish to delete this visual element?");
      if(!cnf) return;
    }

    if(type == 'group') {
      if(iVis.activeMark == Vis.groups[name]) iVis.activeMark = null;
      Vis.groups[name].destroy();
      delete Vis.groups[name];

      var go = Vis.groupOrder;
      go.splice(go.indexOf(name), 1);
    } else {
      if(iVis.activeMark == group[type][name]) iVis.activeMark = null;
      group[type][name].destroy();
      delete group[type][name];

      if(type == 'marks') {
        var mo = group.markOrder;
        mo.splice(mo.indexOf(name), 1);
      }
    }

    return Vis.render().then(function() {
      $('.tooltip').remove();
      if(!noCnf) timeline.save();
    });
  };

  $scope.newTransform = function(type) {
    var t = new Vis.transforms[type]($rootScope.activeVisual.pipelineName);
    $rootScope.activeVisual.pipeline().transforms.push(t);
    $scope.gMdl.showTransforms = false;

    timeline.save();
  };

  $scope.removeTransform = function(i) {
    var cnf = confirm("Are you sure you wish to delete this transformation?");
    if(!cnf) return;

    $rootScope.activeVisual.pipeline().transforms[i].destroy();
    $rootScope.activeVisual.pipeline().transforms.splice(i, 1);
    return Vis.render().then(function() {
      $('.tooltip').remove();

      timeline.save();
    });
  };

  $scope.toggleProp = function(prop, value) {
    var v = $rootScope.activeVisual;

    var props = prop.split('.'), p = v.properties;
    for(var i = 0; i < props.length; i++)
      p = p[props[i]] || (p[props[i]] = {});

    if(p.value == value) delete p.value;
    else p.value = value;

    if('checkExtents' in v) v.checkExtents(prop);

    if('update' in v) v.update(prop);
    else Vis.render();
  };

  $scope.changeMark = function(oldMark, type) {
    var newMark = new Vis.marks[type](),
        name = $filter('inflector')(oldMark.type, 'humanize');

    newMark.displayName  = oldMark.displayName.replace(name, type);
    newMark.layerName    = oldMark.layerName;
    newMark.pipelineName = oldMark.pipelineName;
    newMark.init();

    for(var p in oldMark.properties) {
      // We don't have to check for matching properties, Vega will ignore
      // properties it doesn't understand. But doing this allows us to flip
      // back and forth between mark types losslessly.
      newMark.properties[p] = oldMark.properties[p];
    }

    $scope.removeVisual('marks', oldMark.name, oldMark.group(), true);
    Vis.render().then(function() {
      $scope.toggleVisual(newMark);
      timeline.save();
    });
  };
});


text:
%  SETPLOT2 sets user defined plotting parameters
%
%      User defined Matlab script for setting various Clawpack plotting
%      parameters.  This script is called by PLOTCLAW2.  A default
%      version of this script can be found in claw/matlab/setplot2.m and
%      copied to users working directory and modifed to set things up
%      differently.
%
%      Parameters that can be set with SETPLOT2
%
%        OutputFlag        - set to 'ascii' (default) to read ascii output
%                            or to 'hdf' to read hdf output files.
%        PlotType          - type of plot to produce:
% 			    - 1 = pcolor on slices (with optional contours)
% 			    - 2 = contour lines in 2d on white slices
% 			    - 3 = Schlieren plot on slices
% 			    - 4 = scatter plot of q vs. r
%
%        mq                  - which component of q to plot
%        UserVariable        - Set to 1 to specify a user defined variable.
%        UserVariableFile    - name of m-file mapping data to q
%        MappedGrid          - set to 1 if mapc2p.m exists for nonuniform
%                              grid
%        Manifold            - set to 1 if mapc2m.m exists for manifold plot.
%        MaxFrames           - max number of frames
%        MaxLevels           - max number of AMR levels
%        PlotData            - Data on refinement level k is plotted only if
%                              PlotData(k) == 1
%        PlotGrid            - PLot grid lines on level k is PlotGrid(k) /= 0
%        PlotGridEdges       - Plot 2d patch borders if PlotGridEdges(k) /= 0
%        ContourValues       - Set to desired contour values, or [] for no ...
% 	                       lines.
%        x0,y0               - center for scatter plots.
%        ScatterStyle        - symbols for scatter plot.
%        LineStyle           - same as ScatterStyle.
%        UserMap1d           - set to 1 if 'map1d' file exists.
%
%      All parameters can be modified by typing 'k' at the PLOTCLAW2 prompt.
%
%      See also PLOTCLAW2, SetPlotGrid, setPlotGridEdges.

% OutputFlag = 'ascii'         % default value.

PlotType = 1;                % type of plot to produce:
			     % 1 = pseudo-color (pcolor)
			     % 2 = contour
			     % 3 = Schlieren
			     % 4 = scatter plot of q vs. r

mq = 1;                      % which component of q to plot
UserVariable = 0;            % set to 1 to specify a user-defined variable
UserVariableFile = ' ';      % name of m-file mapping data to q
MappedGrid = 0;              % set to 1 if mapc2p.m exists for nonuniform grid
Manifold = 0;
MaxFrames = 1000;            % max number of frames to loop over
MaxLevels = 6;
PlotData =  [1 1 1 1 1 1];   % Data on refinement level k is plotted only if
			     % k'th component is nonzero
PlotGrid =  [0 0 0 0 0 0];   % Plot grid lines on each level?

PlotGridEdges =  [1 1 1 1 1 1];  % Plot edges of patches of each grid at
                                 % this level?

%---------------------------------
% for clawpack 4.2 version of matlab routines:
   ContourValues = 0.2:0.2:0.8;

%---------------------------------


text:
package com.google.api.ads.dfp.jaxws.v201405;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *             An error for an exception that occurred when using a token.
 *
 *
 *
Java class for TokenError complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="TokenError">
 *   <complexContent>
 *     <extension base="{https://www.google.com/apis/ads/publisher/v201405}ApiError">
 *       <sequence>
 *         <element name="reason" type="{https://www.google.com/apis/ads/publisher/v201405}TokenError.Reason" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TokenError", propOrder = {
    "reason"
})
public class TokenError
    extends ApiError
{

    protected TokenErrorReason reason;

    /**
     * Gets the value of the reason property.
     *
     * @return
     *     possible object is
     *     {@link TokenErrorReason }
     *
     */
    public TokenErrorReason getReason() {
        return reason;
    }

    /**
     * Sets the value of the reason property.
     *
     * @param value
     *     allowed object is
     *     {@link TokenErrorReason }
     *
     */
    public void setReason(TokenErrorReason value) {
        this.reason = value;
    }

}


text:
module SiteObject
  attr_reader :base_url, :unique_methods
  attr_accessor :pages, :browser, :arguments, :most_recent_page

  # Sets up a Page class when the SiteObject module is included in the class you're using to model
  # your site.
  def self.included(base)
    klass = Class.new
    base.const_set('Page', klass)
    base::Page.send(:extend,  PageObject::PageClassMethods)
    base::Page.send(:include, PageObject::PageInstanceMethods)
  end

  # Closes the site object's browser
  def close_browser
    @browser.close # Same for watir-webdriver and selenium-webdriver.
  end

  # Helper method designed to assist with complex workflows. Basically, if you're navigating and
  # expect a certain page to be displayed you can use this method to confirm that the page you want is
  # displayed and then get a page object for it.
  #
  # This method just checks to see if the right class of page is being displayed. If you have defined
  # a templated value in the URL of the page object getting checked it doesn't check the values of
  # the arguments. It only confirms whether or not the arguments are present.
  def expect_page(page_arg)
    p = page

    if p
      if p.class.name == page_arg.class.name  # Do this if it looks like an instance of a page.
        return p
      elsif p.class == page_arg               # Do this if it looks like a page class name.
        return p
      elsif page_arg.is_a?(Symbol) && p.class.name.underscore.to_sym == page_arg
        return p
      else
        raise SiteObject::WrongPageError, "Expected #{page_arg} page to be displayed but the URL doesn't look right. \n\n#{caller.join("\n")}"
      end
    else
      raise SiteObject::WrongPageError, "Expected #{page_arg} page to be displayed but the URL doesn't appear to match the URL template of any known page. \n\n#{caller.join("\n")}"
    end
  end

  # Creates a site object, which will have accessor methods for all pages that have been defined for
  # the site. This object takes a hash argument. There is only one required value (the base_url for
  # the site.) Example:
  #
  #  class MySite
  #    include SiteObject
  #  end
  #
  #  site = MySite.new(base_url: "http://foo.com")
  #
  # You can also specify any other arguments that you want for later use:
  #
  #  site = MySite.new(
  #    base_url: "http://foo.com",
  #    foo:      true
  #    bar:      1
  #  )
  #  site.foo
  #  => true
  #  site.bar
  #  => 1
  def initialize(args={})
    unless args.is_a?(Hash)
      raise SiteObject::SiteInitError, "You must provide hash arguments when initializing a site object. At a minimum you must specify a base_url. Example:\ns = SiteObject.new(base_url: 'http://foo.com')"
    end

    @arguments   = args.with_indifferent_access
    @base_url    = @arguments[:base_url]
    @browser     = @arguments[:browser]
    @pages       = self.class::Page.descendants.reject { |p| p.page_template? }

    # Set up accessor methods for each page and page checking methods..
    @pages.each do |current_page|
      unless current_page.page_template?
        current_page.set_url_template(@base_url)

        if current_page.url_matcher
          unless current_page.url_matcher.is_a? Regexp
            raise SiteObject::PageConfigError, "A url_matcher was defined for the #{current_page} page but it was not a regular expression. Check the value provided to the set_url_matcher method in the class definition for this page. Object provided was a #{current_page.url_matcher.class.name}"
          end
        end

        self.class.class_eval do
          define_method(current_page.to_s.underscore) do |args=nil, block=nil|
            current_page.new(self, args)
          end

          define_method("#{current_page.to_s.underscore}?") do
            on_page? current_page
          end
        end
      end
    end

    visited = Set.new
    tmp = @pages.map {|p| p.instance_methods }.flatten
    tmp.each do |element|
      if visited.include?(element)
       else
        visited << element
      end
    end
    @unique_methods = visited
  end

  # Custom inspect method so that console output doesn't get in the way when debugging.
  def inspect
    "#<#{self.class.name}:0x#{object_id}\n @base_url=\"#{@base_url}\"\n @most_recent_page=#{@most_recent_page}>"
  end

  # In cases where the site object doesn't recognize a method it will try to delegate the method call
  # to the page that's currently being displayed in the browser, assuming that the site object recognizes
  # the page by its URL. If the page is the last visited page and method is unique, (i.e., doesn't belong
  # to any other page object) then the site object won't attempt to regenerate the page when calling
  # the method.
  def method_missing(sym, *args, &block)
    if @unique_methods.include?(sym) && @most_recent_page.respond_to?(sym)
      if args && block
        @most_recent_page.send(sym, *args, &block)
      elsif args
        @most_recent_page.send(sym, *args)
      elsif block
        @most_recent_page.send(sym, &block)
      else
        @most_recent_page.send sym
      end
    elsif p = page
      if p.respond_to?(sym)
        if args && block
           p.send(sym, *args, &block)
        elsif args
          p.send(sym, *args)
        elsif block
          p.send(sym, &block)
        else
          p.send sym
        end
      else
        super
      end
    else
      super
    end
  end

  # Returns true or false depending on whether the specified page is displayed. You can use a page
  # object or a PageObject class name to identify the page you are looking for. Examples:
  #
  #  page = site.account_summary_page
  #  =>#<AccountSummaryPage:70341126478080 ...>
  #  site.on_page? page
  #  =>true
  #
  #  site.on_page? AccountSummaryPage
  #  =>true
  def on_page?(page_arg)
    if @browser.is_a? Watir::Browser
      url = @browser.url
    elsif @browser.is_a? Selenium::WebDriver::Driver
      url = @browser.current_url
    else
      raise SiteObject::BrowserLibraryNotSupportedError, "Unsupported browser library: #{@browser.class}"
    end

    if page_arg.url_matcher && page_arg.url_matcher =~ url
      return true
    elsif page_arg.url_template.match url
      return true
    else
      return false
    end
  end

  # Can be used to open a browser for the site object if the user did not pass one in when it was
  # initialized. The arguments used here get passed down to Watir when starting the browser. Example:
  #  s = SomeSite.new(hash)
  #  s.open_browser :watir, :firefox
  def open_browser(platform, browser_type, args={})
    case platform
    when :watir
      @browser = Watir::Browser.new(browser_type, args)
    when :selenium
      @browser = Selenium::WebDriver::Driver.for(browser_type, args)
    else
      raise ArgumentError "Platform argument must be either :watir or :selenium."
    end
  end

  # Looks at the page currently being displayed in the browser and tries to return a page object for
  # it. Does this by looking at the currently displayed URL in the browser. The first page that gets
  # checked is the page that was most recently accessed. After that it will cycle through all available
  # pages looking for a match. Returns nil if it can't find a matching page object.
  def page
    return @most_recent_page if @most_recent_page && @most_recent_page.on_page?

    if @browser.is_a? Watir::Browser
      url = @browser.url
    elsif @browser.is_a? Selenium::WebDriver::Driver
      url = @browser.current_url
    else
      raise SiteObject::BrowserLibraryNotSupportedError, "Unsupported browser library: #{@browser.class}"
    end

    found_page = nil
    @pages.each do |p|
      if p.url_matcher && p.url_matcher =~ url
        found_page = p
      elsif p.query_arguments && p.url_template.match(url)
        found_page = p
      elsif !p.query_arguments && p.url_template.match(url.split(/(\?|#)/)[0])
        found_page = p
      end

      break if found_page
    end

    if found_page && !found_page.required_arguments.empty?
      if hsh = found_page.url_template.extract(url)
        return found_page.new(self, found_page.url_template.extract(url))
      else
        return found_page.new(self, found_page.url_template.extract(url.split(/(\?|#)/)[0]))
      end
    elsif found_page
      return found_page.new(self)
    else
      return nil
    end
  end

  at_exit { @browser.close if @browser }
end


text:
package org.apache.phoenix.expression;

import java.math.BigDecimal;
import java.util.List;

import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.phoenix.exception.ValueTypeIncompatibleException;
import org.apache.phoenix.schema.PDataType;
import org.apache.phoenix.schema.SortOrder;
import org.apache.phoenix.schema.tuple.Tuple;
import org.apache.phoenix.util.NumberUtil;

/**
 *
 * Subtract expression implementation
 *
 *
 * @since 0.1
 */
public class DecimalSubtractExpression extends SubtractExpression {
    private Integer maxLength;
    private Integer scale;

    public DecimalSubtractExpression() {
    }

    public DecimalSubtractExpression(List<Expression> children) {
        super(children);
        Expression firstChild = children.get(0);
        maxLength = getPrecision(firstChild);
        scale = getScale(firstChild);
        for (int i=1; i<children.size(); i++) {
            Expression childExpr = children.get(i);
            maxLength = getPrecision(maxLength, getPrecision(childExpr), scale, getScale(childExpr));
            scale = getScale(maxLength, getPrecision(childExpr), scale, getScale(childExpr));
        }
    }

    @Override
    public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
        BigDecimal result = null;
        for (int i=0; i<children.size(); i++) {
            Expression childExpr = children.get(i);
            if (!childExpr.evaluate(tuple, ptr)) {
                return false;
            }
            if (ptr.getLength() == 0) {
                return true;
            }

            PDataType childType = childExpr.getDataType();
            boolean isDate = childType.isCoercibleTo(PDataType.DATE);
            SortOrder childSortOrder = childExpr.getSortOrder();
            BigDecimal bd = isDate ?
                    BigDecimal.valueOf(childType.getCodec().decodeLong(ptr, childSortOrder)) :
                    (BigDecimal)PDataType.DECIMAL.toObject(ptr, childType, childSortOrder);

            if (result == null) {
                result = bd;
            } else {
                result = result.subtract(bd);
                /*
                 * Special case for date subtraction - note that only first two expression may be dates.
                 * We need to convert the date to a unit of "days" because that's what sql expects.
                 */
                if (isDate) {
                    result = result.divide(BD_MILLIS_IN_DAY, PDataType.DEFAULT_MATH_CONTEXT);
                }
            }
        }
        if (maxLength != null || scale != null) {
            result = NumberUtil.setDecimalWidthAndScale(result, maxLength, scale);
        }
        if (result == null) {
            throw new ValueTypeIncompatibleException(PDataType.DECIMAL, maxLength, scale);
        }
        ptr.set(PDataType.DECIMAL.toBytes(result));
        return true;
    }

    @Override
    public PDataType getDataType() {
        return PDataType.DECIMAL;
    }

    @Override
    public Integer getScale() {
        return scale;
    }

    @Override
    public Integer getMaxLength() {
        return maxLength;
    }
}


text:
function adiosload(file, prefix)
%ADIOSLOAD Read all variables in an ADIOS BP file
%
%   ADIOSLOAD is a batch process to load all variables in an ADIOS BP
%   file. The simplest way is to give an ADIOS BP file name. An optional
%   'prefix' string can be given to avoid name conflict or name conversion.
%
%   ADIOSLOAD(FILE)
%      Read all the variables in FILE and use the same variable names.
%
%   ADIOSLOAD(FILE, PREFIX)
%      Read all the variables in FILE and add PREFIX to the variable names.
%
%   See also ADIOSOPEN, ADIOSCLOSE, ADIOS.

%   Copyright 2009 UT-BATTELLE, LLC
%   Date: 2018/10/03
%   Author: Norbert Podhorszki <pnorbert@ornl.gov>

if (~exist('prefix', 'var'))
    prefix = '';
end
fp = adiosopen(file);
for i = 1:length(fp.Variables)
    try
        name{i} = fp.Variables(i).Name;
        data{i} = adiosread(fp, fp.Variables(i).Name);
        assignin('base',[prefix name{i}],data{i});
    catch
        warning(['Skip ... ', fp.Variables(i).Name]);
    end
end
adiosclose(fp);


text:
package cz.pfreiberg.knparser.util;

/**
 * Představuje dva druhy kódování, ve kterých se VFK dodává (iso-8859-2 a
 * windows-1250). Výstup je realizován ve windows-1250.
 *
 * @author Petr Freiberg (freibergp@gmail.com)
 *
 */
public enum EncodingCzech {

	iso88592("iso-8859-2", "WE8ISO8859P2"), windows1250("windows-1250",
			"EE8MSWIN1250");
	private String encoding;
	private String encodingVfk;

	private EncodingCzech(String encoding, String encodingVfk) {
		this.encoding = encoding;
		this.encodingVfk = encodingVfk;
	}

	public String getEncoding() {
		return encoding;
	}

	public String getEncodingVfk() {
		return encodingVfk;
	}

	public boolean equalsVfk(String value) {
		return (value == null) ? false : encodingVfk.equals(value);
	}

}


text:
<form novalidate name="editForm" id="edit-form" group="form" ng-submit="update()">

        <input type="hidden" ng-model="data.Id" />

            Code
            <input type="text" class="form-control" ng-model="data.Code" />

            Description
            <input type="text" class="form-control" ng-model="data.Description" />

</form>


text:
/**
 *    Licensed 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.
 */
package org.cdlflex.ui.util.concurrent;

import static org.junit.Assert.assertNotNull;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

import org.apache.wicket.Component;
import org.apache.wicket.core.util.string.ComponentRenderer;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.cdlflex.ui.AbstractWicketTest;
import org.junit.Test;

public class ApplicationCallableTest extends AbstractWicketTest {

    @Test
    public void createComponentInNewThread_attachesThreadContextCorrectly() throws Exception {
        ExecutorService executor = Executors.newSingleThreadExecutor();

        Callable<Component> associated = ThreadUtils.associateWithCurrent(() -> new WebMarkupContainer("test"));

        Future<Component> test = executor.submit(associated);

        // without the association, this would throw an exception because no ThreadContext is associated with the thread
        // that generated the component.
        Component component = test.get();
        assertNotNull(component);
        assertNotNull(ComponentRenderer.renderComponent(component));

        executor.shutdown();
    }
}


text:
@interface SearchPopVC ()
@property (nonatomic, strong) NSTimer *timer;

@property (nonatomic, strong) NSMutableArray *itemButtons;

@property(assign,nonatomic)NSUInteger upIndex;

@property(assign,nonatomic)NSUInteger downIndex;

@property(strong,nonatomic)UIImageView *closeImgView;

@property(strong,nonatomic)NSArray *ary;

@end

@implementation SearchPopVC
static NSInteger StartNumber;

- (NSMutableArray *)itemButtons
{
    if (_itemButtons == nil) {
        _itemButtons = [NSMutableArray array];
    }
    return _itemButtons;
}

-(NSArray *)ary{

    if (_ary==nil) {

        _ary = [NSArray array];

        _ary = @[@"stray",@"losepet"];
    }

    return _ary;
}

//重新初始化主视图样式 透明->
-(void)loadView{

    UIView *view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];

    [view setBackgroundColor:[UIColor blackColor]];

    //获取截取的背景图片,便于达到模糊背景效果
    UIImageView *imgView = [[UIImageView alloc]initWithImage:_backImg];

    //模糊效果层
    UIView *blurView =[[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];

    [blurView setBackgroundColor:colorWithRGBA(64, 64, 64, 0.9)];// [UIColor colorWithWhite:0.9 alpha:0.8]];

    [imgView addSubview:blurView];

    [view addSubview:imgView];

    NSInteger isAlreadStartNum = [[NSUserDefaults standardUserDefaults] integerForKey:@"PopMenuAlreadStartNum"];

    if(isAlreadStartNum < kMaxStartNumber){

        UILabel *alert = [[UILabel alloc] init];
        [alert setTextAlignment:NSTextAlignmentCenter];
        [alert setTextColor:[UIColor colorWithWhite:0.902 alpha:1.000]];
        [alert setFont:[UIFont fontWithName:@"PingFangHK-Light" size:16.0f]];
        [alert setNumberOfLines:0];
        [alert setText:@"您发布的任何内容请遵守用户协议\"扩散用户行为规范\"的要求,倘若发布违规信息一律封号处理"];
        NSDictionary *attributes = @{NSFontAttributeName : alert.font,
                                     NSForegroundColorAttributeName : [UIColor lightGrayColor]};

        //CGSizeMake(CGFLOAT_MAX, 15)->限制最大的宽度和高度`  采用换行模式
        CGRect userNameLBRect = [alert.text boundingRectWithSize:CGSizeMake(kScreenWidth - 16, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingUsesFontLeading attributes:attributes context:nil];

        [alert setFrame:CGRectMake(8, 200, userNameLBRect.size.width, userNameLBRect.size.height)];

        [view addSubview:alert];

        [[NSUserDefaults standardUserDefaults] setInteger:++isAlreadStartNum forKey:@"PopMenuAlreadStartNum"];
    }

    self.view = view;

}

- (void)viewDidLoad {

    [super viewDidLoad];

    StartNumber = 0;

    //添加菜单按钮
    [self setMenu];
    //添加底部关闭按钮
    [self insertCloseImg];

    //定时器控制每个按钮弹出的时间
    self.timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(popupBtn) userInfo:nil repeats:YES];

    //添加手势点击事件
    UITapGestureRecognizer *touch = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(touchesBegan:)];
    [self.view addGestureRecognizer:touch];
}

- (void)viewWillAppear:(BOOL)animated{

    [super viewWillAppear:animated];

    [UIView animateWithDuration:0.6 animations:^{

        _closeImgView.transform = CGAffineTransformRotate(_closeImgView.transform, M_PI);
    }];
}

//关闭图片
- (void)insertCloseImg{

    UIImage *img = [UIImage imageNamed:@"btn_new_nor"];

    UIImageView *imgView = [[UIImageView alloc]initWithImage:img];

    imgView.frame = CGRectMake(self.view.center.x-28, self.view.frame.size.height-74, 56, 56);

    [self.view addSubview:imgView];

    _closeImgView = imgView;

}

- (void)popupBtn{

    if (_upIndex == self.itemButtons.count) {

        [self.timer invalidate];

        _upIndex = 0;

        return;
    }

    PublishMenuButton *btn = self.itemButtons[_upIndex];

    [self setUpOneBtnAnim:btn];

    _upIndex++;
}

//设置按钮从第一个开始向上滑动显示
- (void)setUpOneBtnAnim:(UIButton *)btn
{

    [UIView animateWithDuration:0.8 delay:0 usingSpringWithDamping:0.7 initialSpringVelocity:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
        btn.transform = CGAffineTransformIdentity;
    } completion:^(BOOL finished){

        //获取当前显示的菜单控件的索引
        _downIndex = self.itemButtons.count - 1;
    }];

}

//按九宫格计算方式排列按钮
- (void)setMenu{

    int cols = 2;
    int col = 0;
    int row = 0;

    CGFloat x = 0;
    CGFloat y = 0;
    CGFloat wh = 100;

    CGFloat margin = ([UIScreen mainScreen].bounds.size.width - cols * wh) / (cols + 1);

    //此处按照不同屏幕尺寸适配
    CGFloat preX = 0;
    CGFloat oriY = 500;
    if (kScreenHeight == 480) {
        //4/4s
        preX = 54;
        oriY = 293;
    }else if (kScreenHeight == 568){
        //5/5s
        preX = 54;
        oriY = 380;
    }else if (kScreenHeight == 667){
        //6/6S
        preX = 58;
        oriY = 480;
    }else{
        //6P 736
        preX = 64;
        oriY = 549;
    }

    for (int i = 0; i < self.ary.count; i++) {

        //        NSArray *arrTitle = @[@"文字",@"照片",@"链接",@"视频",@"寻亲",@"文章"];
        NSArray *arrTitle = @[@"流浪动物",@"寻觅爱宠"];

        PublishMenuButton *btn = [PublishMenuButton buttonWithType:UIButtonTypeCustom];

        //图标图片和文本
        UIImage *img = [UIImage imageNamed:self.ary[i]];
        NSString *title = arrTitle[i];

        [btn setImage:img forState:UIControlStateNormal];
        [btn setTitle:title forState:UIControlStateNormal];

        //列数(个数除总列数取余)
        col = i % cols;
        //行数(个数除总列数取整)
        row = i / cols;
        //x 平均间隔 + 前图标宽度
        x = margin + col * (margin + wh);
        //y 起始y + 前宽度
        y = row * (margin + wh) + oriY;

        btn.frame = CGRectMake(x, y, wh, wh);

        btn.transform = CGAffineTransformMakeTranslation(0, self.view.bounds.size.height);

        btn.tag = 1000 + i;

        [btn addTarget:self action:@selector(touchDownBtn:) forControlEvents:UIControlEventTouchUpInside];

        [self.itemButtons addObject:btn];

        [self.view addSubview:btn];

    }
}

//点击按钮进行放大动画效果直到消失
- (void)touchDownBtn:(PublishMenuButton *)btn{

    __weak typeof(self) weakSelf = self;
    NSLog(@"%ld为btn.tag的值,根据不同的按钮需要做什么操作可以写这里",(long)btn.tag);
    //根据选中的不同按钮的tag判断进入相应的界面->

    if (btn.tag == 1000) {
        dispatch_async(kMainQueue, ^{
            //纯文本
            DriftAnimalVC *publishTextVC = [[DriftAnimalVC alloc] init];
            [publishTextVC toDissmissSelf:^{
                weakSelf.timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:weakSelf selector:@selector(returnUpVC) userInfo:nil repeats:YES];
                [UIView animateWithDuration:0.2 animations:^{
                    _closeImgView.transform = CGAffineTransformRotate(_closeImgView.transform, -M_PI_2*1.5);
                }];
                [weakSelf dismissViewControllerAnimated:YES completion:nil];
            }];
            [weakSelf presentViewController:publishTextVC animated:YES completion:nil];
        });

    }else if(btn.tag == 1001){
        dispatch_async(kMainQueue, ^{

            //图文
            SearchAnimalVC *publishVC = [[SearchAnimalVC alloc] init];
            [publishVC toDissmissSelf:^{
                weakSelf.timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:weakSelf selector:@selector(returnUpVC) userInfo:nil repeats:YES];
                [UIView animateWithDuration:0.2 animations:^{
                    _closeImgView.transform = CGAffineTransformRotate(_closeImgView.transform, -M_PI_2*1.5);
                }];
                [weakSelf dismissViewControllerAnimated:YES completion:nil];
            }];
            [weakSelf presentViewController:publishVC animated:YES completion:nil];
        });
    }

    [UIView animateWithDuration:0.5 animations:^{
        btn.transform = CGAffineTransformMakeScale(2.0, 2.0);
        btn.alpha = 0;
    }];

}

//设置按钮从后往前下落
- (void)returnUpVC{

    if (_downIndex == -1) {

        [self.timer invalidate];

        return;
    }

    PublishMenuButton *btn = self.itemButtons[_downIndex];

    [self setDownOneBtnAnim:btn];

    _downIndex--;
}

//按钮下滑并返回上一个控制器
- (void)setDownOneBtnAnim:(UIButton *)btn
{

    [UIView animateWithDuration:0.6 animations:^{

        btn.transform = CGAffineTransformMakeTranslation(0, self.view.bounds.size.height);

    } completion:^(BOOL finished) {

        [self dismissViewControllerAnimated:NO completion:nil];

    }];

}

//点击事件返回上一控制器,并且旋转145弧度关闭按钮
-(void)touchesBegan:(UITapGestureRecognizer *)touches{

    self.timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(returnUpVC) userInfo:nil repeats:YES];

    [UIView animateWithDuration:0.3 animations:^{

        _closeImgView.transform = CGAffineTransformRotate(_closeImgView.transform, -M_PI_2*1.5);
    }];

}

@end


text:
$(function(){

});

function menu(){
	$('header nav ul li a').on('click', function(){
		$('#menu_list').slideDown('slow', function(){
				$(this).css('display', 'block');
		});
	});
}


text:
package javaposse.jobdsl.plugin;

import com.google.common.base.Predicate;

public class SeedReferenceDigestPredicate implements Predicate<SeedReference> {
    private final String digest;

    public SeedReferenceDigestPredicate(String digest) {
        this.digest = digest;
    }

    @Override
    public boolean apply(SeedReference input) {
        return !digest.equals(input.getDigest());
    }
}


text:
package edu.wpi.first.wpilibj.templates.commands;

/**
 * This is the default state of the robot.  JoystickDrive means that Otto is
 * currently controlled by the fancy joystick (the one on the right side of the
 * driver station), and is in the proper mode to drive on his mecanum wheels.
 * This means that he will move forward and backward if the joystick is pushed
 * forward or pulled back, turn left and right based on the joystick input, and
 * strafe left and right based on joystick inputs.  This command never ends, so
 * if you want to change the settings for how it drives, you would need to override
 * the subsystems of JoystickDrive (AKA driveTrain).  If you don't override the
 * subsystems, IT WILL NEVER END.  Likewise, if there is another command being used
 * to drive Otto and you want to kill it, just enable JoystickDrive and it will
 * instantly get you back to a regular driving platform.  This is very useful for
 * KILLING DRIVETRAIN PID'S!  If Otto starts spinning out of control, ENABLE
 * JOYSTICKDRIVE!  There is a button for this in the OI.
 * @author Lauren Dierker and Jessie Adkins
 */
public class JoystickDrive extends CommandBase {

    int dir;
    boolean fieldOrient;
    double driveyStickThrottle;
    int i;

    /**
     * Creates a new JoystickDrive command.  This command always runs, unless it's
     * subsystems are taken away.  There are a few different ways to drive using
     * this command.  If FieldOriented is false, it is driven normally, but if it
     * is set to true, FieldOriented driving is enabled.  Field oriented driving
     * means that the direction the robot is facing when it is enabled is set to
     * forward, and whatever inputs the joystick gives are used to move the robot
     * in relation to that.  Basically, the robot has a defined forward, back, left,
     * and right, and the joystick now conforms to those controls instead of the
     * actual facing of the robot.  In order to designate a new forward, you must
     * reset the gyro, but that is not hard because you can use the command
     * GyroReset(), and there is a button for that in the OI.  Field Oriented driving
     * is all about driver preference, so it is very easy to switch between the
     * two modes.  All you have to do is override one JoystickDrive with the other,
     * and the new one will cancel out the old one.
     * @param direction decides if the controls are inverted or not. Input 1 if normal, and -1 if inverted
     * @param fieldOriented set to true if you want field oriented driving.  This requires a gyro.
     */
    public JoystickDrive(int direction, boolean fieldOriented) {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
        requires(driveTrain);
        requires(colorSensor);
        dir = direction;
        fieldOrient = fieldOriented;
        driveyStickThrottle = 1.0;
        i = 0;
    }

    // Called just before this Command runs the first time
    protected void initialize() {
        driveTrain.startTestEncoder();
        //driveTrain.resetGyro();

        //for some reason, when the timer is in use, the joysticks stop actually
        //driving the robot.  I don't know why, but we should remember this
        //for future reference, so we don't screw up a class later on.
        //timer.start();
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {

        driveyStickThrottle = (oi.getDriveyStickThrottle() + 1) / 2;

        if(fieldOrient == true){
            driveTrain.drive.mecanumDrive_Cartesian(dir * oi.getSideSpeed(), dir * oi.getForwardSpeed(), dir * oi.getTwistSpeed() * driveyStickThrottle, driveTrain.getGyroAngle());
        }else{
            driveTrain.drive.mecanumDrive_Cartesian(dir * oi.getSideSpeed(), dir * oi.getForwardSpeed(), dir * oi.getTwistSpeed() * driveyStickThrottle, 0);
        }
        /**
        if(i < 14){
            i++;
        }else{
            System.out.println("turning speed percent" + driveyStickThrottle);
            i = 0;
        }
        */
        //System.out.println("color: " + colorSensor.colorSensor.getColor());
        //System.out.println("gyro: " + driveTrain.getGyroAngle());
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}


text:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>git on emacs vi</title>
    <link>http://emacsvi.com/tags/git/</link>
    <description>Recent content in git on emacs vi</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 12 Nov 2020 21:28:00 +0800</lastBuildDate><atom:link href="http://emacsvi.com/tags/git/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>git多账户切换</title>
      <link>http://emacsvi.com/posts/git/git/</link>
      <pubDate>Thu, 12 Nov 2020 21:28:00 +0800</pubDate>

      <guid>http://emacsvi.com/posts/git/git/</guid>
      <description>github多账号 ssh-keygen -t rsa -C &#34;email@work_mail.com&#34; -f &#34;id_rsa_work_user1&#34; # ~/.ssh/id_rsa # ~/.ssh/id_rsa_work_user1 ssh-add ~/.ssh/id_rsa ssh-add ~/.ssh/id_rsa_work_user1 创建~/.ssh/config
# Personal account, - the default config Host github.com HostName github.com User git IdentityFile ~/.ssh/id_rsa # Work account-1 Host github.com-work_user1 HostName github.com User git IdentityFile ~/.ssh/id_rsa_work_user1 参考   multiple-gihtub-accounts  </description>
    </item>

  </channel>
</rss>


text:
package com.vlkan.whatismyuseragent.github;

import com.google.common.collect.ImmutableMap;
import lombok.extern.slf4j.Slf4j;
import org.kohsuke.github.GHIssueState;
import org.kohsuke.github.GHRepository;
import org.kohsuke.github.GitHub;

import java.io.IOException;
import java.net.URL;
import java.util.Arrays;

import static com.vlkan.whatismyuseragent.util.Preconditions.checkNotNull;
import static java.util.stream.Collectors.joining;

@Slf4j
public class GitHubIssueSubmitter {

    private final GHRepository repository;

    private final String checksum;

    private final ImmutableMap<String, String> attributes;

    private GitHubIssueSubmitter(GHRepository repository, String checksum, ImmutableMap<String, String> attributes) {
        this.repository = checkNotNull(repository, "repository");
        this.checksum = checkNotNull(checksum, "checksum");
        this.attributes = checkNotNull(attributes, "attributes");
    }

    public static GitHubIssueSubmitter of(
            String repositoryName, String checksum, ImmutableMap<String, String> attributes)
            throws IOException {
        GitHub connection = GitHub.connect();
        GHRepository repository = connection.getRepository(repositoryName);
        return new GitHubIssueSubmitter(repository, checksum, attributes);
    }

    public URL submit() throws GitHubIssueConflict, IOException {
        if (issueExists()) {
            log.trace("GitHub issue conflict: {}", checksum);
            throw new GitHubIssueConflict(repository.getFullName(), checksum);
        }
        URL url = createIssue();
        log.trace("Created GitHub issue: {}", url);
        return url;
    }

    private boolean issueExists() {
        return Arrays.stream(GHIssueState.values())
                .map(state -> {
                    try {
                        return repository
                                .getIssues(state).stream()
                                .anyMatch(issue -> issue.getTitle().contains(checksum));
                    } catch (IOException exception) {
                        log.error("failed to retrieve GitHub issues of state " + state, exception);
                        return false;
                    }
                }).findFirst().orElse(false);
    }

    private URL createIssue() throws IOException {
        return repository
                .createIssue(String.format("Device Profile Submission [%s]", checksum))
                .label("device-profile")
                .body(attributes.entrySet().stream()
                        .map(entry -> String.format("%s: %s", entry.getKey(), entry.getValue()))
                        .collect(joining("\n")))
                .create()
                .getHtmlUrl();
    }

}


text:
using System.Data.Common;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Marten.Internal;
using Weasel.Postgresql;
using Marten.Util;
#nullable enable
namespace Marten.Linq.QueryHandlers
{
    public interface IQueryHandler
    {
        void ConfigureCommand(CommandBuilder builder, IMartenSession session);
    }

    public interface IQueryHandler<T>: IQueryHandler
    {
        T Handle(DbDataReader reader, IMartenSession session);

        Task<T> HandleAsync(DbDataReader reader, IMartenSession session, CancellationToken token);

        Task<int> StreamJson(Stream stream, DbDataReader reader, CancellationToken token);
    }

    public interface IMaybeStatefulHandler : IQueryHandler
    {
        bool DependsOnDocumentSelector();
        IQueryHandler CloneForSession(IMartenSession session, QueryStatistics statistics);

        Task<int> StreamJson(Stream stream, DbDataReader reader, CancellationToken token);
    }
}


text:
<?php

namespace Ekyna\Bundle\ShipmentBundle\Twig;

use Ekyna\Bundle\ShipmentBundle\Model\ShipmentStates;
use Ekyna\Component\Sale\Shipment\ShipmentInterface;
use Symfony\Component\Translation\TranslatorInterface;

/**
 * Class ShipmentExtension
 * @package Ekyna\Bundle\ShipmentBundle\Twig
 * @author Étienne Dauvergne <contact@ekyna.com>
 */
class ShipmentExtension extends \Twig_Extension
{
    /**
     * @var TranslatorInterface
     */
    protected $translator;

    /**
     * Constructor.
     *
     * @param TranslatorInterface   $translator
     */
    public function __construct(TranslatorInterface $translator)
    {
        $this->translator = $translator;
    }

    /**
     * {@inheritdoc}
     */
    public function getFilters()
    {
        return array(
            new \Twig_SimpleFilter('shipment_state_label', [$this, 'getShipmentStateLabel'], ['is_safe' => ['html']]),
            new \Twig_SimpleFilter('shipment_state_badge', [$this, 'getShipmentStateBadge'], ['is_safe' => ['html']]),
        );
    }

    /**
     * Returns the shipment state label.
     *
     * @param string|ShipmentInterface $stateOrShipment
     * @return string
     */
    public function getShipmentStateLabel($stateOrShipment)
    {
        $state = $stateOrShipment instanceof ShipmentInterface ? $stateOrShipment->getState() : $stateOrShipment;

        return $this->translator->trans(ShipmentStates::getLabel($state));
    }

    /**
     * Returns the shipment state badge.
     *
     * @param string|ShipmentInterface $stateOrShipment
     * @return string
     */
    public function getShipmentStateBadge($stateOrShipment)
    {
        $state = $stateOrShipment instanceof ShipmentInterface ? $stateOrShipment->getState() : $stateOrShipment;

        return sprintf(
            '%s',
            ShipmentStates::getTheme($state),
            $this->getShipmentStateLabel($state)
        );
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'ekyna_shipment';
    }
}


text:
var nock = require('nock');

exports.execute = function (options) {

    describe("For determining http 400 error behaviour when Query timeout occurs,", function () {
        var server, ermRest, url,
            ops = {allowUnmocked: true};

        beforeAll(function () {
            server = options.server;
            ermRest = options.ermRest;
            url = options.url.replace('ermrest', '');

            server.http.max_retries = 0;
        });

        it("should be returned as a QueryTimeoutError.", function (done) {
            var queryTimeoutResponse = '400 Bad Request\nQuery run time limit exceeded.';

            nock(url, ops)
                .get("/ermrest/catalog/1235")
                .reply(400, queryTimeoutResponse)
                .persist();

            server.catalogs.get("1235").then(null, function(err) {
                expect(err.code).toBe(400);
                expect(err.message).toBe(queryTimeoutResponse);

                expect(err instanceof ermRest.QueryTimeoutError).toBe(true);
                expect(err instanceof ermRest.ERMrestError).toBe(true);
                done();
            }).catch(function(err) {
                console.log(err);
                done.fail();
            });
        });

        afterAll(function() {
            nock.cleanAll();
            nock.enableNetConnect();
        });

    });

};


text:
'''
Supreme Court Opinion parser for Word Cloud project.

Daniel Klein
The University of Alabama
Computer-Based Honors Program
10.06.2013

This script, given a directory containing text files of Supreme Court
cases from Lexis, will parse each file in the directory to extract the
cases, then parse each case to extract the opinions therein. The script
will then write each opinion to file, along with key information about
the corresponding case.

This code is adapted from a piece of code written by my research
advisor, Dr. Joseph Smith. The basic ideas and algorithms are his --
I merely translated them into a more modularized, object-oriented form.
'''
import re
import os, os.path
from src.core.python.WordCloudConstants import *

class SupremeCourtOpinionParser(object):

    def __init__(self, output_dir):
        self.output_dir = output_dir

    def parse_file(self, source_file_path):
        '''
        This parses a file containing cases and splits each
        case into its own string.
        Returns a list of strings, each string containing the opinions
        for one case.
        '''
        print "Parsing file {0}".format(source_file_path)

        self.file_text = []
        with open(source_file_path, 'r') as opinion_file:
            self.all_opinions = opinion_file.readlines()
        delimiter = self.get_delimiter()
        # TODO: DO SOMETHING IF DELIMITER IS STILL NONE
        # test output
        print "Delimiter is: {0}".format(delimiter)
        # /test output
        completion_message_line = self.remove_bracket_nums()
        del self.file_text[completion_message_line + 1:]

        self.cases = self.split_into_cases(delimiter)
        for case in self.cases:
            self.parse_case(case)

    def parse_case(self, case):
        '''
        This parses a string containing all opinions for one case and
        splits each opinion into its own string.
        '''
        blank_line_regex = re.compile("\n{2,10}")
        alt_opinion_regex = re.compile(r"CONCUR BY|DISSENT")

        #cite_found = False
        maj_start_found = False
        alt_opinions_found = False
        maj_author = ""

        case = "\n".join(case)
        case_paragraphs = blank_line_regex.split(case)
        case_paragraphs = [re.sub('\xa0', '', paragraph) \
						  for paragraph in case_paragraphs]
        case_paragraphs = [re.sub('\n', ' ', paragraph) \
						  for paragraph in case_paragraphs]
        #num_paragraphs = len(case_paragraphs)
        # find the lexis citation
        #lexis_regex = re.compile("U.S.\n?\s*LEXIS")
        for index in range(0, len(case_paragraphs)):
            current_paragraph = case_paragraphs[index]
            if re.match("OPINION$", current_paragraph) and not maj_start_found:
                case_header = ([re.sub(r'[\n]', ' ', line)
                            for line in case_paragraphs[: index - 1]])
                # test output
                #print "RAW: {0}".format(case_header)
                # /test output
                # this filters out this fishy character
                case_header = [re.sub(r'[\xa0]', '', line) for line in case_header]
                maj_start_index = index
                maj_end_index = len(case_paragraphs) - 1
                maj_start_found = True

            if re.match("OPINION BY:", current_paragraph):
                maj_author = " ".join([word
                                for word in current_paragraph.split()[2:]
                                if "JUSTICE" not in word and "Justice" not in word])

            if re.search(alt_opinion_regex, current_paragraph) and maj_start_found:
                maj_end_index = index - 1
                #alt_start_index = index
                alt_opinions_found = True
                break

        if alt_opinions_found:
            self.parse_alt_opinions(case_paragraphs[index:], case_header)

        maj_opinion = case_paragraphs[maj_start_index:maj_end_index]
        if maj_author == "":
            maj_author = "PER CURIAM"

        opinion_with_type = ("majority", "\n".join(maj_opinion))
        self.write_opinion(opinion_with_type, maj_author, case_header)

    def parse_alt_opinions(self, alt_opinions, case_header):
        '''
        This parses the concurring and dissenting opinions for a case.
        '''
        # test output
        #print alt_opinions[:5]
        # /test output
        concur_start_regex = re.compile(r"(JUSTICE|Justice)\s[\w'-]+,[^\.]*\sconcurring")
        dissent_start_regex = re.compile(r"(JUSTICE|Justice)\s[\w'-]+,[^\.]*\sdissenting")
        alt_opinion_regex = re.compile(r"CONCUR BY|DISSENT")
        justice_regex = re.compile(r"(JUSTICE|Justice|MR. JUSTICE|Mr. Justice)\s[\w'-]*\.")
        alt_start_indices = []

        for index in range(0, len(alt_opinions)):
            current_paragraph = alt_opinions[index]
            if ((re.search(concur_start_regex, current_paragraph)
                or re.search(dissent_start_regex, current_paragraph)
                or re.search(alt_opinion_regex, current_paragraph)
                or re.match(justice_regex, current_paragraph))
                and not "Footnotes" in current_paragraph):
                if (len(alt_start_indices) == 0) or (index > alt_start_indices[-1] + 2):
                    alt_start_indices.append(index)

        start_end_pairs = []
        if len(alt_start_indices) == 1:
            start_end_pairs = [(0, len(alt_opinions) - 1)]
        else:
            for i in range(0, len(alt_start_indices)):
                if i == len(alt_start_indices) - 1:
                    start_end_pairs.append(
                        (alt_start_indices[i], len(alt_opinions) - 1))
                    break
                else:
                    start_end_pairs.append(
                        (alt_start_indices[i], alt_start_indices[i+1] - 1))

        split_alt_opinions = []
        for index in range(0, len(start_end_pairs)):
            current_pair = start_end_pairs[index]
            if current_pair[0] == current_pair[1]:
                start_end_pairs[index + 1] = (current_pair[0],
											start_end_pairs[index + 1][1])
                continue
            else:
                opinion_string = "\n".join(alt_opinions[current_pair[0]:current_pair[1]])
                split_alt_opinions.append(opinion_string)

        categorized_opinions = self.categorize_opinions(split_alt_opinions)

        for opinion in categorized_opinions:
            opinion_author = self.get_author(opinion)
            self.write_opinion(opinion, opinion_author, case_header)

    def get_delimiter(self):
        '''
        This method figures out the delimiter that separates opinions.
        This delimiter is typically of the form "of XXX DOCUMENTS"
        '''
        delimiter_regex = re.compile(r"of \d+ DOCUMENTS")
        delimiter = None
        for line in self.all_opinions:
            delimiter_match = delimiter_regex.search(line)
            if delimiter_match is not None:
                break
        delimiter = delimiter_match.group()
        return delimiter

    def remove_bracket_nums(self):
        '''
        This method removes all instances of bracketed numbers from the
        opinion file, as they are unnecessary for our purposes.
        '''
        bracket_regex = re.compile("\[\*+\w*\d*\]")
        completion_regex = re.compile("\*+\sPrint\sCompleted\s\*+")
        for index in range(0, len(self.all_opinions)):
            current_line = self.all_opinions[index]
            split_line = current_line.split()
            list_copy = split_line[:]
            for word in list_copy:
                if re.match(bracket_regex, word):
                    split_line.remove(word)
            current_line = " ".join(split_line)
            if re.search(completion_regex, current_line):
                completion_message_line = index
            self.file_text.append(current_line)
        return completion_message_line

    def split_into_cases(self, delimiter):
        '''
        This method divides the file into individual cases by splitting on
        the delimiter.
        '''
        cases = []
        delimiter_regex = re.compile(delimiter)
        del self.file_text[:2] # get rid of the initial delimiter line

        start_index = 0
        for index in range(2, len(self.file_text)):
            if delimiter_regex.search(self.file_text[index]):
                matched_case = self.file_text[start_index : index]
                cases.append(matched_case)
                start_index = index + 1
            else:
                index += 1
            if index == len(self.file_text) - 1:
                matched_case = self.file_text[start_index : index]
                cases.append(matched_case)
        return cases

    def categorize_opinions(self, split_alt_opinions):
        '''
        Given a list of non-majority opinions, this determines whether
        each on is concurring, dissenting, or both.
        This returns a list of tuples of the form (<opinion-type>,<opinion-text>)
        '''
        categorized_opinions = []
        #concur_regex = re.compile(r"((JUSTICE|Justice)\s[\w'-]+,.*\sconcurring)|concur")
        #dissent_regex = re.compile(r"((JUSTICE|Justice)\s[\w'-]+,.*\sdissenting)|dissent")
        concur_regex = re.compile(r"concur|CONCUR")
        dissent_regex = re.compile(r"dissent|DISSENT")

        for index in range(0, len(split_alt_opinions)):
            is_concur = False
            is_dissent = False
            #opinion_lines = split_alt_opinions[index][:50].split("\n")
            opinion_sample = " ".join(split_alt_opinions[index].split("\n")[:2])
            # test output
            print " * * * * * * ** "
            #print opinion_lines[:10]
            print "HERE IS OPINION SAMPLE"
            print opinion_sample
            print " * * * * * * ** "
            # /test output
            if re.search(concur_regex, opinion_sample):
                is_concur = True
            if re.search(dissent_regex, opinion_sample):
                is_dissent = True

            if is_concur and is_dissent:
                opinion_type = "concur-dissent"
            elif is_concur:
                opinion_type = "concur"
            else:
                opinion_type = "dissent"

            categorized_opinions.append((opinion_type,
                                    split_alt_opinions[index]))
        return categorized_opinions

    def get_author(self, opinion):
        '''
        Given a non-majority opinion, this method returns its author.
        '''
        opinion_author = "NONE"
        author_found = False
        for paragraph in opinion[1].split("\n")[:10]:
            paragraph_words = paragraph.split()
            author_sample = [re.sub(r'\xa0', '', word) for word in paragraph_words]
            author_sample = [word for word in author_sample if word is not '']

            if (len(paragraph_words) >= 2) \
            and (re.search(re.compile(r"(JUSTICE|Justice)"), " ".join(author_sample))) \
            or (re.search(re.compile(r"CONCUR BY"), " ".join(author_sample))) \
            or (re.search(re.compile(r"DISSENT BY"), " ".join(author_sample))):
                # test output
                #print "***********************"
                #print "HERE IS AUTHOR_SAMPLE"
                #print author_sample
                #print "***********************"
                # /test output
                if re.match("THE CHIEF JUSTICE", " ".join(author_sample).strip()) \
                or re.match("MR. CHIEF JUSTICE", " ".join(author_sample).strip()) \
                or re.match("CHIEF JUSTICE", " ".join(author_sample).strip()):
                    opinion_author = "CHIEF"
                    author_found = True
                    break
                elif re.match("CONCUR BY", " ".join(author_sample).strip()) \
                or re.match("DISSENT BY", " ".join(author_sample).strip()):
                    for i in range(len(author_sample)):
                        if re.search(r"BY", author_sample[i]):
                            opinion_author = author_sample[i + 1].strip(",.;")
                            author_found = True
                            break
                else:
                    for i in range(len(author_sample)):
                        if re.search(re.compile(r"(JUSTICE|Justice)"),
									author_sample[i]) \
                        or re.search(re.compile(r"(MR. JUSTICE|Mr. Justice)"),
									author_sample[i]):
                            opinion_author = author_sample[i + 1].strip(",.;")
                            author_found = True
                            break
            if author_found:
                break

        return opinion_author

    def write_opinion(self, opinion_with_type, opinion_author, case_header):
        '''
        Given the key info about an opinion, this writes it to file.
        '''
        (title, case_num, full_citation, us_citation,
        supr_court_citation, lawyers_ed_citation, lexis_citation,
        dates, disposition) = self.get_info(case_header)

        opinion_filename = opinion_author + "_" + lexis_citation + ".txt"
        output_dir = self.output_dir
        output_path = os.path.join(output_dir, opinion_filename)
        # test output
        print "filename is: {0}".format(opinion_filename)
        print "output path is: {0}".format(output_path)
        # /test output

        with open(output_path, 'w') as output_file:
            output_file.write("TITLE: {0}\n".format(title))
            output_file.write("CASE NUMBER: {0}\n".format(case_num))
            output_file.write("US CITATION: {0}\n".format(us_citation))
            output_file.write("SUPREME COURT CITATION: {0}\n".format(
                                                        supr_court_citation))
            output_file.write("LAWYERS ED CITATION: {0}\n".format(
                                                        lawyers_ed_citation))
            output_file.write("LEXIS CITATION: {0}\n".format(lexis_citation))
            output_file.write("FULL CITATION: {0}\n".format(full_citation))
            date_string = "DATES: "
            for date in dates:
                date_string += date + ";"
            output_file.write(date_string + "\n")
            output_file.write("DISPOSITION: {0}\n".format(disposition))
            output_file.write("OPINION TYPE: {0}".format(opinion_with_type[0]))
            output_file.write("\n* * * * * * * *\n")
            output_file.write(opinion_with_type[1])

    def get_info(self, case_header):
        '''
        Given the header of a case, this parses out the important
        information and returns a tuple containing that information.
        '''
        # test output
        print case_header
        # /test output
        joined_header = " ".join(case_header)
        # these might not be exactly right... check them!!
        title = case_header[0].strip()
        case_num = case_header[1].strip()
        full_citation = case_header[3].strip()
        lexis_citation = self.get_lexis_cite(joined_header)
        us_citation = self.get_us_cite(full_citation)
        lawyers_ed_citation = self.get_lawyers_ed_cite(full_citation)
        supr_court_citation = self.get_supr_court_cite(full_citation)

        dates = []
        date_regex = re.compile(r"\w+\s\d{1,2}-?\d?\d?,\s\d{4},\s\w+")
        for line in case_header:
            dates = dates + date_regex.findall(line)

        disposition_regex = re.compile(r"DISPOSITION:(.*)")
        disposition_match = disposition_regex.search(joined_header)
        if disposition_match:
            disposition = disposition_match.group(1).strip()
        else:
            disposition = "NONE"
        return (title, case_num, full_citation, us_citation,
                supr_court_citation, lawyers_ed_citation, lexis_citation,
                 dates, disposition)

    def get_lexis_cite(self, paragraph):
        '''
        This method parses the US LEXIS citation out of a paragraph.
        '''
        cite_paragraph = paragraph.split()
        for index in range(0, len(cite_paragraph)):
            if re.match("LEXIS", cite_paragraph[index]):
                lexis_cite = cite_paragraph[index - 2:index + 2]
                lexis_cite = " ".join(lexis_cite).strip(";")
                return lexis_cite
        return "NONE"

    def get_us_cite(self, citation_string):
        us_cite_regex = re.compile(r"\d+\sU\.S\.\s\d+;")
        us_cite_match = us_cite_regex.search(citation_string)
        if us_cite_match:
            return us_cite_match.group().strip(";")
        else:
            return "NONE"

    def get_lawyers_ed_cite(self, citation_string):
        led_regex = re.compile(r"\d+\sL\.\sEd\.\s2?d?\s?\d+;")
        led_match = led_regex.search(citation_string)
        if led_match:
            return led_match.group().strip(";")
        else:
            return "NONE"

    def get_supr_court_cite(self, citation_string):
        sct_regex = re.compile(r"\d+\sS\.\sCt\.\s\d+;")
        sct_match = sct_regex.search(citation_string)
        if sct_match:
            return sct_match.group().strip(";")
        else:
            return "NONE"

def main():
    source_dir = LEXIS_FILE_PATH
    output_dir = OPINION_OUTPUT_PATH

    parser = SupremeCourtOpinionParser(output_dir)
    print "Beginning to parse files in {0}".format(source_dir)
    for opinion_file in os.listdir(source_dir):
        full_path = os.path.join(source_dir, opinion_file)
        if os.path.isfile(full_path):
            parser.parse_file(full_path)

main()


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

<title>ActivityIdlingResource</title>
<meta name="date" content="2018-11-08">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

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.mercadopago.android.testlib.idlingresource

Class ActivityIdlingResource

java.lang.Object

com.mercadopago.android.testlib.idlingresource.ActivityIdlingResource

All Implemented Interfaces:

android.support.test.espresso.IdlingResource

public class ActivityIdlingResource
extends java.lang.Object
implements android.support.test.espresso.IdlingResource

Nested Class Summary

Nested classes/interfaces inherited from interface android.support.test.espresso.IdlingResource

android.support.test.espresso.IdlingResource.ResourceCallback

Constructor Summary

Constructors

Constructor and Description

ActivityIdlingResource(java.lang.Class<? extends android.app.Activity> activity)

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

java.lang.String
getName()

boolean
isIdleNow()

void
registerIdleTransitionCallback(android.support.test.espresso.IdlingResource.ResourceCallback resourceCallback)

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ActivityIdlingResource

public ActivityIdlingResource(@NonNull
                              java.lang.Class<? extends android.app.Activity> activity)

Method Detail

getName

public java.lang.String getName()

Specified by:

getName in interface android.support.test.espresso.IdlingResource

isIdleNow

public boolean isIdleNow()

Specified by:

isIdleNow in interface android.support.test.espresso.IdlingResource

registerIdleTransitionCallback

public void registerIdleTransitionCallback(android.support.test.espresso.IdlingResource.ResourceCallback resourceCallback)

Specified by:

registerIdleTransitionCallback in interface android.support.test.espresso.IdlingResource

Skip navigation links

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:
import { actions, actionTypes } from 'app/actions';
import { reducers } from 'app/reducers';

import App from 'app/components/App';

const name = 'app';

export { name, actionTypes, actions, reducers, App };