text:
<?php

namespace Drupal\Core\Form;

use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Render\Element;

/**
 * Handles form errors.
 */
class FormErrorHandler implements FormErrorHandlerInterface {

  /**
   * {@inheritdoc}
   */
  public function handleFormErrors(array &$form, FormStateInterface $form_state) {
    // After validation check if there are errors.
    if ($errors = $form_state->getErrors()) {
      // Display error messages for each element.
      $this->displayErrorMessages($form, $form_state);

      // Loop through and assign each element its errors.
      $this->setElementErrorsFromFormState($form, $form_state);
    }

    return $this;
  }

  /**
   * Loops through and displays all form errors.
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   */
  protected function displayErrorMessages(array $form, FormStateInterface $form_state) {
    $errors = $form_state->getErrors();

    // Loop through all form errors and set an error message.
    foreach ($errors as $error) {
      $this->drupalSetMessage($error, 'error');
    }
  }

  /**
   * Stores errors and a list of child element errors directly on each element.
   *
   * Grouping elements like containers, details, fieldgroups and fieldsets may
   * need error info from their child elements to be able to accessibly show
   * form error messages to a user. For example, a details element should be
   * opened when child elements have errors.
   *
   * Grouping example:
   * Assume you have a 'street' element somewhere in a form, which is displayed
   * in a details element 'address'. It might be:
   * @code
   * $form['street'] = [
   *   '#type' => 'textfield',
   *   '#title' => $this->t('Street'),
   *   '#group' => 'address',
   *   '#required' => TRUE,
   * ];
   * $form['address'] = [
   *   '#type' => 'details',
   *   '#title' => $this->t('Address'),
   * ];
   * @endcode
   *
   * When submitting an empty street field, the generated error is available to
   * the different render elements like so:
   * @code
   * // The street textfield element.
   * $element = [
   *   '#errors' => {Drupal\Core\StringTranslation\TranslatableMarkup},
   *   '#children_errors' => [],
   * ];
   * // The address detail element.
   * $element = [
   *   '#errors' => null,
   *   '#children_errors' => [
   *      'street' => {Drupal\Core\StringTranslation\TranslatableMarkup}
   *   ],
   * ];
   * @endcode
   *
   * The list of child element errors of an element is an associative array. A
   * child element error is keyed with the #array_parents value of the
   * respective element. The key is formed by imploding this value with '][' as
   * glue. For example, a value ['contact_info', 'name'] becomes
   * 'contact_info][name'.
   *
   * @param array $form
   *   An associative array containing a reference to the complete structure of
   *   the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   * @param array $elements
   *   An associative array containing the part of the form structure that will
   *   be processed while traversing up the tree. For recursion only; leave
   *   empty when calling this method.
   */
  protected function setElementErrorsFromFormState(array &$form, FormStateInterface $form_state, array &$elements = []) {
    // At the start of traversing up the form tree set the to be processed
    // elements to the complete form structure by reference so that we can
    // modify the original form. When processing grouped elements a reference to
    // the complete form is needed.
    if (empty($elements)) {
      $elements = &$form;
    }

    // Recurse through all element children.
    foreach (Element::children($elements) as $key) {
      if (!empty($elements[$key])) {
        // Get the child by reference so that we can update the original form.
        $child = &$elements[$key];

        // Call self to traverse up the form tree. The current element's child
        // contains the next elements to be processed.
        $this->setElementErrorsFromFormState($form, $form_state, $child);

        $children_errors = [];

        // Inherit all recorded "children errors" of the direct child.
        if (!empty($child['#children_errors'])) {
          $children_errors = $child['#children_errors'];
        }

        // Additionally store the errors of the direct child itself, keyed by
        // it's parent elements structure.
        if (!empty($child['#errors'])) {
          $child_parents = implode('][', $child['#array_parents']);
          $children_errors[$child_parents] = $child['#errors'];
        }

        if (!empty($elements['#children_errors'])) {
          $elements['#children_errors'] += $children_errors;
        }
        else {
          $elements['#children_errors'] = $children_errors;
        }

        // If this direct child belongs to a group populate the grouping element
        // with the children errors.
        if (!empty($child['#group'])) {
          $parents = explode('][', $child['#group']);
          $group_element = NestedArray::getValue($form, $parents);
          if (isset($group_element['#children_errors'])) {
            $group_element['#children_errors'] = $group_element['#children_errors'] + $children_errors;
          }
          else {
            $group_element['#children_errors'] = $children_errors;
          }
          NestedArray::setValue($form, $parents, $group_element);
        }
      }
    }

    // Store the errors for this element on the element directly.
    $elements['#errors'] = $form_state->getError($elements);
  }

  /**
   * Wraps drupal_set_message().
   *
   * @codeCoverageIgnore
   */
  protected function drupalSetMessage($message = NULL, $type = 'status', $repeat = FALSE) {
    drupal_set_message($message, $type, $repeat);
  }

}


text:
'use strict';

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

import applyNativeMethods from '../../modules/applyNativeMethods';
import createReactClass from 'create-react-class';
import ensurePositiveDelayProps from '../Touchable/ensurePositiveDelayProps';
import * as React from 'react';
import StyleSheet from '../StyleSheet';
import Touchable from '../Touchable';
import View from '../View';
var flattenStyle = StyleSheet.flatten;
var PRESS_RETENTION_OFFSET = {
  top: 20,
  left: 20,
  right: 20,
  bottom: 30
};

/**
 * A wrapper for making views respond properly to touches.
 * On press down, the opacity of the wrapped view is decreased, dimming it.
 *
 * Opacity is controlled by wrapping the children in an Animated.View, which is
 * added to the view hiearchy.  Be aware that this can affect layout.
 *
 * Example:
 *
 * ```
 * renderButton: function() {
 *   return (
 *     <TouchableOpacity onPress={this._onPressButton}>
 *       <Image
 *         style={styles.button}
 *         source={require('./myButton.png')}
 *       />
 *     </TouchableOpacity>
 *   );
 * },
 * ```
 * ### Example
 *
 * ```ReactNativeWebPlayer
 * import React, { Component } from 'react'
 * import {
 *   AppRegistry,
 *   StyleSheet,
 *   TouchableOpacity,
 *   Text,
 *   View,
 * } from 'react-native'
 *
 * class App extends Component {
 *   constructor(props) {
 *     super(props)
 *     this.state = { count: 0 }
 *   }
 *
 *   onPress = () => {
 *     this.setState({
 *       count: this.state.count+1
 *     })
 *   }
 *
 *  render() {
 *    return (
 *      <View style={styles.container}>
 *        <TouchableOpacity
 *          style={styles.button}
 *          onPress={this.onPress}
 *        >
 *          <Text> Touch Here </Text>
 *        </TouchableOpacity>
 *        <View style={[styles.countContainer]}>
 *          <Text style={[styles.countText]}>
 *             { this.state.count !== 0 ? this.state.count: null}
 *           </Text>
 *         </View>
 *       </View>
 *     )
 *   }
 * }
 *
 * const styles = StyleSheet.create({
 *   container: {
 *     flex: 1,
 *     justifyContent: 'center',
 *     paddingHorizontal: 10
 *   },
 *   button: {
 *     alignItems: 'center',
 *     backgroundColor: '#DDDDDD',
 *     padding: 10
 *   },
 *   countContainer: {
 *     alignItems: 'center',
 *     padding: 10
 *   },
 *   countText: {
 *     color: '#FF00FF'
 *   }
 * })
 *
 * AppRegistry.registerComponent('App', () => App)
 * ```
 *
 */
// eslint-disable-next-line react/prefer-es6-class
var TouchableOpacity = createReactClass({
  displayName: 'TouchableOpacity',
  mixins: [Touchable.Mixin.withoutDefaultFocusAndBlur],
  getDefaultProps: function getDefaultProps() {
    return {
      activeOpacity: 0.2
    };
  },
  getInitialState: function getInitialState() {
    return _objectSpread({}, this.touchableGetInitialState(), {
      anim: this._getChildStyleOpacityWithDefault()
    });
  },
  componentDidMount: function componentDidMount() {
    ensurePositiveDelayProps(this.props);
  },
  UNSAFE_componentWillReceiveProps: function UNSAFE_componentWillReceiveProps(nextProps) {
    ensurePositiveDelayProps(nextProps);
  },
  componentDidUpdate: function componentDidUpdate(prevProps, prevState) {
    if (this.props.disabled !== prevProps.disabled) {
      this._opacityInactive(250);
    }
  },

  /**
   * Animate the touchable to a new opacity.
   */
  setOpacityTo: function setOpacityTo(value, duration) {
    this.setNativeProps({
      style: {
        opacity: value,
        transitionDuration: duration ? duration / 1000 + "s" : '0s'
      }
    });
  },

  /**
   * `Touchable.Mixin` self callbacks. The mixin will invoke these if they are
   * defined on your component.
   */
  touchableHandleActivePressIn: function touchableHandleActivePressIn(e) {
    if (e.dispatchConfig.registrationName === 'onResponderGrant') {
      this._opacityActive(0);
    } else {
      this._opacityActive(150);
    }

    this.props.onPressIn && this.props.onPressIn(e);
  },
  touchableHandleActivePressOut: function touchableHandleActivePressOut(e) {
    this._opacityInactive(250);

    this.props.onPressOut && this.props.onPressOut(e);
  },
  touchableHandleFocus: function touchableHandleFocus(e) {
    //if (Platform.isTV) {
    //  this._opacityActive(150);
    //}
    this.props.onFocus && this.props.onFocus(e);
  },
  touchableHandleBlur: function touchableHandleBlur(e) {
    //if (Platform.isTV) {
    //  this._opacityInactive(250);
    //}
    this.props.onBlur && this.props.onBlur(e);
  },
  touchableHandlePress: function touchableHandlePress(e) {
    this.props.onPress && this.props.onPress(e);
  },
  touchableHandleLongPress: function touchableHandleLongPress(e) {
    this.props.onLongPress && this.props.onLongPress(e);
  },
  touchableGetPressRectOffset: function touchableGetPressRectOffset() {
    return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;
  },
  touchableGetHitSlop: function touchableGetHitSlop() {
    return this.props.hitSlop;
  },
  touchableGetHighlightDelayMS: function touchableGetHighlightDelayMS() {
    return this.props.delayPressIn || 0;
  },
  touchableGetLongPressDelayMS: function touchableGetLongPressDelayMS() {
    return this.props.delayLongPress === 0 ? 0 : this.props.delayLongPress || 500;
  },
  touchableGetPressOutDelayMS: function touchableGetPressOutDelayMS() {
    return this.props.delayPressOut;
  },
  _opacityActive: function _opacityActive(duration) {
    this.setOpacityTo(this.props.activeOpacity, duration);
  },
  _opacityInactive: function _opacityInactive(duration) {
    this.setOpacityTo(this._getChildStyleOpacityWithDefault(), duration);
  },
  _getChildStyleOpacityWithDefault: function _getChildStyleOpacityWithDefault() {
    var childStyle = flattenStyle(this.props.style) || {};
    return childStyle.opacity == null ? 1 : childStyle.opacity;
  },
  render: function render() {
    return React.createElement(View, _extends({}, this.props, {
      accessibilityHint: this.props.accessibilityHint,
      accessibilityLabel: this.props.accessibilityLabel,
      accessibilityRole: this.props.accessibilityRole,
      accessibilityState: this.props.accessibilityState,
      accessible: this.props.accessible !== false,
      hitSlop: this.props.hitSlop,
      nativeID: this.props.nativeID,
      onKeyDown: this.touchableHandleKeyEvent,
      onKeyUp: this.touchableHandleKeyEvent,
      onLayout: this.props.onLayout,
      onResponderGrant: this.touchableHandleResponderGrant //isTVSelectable={true}
      //nextFocusDown={this.props.nextFocusDown}
      //nextFocusForward={this.props.nextFocusForward}
      //nextFocusLeft={this.props.nextFocusLeft}
      //nextFocusRight={this.props.nextFocusRight}
      //nextFocusUp={this.props.nextFocusUp}
      //hasTVPreferredFocus={this.props.hasTVPreferredFocus}
      //tvParallaxProperties={this.props.tvParallaxProperties}
      ,
      onResponderMove: this.touchableHandleResponderMove //clickable={
      //  this.props.clickable !== false && this.props.onPress !== undefined
      //}
      //onClick={this.touchableHandlePress}
      ,
      onResponderRelease: this.touchableHandleResponderRelease,
      onResponderTerminate: this.touchableHandleResponderTerminate,
      onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest,
      onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,
      style: [styles.root, !this.props.disabled && styles.actionable, this.props.style, {
        opacity: this.state.anim
      }],
      testID: this.props.testID
    }), this.props.children, Touchable.renderDebugView({
      color: 'cyan',
      hitSlop: this.props.hitSlop
    }));
  }
});
var styles = StyleSheet.create({
  root: {
    transitionProperty: 'opacity',
    transitionDuration: '0.15s',
    userSelect: 'none'
  },
  actionable: {
    cursor: 'pointer',
    touchAction: 'manipulation'
  }
});
export default applyNativeMethods(TouchableOpacity);

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RDCompiler.Language
{
    public enum SNLLexType { NULL, ENDFILE, ERROR, PROGRAM, PROCEDURE, TYPE, VAR, IF, THEN, ELSE, FI, WHILE, DO, ENDWH, BEGIN, END, READ, WRITE, ARRAY, OF, RECORD, RETURN, INTEGER, CHAR, ID, INTC, CHARC, ASSIGN, EQ, LT, PLUS, MINUS, TIMES, OVER, LPAREN, RPAREN, DOT, COLON, SEMI, COMMA, LMIDPAREN, RMIDPAREN, UNDERANGE, SINGLED };

    public enum SNLTreeNodeType { ProK, PheadK, TypeK, VarK, ProcDecK, StmLK, DecK, StmtK, ExpK };

    public enum SNLTreeNodeTypeDec { NULL, ArrayK, CharK, IntegerK, RecordK, IdK };

    public enum SNLTreeNodeTypeStmt { NULL, IfK, WhileK, AssignK, ReadK, WriteK, CallK, ReturnK };

    public enum SNLTreeNodeTypeExp { NULL, OpK, ConstK, VariK };

    public enum SNLProcParamtType { NULL, VALPARAMTYPE, VARPARAMTYPE }

    public enum SNLExpAttrVarKindType { NULL, IdV, ArrayMembV, FieldMembV };

    public enum SNLExpAttrType { NULL, Void, Integer, Boolean };

}


text:
package com.opengamma.analytics.financial.credit.isdastandardmodel;

import static com.opengamma.analytics.math.utilities.Epsilon.epsilon;

import java.util.Arrays;

import com.opengamma.analytics.math.function.Function1D;
import com.opengamma.analytics.math.rootfinding.NewtonRaphsonSingleRootFinder;
import com.opengamma.util.ArgumentChecker;

/**
 *
 */
public class AnalyticBondPricer {

  private static final NewtonRaphsonSingleRootFinder ROOTFINDER = new NewtonRaphsonSingleRootFinder();
  private final AnalyticCDSPricer _pricer = new AnalyticCDSPricer();

  /**
   * Compute the equivalent CDS spread for a bond. This works by first finding a constant hazard rate that reprices the bond (given the supplied yield curve), the using this hazard
   * rate to calculate the par spread of a CDS.
   * @param bond Simple analytic representation of a fixed coupon bond
   * @param yieldCurve The yield curve
   * @param bondPrice The bond price (for unit notional). Can be given clean or dirty (see below). The dirty price cannot be low that the bond's recovery rate or greater
   * than its risk free price.
   * @param cleanOrDirty Clean or dirty price for the bond
   * @param cds analytic description of a CDS traded at a certain time. The spread is calculated for this CDS.
   * @see {@link getHazardRate}
   * @return equivalent CDS spread
   */
  public double getEquivalentCDSSpread(final BondAnalytic bond, final ISDACompliantYieldCurve yieldCurve, final double bondPrice, final PriceType cleanOrDirty, final CDSAnalytic cds) {

    final double lambda = getHazardRate(bond, yieldCurve, bondPrice, cleanOrDirty);
    final ISDACompliantCreditCurve cc = new ISDACompliantCreditCurve(cds.getProtectionEnd(), lambda);
    return _pricer.parSpread(cds, yieldCurve, cc);
  }

  /**
   *Get the constant hazard rate implied from a bond price
   * @param bond Simple analytic representation of a fixed coupon bond
   * @param yieldCurve  The yield curve
   * @param bondPrice The bond price (for unit notional). Can be given clean or dirty (see below). The dirty price cannot be low that the bond's recovery rate or greater
   * than its risk free price.
   * @param cleanOrDirty Clean or dirty price for the bond
   * @return The implied hazard rate
   */
  public double getHazardRate(final BondAnalytic bond, final ISDACompliantYieldCurve yieldCurve, final double bondPrice, final PriceType cleanOrDirty) {
    ArgumentChecker.isTrue(bondPrice > 0.0, "Bond price must be positive");

    final Function1D<Double, Double> priceFunc = getBondPriceForHazardRateFunction(bond, yieldCurve, cleanOrDirty);

    final double zeroRiskPrice = priceFunc.evaluate(0.);
    if (bondPrice == zeroRiskPrice) {
      return 0.0;
    }
    if (bondPrice > zeroRiskPrice) {
      throw new IllegalArgumentException("Bond price of " + bondPrice + ", is greater that zero-risk price of " + zeroRiskPrice +
          ". It is not possible to imply a hazard rate for this bond. Please check inputs");
    }
    final double dp = cleanOrDirty == PriceType.DIRTY ? bondPrice : bondPrice + bond.getAccruedInterest();
    if (dp <= bond.getRecoveryRate()) {
      throw new IllegalArgumentException("The dirty price of " + dp + " give, is less than the bond's recovery rate of " + bond.getRecoveryRate() + ". Please check inputs");
    }

    final Function1D<Double, Double> func = new Function1D<Double, Double>() {
      @Override
      public Double evaluate(final Double lambda) {
        return priceFunc.evaluate(lambda) - bondPrice;
      }
    };

    final double guess = 0.01;
    return ROOTFINDER.getRoot(func, guess);
  }

  /**
   * Compute the bond price for a given level of a constant hazard rate
   * @param bond Simple analytic representation of a fixed coupon bond
   * @param yieldCurve The yield curve
   * @param hazardRate The hazard rate. Can be zero.
   * @param cleanOrDirty  Clean or dirty price for the bond
   * @see {@link getBondPriceForHazardRateFunction}
   * @return The bond price
   */
  public double bondPriceForHazardRate(final BondAnalytic bond, final ISDACompliantYieldCurve yieldCurve, final double hazardRate, final PriceType cleanOrDirty) {
    return getBondPriceForHazardRateFunction(bond, yieldCurve, cleanOrDirty).evaluate(hazardRate);
  }

  /**
   * This gives a function (Function1D<Double, Double>) that allows you to price a bond for any level of a constant hazard rate
   * @param bond Simple analytic representation of a fixed coupon bond
   * @param yieldCurve The yield curve
   * @param cleanOrDirty Clean or dirty price for the bond
   * @return a function of hazard rate -> bond price
   */
  public Function1D<Double, Double> getBondPriceForHazardRateFunction(final BondAnalytic bond, final ISDACompliantYieldCurve yieldCurve, final PriceType cleanOrDirty) {
    ArgumentChecker.notNull(bond, "bond");
    ArgumentChecker.notNull(yieldCurve, "yieldCurve");
    ArgumentChecker.notNull(cleanOrDirty, "cleanOrDirty");

    final int nPayments = bond.getnPayments();
    final double[] discPayments = new double[nPayments];

    for (int i = 0; i < nPayments; i++) {
      discPayments[i] = bond.getPaymentAmount(i) * yieldCurve.getDiscountFactor(bond.getPaymentTime(i));
    }

    final double exp = bond.getPaymentTime(nPayments - 1);
    int index = Arrays.binarySearch(yieldCurve.getKnotTimes(), exp);
    double[] temp;
    if (index >= 0) {
      temp = new double[index + 1];
      System.arraycopy(yieldCurve.getKnotTimes(), 0, temp, 0, index + 1);
    } else {
      index = -(index + 1);
      temp = new double[index + 1];
      System.arraycopy(yieldCurve.getKnotTimes(), 0, temp, 0, index);
      temp[index] = exp;
    }

    final double[] intNodes = temp;
    final int nNodes = intNodes.length;
    final double[] rt = new double[nNodes];
    for (int i = 0; i < nNodes; i++) {
      rt[i] = yieldCurve.getRT(intNodes[i]);
    }

    return new Function1D<Double, Double>() {

      @Override
      public Double evaluate(final Double lambda) {

        double riskyDisPayments = cleanOrDirty == PriceType.CLEAN ? -bond.getAccruedInterest() : 0.0;
        for (int i = 0; i < nPayments; i++) {
          final double q = Math.exp(-lambda * bond.getPaymentTime(i));
          riskyDisPayments += discPayments[i] * q;
        }
        if (bond.getRecoveryRate() == 0.0) {
          return riskyDisPayments;
        }

        final double[] ht = new double[nNodes];
        final double[] b = new double[nNodes];
        for (int i = 0; i < nNodes; ++i) {
          ht[i] = lambda * intNodes[i];
          b[i] = Math.exp(-rt[i] - ht[i]);
        }

        double defaultPV = 0.0;
        {
          final double dht = ht[0];
          final double drt = rt[0];
          final double dhrt = dht + drt;
          double dPV;
          if (Math.abs(dhrt) < 1e-5) {
            dPV = dht * epsilon(-dhrt);
          } else {
            dPV = (1 - b[0]) * dht / dhrt;
          }
          defaultPV += dPV;
        }
        for (int i = 1; i < nNodes; ++i) {

          final double dht = ht[i] - ht[i - 1];
          final double drt = rt[i] - rt[i - 1];
          final double dhrt = dht + drt;
          double dPV;
          if (Math.abs(dhrt) < 1e-5) {
            dPV = dht * b[i - 1] * epsilon(-dhrt);
          } else {
            dPV = (b[i - 1] - b[i]) * dht / dhrt;
          }
          defaultPV += dPV;
        }

        return riskyDisPayments + bond.getRecoveryRate() * defaultPV;
      }
    };

  }

}


text:
#region S# License

#endregion S# License
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Hydra.BarChart")]
[assembly: AssemblyDescription("Hydra plugin for BarChart.")]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c3d52fb6-9686-41d8-9224-d3be26903945")]

[assembly: ThemeInfo(
	ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
	//(used if a resource is not found in the page,
	// or application resource dictionaries)
	ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
	//(used if a resource is not found in the page,
	// app, or any theme specific resource dictionaries)
)]


text:
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<title>
  {% if page.title == "R29 Styleguide" %}
    {{ page.title }}
  {% else if %}
    {{ page.title }} · R29 Styleguide
  {% endif %}
</title>

<!-- Bootstrap core CSS -->
<link href="{{ page.base_url }}dist/css/bootstrap.css" rel="stylesheet">

<!-- Documentation extras -->
<link href="{{ page.base_url }}assets/css/docs.css" rel="stylesheet">
<link href="{{ page.base_url }}assets/css/pygments-manni.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
  <script src="{{ page.base_url }}assets/js/html5shiv.js"></script>
  <script src="{{ page.base_url }}assets/js/respond.min.js"></script>
<![endif]-->

<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ page.base_url }}assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="{{ page.base_url }}assets/ico/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="{{ page.base_url }}assets/ico/apple-touch-icon-72-precomposed.png">
                <link rel="apple-touch-icon-precomposed" href="{{ page.base_url }}assets/ico/apple-touch-icon-57-precomposed.png">
                               <link rel="shortcut icon" href="{{ page.base_url }}assets/ico/favicon.png">


text:
import { strictEqual } from "node:assert";
import { Exception } from "../../../System/Exception.js";

/**
 * Registers tests for the {@link Exception `Exception`} class.
 */
export function ExceptionTests(): void
{
    suite(
        nameof(Exception),
        () =>
        {
            let exception: Exception;
            let innerException: Exception;

            suiteSetup(
                () =>
                {
                    innerException = new Exception();
                });

            suite(
                nameof(Exception.constructor),
                () =>
                {
                    test(
                        "Checking whether the values are assigned correctly…",
                        () =>
                        {
                            exception = new Exception();
                            strictEqual(exception.Message, null);
                            strictEqual(exception.InnerException, null);
                            exception = new Exception("hello");
                            strictEqual(exception.Message, "hello");
                            strictEqual(exception.InnerException, null);
                            exception = new Exception("hello", innerException);
                            strictEqual(exception.Message, "hello");
                            strictEqual(exception.InnerException, innerException);
                        });
                });
        });
}


text:
package org.apereo.cas.config;

import org.junit.jupiter.api.Tag;
import org.springframework.test.context.TestPropertySource;

/**
 * This is {@link CasSamlSPCraniumCafeConfigurationTests}.
 *
 * @author Misagh Moayyed
 * @since 6.2.0
 */
@Tag("SAML")
@TestPropertySource(properties = {
    "cas.saml-sp.cranium-cafe.metadata=classpath:/metadata/sp-metadata.xml",
    "cas.saml-sp.cranium-cafe.name-id-attribute=cn",
    "cas.saml-sp.cranium-cafe.name-id-format=transient"
})
public class CasSamlSPCraniumCafeConfigurationTests extends BaseCasSamlSPConfigurationTests {

    @Override
    protected String getServiceProviderId() {
        return casProperties.getSamlSp().getCraniumCafe().getEntityIds().get(0);
    }
}


text:
'use strict';

describe('Uncaught exception within pending test', () => {
  it('test1', function () { });

  it('test2', function () {
    process.nextTick(function () {
      throw new Error('I am uncaught!');
    });
    this.skip();
  });

  it('test3 - should run', function () { });
  it('test4 - should run', function () { });
});


text:
using Newtonsoft.Json;

namespace Nest
{
		public class QueryFacet : Facet
    {
        [JsonProperty(PropertyName = "count")]
        public long Count { get; internal set; }
    }
}


text:
<?php

use yii\db\Schema;
use yii\db\Migration;

class m150530_142836_costa_rico extends Migration
{
    public function up()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
        }

        $this->createTable('image', [
            'id' => 'pk',
            'filePath' => 'VARCHAR(400) NOT NULL',
            'itemId' => 'int(20) NOT NULL',
            'isMain' => 'int(1)',
            'modelName' => 'VARCHAR(150) NOT NULL',
            'urlAlias' => 'VARCHAR(400) NOT NULL',
        ],$tableOptions);
    }

    public function down()
    {
        $this->dropTable('image');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<!--
Pass: (1701) A RateRule's variable must be the id of a Compartment,
Species, or Parameter.
-->

<sbml xmlns="http://www.sbml.org/sbml/level2" level="2" version="1">
  <model>
    <listOfCompartments>
      <compartment id="c" constant="false"/>
    </listOfCompartments>
    <listOfRules>
      <rateRule variable="c"/>
    </listOfRules>
  </model>
</sbml>


text:
package com.twu.biblioteca;

import com.twu.io.input.ConsoleInput;
import com.twu.io.inputreader.InputReader;
import com.twu.io.output.ConsoleOutput;
import com.twu.io.outputwriter.OutputWriter;
import com.twu.model.menuoption.MenuOption;
import com.twu.model.menuoption.QuitMenuOption;

public class LibrarySystem {

    private static final String WELCOME_MESSAGE = "Hello User! Welcome to " +
            "Biblioteca! :)\n";
    private InputReader inputReader;
    private OutputWriter outputWriter;
    private Menu menu;
    private BookRepository bookRepository;

    public LibrarySystem(InputReader inputReader, OutputWriter outputWriter) {
        this.inputReader = inputReader;
        this.outputWriter = outputWriter;
        bookRepository = new BookRepository();
        menu = new Menu(inputReader, outputWriter);
    }

    public void run() {
        ConsoleOutput welcomeMessage = new ConsoleOutput(WELCOME_MESSAGE);
        outputWriter.write(welcomeMessage);

        ConsoleOutput menuOptionsOutput = menu.getMenuOptions();
        MenuOption menuOption;

        do{
            outputWriter.write(menuOptionsOutput);

            ConsoleInput menuOptionInput = inputReader.read();
            menuOption = getMenuOptionForUserInput(menuOptionInput.getInput());

            ConsoleOutput menuActionOutput = menuOption.action(bookRepository);
            outputWriter.write(menuActionOutput);

        }while(!(menuOption instanceof QuitMenuOption));
    }

    private MenuOption getMenuOptionForUserInput(String userInput) {
        return menu.getMenuForOption(userInput);
    }
}


text:
function checkNewMessage(){
    var subject = document.getElementById('subject');
    var text = document.getElementById('text');
    if (!subject.value) {
        alert ("The subject is mandatory");
        return false;
    }

    if (!text.value) {
        alert ("The text is mandatory");
        return false;
    } else if (text.value.lenght > 5000) {
        alert ("The maximun size of a message is 5,000 chars");
        return false;
    }
    return true;
}

function showDeletedMessages() {
    var elements = document.getElementsByClassName("thread_container");
    var i = 0;
    for (i=0;i<elements.length;i++){
        elements[i].className = "thread_container";
    }
    document.getElementById("show_deleted_message").className = "hidden";
    return false;
}


text:
from drf_yasg import openapi

organization_params_in_header = openapi.Parameter(
    "org", openapi.IN_HEADER, required=True, type=openapi.TYPE_INTEGER
)

organization_params = [
    organization_params_in_header,
]

cases_list_get_params = [
    organization_params_in_header,
    openapi.Parameter("name", openapi.IN_QUERY, type=openapi.TYPE_STRING),
    openapi.Parameter("status", openapi.IN_QUERY, type=openapi.TYPE_STRING),
    openapi.Parameter("priority", openapi.IN_QUERY, type=openapi.TYPE_STRING),
    openapi.Parameter("account", openapi.IN_QUERY, type=openapi.TYPE_STRING),
]

cases_detail_get_params = [
    organization_params_in_header,
    openapi.Parameter(
        "case_attachment",
        openapi.IN_QUERY,
        type=openapi.TYPE_FILE,
    ),
    openapi.Parameter("comment", openapi.IN_QUERY, type=openapi.TYPE_STRING),
]

cases_create_post_params = [
    organization_params_in_header,
    openapi.Parameter(
        "name", openapi.IN_QUERY, required=True, type=openapi.TYPE_STRING
    ),
    openapi.Parameter(
        "status", openapi.IN_QUERY, type=openapi.TYPE_STRING, required=True
    ),
    openapi.Parameter(
        "priority", openapi.IN_QUERY, type=openapi.TYPE_STRING, required=True
    ),
    openapi.Parameter("type_of_case", openapi.IN_QUERY, type=openapi.TYPE_STRING),
    openapi.Parameter(
        "closed_on",
        openapi.IN_QUERY,
        type=openapi.TYPE_STRING,
        format="date",
        required=True,
    ),
    openapi.Parameter("teams", openapi.IN_QUERY, type=openapi.TYPE_STRING),
    openapi.Parameter("assigned_to", openapi.IN_QUERY, type=openapi.TYPE_STRING),
    openapi.Parameter("account", openapi.IN_QUERY, type=openapi.TYPE_INTEGER),
    openapi.Parameter(
        "case_attachment",
        openapi.IN_QUERY,
        type=openapi.TYPE_FILE,
    ),
    openapi.Parameter("contacts", openapi.IN_QUERY, type=openapi.TYPE_STRING),
    openapi.Parameter("description", openapi.IN_QUERY, type=openapi.TYPE_STRING),
]

cases_comment_edit_params = [
    organization_params_in_header,
    openapi.Parameter("comment", openapi.IN_QUERY, type=openapi.TYPE_STRING),
]


text:
require('garnet');

var
	kind = require('enyo/kind'),
	Group = require('enyo/Group'),
	Button = require('garnet/Button'),
	Panel = require('garnet/Panel');

var ButtonPanel = kind({
	name: 'g.sample.ButtonPanel',
	kind: Panel,
	events: {
		onResult: ''
	},
	classes: 'g-layout-absolute-wrapper',
	components: [
		{classes: 'g-sample-button-container g-layout-absolute-center', components: [
			{name: 'B Button', kind: Button, content: 'B', ontap: 'tapButton'},
			{name: 'B Button Disabled', kind: Button, content: 'Disabled', classes: 'g-sample-button-disable', disabled: true, ontap: 'tapButton'},
			{content: 'Fixed Button : ', classes: 'g-sample-text'},
			{name: 'Fixed Button', kind: Button, content: 'Fixed Button', classes: 'g-sample-button-fixed', ontap: 'tapButton'},
			{content: 'Grouped Buttons : ', classes: 'g-sample-text'},
			{kind: Group, components: [
				{name: 'Apple Button', kind: Button, active: true, content: 'AA', ontap: 'tapButton'},
				{name: 'Banana Button', kind: Button, content: 'BB', ontap: 'tapButton'}
			]}
		]}
	],
	tapButton: function(inSender, inEvent) {
		this.doResult({msg: '"' + inSender.name + '" pressed.'});
	}
});

module.exports = kind({
	name: 'g.sample.ButtonSample',
	classes: 'enyo-unselectable enyo-fit garnet g-sample g-sample-button',
	components: [
		{content: '< Button Sample', classes: 'g-sample-header', ontap: 'goBack'},

		{content: 'Buttons', classes: 'g-sample-subheader'},
		{kind: ButtonPanel, classes: 'g-sample-circle-panel', onResult: 'result'},

		{src: '@../assets/btn_command_next.svg', classes: 'g-sample-result', components: [
			{content: 'Result', classes: 'g-sample-subheader'},
			{name: 'result', allowHtml: true, content: 'No button pressed yet.', classes: 'g-sample-description'}
		]}
	],
	result: function(inSender, inEvent) {
		this.$.result.setContent(inEvent.msg);
	},
	goBack: function(inSender, inEvent) {
		global.history.go(-1);
		return false;
	}
});


text:
// Tests that the jsb command works as it should

const TEST_URI = "http://example.com/browser/browser/devtools/commandline/" +
                 "test/browser_cmd_jsb_script.jsi";

let scratchpadWin = null;
let Scratchpad = null;

function test() {
  DeveloperToolbarTest.test("about:blank", [ GJT_test ]);
}

function GJT_test() {
  helpers.setInput('jsb');
  helpers.check({
    input:  'jsb',
    hints:     ' <url> [options]',
    markup: 'VVV',
    status: 'ERROR'
  });
  DeveloperToolbarTest.exec({ completed: false });

  Services.ww.registerNotification(function(aSubject, aTopic, aData) {
      if (aTopic == "domwindowopened") {
        Services.ww.unregisterNotification(arguments.callee);

        scratchpadWin = aSubject.QueryInterface(Ci.nsIDOMWindow);
        scratchpadWin.addEventListener("load", function GDT_onLoad() {
          scratchpadWin.removeEventListener("load", GDT_onLoad, false);
          Scratchpad = scratchpadWin.Scratchpad;

          let observer = {
            onReady: function GJT_onReady() {
              Scratchpad.removeObserver(observer);

              let result = Scratchpad.getText();
              result = result.replace(/[\r\n]]*/g, "\n");
              let correct = "function somefunc() {\n" +
                        "  if (true) // Some comment\n" +
                        "  doSomething();\n" +
                        "  for (let n = 0; n < 500; n++) {\n" +
                        "    if (n % 2 == 1) {\n" +
                        "      console.log(n);\n" +
                        "      console.log(n + 1);\n" +
                        "    }\n" +
                        "  }\n" +
                        "}";
              is(result, correct, "JS has been correctly prettified");

              finishUp();
            },
          };
          Scratchpad.addObserver(observer);
        }, false);
      }
    });

  info("Checking beautification");
  DeveloperToolbarTest.exec({
    typed: "jsb " + TEST_URI,
    completed: false
  });
}

let finishUp = DeveloperToolbarTest.checkCalled(function GJT_finishUp() {
  if (scratchpadWin) {
    scratchpadWin.close();
    scratchpadWin = null;
  }
});


text:
    // We recommend enabling Objective-C Modules in your project Build Settings for numerous benefits over regular #imports
    @import Foundation;
    @import UIKit;
    @import CoreGraphics;
#else
    #import <Foundation/Foundation.h>
    #import <UIKit/UIKit.h>
    #import <CoreGraphics/CoreGraphics.h>
#endif

@interface KSMHand : UIView

#pragma mark Public Properties

/// The color of the the hand instance
@property (strong, nonatomic) UIColor *color;

/// The widgth of the hand instance
@property (nonatomic) CGFloat width;

/// The length of the hand instance
@property (nonatomic) CGFloat length;

/// The length on the short side of the hand instance.
@property (nonatomic) CGFloat offsetLength;

/// Is there a shadow behind the hand
@property (nonatomic) BOOL shadowEnabled;

// The degree the hand should be rotated by.
@property (nonatomic) float degree;

- (void)setDegree:(float)degree animated:(BOOL)animated;

@end


text:
[CmdletBinding(SupportsShouldProcess = $true)]
param(
# The name of valide Azure Subscription associated with Account
[Parameter(Mandatory = $true)]
[string]$AzureSubscriptionName,

# The webSite Name you want to create
[Parameter(Mandatory = $true)]
[string]$WebSiteName,

# The webSite Job Name you want to create
[Parameter(Mandatory = $true)]
[string]$WebSiteJobName,

# The webSite Job Type Name you want to create 'triggered' or 'continuous' Job
[Parameter(Mandatory = $true)]
[string]$JobType,

# The full path to copy files from.
[Parameter(Mandatory = $true)]
[string]$JobFile
)
Login-AzureRmAccount

# Ensure the local path given exists. Create it if switch specified to do so.
if (-not (Test-Path $JobFile))
{
throw "Source path '$LocalFilePath' does not exist.  Specify an existing valid path."
}

# To select specific subscription from available subscription "Visual Studio Enterprise with MSDN"
Select-AzureSubscription -SubscriptionName $AzureSubscriptionName

# Create the website
$website = Get-AzureWebsite | Where-Object {$_.Name -eq $WebSiteName }
if (!($website -eq $null))
{
    Write-Host "Creating website Job for '$WebSiteName'."
    New-AzureWebsiteJob -Name $WebSiteName -JobName MyWebJob -JobType Continuous -JobFile $JobFile
    Write-Host "Website Job '$WebSiteJobName' is created successfully."
}
else
{
    throw "WebJob creation operation Failed. Website is not available."
}


text:
import os

def upload_path(instance, filename):
    _, ext = os.path.splitext(filename)
    return "avatars/{pk}{ext}".format(pk=instance.pk, ext=ext)


text:
package nl.kaninefatendreef.si.server.repository;

import nl.kaninefatendreef.si.server.model.SimpleInvoiceApplicationUserPage;
import nl.kaninefatendreef.si.server.model.SimplerInvoicingApplicationUser;
import nl.kaninefatendreef.si.server.repository.jpa.SimplerInvoicingApplicationUserRepository;
import nl.kaninefatendreef.si.server.ssl.SimplerInvoicingUserApplicationPasswordHash;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;

@Component
public class ActiveSimplerInvoicingApplicationUserRepository implements ApplicationContextAware {

	ApplicationContext _applicationContext = null;

	@Autowired(required=false)
	SimplerInvoicingApplicationUserRepository<Long> jpaSimplerInvoicingApplicationUserRepository = null;

	@Autowired(required=false)
	nl.kaninefatendreef.si.server.repository.mongo.SimplerInvoicingApplicationUserRepository mongoSimplerInvoicingApplicationUserRepository = null;

	@Autowired(required=false)
	nl.kaninefatendreef.si.server.repository.cassandra.SimplerInvoicingApplicationUserRepository cassandraSimplerInvoicingApplicationUserRepository = null;

	@Override
	public void setApplicationContext(ApplicationContext applicationContext)
			throws BeansException {
		_applicationContext = applicationContext;

	}

	public SimplerInvoicingApplicationUser createSimplerInvoicingApplicationUser(){

		if (isProfileActive("mongodb")){
			return new nl.kaninefatendreef.si.server.model.mongo.SimplerInvoicingApplicationUser();
		}else if (isProfileActive("rdbms")){
			return new nl.kaninefatendreef.si.server.model.jpa.SimplerInvoicingApplicationUser();
		}else if (isProfileActive("cassandra")){
			return new nl.kaninefatendreef.si.server.model.cassandra.SimplerInvoicingApplicationUser();
		}else{
			return null;
		}
	}

	private boolean isProfileActive(String profile){

		for (String profileInList : _applicationContext.getEnvironment().getActiveProfiles()){
			if (profileInList.equals(profile)){
				return true;
			}
		}
		return false;
	}

	public SimplerInvoicingApplicationUser save (SimplerInvoicingApplicationUser user){

		SimplerInvoicingApplicationUser userObject = createSimplerInvoicingApplicationUser();

		if (user.getId() != null){
			userObject.setId(user.getId());
		}

		userObject.setUsername(user.getUsername());

		if (user.getPassword() != null){
			userObject.setPassword(SimplerInvoicingUserApplicationPasswordHash.hash(user.getPassword()));
		}

		userObject.setRoles(user.getRoles());

		if (isProfileActive("mongodb")){
			nl.kaninefatendreef.si.server.model.mongo.SimplerInvoicingApplicationUser mongoDocument = (nl.kaninefatendreef.si.server.model.mongo.SimplerInvoicingApplicationUser)userObject;
			return mongoSimplerInvoicingApplicationUserRepository.save(mongoDocument);
		}else if (isProfileActive("rdbms")){
			nl.kaninefatendreef.si.server.model.jpa.SimplerInvoicingApplicationUser mongoDocument = (nl.kaninefatendreef.si.server.model.jpa.SimplerInvoicingApplicationUser)userObject;
			return jpaSimplerInvoicingApplicationUserRepository.save(mongoDocument);
		}else if (isProfileActive("cassandra")){
			nl.kaninefatendreef.si.server.model.cassandra.SimplerInvoicingApplicationUser cassandraDocument = (nl.kaninefatendreef.si.server.model.cassandra.SimplerInvoicingApplicationUser)userObject;
			return cassandraSimplerInvoicingApplicationUserRepository.save(cassandraDocument);
		}else{
			return null;
		}

	}

	public Page<SimplerInvoicingApplicationUser> findAll(Pageable pageable) {
		if (isProfileActive("mongodb")){
			return new SimpleInvoiceApplicationUserPage(mongoSimplerInvoicingApplicationUserRepository.findAll( pageable));
		}else if (isProfileActive("rdbms")){
			return new SimpleInvoiceApplicationUserPage(jpaSimplerInvoicingApplicationUserRepository.findAll( pageable));
		}else if (isProfileActive("cassandra")){
			return new SimpleInvoiceApplicationUserPage(cassandraSimplerInvoicingApplicationUserRepository.findAll( pageable));
		}else{
			return null;
		}
	}

	public SimplerInvoicingApplicationUser findByUsername(
			String user) {
		if (isProfileActive("mongodb")){
			return mongoSimplerInvoicingApplicationUserRepository.findByUsername(user);
		}else if (isProfileActive("rdbms")){
			return jpaSimplerInvoicingApplicationUserRepository.findByUsername(user);
		}else if (isProfileActive("cassandra")){
			return cassandraSimplerInvoicingApplicationUserRepository.findByUsername(user);
		}else{
			return null;
		}
	}

	public SimplerInvoicingApplicationUser findOne(String userId) {
		if (isProfileActive("mongodb")){
			return mongoSimplerInvoicingApplicationUserRepository.findOne(userId);
		}else if (isProfileActive("rdbms")){
			return jpaSimplerInvoicingApplicationUserRepository.findOne(new Long(userId));
		}else if (isProfileActive("cassandra")){
			return cassandraSimplerInvoicingApplicationUserRepository.findOne(userId);
		}else{
			return null;
		}
	}

	public long count() {
		if (isProfileActive("mongodb")){
			return mongoSimplerInvoicingApplicationUserRepository.count();
		}else if (isProfileActive("rdbms")){
			return jpaSimplerInvoicingApplicationUserRepository.count();
		}else if (isProfileActive("cassandra")){
			return cassandraSimplerInvoicingApplicationUserRepository.count();
		}else{
			return -1;
		}
	}

	public Iterable<?> findAll() {
		if (isProfileActive("mongodb")){
			return mongoSimplerInvoicingApplicationUserRepository.findAll();
		}else if (isProfileActive("rdbms")){
			return jpaSimplerInvoicingApplicationUserRepository.findAll();
		}else if (isProfileActive("cassandra")){
			return cassandraSimplerInvoicingApplicationUserRepository.findAll();
		}else{
			return null;
		}
	}

	public void delete(SimplerInvoicingApplicationUser user) {
		if (isProfileActive("mongodb")){
			mongoSimplerInvoicingApplicationUserRepository.delete(user.getId());
		}else if (isProfileActive("rdbms")){
			jpaSimplerInvoicingApplicationUserRepository.delete(new Long(user.getId()));
		}else if (isProfileActive("cassandra")){
			cassandraSimplerInvoicingApplicationUserRepository.delete(user.getId());
		}
	}

}


text:
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2016 by EMC Corporation, All Rights Reserved
///
/// 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.
///
/// Copyright holder is EMC Corporation
///
/// @author Andrey Abramov
/// @author Vasiliy Nabatchikov
////////////////////////////////////////////////////////////////////////////////

#ifndef IRESEARCH_BOOLEAN_FILTER_H
#define IRESEARCH_BOOLEAN_FILTER_H

#include "filter.hpp"
#include "utils/iterator.hpp"
#include <vector>

NS_ROOT

//////////////////////////////////////////////////////////////////////////////
/// @class boolean_filter
/// @brief defines user-side boolean filter, as the container for other
/// filters
//////////////////////////////////////////////////////////////////////////////
class IRESEARCH_API boolean_filter : public filter, private util::noncopyable {
 public:
  typedef std::vector<filter::ptr> filters_t;
  typedef ptr_iterator< filters_t::const_iterator > const_iterator;
  typedef ptr_iterator< filters_t::iterator > iterator;

  const_iterator begin() const { return const_iterator( filters_.begin() ); }
  const_iterator end() const { return const_iterator( filters_.end() ); }

  iterator begin() { return iterator( filters_.begin() ); }
  iterator end() { return iterator( filters_.end() ); }

  template<typename T>
  T& add() {
    typedef typename std::enable_if <
      std::is_base_of<filter, T>::value, T
    >::type type;

    filters_.emplace_back(type::make());
    return static_cast<type&>(*filters_.back());
  }

  virtual size_t hash() const NOEXCEPT override;

  void clear() { return filters_.clear(); }
  bool empty() const { return filters_.empty(); }
  size_t size() const { return filters_.size(); }

  virtual filter::prepared::ptr prepare(
    const index_reader& rdr,
    const order::prepared& ord,
    boost_t boost,
    const attribute_view& ctx
  ) const override final;

 protected:
  boolean_filter(const type_id& type) NOEXCEPT;
  virtual bool equals(const filter& rhs) const NOEXCEPT override;

  virtual void optimize(
      std::vector<const filter*>& /*incl*/,
      std::vector<const filter*>& /*excl*/,
      boost_t& /*boost*/) const {
    // noop
  }

  virtual filter::prepared::ptr prepare(
    const std::vector<const filter*>& incl,
    const std::vector<const filter*>& excl,
    const index_reader& rdr,
    const order::prepared& ord,
    boost_t boost,
    const attribute_view& ctx
  ) const = 0;

 private:
  void group_filters(
    std::vector<const filter*>& incl,
    std::vector<const filter*>& excl
  ) const;

  IRESEARCH_API_PRIVATE_VARIABLES_BEGIN
  filters_t filters_;
  IRESEARCH_API_PRIVATE_VARIABLES_END
};

//////////////////////////////////////////////////////////////////////////////
/// @class And
//////////////////////////////////////////////////////////////////////////////
class IRESEARCH_API And: public boolean_filter {
 public:
  DECLARE_FILTER_TYPE();
  DECLARE_FACTORY();

  And() NOEXCEPT;

  using filter::prepare;

 protected:
  virtual void optimize(
    std::vector<const filter*>& incl,
    std::vector<const filter*>& excl,
    boost_t& boost
  ) const override;

  virtual filter::prepared::ptr prepare(
    const std::vector<const filter*>& incl,
    const std::vector<const filter*>& excl,
    const index_reader& rdr,
    const order::prepared& ord,
    boost_t boost,
    const attribute_view& ctx
  ) const override;
}; // And

//////////////////////////////////////////////////////////////////////////////
/// @class Or
//////////////////////////////////////////////////////////////////////////////
class IRESEARCH_API Or : public boolean_filter {
 public:
  DECLARE_FILTER_TYPE();
  DECLARE_FACTORY();

  Or() NOEXCEPT;

  using filter::prepare;

  //////////////////////////////////////////////////////////////////////////////
  /// @return minimum number of subqueries which must be satisfied
  //////////////////////////////////////////////////////////////////////////////
  size_t min_match_count() const { return min_match_count_; }

  //////////////////////////////////////////////////////////////////////////////
  /// @brief sets minimum number of subqueries which must be satisfied
  //////////////////////////////////////////////////////////////////////////////
  Or& min_match_count(size_t count) {
    min_match_count_ = count;
    return *this;
  }

 protected:
  virtual filter::prepared::ptr prepare(
    const std::vector<const filter*>& incl,
    const std::vector<const filter*>& excl,
    const index_reader& rdr,
    const order::prepared& ord,
    boost_t boost,
    const attribute_view& ctx
  ) const override;

 private:
  size_t min_match_count_;
}; // Or

//////////////////////////////////////////////////////////////////////////////
/// @class not
//////////////////////////////////////////////////////////////////////////////
class IRESEARCH_API Not: public filter {
 public:
  DECLARE_FILTER_TYPE();
  DECLARE_FACTORY();

  Not() NOEXCEPT;

  const iresearch::filter* filter() const {
    return filter_.get();
  }

  template<typename T>
  const T* filter() const {
    typedef typename std::enable_if <
      std::is_base_of<iresearch::filter, T>::value, T
    >::type type;

    return static_cast<const type*>(filter_.get());
  }

  template<typename T>
  T& filter() {
    typedef typename std::enable_if <
      std::is_base_of< iresearch::filter, T >::value, T
    >::type type;

    filter_ = type::make();
    return static_cast<type&>(*filter_);
  }

  void clear() { filter_.reset(); }
  bool empty() const { return nullptr == filter_; }

  using filter::prepare;

  virtual filter::prepared::ptr prepare(
    const index_reader& rdr,
    const order::prepared& ord,
    boost_t boost,
    const attribute_view& ctx
  ) const override;

  virtual size_t hash() const NOEXCEPT override;

 protected:
  virtual bool equals(const iresearch::filter& rhs) const NOEXCEPT override;

 private:
  IRESEARCH_API_PRIVATE_VARIABLES_BEGIN
  filter::ptr filter_;
  IRESEARCH_API_PRIVATE_VARIABLES_END
};

NS_END

#endif


text:
# Detailed Getting Started Instructions

###Installing the prerequisites

Perform these steps once per computer:

 * Download and install Node.js from http://nodejs.org/
 * You will need a git client.  If you don't already have one, consider the clients for Mac or Windows from GitHub: https://mac.github.com/ or https://windows.github.com/
 * Once those are installed, you will need to download the Grunt command-line interface to allow access to the `grunt` command anywhere on your system.  Run this command: `npm install -g grunt-cli`

There are frequent updates to Node.js for functionality, performance, and security, so you should try to keep it up-to-date.  The GitHub for Mac and Windows clients will automatically patch themselves.  The `grunt-cli` package is just a stub that will launch whatever version of GruntJS is installed in your project folder, so it doesn't typically need updates.

###Configuring a project for grunt-ts

Perform these steps once per project:

 * Ensure that your project is completely checked-in to source control or backed-up.  Consider starting a new branch in your source control system for this work.
 * Open a command-line and navigate to your project folder.  Run `npm install grunt-ts` .  This will download grunt-ts, Grunt, and TypeScript from npm.
 * Look for a file called `gruntfile.js` in your project.  If it's not there, create it and add the code below.  If it is there, follow the instructions in the note:

````javascript
module.exports = function(grunt) {
  grunt.initConfig({
    ts: {
      default : {
        src: ["**/*.ts", "!node_modules/**/*.ts"]
      }
    }
  });
  grunt.loadNpmTasks("grunt-ts");
  grunt.registerTask("default", ["ts"]);
};
````
 * **Note:** If you already had a `gruntfile.js`, you'll still need to make at least three edits to it.  First, add the `ts` property to the existing initConfig() call (separate from existing properties with commas).  Next, add the line to load the grunt-ts task (`grunt.loadNpmTasks("grunt-ts");`).  Finally, ensure `ts` is listed in your default task or whichever tasks you wish to use.  All calls to `grunt` need to be within the braces `{ }` of the function where grunt is getting passed-in.
 * This basic gruntfile uses the `default` task (which is selected if you run `grunt` from the command-line with no arguments).  We've set the `src` property of the `ts:default` task to a "glob" array.  Grunt globs allow the developer to select files that the task should act on.  In this case, we are selecting all files with a `.ts` extension in the project root folder and any subfolders, excluding (`!` means exclude) any `.ts` files in the `node_modules` folder.
 * If you run `grunt` from the command line, all `.ts` files in your project folder and all subdirectories will be compiled.  If you wish to further customize what happens, you'll have to edit the gruntfile appropriately.  See the rest of the documentation for instructions.


text:
namespace Wangkanai.Detection.Hosting;

/// <summary>
///     Specifies the GetDevice view formar for <see cref="ResponsiveViewLocationExpander" />.
/// </summary>
public enum ResponsiveViewLocationFormat
{
    Subfolder,
    Suffix
}


text:
using NBatch.Main.Core;
using NBatch.Main.Readers.SqlReader;

namespace NBatch.ConsoleDemo.Tests
{
    /// <summary>
    /// Read from database, lowercase all values and write to console.
    /// </summary>
    public class SqlReaderConsoleWriterTest
    {
        public static void Run()
        {
            IStep processDb = new Step<Product, Product>("dbProcessor")
                .SetReader(SqlReader())
                .SetProcessor(new ProductLowercaseProcessor())
                .SetWriter(new ConsoleWriter<Product>())
                .WithChunkSize(3);

            new Job("Job4", "JobDB")
                .AddStep(processDb)
                .Start();
        }

        private static IReader<Product> SqlReader()
        {
            return new SqlDbItemReader<Product>("ApplicationDB")
                .Query("Select * from Product")
                .OrderBy("ProductId");
        }
    }
}


text:
siths-server
============
SITHS is a Small Issue Tracking and Handling system

HowTo
============
1. Istall JDK 1.7 (Java 7 is required since SITHS is using Neo4j 2.0.1)
2. Install Apache Maven (Maven 3 is preferrable)
3. Compile

    mvn clean package

4. Run

    java -jar target/siths-0.1.0.jar --server.port=8080


text:
from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', 'devops_challenge.ipdistance.views.index', name='index'),
    url(r'^admin/', include(admin.site.urls)),
)


text:
from msrest.serialization import Model

class Product(Model):

    _required = ['id']

    _attribute_map = {
        'id': {'key': 'id', 'type': 'int'},
        'name': {'key': 'name', 'type': 'str'},
    }

    def __init__(self, *args, **kwargs):
        """Product

        :param int id
        :param str name
        """
        self.id = None
        self.name = None

        super(Product, self).__init__(*args, **kwargs)


text:
@import UIKit;

@interface TWTViewController : UIViewController<UIActionSheetDelegate>

@end


text:
![Keep the change, ya filthy animal! by Mike Smith https://dribbble.com/shots/1261538-Keep-the-change-ya-filthy-animal](./images/paris_france.jpg)

A **light-weight** (*CodeIgniter*, *Twitter Bootstrap*, *SVG*) **email server** (*Campaign*, *Autoresponder* and *Transactional*) and **its free** (*Apache 2.0*, *AWS: SES, OpsWorks t2.micro, SQS, SNS, S3, RDS t2.micro, Route 53*).

## Features

- List-unsubscribe
  - Autoresponders
  - Campaign
  - Transactional

- API Access

```
  - request/transactional/{message_id}
  - recipient/subscribe/{list}
  - recipient/unsubscribe/{list}
  - recipient/update-metadata/{list}
  - archive/get-info/{request_id}/{unsubscribe_key}
```

- Upload attachments to S3 (`YYYYMMDD-HHMMSS_file_name.ext`)
- Admin login
- Auto add [`List-Unsubscribe`](http://www.list-unsubscribe.com/) headers (if body includes `{_unsubscribe_link}`)
- Auto inline CSS
- Minify HTML
- Auto `Plain text` email
- SNS, SQS - handle feedback (bounces, complaints, deliveries)
- Queuing and Multiple emails sending
- Campaign Archive - `open/campaign/{list}/{created_hash}`
- Open Subscribe `open/subscribe/{list}` and Unsubscribe `open/unsubscribe/{request_id}/{unsubscribe_key}`
- Google Analytics (click and open)

# 🙇🏼♂ ··· 🤖

[![](images/Fi5YIvH.gif)](//imgur.com/Fi5YIvH)

> J (Will Smith) has to bring back Kevin Brown a. k. a. K (Tommy Lee Jones) to the MIB. Funny Scene.
> [Men In Black II - Post Office Scene](//youtu.be/4HgUh5bOgbM?t=195)


text:
using System;
using Pomelo.EntityFrameworkCore.MySql.Infrastructure.Internal;
using Pomelo.EntityFrameworkCore.MySql.Storage.Internal;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Internal;
using Pomelo.EntityFrameworkCore.MySql.Infrastructure;

namespace Pomelo.EntityFrameworkCore.MySql.Internal
{
    public class MySqlOptions : IMySqlOptions
    {
        public MySqlOptions()
        {
            ConnectionSettings = new MySqlConnectionSettings();
            ServerVersion = new ServerVersion(null);
            CharSetBehavior = CharSetBehavior.AppendToAllAnsiColumns;
            AnsiCharSetInfo = new CharSetInfo(CharSet.Latin1);
            UnicodeCharSetInfo = new CharSetInfo(CharSet.Utf8mb4);
        }

        public virtual void Initialize(IDbContextOptions options)
        {
            var mySqlOptions = options.FindExtension<MySqlOptionsExtension>() ?? new MySqlOptionsExtension();

            ConnectionSettings = GetConnectionSettings(mySqlOptions);
            ServerVersion = mySqlOptions.ServerVersion ?? ServerVersion;
            CharSetBehavior = mySqlOptions.NullableCharSetBehavior ?? CharSetBehavior;
            AnsiCharSetInfo = mySqlOptions.AnsiCharSetInfo ?? AnsiCharSetInfo;
            UnicodeCharSetInfo = mySqlOptions.UnicodeCharSetInfo ?? UnicodeCharSetInfo;
            NoBackslashEscapes = mySqlOptions.NoBackslashEscapes;
        }

        public virtual void Validate(IDbContextOptions options)
        {
            var mySqlOptions = options.FindExtension<MySqlOptionsExtension>() ?? new MySqlOptionsExtension();

            if (!Equals(ServerVersion, mySqlOptions.ServerVersion ?? new ServerVersion(null)))
            {
                throw new InvalidOperationException(
                    CoreStrings.SingletonOptionChanged(
                        nameof(MySqlDbContextOptionsBuilder.ServerVersion),
                        nameof(DbContextOptionsBuilder.UseInternalServiceProvider)));
            }

            var connectionSettings = GetConnectionSettings(mySqlOptions);

            if (!Equals(ConnectionSettings.OldGuids, connectionSettings.OldGuids)
                || !Equals(ConnectionSettings.TreatTinyAsBoolean, connectionSettings.TreatTinyAsBoolean))
            {
                throw new InvalidOperationException(
                    CoreStrings.SingletonOptionChanged(
                        nameof(MySqlDbContextOptionsExtensions.UseMySql),
                        nameof(DbContextOptionsBuilder.UseInternalServiceProvider)));
            }
        }

        private static MySqlConnectionSettings GetConnectionSettings(MySqlOptionsExtension relationalOptions)
        {
            if (relationalOptions.Connection != null)
            {
                return new MySqlConnectionSettings(relationalOptions.Connection);
            }

            if (relationalOptions.ConnectionString != null)
            {
                return new MySqlConnectionSettings(relationalOptions.ConnectionString);
            }

            throw new InvalidOperationException(RelationalStrings.NoConnectionOrConnectionString);
        }

        public virtual MySqlConnectionSettings ConnectionSettings { get; private set; }
        public virtual ServerVersion ServerVersion { get; private set; }
        public virtual CharSetBehavior CharSetBehavior { get; private set; }
        public virtual CharSetInfo AnsiCharSetInfo { get; private set; }
        public virtual CharSetInfo UnicodeCharSetInfo { get; private set; }
        public virtual bool NoBackslashEscapes { get; private set; }
    }
}


text:
package org.apache.wicket.protocol.http;

import java.util.Locale;

import javax.servlet.http.HttpServletRequest;

import junit.framework.TestCase;

import org.apache.wicket.protocol.http.servlet.ServletWebRequest;

/**
 * @author Timo Rantalaiho
 */
public class WebSessionTest extends TestCase
{
	public void testReadsLocaleFromRequestOnConstruction()
	{
		final Locale locale = Locale.TRADITIONAL_CHINESE;
		HttpServletRequest request = new MockHttpServletRequest(null, null, null)
		{
			@Override
			public Locale getLocale()
			{
				return locale;
			}
		};

		WebSession session = new WebSession(new ServletWebRequest(request));
		assertEquals(locale, session.getLocale());
	}
}


text:
#pragma once

#include "smooth/core/Application.h"
#include "smooth/core/task_priorities.h"
#include <iostream>

namespace logging
{
    class App : public smooth::core::Application
    {
        public:
            App();

            void init() override;

            void tick() override;
    };
}


text:
package org.apache.helix.participant;

import org.apache.helix.api.id.PartitionId;
import org.testng.annotations.Test;

public class TestMultiClusterControllerStateModelFactory {

  @Test()
  public void test() {
    MultiClusterControllerTransitionHandlerFactory factory =
        new MultiClusterControllerTransitionHandlerFactory("localhost:2181");
    MultiClusterControllerTransitionHandler stateModel =
        factory.createStateTransitionHandler(PartitionId.from("key"));
    stateModel.onBecomeStandbyFromOffline(null, null);
  }
}


text:
title: "ServiceComb Releases"
lang: cn
ref: release
permalink: /cn/release/
excerpt: "ServiceComb Releases"
last_modified_at: 2018-03-28T00:50:43-55:00
---

Use the links below to download the Apache ServiceComb Incubating from one of our mirrors. You must verify the integrity of the downloaded files using signatures downloaded from our main distribution directory.

Only current recommended releases are available on the main distribution site and its mirrors.

**Stable Release - Latest Version:**

* [Apache ServiceComb (incubating) Service-Center 1.0.0-m1](https://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0-m1/){:target="_blank"} (released on 2018-03-27)

* [Apache ServiceComb (incubating) Java-Chassis 1.0.0-m1](https://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0-m1/){:target="_blank"} (released on 2018-04-02)

* [Apache ServiceComb (incubating) Saga 0.1.0](https://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-saga/0.1.0/){:target="_blank"} (released on 2018-03-27)

**Verifying the release**

It is essential that you verify the integrity of the downloaded files using the PGP or SHA signatures.
 The PGP signatures can  be verified using GPG or PGP.
 Please download the [KEYS](https://www.apache.org/dist/incubator/servicecomb/KEYS){:target="_blank"} as well as the asc signature files for relevant distribution. It is recommended to get these files from the main distribution [directory](https://www.apache.org/dist/incubator/servicecomb/){:target="_blank"} and not from the mirrors.
 ```
 gpg -i KEYS

 or

 pgpk -a KEYS

 or

 pgp -ka KEYS

```

To verify the binaries/sources you can download the relevant asc files for it from main distribution directory and follow the below guide.

```
gpg --verify apache-servicecomb-incubating********.asc apache-servicecomb-incubating*********

or

pgpv apache-servicecomb-incubating********.asc

or

pgp apache-servicecomb-incubating********.asc

```

Alternatively you can download the SHA signatures from main distribution [repo](https://www.apache.org/dist/incubator/servicecomb/){:target="_blank"} and verify the downloads using sha512sum.


text:
:man_page: mongoc_bulk_operation_set_comment

mongoc_bulk_operation_set_comment()
===================================

Synopsis
--------

.. code-block:: c

  void
  mongoc_bulk_operation_set_comment (
     mongoc_bulk_operation_t *bulk, const bson_value_t *comment);

Parameters
----------

* ``bulk``: A :symbol:`mongoc_bulk_operation_t`.
* ``comment``: A :symbol:`bson_value_t` specifying the comment to associate with this bulk write.

Description
-----------

Assigns a comment to attach to all commands executed as part of this :doc:`bulk <mongoc_bulk_operation_t>`. The comment will appear in log messages, profiler output, and currentOp output. Comments for write commands are only supported by MongoDB 4.4+.

It is prohibited to call this function after adding operations to the :doc:`bulk <mongoc_bulk_operation_t>`.


text:
/*	$NetBSD: error.h,v 1.1.1.2.4.1 2014/12/24 00:05:18 riz Exp $	*/

/*
 * Copyright (C) 2004-2007, 2009  Internet Systems Consortium, Inc. ("ISC")
 * Copyright (C) 1998-2001  Internet Software Consortium.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/* Id: error.h,v 1.22 2009/09/29 23:48:04 tbox Exp  */

#ifndef ISC_ERROR_H
#define ISC_ERROR_H 1

/*! \file isc/error.h */

#include <stdarg.h>

#include <isc/formatcheck.h>
#include <isc/lang.h>
#include <isc/platform.h>

ISC_LANG_BEGINDECLS

typedef void (*isc_errorcallback_t)(const char *, int, const char *, va_list);

/*% set unexpected error */
void
isc_error_setunexpected(isc_errorcallback_t);

/*% set fatal error */
void
isc_error_setfatal(isc_errorcallback_t);

/*% unexpected error */
void
isc_error_unexpected(const char *, int, const char *, ...)
     ISC_FORMAT_PRINTF(3, 4);

/*% fatal error */
ISC_PLATFORM_NORETURN_PRE void
isc_error_fatal(const char *, int, const char *, ...)
ISC_FORMAT_PRINTF(3, 4) ISC_PLATFORM_NORETURN_POST;

/*% runtimecheck error */
void
isc_error_runtimecheck(const char *, int, const char *);

#define ISC_ERROR_RUNTIMECHECK(cond) \
	((void) ((cond) || \
		 ((isc_error_runtimecheck)(__FILE__, __LINE__, #cond), 0)))

ISC_LANG_ENDDECLS

#endif /* ISC_ERROR_H */


text:
// Generated by CoffeeScript 1.7.1

var $;

$ = jQuery;

$.fn.extend({
  eqHeight: function(column_selector, option) {
    if (option == null) {
      option = {
        equalize_interval: null,
        break_point: null
      };
    }
    return this.each(function() {
      var columns, equalizer, infinite_equalizing, start_equalizing, timer, _equalize_marked_columns;
      timer = null;
      columns = $(this).find(column_selector);
      if (columns.length === 0) {
        columns = $(this).children();
      }
      if (columns.length === 0) {
        return;
      }
      _equalize_marked_columns = function() {
        var marked_columns, max_col_height;
        marked_columns = $(".eqHeight_row");
        max_col_height = 0;
        marked_columns.each(function() {
          return max_col_height = Math.max($(this).outerHeight(), max_col_height);
        });
        marked_columns.height(max_col_height);
        return $(".eqHeight_row").removeClass("eqHeight_row");
      };
      equalizer = function() {
        var row_top_value;
        columns.height("auto");
        if (typeof option.break_point === "number" && $(window).width() <= option.break_point) {
          return;
        }
        row_top_value = columns.first().position().top;
        columns.each(function() {
          var current_top;
          current_top = $(this).position().top;
          if (current_top !== row_top_value) {
            _equalize_marked_columns();
            row_top_value = $(this).position().top;
          }
          return $(this).addClass("eqHeight_row");
        });
        return _equalize_marked_columns();
      };
      start_equalizing = function() {
        clearTimeout(timer);
        return timer = setTimeout(equalizer, 100);
      };
      infinite_equalizing = function() {
        equalizer();
        return timer = setTimeout(infinite_equalizing, option.equalize_interval);
      };
      $(window).load(equalizer);
      if (typeof option.equalize_interval === "number") {
        return infinite_equalizing();
      } else {
        return $(window).resize(start_equalizing);
      }
    });
  }
});


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx.Logging;
using HarmonyLib;
using HN = global::Hacknet;

namespace BepInEx.Hacknet;

public static class Entrypoint
{
    public static void Bootstrap()
    {
        AppDomain.CurrentDomain.AssemblyResolve += ResolveBepAssembly;
        if (Type.GetType("Mono.Runtime") != null)
            AppDomain.CurrentDomain.AssemblyResolve += ResolveGACAssembly;
        AppDomain.CurrentDomain.AssemblyResolve += ResolveRenamedAssembly;

        Environment.SetEnvironmentVariable("MONOMOD_DMD_TYPE", "dynamicmethod");

        LoadBepInEx.Load();
    }

    public static Assembly ResolveBepAssembly(object sender, ResolveEventArgs args)
    {
        var asmName = new AssemblyName(args.Name);

        foreach (var path in Directory
                     .GetFiles("./BepInEx", $"{asmName.Name}.dll", SearchOption.AllDirectories)
                     .Select(Path.GetFullPath))
        {
            try
            {
                return Assembly.LoadFile(path);
            }
            catch {}
        }

        return null;
    }

    public static Assembly ResolveGACAssembly(object sender, ResolveEventArgs args)
    {
        var asmName = new AssemblyName(args.Name);

        try
        {
            foreach (var path in Directory
                         .GetFiles($"/usr/lib/mono/gac/{asmName.Name}", $"{asmName.Name}.dll", SearchOption.AllDirectories)
                         .Select(Path.GetFullPath))
            {
                try
                {
                    return Assembly.LoadFile(path);
                }
                catch { }
            }
        }
        catch { }

        return null;
    }

    public static Assembly ResolveRenamedAssembly(object sender, ResolveEventArgs args)
    {
        var asmName = new AssemblyName(args.Name);

        if (ChainloaderFix.Remaps.TryGetValue(asmName.Name, out Assembly ret))
            return ret;

        return null;
    }
}

internal static class LoadBepInEx
{
    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static void Load()
    {
        try
        {
            Paths.SetExecutablePath(typeof(HN.Program).Assembly.GetName().Name);

            Logger.Listeners.Add(new ConsoleLogger());
            AccessTools.PropertySetter(typeof(TraceLogSource), nameof(TraceLogSource.IsListening)).Invoke(null, new object[] { true });
            ConsoleManager.Initialize(true);

            // Start chainloader for plugins
            var chainloader = new HacknetChainloader();
            chainloader.Initialize();
            chainloader.Execute();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Fatal loading exception:");
            Console.WriteLine(ex);
            Console.ReadLine();
            Environment.Exit(1);
        }
    }
}


text:
#!/usr/bin/env node

'use strict';

var _commander = require('commander');

var _commander2 = _interopRequireDefault(_commander);

var _fsExtra = require('fs-extra');

var _fsExtra2 = _interopRequireDefault(_fsExtra);

var _async = require('async');

var _async2 = _interopRequireDefault(_async);

var _gitConfig = require('git-config');

var _gitConfig2 = _interopRequireDefault(_gitConfig);

var _prompt = require('prompt');

var _prompt2 = _interopRequireDefault(_prompt);

var _yesno = require('yesno');

var _yesno2 = _interopRequireDefault(_yesno);

var _colors = require('colors');

var _colors2 = _interopRequireDefault(_colors);

var _child_process = require('child_process');

var _child_process2 = _interopRequireDefault(_child_process);

var _singleLineLog = require('single-line-log');

var _singleLineLog2 = _interopRequireDefault(_singleLineLog);

var _pug = require('pug');

var _pug2 = _interopRequireDefault(_pug);

var _zipFolder = require('zip-folder');

var _zipFolder2 = _interopRequireDefault(_zipFolder);

var _xml2json = require('xml2json');

var _xml2json2 = _interopRequireDefault(_xml2json);

var _prettyData = require('pretty-data');

var _prettyData2 = _interopRequireDefault(_prettyData);

var _index = require('../index');

var _index2 = _interopRequireDefault(_index);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var BROXJS_DIR = '/usr/local/lib/node_modules/broxjs';
var TPL_DIR = BROXJS_DIR + '/template';
var NAVIGATOR = ['chrome', 'firefox'];
var NAV_OUT_ZIP = {
  'chrome': 'crx',
  'firefox': 'xpi'
};
var pkg = require(__dirname + '/../../package.json');
var PACKAGE = {};
var EXTENSION = {};

_commander2.default.version(pkg.version).option('-p, --pack', 'Pack the Extension').parse(process.argv);

var currentDir = process.cwd();
var projectName = (_commander2.default.args || []).shift();
if (projectName) {
  currentDir += '/' + projectName;
  _fsExtra2.default.mkdirsSync(currentDir);
  process.chdir(currentDir);
}

var error = function error(err) {
  console.error(err);
  process.exit(1);
};

var animeLogI = 0;
var log = _singleLineLog2.default.stdout;
var animeLog = function animeLog() {
  log.clear();
  var temp = '';
  var i = 0;
  while (i < animeLogI) {
    temp = temp + '    ';
    i = i + 1;
  }
  var last = '';
  switch (animeLogI % 2) {
    case 0:
      last = '   ]\\_  \n';
      break;
    default:
      last = '   /_[  \n';
  }
  log(temp + '      MM \n' + temp + '|\\___/ `>\n' + temp + ' \\_  _/ \n' + temp + last);
  animeLogI = animeLogI + 1;
  if (animeLogI >= 5) {
    animeLogI = 0;
  }
};

var init = function init() {
  (0, _gitConfig2.default)(function (err, gconfig) {

    var user = gconfig.user.name || 'John Doe';
    var email = gconfig.user.email || 'johndoe@iap.com';

    var schema = {
      properties: {
        "filesaverjs": "^0.2.2",
        name: {
          message: 'Extension\'s name',
          default: 'My Extension',
          required: true
        },
        shortName: {
          message: 'Extension\'s short name',
          default: 'my-extension',
          required: true
        },
        version: {
          message: 'Starting version',
          default: '0.1.0',
          required: true
        },
        repository: {
          message: 'CVS repository'
        },
        author: {
          message: 'Author',
          default: user + ' <' + email + '>'
        },
        description: {
          message: 'Description',
          default: 'This is a default description.'
        },
        homepageURL: {
          message: 'Homepage URL'
        }
      }
    };

    _prompt2.default.message = 'Broxjs'.bold.yellow;
    _prompt2.default.start();

    console.log();

    _prompt2.default.get(schema, function (err, result) {

      if (err) return error(err);

      var operations = [];

      var copyOperation = function copyOperation(srcFile, dstFile) {
        return operations.push(function (cbk) {
          return _fsExtra2.default.copy(srcFile, dstFile, cbk);
        });
      };
      var writeJsonOperation = function writeJsonOperation(file, obj) {
        return operations.push(function (cbk) {
          return _fsExtra2.default.writeJson(file, obj, { spaces: 2 }, cbk);
        });
      };

      var extInfos = require(TPL_DIR + '/extension.json');
      extInfos.name = extInfos.browser_action.default_title = result.name;
      extInfos.version = result.version;
      extInfos.author = result.author;
      extInfos.description = result.description;
      extInfos.extension_url = result.homepageURL;
      extInfos.update_url = result.homepageURL + '/update';
      writeJsonOperation(currentDir + '/extension.json', extInfos);

      var npm = require(TPL_DIR + '/package.json');
      npm.name = result.shortName;
      npm.version = result.version;
      npm.description = result.description;
      if (result.repository) npm.repository = result.repository;
      writeJsonOperation(currentDir + '/package.json', npm);

      var bower = require(TPL_DIR + '/bower.json');
      bower.name = result.shortName;
      bower.authors.push(result.author);
      writeJsonOperation(currentDir + '/bower.json', bower);

      ['babelrc', 'bowerrc', 'editorconfig', 'gitattributes', 'gitignore', 'jshintrc', 'broxrc'].forEach(function (file) {
        return copyOperation(TPL_DIR + '/' + file, currentDir + '/.' + file);
      });

      ['assets/', 'src/', 'test/', 'views/'].concat(['LICENSE', 'README.md']).concat(['gulpfile.babel.js']).forEach(function (file) {
        return copyOperation(TPL_DIR + '/' + file, currentDir + '/' + file);
      });

      var installDeps = void 0;
      operations.push(function (cbk) {
        return _yesno2.default.ask('\nDo you you to install npm/bower dependencies? (Y/n)'.bold.yellow, true, function (res) {
          installDeps = res;
          cbk();
        });
      });

      operations.push(function (cbk) {
        if (!installDeps) return cbk();
        console.log('\nInstalling dependencies...'.bold.red);
        var npmi = _child_process2.default.exec('npm i && bower i');
        var animate = setInterval(animeLog, 400);
        npmi.on('close', function (code) {
          clearInterval(animate);
          cbk();
        });
        npmi.on('error', function (err) {
          cbk(err);
        });
      });

      _async2.default.series(operations, function (err, results) {
        if (err) return error(err);
        console.log('\nCongralutions! Your extension is ready\n'.bold.green);
        _prompt2.default.stop();
      });
    });
  });
};

var createHTML = function createHTML(file) {
  return new Promise(function (resolve, reject) {
    var nameFile = file.split('.');
    var ext = nameFile.pop();
    if (ext !== 'jade') {
      console.log(file + ' ignored');
      return resolve({ ignored: true });
    }
    var html = _pug2.default.renderFile('./views/' + file, { pretty: true });
    resolve({ html: html, file: nameFile.join('.') + '.html' });
  });
};

var writeHTML = function writeHTML(dir, html) {
  return new Promise(function (resolve, reject) {
    return _fsExtra2.default.outputFile(dir, html, function (err) {
      if (err) return reject();
      return resolve();
    });
  });
};

var logInfo = function logInfo(nav, string) {
  var t = '[' + nav + ']';
  console.log(t.bold.blue, string);
};

var copyFileP = function copyFileP(src, target, nav, string) {
  return new Promise(function (resolve, reject) {
    return _fsExtra2.default.copy(src, target, function (err) {
      if (err) return reject();
      logInfo(nav, string);
      return resolve();
    });
  });
};

var parseViews = function parseViews() {
  return new Promise(function (resolve, reject) {
    _fsExtra2.default.readdir('./views', function (err, files) {
      var render = [];
      files.forEach(function (val) {
        render.push(createHTML(val));
      });
      return Promise.all(render).then(function (r) {
        var html = [];
        r.forEach(function (val) {
          if (val.ignored) {
            return;
          }
          NAVIGATOR.forEach(function (nav) {
            html.push(writeHTML('./output/' + nav + '/views/' + val.file, val.html));
            logInfo(nav, 'views/' + val.file);
          });
        });
        return Promise.all(html).then(resolve);
      }).catch(reject);
    });
  });
};

var zipFolderP = function zipFolderP(src, target) {
  return new Promise(function (resolve, reject) {
    (0, _zipFolder2.default)(src, target, function (err) {
      if (err) {
        return reject(err);
      }
      resolve();
    });
  });
};

var zip = function zip() {
  return new Promise(function (resolve, reject) {
    var pro = [];
    NAVIGATOR.forEach(function (val) {
      if (val === 'chrome') {
        pro.push(zipFolderP('./output/' + val, './output/' + PACKAGE.name + '_' + PACKAGE.version + '_webstore' + '.zip'));
      }
      pro.push(zipFolderP('./output/' + val, './output/' + PACKAGE.name + '_' + PACKAGE.version + '.' + NAV_OUT_ZIP[val]));
    });
    Promise.all(pro).then(function () {
      logInfo('All', 'Zip OK!');
      resolve();
    }).catch(console.error);
  });
};

var fileUpdateChrome = function fileUpdateChrome() {
  return new Promise(function (resolve, reject) {
    _fsExtra2.default.readFile(TPL_DIR + '/update/update_chrome.xml', function (err, data) {
      var json = _xml2json2.default.toJson(data, { object: true, coerce: true, reversible: true });
      json.gupdate.app.appid = 'une_appid_recup_du_fichier';
      json.gupdate.app.updatecheck.codebase = EXTENSION.update_url;
      json.gupdate.app.updatecheck.version = PACKAGE.version;
      var xml = '<?xml version="1.0" encoding="utf-8"?>';
      xml = xml + _xml2json2.default.toXml(json);
      xml = _prettyData2.default.pd.xml(xml);
      _fsExtra2.default.writeFile('./output/update_chrome.xml', xml, function (err) {
        if (err) {
          return reject(err);
        }
        logInfo('chrome', 'Update xml create.');
        resolve();
      });
    });
  });
};

var fileUpdateFirefox = function fileUpdateFirefox() {
  return new Promise(function (resolve, reject) {
    _fsExtra2.default.readFile(TPL_DIR + '/update/update_firefox.xml', function (err, data) {
      var json = _xml2json2.default.toJson(data, { object: true, coerce: true, reversible: true });
      json['RDF:RDF']['RDF:Description']['em:updates']['RDF:Seq']['RDF:li']['RDF:Description']['em:version'].$t = PACKAGE.version;
      json['RDF:RDF']['RDF:Description']['em:updates']['RDF:Seq']['RDF:li']['RDF:Description']['em:targetApplication']['RDF:Description']['em:id'].$t = '{une_appid_recup_du_fichier}';
      json['RDF:RDF']['RDF:Description']['em:updates']['RDF:Seq']['RDF:li']['RDF:Description']['em:targetApplication']['RDF:Description']['em:updateLink'].$t = EXTENSION.update_url;
      json['RDF:RDF']['RDF:Description']['em:version'].$t = PACKAGE.version;
      json['RDF:RDF']['RDF:Description']['em:updateLink'].$t = EXTENSION.update_url;
      var xml = '<?xml version="1.0" encoding="utf-8"?>';
      xml = xml + _xml2json2.default.toXml(json);
      xml = _prettyData2.default.pd.xml(xml);
      _fsExtra2.default.writeFile('./output/update_firefox.xml', xml, function (err) {
        if (err) {
          return reject(err);
        }
        logInfo('firefox', 'Update xml create.');
        resolve();
      });
    });
  });
};

var pack = function pack() {

  _fsExtra2.default.readJson('./package.json', function (err, data) {
    PACKAGE = data;
  });

  _fsExtra2.default.readJson('./extension.json', function (err, data) {
    EXTENSION = data;
  });

  console.log('\nPacking...\n'.bold.yellow);
  console.log('           ((\\o/))\n'.cyan + '.-----------//^\\\\-----------.\n'.cyan + '|          /`| |`\\_______   |\n'.cyan + '|            | |  |BroxJS|  |\n'.cyan + '|            | |  """"""""  |\n'.cyan + '|            | |            |\n'.cyan + '\'------------===------------\'\n'.cyan);
  /*const configMapping = require(BROXJS_DIR + '/doc/manifest.mapping.json');
  const extInfos = require(currentDir + '/extension.json');
  console.log(broxjs.configUnifier('chrome', configMapping, extInfos));*/

  var pro = [];

  NAVIGATOR.forEach(function (val) {
    pro.push(copyFileP('./assets', './output/' + val + '/assets', val, 'Assets has been copied'));
    pro.push(copyFileP('./src', './output/' + val + '/src', val, 'Source has been copied'));
  });
  pro.push(parseViews());
  pro.push(fileUpdateChrome());
  pro.push(fileUpdateFirefox());

  Promise.all(pro).then(zip).then(function () {
    console.log('\nPacking completed\n'.bold.green);
  }).catch(console.error);
};

if (_commander2.default.pack) _fsExtra2.default.stat('./.broxrc', function (err, stat) {
  if (err) {
    return console.log('\nYou are not in project directory!\n'.bold.red);
  }
  pack();
});else init();


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Namespace Bifrost.Events
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Namespace Bifrost.Events
   ">
    <meta name="generator" content="docfx 2.9.3.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Namespace Bifrost.Events

Classes

AsynchronousUncommittedEventStreamCoordinator

Represents a IUncommittedEventStreamCoordinator that commits asynchronously

CommittedEventStream

Represents a special version of an EventStream
that holds committed IEvent

DuplicateInEventMigrationHierarchyException

Represents an exceptional situation where an event in an EventMigrationHierarchy
has more than one migration path.

Event

Represents an event

EventExtensions

Extensions for an enumerable of IEvent

EventMigrationHierarchy

Represents a migration hierarchy for a logical event, containing the concrete type for each step in the chain.

EventMigrationHierarchyDiscoverer

Represents a IEventMigrationHierarchyDiscoverer

EventMigrationHierarchyManager

Represents a IEventMigrationHierarchyManager

EventMigratorManager

Represents a IEventMigratorManager

EventOutOfSequenceException

The exception that is thrown when an IEvent is out of sequence in an EventStream

EventSource

Represents a IEventSource

This is a base abstract class for any EventSource

EventSourceExtensions

Extensions for EventSource

EventSourceExtensions.EventSourceHandleMethods<T>

EventStoreChangeManager

Represents a IEventStoreChangeManager

EventStream

Represents a collection of events in the order that they were applied.

EventSubscriber<T>

Represents a base class implementation of an IProcessEvents

EventSubscription

Represents a subscription for a specific IProcessEvents and method on it that can receive a method

EventSubscriptionManager

Represents an implementation of IEventSubscriptionManager

InvalidFastForwardException

Represents an exceptional situation where an IEventSource is stateful
but there has been an attempt to retrieve it without restoring state by replaying events (fast-forwarding)

InvalidMigrationTypeException

Represents an exceptional situation where an IEvent in an EventMigrationHierarchy
has does not migrate from the previous event in the migration hierarchy.

MigrationLevelOutOfRangeException

Represents an exception situation where a EventMigrationHierarchy is
asked for a concrete type at a level that does not exist.

This could be a level less than 0, or a level greater than the hierarchy depth.

NotAMigratedEventTypeException

Represents an exceptional situation where an IEvent in an EventMigrationHierarchy
has not implemented the correct IAmNextGenerationOf<T>.

NullEventStore

Represents a null implementation of IEventStore

NullEventSubscriptions

Represents a null implementation of IEventSubscriptions

NullUncommittedEventStreamCoordinator

A null implementation for IUncommittedEventStreamCoordinator

ProcessMethodInvoker

Represents an implementation of IProcessMethodInvoker

UncommittedEventStream

Represents a stream of events that are uncommitted

UncommittedEventStreamCoordinator

Represents a IUncommittedEventStreamCoordinator

UnregisteredEventException

Represents an exceptional situation where an IEvent in an EventMigrationHierarchy
has not been registered as an IEvent.

Structs

EventSourceVersion

Represents the versioning for an EventSource

Interfaces

IAmNextGenerationOf<T>

Defines an event which is the subsequent generation of the IEvent

IEvent

Defines the basics of an event.

IEventMigrationHierarchyDiscoverer

Defines a discoverer that is able to detect all events and group them into EventMigrationHierarchy

IEventMigrationHierarchyManager

Defines a manager that is able to determine what the current migration level for an IEvent
and what the System.Type of any specified migration level.

IEventMigrator<TIn, TOut>

Defines the functionality for a migrator that migrates from an older generation of IEvent to a newer generation

IEventMigratorManager

Defines the functionality for a manager that handles the migration of events from older generations to newer generations.

Migrates an IEvent to the current generation

IEventSource

An EventSource is a domain object that is capable of generating and applying events.  It is an AggregateRoot in the context
of event sourcing.

IEventStore

Defines a repository that holds events generated

IEventStoreChangeListener

Defines a listener for changes occuring on a IEventStore

IEventStoreChangeManager

Defines a manager for notifying changes to registered notifiers

IEventStoreChangeNotifier

Defines a notifier for notifying when changes occur on an IEventStore

IEventSubscriptionManager

Defines a manager for dealing with EventSubscription

IEventSubscriptions

Defines a system for working with <see cref="!:IEventSubscription">Event Subscriptions</see>

IProcessEvents

Defines an event subscriber.

IProcessMethodInvoker

Defines an invoker for handle methods - it should recognize methods called Handle and be able to
call them

IUncommittedEventStreamCoordinator

Defines a coordinator for dealing with UncommittedEventStream

                    Improve this Doc

              Back to top

            Copyright © 2008-2017 Dolittle


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Revue Mycol. , Paris 12(1): 31 (1947)

#### Original name
Cudoniella buissonii Grelet, 1947

### Remarks
null


text:
var ControllerApp = function (options){

	var socket = null;

	var init = function (){
		initSocket();
		addHandlers();
		FastClick.attach(document.body);
	};

	var initSocket = function (){
		if(socket) return; // already initialized

		socket = io.connect(window.location.hostname);

		// some debugging statements concerning socket.io
		socket.on('reconnecting', function(seconds){
			console.log('reconnecting in ' + seconds + ' seconds');
		});
		socket.on('reconnect', function(){
			console.log('reconnected');
		});
		socket.on('reconnect_failed', function(){
			console.log('failed to reconnect');
		});
		socket.on('connect', function() {
			console.log('socket connected');
		});
	};

	var addHandlers = function () {
		$('.preset').click( onPresetClick );

		$("#pantiltabsolute").submit(function(e){
			e.preventDefault();
			var pan = $("#pantiltabsolute #pan").val();
			var tilt = $("#pantiltabsolute #tilt").val();

			socket.emit('pantilt.absolute', {pan: pan, tilt: tilt});
		});

		$("form").submit(function(e){
			e.preventDefault();
		});

		$(".set").click( onSetClick );

		$('.slider').slider();
	};

	var onPresetClick = function (event){
		var preset = $(this).attr('data-preset');
		socket.emit('preset.move', preset, function (data) {
			console.log(data);
		});
	};

	var onSetClick = function (event) {
		var form = $(this).closest("form");
		var name = form.attr('data-name');

		// gather all inputs:
		var command = {
			name: name,
			inputs: {}
		};
		form.find(":input").each(function(){
			var id = $(this).attr('data-controlid');
			var value = $(this).val();

			if(id && value != ""){
				command.inputs[id] = value;
			}
		});

		socket.emit('command', command, function (data) {
			console.log(data);
			for(var key in data){
				var value = data[key];
				var outputfield = form.find('[data-outputid="'+key+'"]');
				outputfield.val( value.code_text + ' ('+value.code+')' );
			}
		});
	};

	return {
		init: init
	};
};

$(function(){
	var app = new ControllerApp();
	app.init();
});


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 wvlet.airframe.ulid

import scala.util.Random

/**
  */
object compat {
  val random: Random = {
    try {
      // When 'crypto' module is available
      new scala.util.Random(new java.security.SecureRandom())
    } catch {
      case _: Throwable =>
        scala.util.Random
    }
  }

  def sleep(millis: Int): Unit = {
    // no-op as Scala.js has no sleep
  }
}


text:
class Profile;

namespace user_prefs {
class PrefRegistrySyncable;
}

namespace chromeos {

class PrinterPrefManager : public KeyedService {
 public:
  explicit PrinterPrefManager(Profile* profile);

  // Register the printing preferences with the |registry|.
  static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);

  // Returns the printers that are saved in preferences.
  std::vector<std::unique_ptr<Printer>> GetPrinters() const;

  // Returns the printer with id |printer_id|.
  std::unique_ptr<Printer> GetPrinter(const std::string& printer_id) const;

  // Adds or updates a printer. Printers are identified by the id field.  Use an
  // empty id to add a new printer.
  void RegisterPrinter(std::unique_ptr<Printer> printer);

  // Remove printer from preferences with the id |printer_id|.  Returns true if
  // the printer was successfully removed.
  bool RemovePrinter(const std::string& printer_id);

 private:
  Profile* profile_;
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_PREF_MANAGER_H_