text:
export function sequence(items, consumer) {
  const results = [];
  const runner = () => {
    const item = items.shift();
    if (item) {
      return consumer(item)
        .then((result) => {
          results.push(result);
        })
        .then(runner);
    }

    return Promise.resolve(results);
  };

  return runner();
}


text:
{{_message}}
  <button type="button" class="close" (click)="close()" aria-label="Close">
    ×
  </button>

redpajama_set_name: RedPajamaGithub


text:
package scaldi.jsr330;

import javax.inject.Qualifier;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Qualifier
@Retention(RetentionPolicy.RUNTIME)
public @interface TestQualifier {
    String value();
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _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; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _simpleAssign = require('simple-assign');

var _simpleAssign2 = _interopRequireDefault(_simpleAssign);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _transitions = require('../styles/transitions');

var _transitions2 = _interopRequireDefault(_transitions);

var _childUtils = require('../utils/childUtils');

var _colorManipulator = require('../utils/colorManipulator');

var _EnhancedButton = require('../internal/EnhancedButton');

var _EnhancedButton2 = _interopRequireDefault(_EnhancedButton);

var _FlatButtonLabel = require('./FlatButtonLabel');

var _FlatButtonLabel2 = _interopRequireDefault(_FlatButtonLabel);

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

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

function validateLabel(props, propName, componentName) {
  if (process.env.NODE_ENV !== 'production') {
    if (!props.children && props.label !== 0 && !props.label && !props.icon) {
      return new Error('Required prop label or children or icon was not specified in ' + componentName + '.');
    }
  }
}

var FlatButton = function (_Component) {
  _inherits(FlatButton, _Component);

  function FlatButton() {
    var _Object$getPrototypeO;

    var _temp, _this, _ret;

    _classCallCheck(this, FlatButton);

    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(FlatButton)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
      hovered: false,
      isKeyboardFocused: false,
      touch: false
    }, _this.handleKeyboardFocus = function (event, isKeyboardFocused) {
      _this.setState({ isKeyboardFocused: isKeyboardFocused });
      _this.props.onKeyboardFocus(event, isKeyboardFocused);
    }, _this.handleMouseEnter = function (event) {
      // Cancel hover styles for touch devices
      if (!_this.state.touch) _this.setState({ hovered: true });
      _this.props.onMouseEnter(event);
    }, _this.handleMouseLeave = function (event) {
      _this.setState({ hovered: false });
      _this.props.onMouseLeave(event);
    }, _this.handleTouchStart = function (event) {
      _this.setState({ touch: true });
      _this.props.onTouchStart(event);
    }, _temp), _possibleConstructorReturn(_this, _ret);
  }

  _createClass(FlatButton, [{
    key: 'componentWillReceiveProps',
    value: function componentWillReceiveProps(nextProps) {
      if (nextProps.disabled && this.state.hovered) {
        this.setState({
          hovered: false
        });
      }
    }
  }, {
    key: 'render',
    value: function render() {
      var _props = this.props;
      var children = _props.children;
      var disabled = _props.disabled;
      var hoverColor = _props.hoverColor;
      var backgroundColor = _props.backgroundColor;
      var icon = _props.icon;
      var label = _props.label;
      var labelStyle = _props.labelStyle;
      var labelPosition = _props.labelPosition;
      var primary = _props.primary;
      var rippleColor = _props.rippleColor;
      var secondary = _props.secondary;
      var style = _props.style;

      var other = _objectWithoutProperties(_props, ['children', 'disabled', 'hoverColor', 'backgroundColor', 'icon', 'label', 'labelStyle', 'labelPosition', 'primary', 'rippleColor', 'secondary', 'style']);

      var _context$muiTheme = this.context.muiTheme;
      var _context$muiTheme$but = _context$muiTheme.button;
      var buttonHeight = _context$muiTheme$but.height;
      var buttonMinWidth = _context$muiTheme$but.minWidth;
      var buttonTextTransform = _context$muiTheme$but.textTransform;
      var _context$muiTheme$fla = _context$muiTheme.flatButton;
      var buttonFilterColor = _context$muiTheme$fla.buttonFilterColor;
      var buttonColor = _context$muiTheme$fla.color;
      var disabledTextColor = _context$muiTheme$fla.disabledTextColor;
      var fontSize = _context$muiTheme$fla.fontSize;
      var fontWeight = _context$muiTheme$fla.fontWeight;
      var primaryTextColor = _context$muiTheme$fla.primaryTextColor;
      var secondaryTextColor = _context$muiTheme$fla.secondaryTextColor;
      var textColor = _context$muiTheme$fla.textColor;
      var _context$muiTheme$fla2 = _context$muiTheme$fla.textTransform;
      var textTransform = _context$muiTheme$fla2 === undefined ? buttonTextTransform || 'uppercase' : _context$muiTheme$fla2;

      var defaultTextColor = disabled ? disabledTextColor : primary ? primaryTextColor : secondary ? secondaryTextColor : textColor;

      var defaultHoverColor = (0, _colorManipulator.fade)(buttonFilterColor, 0.2);
      var defaultRippleColor = buttonFilterColor;
      var buttonHoverColor = hoverColor || defaultHoverColor;
      var buttonRippleColor = rippleColor || defaultRippleColor;
      var buttonBackgroundColor = backgroundColor || buttonColor;
      var hovered = (this.state.hovered || this.state.isKeyboardFocused) && !disabled;

      var mergedRootStyles = (0, _simpleAssign2.default)({}, {
        height: buttonHeight,
        lineHeight: buttonHeight + 'px',
        minWidth: buttonMinWidth,
        color: defaultTextColor,
        transition: _transitions2.default.easeOut(),
        borderRadius: 2,
        userSelect: 'none',
        position: 'relative',
        overflow: 'hidden',
        backgroundColor: hovered ? buttonHoverColor : buttonBackgroundColor,
        padding: 0,
        margin: 0,
        textAlign: 'center'
      }, style);

      var iconCloned = void 0;
      var labelStyleIcon = {};

      if (icon) {
        var iconStyles = (0, _simpleAssign2.default)({
          verticalAlign: 'middle',
          marginLeft: label && labelPosition !== 'before' ? 12 : 0,
          marginRight: label && labelPosition === 'before' ? 12 : 0
        }, icon.props.style);
        iconCloned = _react2.default.cloneElement(icon, {
          color: icon.props.color || mergedRootStyles.color,
          style: iconStyles
        });

        if (labelPosition === 'before') {
          labelStyleIcon.paddingRight = 8;
        } else {
          labelStyleIcon.paddingLeft = 8;
        }
      }

      var mergedLabelStyles = (0, _simpleAssign2.default)({
        letterSpacing: 0,
        textTransform: textTransform,
        fontWeight: fontWeight,
        fontSize: fontSize
      }, labelStyleIcon, labelStyle);

      var labelElement = label ? _react2.default.createElement(_FlatButtonLabel2.default, { label: label, style: mergedLabelStyles }) : undefined;

      // Place label before or after children.
      var childrenFragment = labelPosition === 'before' ? {
        labelElement: labelElement,
        iconCloned: iconCloned,
        children: children
      } : {
        children: children,
        iconCloned: iconCloned,
        labelElement: labelElement
      };

      var enhancedButtonChildren = (0, _childUtils.createChildFragment)(childrenFragment);

      return _react2.default.createElement(
        _EnhancedButton2.default,
        _extends({}, other, {
          disabled: disabled,
          focusRippleColor: buttonRippleColor,
          focusRippleOpacity: 0.3,
          onKeyboardFocus: this.handleKeyboardFocus,
          onMouseLeave: this.handleMouseLeave,
          onMouseEnter: this.handleMouseEnter,
          onTouchStart: this.handleTouchStart,
          style: mergedRootStyles,
          touchRippleColor: buttonRippleColor,
          touchRippleOpacity: 0.3
        }),
        enhancedButtonChildren
      );
    }
  }]);

  return FlatButton;
}(_react.Component);

FlatButton.muiName = 'FlatButton';
FlatButton.propTypes = {
  /**
   * Color of button when mouse is not hovering over it.
   */
  backgroundColor: _react.PropTypes.string,
  /**
   * This is what will be displayed inside the button.
   * If a label is specified, the text within the label prop will
   * be displayed. Otherwise, the component will expect children
   * which will then be displayed. (In our example,
   * we are nesting an `<input type="file" />` and a `span`
   * that acts as our label to be displayed.) This only
   * applies to flat and raised buttons.
   */
  children: _react.PropTypes.node,
  /**
   * Disables the button if set to true.
   */
  disabled: _react.PropTypes.bool,
  /**
   * Color of button when mouse hovers over.
   */
  hoverColor: _react.PropTypes.string,
  /**
   * The URL to link to when the button is clicked.
   */
  href: _react.PropTypes.string,
  /**
   * Use this property to display an icon.
   */
  icon: _react.PropTypes.node,
  /**
   * Label for the button.
   */
  label: validateLabel,
  /**
   * Place label before or after the passed children.
   */
  labelPosition: _react.PropTypes.oneOf(['before', 'after']),
  /**
   * Override the inline-styles of the button's label element.
   */
  labelStyle: _react.PropTypes.object,
  /**
   * Callback function fired when the element is focused or blurred by the keyboard.
   *
   * @param {object} event `focus` or `blur` event targeting the element.
   * @param {boolean} isKeyboardFocused Indicates whether the element is focused.
   */
  onKeyboardFocus: _react.PropTypes.func,
  /** @ignore */
  onMouseEnter: _react.PropTypes.func,
  /** @ignore */
  onMouseLeave: _react.PropTypes.func,
  /** @ignore */
  onTouchStart: _react.PropTypes.func,
  /**
   * If true, colors button according to
   * primaryTextColor from the Theme.
   */
  primary: _react.PropTypes.bool,
  /**
   * Color for the ripple after button is clicked.
   */
  rippleColor: _react.PropTypes.string,
  /**
   * If true, colors button according to secondaryTextColor from the theme.
   * The primary prop has precendent if set to true.
   */
  secondary: _react.PropTypes.bool,
  /**
   * Override the inline-styles of the root element.
   */
  style: _react.PropTypes.object
};
FlatButton.defaultProps = {
  disabled: false,
  labelStyle: {},
  labelPosition: 'after',
  onKeyboardFocus: function onKeyboardFocus() {},
  onMouseEnter: function onMouseEnter() {},
  onMouseLeave: function onMouseLeave() {},
  onTouchStart: function onTouchStart() {},
  primary: false,
  secondary: false
};
FlatButton.contextTypes = {
  muiTheme: _react.PropTypes.object.isRequired
};
exports.default = FlatButton;


text:
package com.example.fw;

import java.util.Properties;

import javax.mail.Flags;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Store;

public class MailHelper extends HelperBase {

	public MailHelper(ApplicationManager manager) {
		super(manager);
	}

	public Msg getNewMail(String user, String password) {
		Properties props = System.getProperties();
		Session session = Session.getDefaultInstance(props);

		Store store;
		try {
			store = session.getStore("pop3");
			store.connect(manager.getProperty("mailserver"), user, password);
			Folder folder = store.getDefaultFolder().getFolder("INBOX");
			folder.open(Folder.READ_WRITE);
			if (folder.getMessageCount() != 1) {
				return null;
			}
			Message message = folder.getMessage(1);

			message.setFlag(Flags.Flag.DELETED, true);
			Msg msg = new Msg((String) message.getContent());
			folder.close(true);
			store.close();

			return msg;

		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

}


text:
package macromedia.asc.embedding.avmplus;

import macromedia.asc.util.*;
import macromedia.asc.semantics.*;
import static macromedia.asc.semantics.Slot.*;
import static macromedia.asc.parser.Tokens.*;

/**
 * Package object builder.
 */
public class PackageBuilder extends Builder
{
    public PackageBuilder()
    {
    }

    public PackageBuilder(QName name)
    {
        classname = name;
    }

	public void build(Context cx, ObjectValue ob)
	{
		objectValue = ob;
		contextId = cx.getId();
		var_offset = 0;
		reg_offset = 1; // this, in init

		Builder globbui = new GlobalBuilder();
		globbui.build(cx, ob);
	}

    public int Variable( Context cx, ObjectValue ob )
    {

        // If building an intrinsic instance, then do nothing here.

        if( is_intrinsic )
        {
            return -1;
        }

        // front-end

        int var_id = super.Variable(cx,ob);

        // back-end

        return var_id;
    }

    public int Method(Context cx, ObjectValue ob, final String name, Namespaces namespaces)
    {
        return GetMethodId(cx,name,namespaces);
    }

	public int ExplicitCall( Context cx, ObjectValue ob, String name, Namespaces namespaces, TypeValue type, boolean is_final, boolean is_override, int expected_id)
	{
		return ExplicitCall(cx, ob, name, namespaces, type, is_final, is_override, expected_id, -1, -1);
	}

	public int ExplicitCall( Context cx, ObjectValue ob, String name, Namespaces namespaces, TypeValue type, boolean is_final, boolean is_override, int expected_id, int method_id , int var_id )
	{
		// Do the frontend binding
		TypeValue functionType = cx.useStaticSemantics() ? cx.functionType() : type;
		int slot_id = super.ExplicitGet(cx,ob,name,namespaces,functionType,true/*is_final*/,false/*is_override*/,expected_id,-1,var_id);
        ob.getSlot(cx, slot_id).setGetter(false);
		int implied_id = ob.addSlotImplicit(cx,slot_id,EMPTY_TOKEN,type);  // ISSUE: clean up

		Slot slot = ob.getSlot(cx,implied_id);
		ob.getSlot(cx,implied_id).attrs(CALL_ThisMethod,method_id);
		slot.setFinal(is_final);
		slot.setOverride(is_override);
		slot.setMethodName(classname+"$"+name);
		slot.setGetter(false);
							// this isn't right

		// do backend binding

		if( method_id >= 0 )
		{
			for (ObjectValue n : namespaces)
			{
				Name(cx,EMPTY_TOKEN,name,n);
			}
		}

		return slot_id;
	}
}


text:
SET(ENET_SEARCH_PATHS
    /usr/local/
    /usr
    /opt
)

FIND_PATH(ENET_INCLUDE_DIR enet/enet.h
    HINTS ${ENET_ROOT}
    PATH_SUFFIXES include include/enet
    PATHS ${ENET_SEARCH_PATHS}
)
FIND_LIBRARY(ENET_LIBRARY enet
    HINTS ${ENET_ROOT}
    PATH_SUFFIXES lib64 lib bin
    PATHS ${ENET_SEARCH_PATHS}
)

IF(ENET_INCLUDE_DIR AND ENET_LIBRARY)
   SET(ENET_FOUND TRUE)
ENDIF (ENET_INCLUDE_DIR AND ENET_LIBRARY)

IF(ENET_FOUND)
    MESSAGE(STATUS "Found ENet: ${ENET_LIBRARY}")
ELSE(ENET_FOUND)
    MESSAGE(WARNING "Could not find ENet")
ENDIF(ENET_FOUND)


text:
<?xml version="1.0" encoding="utf-8" ?>
<INTERACTIONS>
<INTERACTION>
<SOURCE>
<CLINICAL_SOURCE>ANSM</CLINICAL_SOURCE>
<SOURCE_FILE>500-TAMOXIFEN.html
</SOURCE_FILE>
</SOURCE>
<DRUG1>
<DRUG name="TAMOXIFEN" rxcui="10324">
<ATC code="L02BA01" />
</DRUG>
</DRUG1>
<DRUG2>
<CLASS name="VITAMIN K ANTAGONISTS" code="B01AA-001" /></DRUG2>
<DESCRIPTION>Risk of increase of the effect of the vitamin K antagonist and of the risk of hemorrhage</DESCRIPTION>
<SEVERITY>Precaution for use</SEVERITY>
<COMMENT>More frequent testing of the INR. Possible adjustment of the dosage of the vitamin K antagonist.</COMMENT>
</INTERACTION>
<INTERACTION>
<SOURCE>
<CLINICAL_SOURCE>ANSM</CLINICAL_SOURCE>
<SOURCE_FILE>500-TAMOXIFEN.html
</SOURCE_FILE>
</SOURCE>
<DRUG1>
<DRUG name="TAMOXIFEN" rxcui="10324">
<ATC code="L02BA01" />
</DRUG>
</DRUG1>
<DRUG2>
<DRUG name="BUPROPION" rxcui="42347">
<ATC code="N06AX12" />
</DRUG>
</DRUG2>
<DESCRIPTION>Risk of reduction of the effectiveness of the tamoxifen, due to inhibition of the formation of its active metabolite by the terbinafine [sic] </DESCRIPTION>
<SEVERITY>Not recommended</SEVERITY>
</INTERACTION>
<INTERACTION>
<SOURCE>
<CLINICAL_SOURCE>ANSM</CLINICAL_SOURCE>
<SOURCE_FILE>500-TAMOXIFEN.html
</SOURCE_FILE>
</SOURCE>
<DRUG1>
<DRUG name="TAMOXIFEN" rxcui="10324">
<ATC code="L02BA01" />
</DRUG>
</DRUG1>
<DRUG2>
<DRUG name="DULOXETINE" rxcui="72625">
<ATC code="N06AX21" />
</DRUG>
</DRUG2>
<DESCRIPTION>Risk of reduction of the effectiveness of the tamoxifen, due to inhibition of the formation of its active metabolite by the duloxetine</DESCRIPTION>
<SEVERITY>Not recommended</SEVERITY>
</INTERACTION>
<INTERACTION>
<SOURCE>
<CLINICAL_SOURCE>ANSM</CLINICAL_SOURCE>
<SOURCE_FILE>500-TAMOXIFEN.html
</SOURCE_FILE>
</SOURCE>
<DRUG1>
<DRUG name="TAMOXIFEN" rxcui="10324">
<ATC code="L02BA01" />
</DRUG>
</DRUG1>
<DRUG2>
<DRUG name="FLUOXETINE" rxcui="4493">
<ATC code="N06AB03" />
<ATC code="N06CA03" />
</DRUG>
</DRUG2>
<DESCRIPTION>Reduction of the effectiveness of the tamoxifen, due to inhibition of the formation of its active metabolite by the fluoxetine</DESCRIPTION>
<SEVERITY>Not recommended</SEVERITY>
</INTERACTION>
<INTERACTION>
<SOURCE>
<CLINICAL_SOURCE>ANSM</CLINICAL_SOURCE>
<SOURCE_FILE>500-TAMOXIFEN.html
</SOURCE_FILE>
</SOURCE>
<DRUG1>
<DRUG name="TAMOXIFEN" rxcui="10324">
<ATC code="L02BA01" />
</DRUG>
</DRUG1>
<DRUG2>
<DRUG name="PAROXETINE" rxcui="32937">
<ATC code="N06AB05" />
</DRUG>
</DRUG2>
<DESCRIPTION>Reduction of the effectiveness of the tamoxifen, due to inhibition of the formation of its active metabolite by the paroxetine</DESCRIPTION>
<SEVERITY>Not recommended</SEVERITY>
</INTERACTION>
<INTERACTION>
<SOURCE>
<CLINICAL_SOURCE>ANSM</CLINICAL_SOURCE>
<SOURCE_FILE>500-TAMOXIFEN.html
</SOURCE_FILE>
</SOURCE>
<DRUG1>
<DRUG name="TAMOXIFEN" rxcui="10324">
<ATC code="L02BA01" />
</DRUG>
</DRUG1>
<DRUG2>
<DRUG name="QUINIDINE" rxcui="9068">
<ATC code="C01BA01" />
</DRUG>
</DRUG2>
<DESCRIPTION>Risk of reduction of the effectiveness of the tamoxifen, due to inhibition of the formation of its active metabolite by the quinidine</DESCRIPTION>
<SEVERITY>Not recommended</SEVERITY>
</INTERACTION>
<INTERACTION>
<SOURCE>
<CLINICAL_SOURCE>ANSM</CLINICAL_SOURCE>
<SOURCE_FILE>500-TAMOXIFEN.html
</SOURCE_FILE>
</SOURCE>
<DRUG1>
<DRUG name="TAMOXIFEN" rxcui="10324">
<ATC code="L02BA01" />
</DRUG>
</DRUG1>
<DRUG2>
<DRUG name="TERBINAFINE" rxcui="37801">
<ATC code="D01AE15" />
<ATC code="D01BA02" />
</DRUG>
</DRUG2>
<DESCRIPTION>Risk of reduction of the effectiveness of the tamoxifen, due to inhibition of the formation of its active metabolite by the terbinafine</DESCRIPTION>
<SEVERITY>Not recommended</SEVERITY>
</INTERACTION>
</INTERACTIONS>


text:
// Copyright 2018 Google LLC
//
// 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 com.google.location.suplclient.asn1.supl2.rrlp_components;

// Copyright 2008 Google Inc. All Rights Reserved.
/*
 * This class is AUTOMATICALLY GENERATED. Do NOT EDIT.
 */

//
//
import com.google.location.suplclient.asn1.base.Asn1SequenceOf;
import com.google.location.suplclient.asn1.base.Asn1Tag;
import com.google.location.suplclient.asn1.base.BitStream;
import com.google.location.suplclient.asn1.base.BitStreamReader;
import com.google.common.collect.ImmutableList;
import java.util.Collection;
import javax.annotation.Nullable;

/**
 *
 */
public  class SeqOfBadSignalElement
    extends Asn1SequenceOf<BadSignalElement> {
  //

  private static final Asn1Tag TAG_SeqOfBadSignalElement
      = Asn1Tag.fromClassAndNumber(-1, -1);

  public SeqOfBadSignalElement() {
    super();
    setMinSize(1);
setMaxSize(16);

  }

  @Override
  @Nullable
  protected Asn1Tag getTag() {
    return TAG_SeqOfBadSignalElement;
  }

  @Override
  protected boolean isTagImplicit() {
    return true;
  }

  public static Collection<Asn1Tag> getPossibleFirstTags() {
    if (TAG_SeqOfBadSignalElement != null) {
      return ImmutableList.of(TAG_SeqOfBadSignalElement);
    } else {
      return Asn1SequenceOf.getPossibleFirstTags();
    }
  }

  /**
   * Creates a new SeqOfBadSignalElement from encoded stream.
   */
  public static SeqOfBadSignalElement fromPerUnaligned(byte[] encodedBytes) {
    SeqOfBadSignalElement result = new SeqOfBadSignalElement();
    result.decodePerUnaligned(new BitStreamReader(encodedBytes));
    return result;
  }

  /**
   * Creates a new SeqOfBadSignalElement from encoded stream.
   */
  public static SeqOfBadSignalElement fromPerAligned(byte[] encodedBytes) {
    SeqOfBadSignalElement result = new SeqOfBadSignalElement();
    result.decodePerAligned(new BitStreamReader(encodedBytes));
    return result;
  }

  @Override public BadSignalElement createAndAddValue() {
    BadSignalElement value = new BadSignalElement();
    add(value);
    return value;
  }

  @Override public Iterable<BitStream> encodePerUnaligned() {
    return super.encodePerUnaligned();
  }

  @Override public Iterable<BitStream> encodePerAligned() {
    return super.encodePerAligned();
  }

  @Override public void decodePerUnaligned(BitStreamReader reader) {
    super.decodePerUnaligned(reader);
  }

  @Override public void decodePerAligned(BitStreamReader reader) {
    super.decodePerAligned(reader);
  }

  @Override public String toString() {
    return toIndentedString("");
  }

  public String toIndentedString(String indent) {
    StringBuilder builder = new StringBuilder();
    builder.append("SeqOfBadSignalElement = [\n");
    final String internalIndent = indent + "  ";
    for (BadSignalElement value : getValues()) {
      builder.append(internalIndent)
          .append(value.toIndentedString(internalIndent));
    }
    builder.append(indent).append("];\n");
    return builder.toString();
  }
}


text:
require 'income_tax/countries/united_states'

module IncomeTax
  module Countries
    class VirginIslandsUs < Models::Delegate(UnitedStates)
      register 'Virgin Islands, U.S.', 'Virgin Islands (U.S.)', 'VI', 'VIR'
      currency 'USD'
    end
  end
end


text:
@font-face {
    font-family: Minion Pro;
    src: url(../font/MinionPro-Regular.otf), url(../font/MinionPro-Regular.ttf);
}

@font-face {
    font-family: Arizonia-Regular;
    src: url(../font/Arizonia-Regular.otf), url(../font/Arizonia-Regular.ttf);
}

@font-face {
    font-family: Optima Cyr;
    src: url(../font/Optima-Cyr-Regular.otf), url(../font/Optima-Cyr-Regular.ttf);
}

@font-face {
    font-family: Optima;
    src: url(../font/Optima-Bold_34072_2.otf), url(../font/Optima-Bold_34072_2.ttf);
}

html,
body {
    height: 100%;
    background-image: url('../img/smoke-main.png');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: bottom right;
}

header {
    background-image: url('../img/smoke.png');
    background-size: cover;
    width: 100%;
    min-width: 1100px;
    height: 160px;
    padding: 30px 40px 30px 40px;
    position: relative;
    border-bottom: solid 10px #e6e6e6;
}

.logo-container {
    position: relative;
}

.logo {
    height: 100px;
    width: auto;
    display: inline-block;
    vertical-align: inherit;
}

.company {
    height: 100px;
    width: auto;
    display: inline-block;
}

.company-about {
    font-size: 15px;
    font-family: "Optima Cyr";
    color: rgb(0, 0, 0);
    text-align: right;
}

.company-number-container {
    height: 100px;
    width: auto;
    display: inline-block;
    vertical-align:top;
    position: absolute;
    bottom: 0px;
    right: 0px;
}

.company-number {
    height: 70px;
    margin: 0;
    padding-top: 5px;
    font-size: 70px;
    font-family: Arizonia-Regular;
    color: rgb(66, 0, 109);
    text-align: right;
}

.company-address {
    margin-top: 12px;
}

.wrap {
    min-height: 100%;
    height: auto;
    margin: 0 auto -60px;
    padding: 0 0 60px;
}

.wrap > .container {
    padding: 70px 15px 20px;
}

.navbar-custom {
    position: relative;
    height: 50px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.navbar {
    min-height: 40px !important;
    margin-bottom: 0px !important;
    height: 40px;
    width: 100%;
    background-color: #691d9a;
    background: -moz-linear-gradient(top,  #691d9a 20px, #8c28cc 20px) !important;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(50%,#691d9a), color-stop(50%,#8c28cc)) !important;
    background: -webkit-linear-gradient(top,  #691d9a 20px,#8c28cc 20px) !important;
    background: -o-linear-gradient(top,  #691d9a 20px,#8c28cc 20px) !important;
    background: -ms-linear-gradient(top,  #691d9a 20px,#8c28cc 20px) !important;
    background: linear-gradient(top,  #691d9a 20px,#8c28cc 20px) !important;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

a {
    color: #ffffff !important;
    font-family: Optima;
    padding: 5px 10px !important;
    font-size: 20px;
}

.nav .open > a {
    background-color: #8c28cc !important;
}

a:active, a:hover, a:focus {
    background-color: #8c28cc !important;
}

a.a-main:hover{
    background-color: transparent !important;
}

a.no-bckg:hover, a.no-bckg:focus, a.no-bckg:active{
    background-color: transparent !important;
}

.dropdown-menu > .active > a, .dropdown-menu > .active > a:focus {
    color: #8c28cc !important;
    text-decoration: inherit !important;
    background-color: white !important;
    outline: 0 !important;
}

.dropdown-menu > li > a:hover {
    background-color: white !important;
    text-decoration: underline !important;
}

.dropdown-menu > .active > a:hover {
    color: #8c28cc !important;
    text-decoration: underline !important;
    background-color: white !important;
    outline: 0 !important;
}

.dropdown-menu > li > a {
    color: #8c28cc !important;
}

.nav li.active a, .nav li.active a:hover  {
    background-color: #8c28cc !important;
    color: white!important;
}

.carousel-container {
    min-height: 680px;
    padding: 60px 0px 20px;
    position: relative;
    height: 680px;
    background-color: #e6e6e6;
}

.carousel {
    background-color: #e6e6e6 !important;
}

div.carousel-inner {
    border-color: #e6e6e6 !important;
}

.carousel-inner-object {
    height: 600px;
    width: auto;
}

.carousel-inner > .item > img {
    margin: 0 100px 0 auto;
}

.company-info-container {
    background-color: rgb(105, 29, 154);
    opacity: 0.8;
    position: absolute;
    height: 450px;
    width: 600px;
    padding: 20px 30px 20px 40px;
    top: 20%;
    left: 10%;
}

.company-info-header {
    font-size: 60px;
    font-family: Optima;
    color: rgb(255, 255, 255);
    font-weight: bold;
    text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.004);
    position: relative;
    margin: 0;
    padding: 0 0 0 2px;
}

.company-info-text {
    font-size: 14px;
    font-family: "Optima Cyr";
    color: rgb(255, 255, 255);
    text-align: left;
    text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.004);
}

a.carousel-control:hover, a.carousel-control:focus {
    background-color: transparent !important;
}

.menu-container {
    min-width: 840px;
    width: 60%;
    height: 150px;
    padding: 0;
    position: absolute;
    border-bottom: 10px solid #691d9a;
    top: 90%;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    background-image: -moz-linear-gradient( 90deg, rgb(137,137,137) 0%, rgb(137,137,137) 0%, rgb(215,215,215) 10%, rgb(255,255,255) 100%);
    background-image: -webkit-linear-gradient( 90deg, rgb(137,137,137) 0%, rgb(137,137,137) 0%, rgb(215,215,215) 10%, rgb(255,255,255) 100%);
    background-image: -ms-linear-gradient( 90deg, rgb(137,137,137) 0%, rgb(137,137,137) 0%, rgb(215,215,215) 10%, rgb(255,255,255) 100%);
    box-shadow: 0px 23px 23px 0px rgba(0, 0, 0, 0.16);
}

.menu-block {
    height:100px;
    width: auto;
    padding: 20px 10px;
    display: inline-block;
    margin: 0;
    vertical-align: middle;
    float: left;
    position: relative;
}

.menu-block-title{
    font-size: 30px;
    font-family: Optima;
    color: rgb(102, 0, 153);
    font-weight: bold;
    text-align: center;
    padding: 0;
    margin: 0;
}

#learn-more {
    font-size: 15px;
    font-family: Tahoma;
    color: rgb(0, 0, 0);
    text-align: left;
    display: inline-block;
    padding-right: 20px;
}

#learn-more-button {
    background-color: #691d9a;
    text-align: center;
    padding: 0 7px;
    color: white;
    display: inline-block;
}

#learn-more-link{
    display: table;
    margin: auto;
}

#learn-more-link:hover{
    text-decoration: none !important;
}

#learn-more-link:active, #learn-more-link:focus{
    background-color: transparent!important;
}

.learn-more-link:hover, .learn-more-link:active{
    background-color: transparent!important;
}

#learn-more:hover + #learn-more-button, #learn-more-button:hover, #learn-more-link:hover + #learn-more-button {
    background-color: #bc04b8!important;
}

.footer {
    height: 210px;
    background-color: #e8e8e8;
    border-top: 1px solid #ddd;
    padding: 0;
    margin: 0;
    position: relative;
    min-width: 1038px;
}

.bluezed-scroll-top:hover, .bluezed-scroll-top:active, .bluezed-scroll-top:focus{
    background-color: transparent !important;
}

.bluezed-scroll-top-circle {
    width: 50px!important;
    height: 50px!important;
    padding-top: 13px!important;
}

.social-container {
    padding: 10px 40px 10px;
    display: inline-block;
    margin-left: 0;
    margin-right: auto;
    margin-top: 0;
}

.social-network-pre {
    font-size: 25px;
    font-family: Optima Cyr;
    color: rgb(105, 29, 154);
    text-align: center;
}

.social-network-img {
    margin: auto;
}

.social-network-magic {
    font-size: 30px;
}

.social-network-link {
    height: 60px;
    width: 60px;
    padding: 15px !important;
    border-radius: 50%;
    background-color: #691d9a;
    margin: 15px;
    display: inline-table;
}

.social-network-link:hover {
    background-color: #bc04b8;
}

.company-map {
    height: inherit;
    width: 300px;
    height: auto;
    display: inline-block;
}

.company-map-link {
    float: right;
    margin-right: 60px;
}

.company-map-link:hover {
    background-color: transparent !important;
}

.jumbotron {
    text-align: center;
    background-color: transparent;
}

.jumbotron .btn {
    font-size: 21px;
    padding: 14px 24px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

.main-content {
    min-width: 840px!important;
    width: 60%!important;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    margin-top: 150px;
    padding: 0 !important;
}

.content-title-container {
    width: 100%;
    height:30px;
    background-color: #691d9a;
    background: -moz-linear-gradient(top,  #691d9a 15px, #8c28cc 15px) !important;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(50%,#691d9a), color-stop(50%,#8c28cc)) !important;
    background: -webkit-linear-gradient(top,  #691d9a 15px,#8c28cc 15px) !important;
    background: -o-linear-gradient(top,  #691d9a 15px,#8c28cc 15px) !important;
    background: -ms-linear-gradient(top,  #691d9a 15px,#8c28cc 15px) !important;
    background: linear-gradient(top,  #691d9a 15px,#8c28cc 15px) !important;
}

.content-title {
    font-size: 25px;
    font-family: "Optima Cyr";
    color: rgb(242, 242, 242);
    text-align: left;
    padding-top: 2px;
    padding-left: 20px;
    vertical-align: bottom;
}

.learn-courses {
    border: 1px solid #691d9a;
    border-radius: 3px;
    margin: 0 0 0 auto!important;
    background-color: white;
}

.learn-courses:hover {
    background-color: white!important;
}

.about-title-container {
    width: 100%;
    height: 45px;
    margin-top: 20px;
    border-bottom: 10px solid #691d9a;
    margin-bottom: 20px;
    background-color: white;
}

.about-title {
    font-size: 35px;
    font-family: "Optima Cyr";
    color: rgb(27, 0, 49);
    margin: 0;
}

.about-content{
    padding-left: 3px;
    font-size: 15px;
    font-family: "Optima Cyr";
    color: rgb(0, 0, 0);
}

/*rules*/

.rules-list {
    font-family: "Optima Cyr";
    font-size: 20px;
    color: #691d9a;
}

.rules-list-element {
    font-family: "Optima Cyr";
    font-size: 15px;
    color: rgb(27, 0, 49);
    margin: 0;
}

/*store*/

.product {
    width: 100%;
    background-color: white;
    height: 250px;
    position: relative;
    display: inline-block;
    margin-top: 20px;
}

.product-picture-container {
    position: absolute;
    float: left;
    width: 33%;
    background-color: #e6cdf5;
    display: inline-block;
    height: 250px;
    position: relative;
}

.product-picture{
    height: 175px;
    width: auto;
    display: block;
    margin: 37.5px auto;
}

.product-description-container{
    position: absolute;
    float: right;
    display: inline-block;
    width: 64%;
    height: 250px;
    margin: 0 2%
}

.product-title-container{
    height: 30px;
    border-bottom: 3px dashed #691d9a;
}

.product-text{
    height: 120px;
    width: auto;
    margin: 20px 10% 0;
}

/*trainers*/
.trainer-container{
    width: 100%;
    margin: 40px 0;
}

.trainer-name{
    color: #691d9a;
    font-size: 20px;
    text-align: center;
}

.trainer {
    position: relative;
    min-height: 520px;
    height: auto;
    width: 30%;
    background-color: #e7e7e7;
    display: inline-block;
    vertical-align: top;
}

.trainer-photo{
    width:90%;
    height: auto;
    margin: auto;
    margin-top: 10px;
    border: 2px solid #691d9a;
    border-radius: 50%;
    display: block;
}

.trainer-detailed-photo-container {
    width: 33%;
    background-color: #e6cdea;
    height: auto;
    display: inline-block;
    vertical-align: top;
}

.trainer-detailed-photo{
    width: 90%;
    display: block;
    margin: 10px auto;
}

.trainer-detailed-info{
    display: inline-block;
    width: 60%;
    margin: 20px 3%;
    vertical-align: top;
    font-size: 20px;
    font-family: "Optima Cyr"!important;
}

.more-button {
    position: absolute!important;
    width: 70%;
    display: block;
    bottom: 5px;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    border-color: #691d9a;
    font-family: "Optima Cyr";
}

.more-button:hover{
    border-color: #bc04b8;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    position: relative;
    top: 1px;
    display: inline-block;
    font-family: 'Glyphicons Halflings';
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    padding-left: 5px;
}

a.asc:after {
    content: /*"\e113"*/ "\e151";
}

a.desc:after {
    content: /*"\e114"*/ "\e152";
}

.sort-numerical a.asc:after {
    content: "\e153";
}

.sort-numerical a.desc:after {
    content: "\e154";
}

.sort-ordinal a.asc:after {
    content: "\e155";
}

.sort-ordinal a.desc:after {
    content: "\e156";
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

.close{
    /*display: none!important;*/
}

.gallery-item{
    padding: 0!important;
}

.gallery-item:hover{
    background-color: transparent!important;
}

.page-button-all {
    background-color: #691d9a;
    color: white;
}

.page-button-all-link {
    background-color: inherit!important;
    color: inherit!important;
}

.page-button-all-link:active, page-button-all-link:focus{
    background-color:inherit!important;
}

.page-button-active {
    background-color: #bc04b8!important;
}

.next-page-button, .prev-page-button {
    color: grey;
}

.slick-prev, .slick-prev:focus, .slick-prev:active, .slick-next, .slick-next:focus, .slick-next:active{
    color: black!important;
    width: 90px!important;
    height: 90px!important;
    background-color: #691d9a!important;
    border-radius: 50%!important;
}

.slick-prev:hover, .slick-next:hover{
    background-color: #bc04b8!important;
}

.slick-list{
    width: 560px!important;
    display: block;
    margin: auto!important;
}

.slick-initialized {
    padding: 0!important;
    width: 100%!important;
}

span{
    height: 40px!important;
}

#w0, #w1{
    margin-bottom: 100px;
}

.news-date {
    font-family: "Optima Cyr";
    text-align: center;
    font-size: 20px;
    color: black;
}

.news-picture{
    height: auto;
    width: auto;
    max-width: 100%;
    max-height: 260px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: auto;
    margin-bottom: auto;
    padding: 0 5px;
}
/* align the logout "link" (button in form) of the navbar */

@media(max-width:767px) {
    .navbar-header {
        float: left;
    }

    .navbar {
        border-radius: 4px;
        min-width: 1038px;
    }

    .nav-justified > li {
        display: inline-block;
        width: auto;
    }
    .nav-justified > li > a {
        margin-bottom: 0;
    }

    .nav > li {
        display: inline-block!important;
    }

    .nav-tabs.nav-justified > li > a {
        border-bottom: 1px solid #ddd;
        border-radius: 4px 4px 0 0;
    }
    .nav-tabs.nav-justified > .active > a,
    .nav-tabs.nav-justified > .active > a:hover,
    .nav-tabs.nav-justified > .active > a:focus {
        border-bottom-color: #fff;
    }

    .nav-tabs.nav-justified > li {
        display: inline-block;
        width: auto;
    }
    .nav-tabs.nav-justified > li > a {
        margin-bottom: 0;
    }

    .navbar-right .dropdown-menu {
        right: 0;
        left: auto;
    }
    .navbar-right .dropdown-menu-left {
        right: auto;
        left: 0;
    }
    .container {
        min-width: 1038px;
    }

    .navbar-collapse {
        width: auto;
        border-top: 0;
        box-shadow: none;
    }
    .navbar-collapse.collapse {
        display: block !important;
        height: auto !important;
        padding-bottom: 0;
        overflow: visible !important;
    }
    .navbar-collapse.in {
        overflow-y: visible;
    }
    .navbar-fixed-top .navbar-collapse,
    .navbar-static-top .navbar-collapse,
    .navbar-fixed-bottom .navbar-collapse {
        padding-right: 0;
        padding-left: 0;
    }

    .container > .navbar-header,
    .container-fluid > .navbar-header,
    .container > .navbar-collapse,
    .container-fluid > .navbar-collapse {
        margin-right: 0;
        margin-left: 0;
    }

    .navbar-static-top {
        border-radius: 0;
    }

    .navbar-fixed-top,
    .navbar-fixed-bottom {
        border-radius: 0;
    }

    .navbar-toggle {
        display: none;
    }

    .navbar-nav {
        float: left;
        margin: 0;
    }
    .navbar-nav > li {
        float: left;
    }
    .navbar-nav > li > a {
        padding-top: 15px;
        padding-bottom: 15px;
    }
    .navbar-nav.navbar-right:last-child {
        margin-right: -15px;
    }

    .navbar-left {
        float: left !important;
    }
    .navbar-right {
        float: right !important;
    }

    .navbar-form .form-group {
        display: inline-block;
        margin-bottom: 0;
        vertical-align: middle;
    }
    .navbar-form .form-control {
        display: inline-block;
        width: auto;
        vertical-align: middle;
    }
    .navbar-form .control-label {
        margin-bottom: 0;
        vertical-align: middle;
    }
    .navbar-form .radio,
    .navbar-form .checkbox {
        display: inline-block;
        padding-left: 0;
        margin-top: 0;
        margin-bottom: 0;
        vertical-align: middle;
    }
    .navbar-form .radio input[type="radio"],
    .navbar-form .checkbox input[type="checkbox"] {
        float: none;
        margin-left: 0;
    }
    .navbar-form .has-feedback .form-control-feedback {
        top: 0;
    }

    .navbar-form {
        width: auto;
        padding-top: 0;
        padding-bottom: 0;
        margin-right: 0;
        margin-left: 0;
        border: 0;
        -webkit-box-shadow: none;
        box-shadow: none;
    }
    .navbar-form.navbar-right:last-child {
        margin-right: -15px;
    }

    .navbar-text {
        float: left;
        margin-right: 15px;
        margin-left: 15px;
    }
    .navbar-text.navbar-right:last-child {
        margin-right: 0;
    }
}


text:
.. _nv43-therm:

============================
NV43:G80 thermal monitoring
============================

.. contents::

Introduction
============

THERM is an area present in PBUS on NV43:G80 GPUs. This area is reponsible
for temperature monitoring, probably on low-end and middle-range GPUs since
high-end cards have been using LM89/ADT7473 for a long time.
Beside some configuration knobs, THERM can generate IRQs to the HOST when the
temperature goes over a configurable ALARM threshold or outside a configurable
temperature range. This range has been replaced by PTHERM on G80+ GPUs.

THERM's MMIO range is 0x15b0:0x15c0. There are two major variants of this range:

- NV43:G70
- G70:G80

.. _nv43-therm-mmio:

MMIO register list
==================

======== =========== ========== ============
Address  Present on  Name       Description
======== =========== ========== ============
0x0015b0 all         CFG0       sensor enable / IRQ enable / ALARM configuration
0x0015b4 all         STATUS     sensor state / ALARM state / ADC rate configuration
0x0015b8 non-IGP     CFG1       misc. configuration
0x0015bc all         TEMP_RANGE LOW and HIGH temperature thresholds
======== =========== ========== ============

MMIO 0x15b0: CFG0 [NV43:G70]
  - bits 0-7: ALARM_HIGH
  - bits 16-23: SENSOR_OFFSET (signed integer)
  - bit 24: DISABLE
  - bit 28: ALARM_INTR_EN

MMIO 0x15b0: CFG0 [G70:G80]
  - bits 0-13: ALARM_HIGH
  - bits 16-29: SENSOR_OFFSET (signed integer)
  - bit 30: DISABLE
  - bit 31: ENABLE

MMIO 0x15b4: STATUS [NV43:G70]
  - bits 0-7: SENSOR_RAW
  - bit 8: ALARM_HIGH
  - bits 25-31: ADC_CLOCK_XXX

.. todo:: figure out what divisors are available

MMIO 0x15b4: STATUS [G70:G80]
  - bits 0-13: SENSOR_RAW
  - bit 16: ALARM_HIGH
  - bits 26-31: ADC_CLOCK_DIV
    The division is stored right-shifted 4. The possible division values range
    from 32 to 2016 with the possibility to completely bypass the divider.

MMIO 0x15b8: CFG1 [NV43:G70]
  - bit 17: ADC_PAUSE
  - bit 23: CONNECT_SENSOR

MMIO 0x15bc: TEMP_RANGE [NV43:G70]
  - bits 0-7: LOW
  - bits 8-15: HIGH

MMIO 0x15bc: TEMP_RANGE [G70:G80]
  - bits 0-13: LOW
  - bits 16-29: HIGH

The ADC clock
=============

The source clock for THERM's ADC is:

- NV43:G70: the host clock
- G70:G80: constant (most likely hclck)

(most likely, since the rate doesn't change when I change the HOST clock)

Before reaching the ADC, the clock source is divided by a fixed divider of 1024
and then by ADC_CLOCK_DIV.

MMIO 0x15b4: STATUS [NV43:G70]
  - bits 25-31: ADC_CLOCK_DIV

.. todo:: figure out what divisors are available

MMIO 0x15b4: STATUS [G70:G80]
  - bits 26-31: ADC_CLOCK_DIV
    The division is stored right-shifted 4. The possible division values range
    from 32 to 2016 with the possibility to completely bypass the divider.

The final ADC clock is:

ADC_clock = source_clock / ADC_CLOCK_DIV

The accuracy of the reading greatly depends on the ADC clock. A clock too fast
will produce a lot of noise. A clock too low may actually produce an offseted
value. The ADC clock rate under 10 kHz is advised, based on limited testing
on a G73.

.. todo:: Make sure this clock range is safe on all cards

Anyway, it seems like it is clocked at an acceptable frequency at boot time,
so, no need to worry too much about it.

Reading temperature
===================

Temperature is read from:

MMIO 0x15b4: STATUS [NV43:G70]
  bits 0-7: SENSOR_RAW
MMIO 0x15b4: STATUS [G70:G80]
  bits 0-13: SENSOR_RAW

SENSOR_RAW is the result of the (signed) addition of the actual value read by
the ADC and SENSOR_OFFSET:

MMIO 0x15b0: CFG0 [NV43:G70]
  - bits 16-23: SENSOR_OFFSET signed

MMIO 0x15b0: CFG0 [G70:G80]
  - bits 16-29: SENSOR_OFFSET signed

Starting temperature readouts requires to flip a few switches that are
GPU-dependent:

MMIO 0x15b0: CFG0 [NV43:G70]
  - bit 24: DISABLE

MMIO 0x15b0: CFG0 [G70:G80]
  - bit 30: DISABLE - mutually exclusive with ENABLE
  - bit 31: ENABLE - mutually exclusive with DISABLE

MMIO 0x15b8: CFG1 [NV43:G70]
  - bit 17: ADC_PAUSE
  - bit 23: CONNECT_SENSOR

Both DISABLE and ADC_PAUSE should be clear. ENABLE and CONNECT_SENSOR should be set.

.. todo:: There may be other switches.

Setting up thresholds and interrupts
====================================

.. _nv43-therm-intr-alarm:

Alarm
-----

THERM features the ability to set up an alarm that will trigger interrupt
PBUS #16 when SENSOR_RAW > ALARM_HIGH. NV43-47 GPUs require ALARM_INTR_EN
to be set in order to get the IRQ. You may need to set bits 0x40001 in 0x15a0
and 1 in 0x15a4. Their purpose has not been understood yet even though they
may be releated to automatic downclocking.

MMIO 0x15b0: CFG0 [NV43:G70]
  - bits 0-7: ALARM_HIGH
  - bit 28: ALARM_INTR_EN

MMIO 0x15b0: CFG0 [G70:G80]
  - bits 0-13: ALARM_HIGH

When SENSOR_RAW > ALARM_HIGH, STATUS.ALARM_HIGH is set.

MMIO 0x15b4: STATUS [NV43:G70]
  - bit 8: ALARM_HIGH

MMIO 0x15b4: STATUS [G70:G80]
  - bit 16: ALARM_HIGH

STATUS.ALARM_HIGH is unset as soon as SENSOR_RAW < ALARM_HIGH, without any
hysteresis cycle.

.. _nv43-therm-intr-range:

Temperature range
-----------------

THERM can check that temperature is inside a range. When the temperature goes
outside this range, an interrupt is sent. The range is defined in the register
TEMP_RANGE where the thresholds LOW and HIGH are set.

MMIO 0x15bc: TEMP_RANGE [NV43:G70]
  - bits 0-7: LOW
  - bits 8-15: HIGH

MMIO 0x15bc: TEMP_RANGE [G70:G80]
  - bits 0-13: LOW
  - bits 16-29: HIGH

When SENSOR_RAW < TEMP_RANGE.LOW, interrupt PBUS #17 is sent.
When SENSOR_RAW > TEMP_RANGE.HIGH, interrupt PBUS #18 is sent.

There are no hyteresis cycles on these thresholds.

Extended configuration
======================

.. todo:: Document reg 15b8


text:
import ctypes
import json
import os
import subprocess

from twitter.common import log

from gen.apache.aurora.api.constants import TASK_FILESYSTEM_MOUNT_POINT

def is_launch_info_supported(mesos_containerizer_path):
  process = subprocess.Popen(
          [mesos_containerizer_path, 'launch'],
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE)

  _, stderr = process.communicate()
  if "launch_info" in stderr:
    return True

  return False

def wrap_with_mesos_containerizer(cmdline, user, cwd, mesos_containerizer_path):
  command_info = {
    'shell': False,
    'value': '/bin/bash',  # the binary to executed
    'arguments': [
      '/bin/bash',  # the name of the called binary as passed to the launched process
      '-c',
      cmdline
    ]
  }

  rootfs = os.path.join(os.environ['MESOS_DIRECTORY'], TASK_FILESYSTEM_MOUNT_POINT)

  launch_info = {
    'rootfs': rootfs,
    'user': str(user),
    'working_directory': cwd,
    'command': command_info
  }

  # TODO(santhk) it is unfortunate that we will need to check the
  # interface of mesos-containerizer like this. Clean this up when we have
  # migrated to Mesos-1.2.0.
  if is_launch_info_supported(mesos_containerizer_path):
    return [mesos_containerizer_path,
      'launch',
      '--unshare_namespace_mnt',
      '--launch_info=%s' % json.dumps(launch_info)]
  else:
    return [mesos_containerizer_path,
      'launch',
      '--unshare_namespace_mnt',
      '--working_directory=%s' % cwd,
      '--rootfs=%s' % rootfs,
      '--user=%s' % user,
      '--command=%s' % json.dumps(command_info)]

def setup_child_subreaping():
  """
  This uses the prctl(2) syscall to set the `PR_SET_CHILD_SUBREAPER` flag. This
  means if any children processes need to be reparented, they will be reparented
  to this process.

  More documentation here: http://man7.org/linux/man-pages/man2/prctl.2.html
  and here: https://lwn.net/Articles/474787/

  Callers should reap terminal children to prevent zombies.
  """
  log.debug("Calling prctl(2) with PR_SET_CHILD_SUBREAPER")
  # This constant is taken from prctl.h
  PR_SET_CHILD_SUBREAPER = 36
  try:
    library_name = ctypes.util.find_library('c')
    if library_name is None:
      log.warning("libc is not found. Unable to call prctl!")
      log.warning("Children subreaping is disabled!")
      return
    libc = ctypes.CDLL(library_name, use_errno=True)
    # If we are on a system where prctl doesn't exist, this will throw an
    # attribute error.
    ret = libc.prctl(PR_SET_CHILD_SUBREAPER, 1, 0, 0, 0)
    if ret != 0:
      errno = ctypes.get_errno()
      raise OSError(errno, os.strerror(errno))
  except Exception as e:
    log.error("Unable to call prctl %s" % e)
    log.error("Children subreaping is disabled!")


text:
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms, it was developed by the Legion of the Bouncy Castle, a registered Australian Charity, with a little help! The Legion, and the latest goings on with this package, can be found at [http://www.bouncycastle.org](http://www.bouncycastle.org).

The Legion also gratefully acknowledges the contributions made to this package by others (see [here](http://www.bouncycastle.org/contributors.html) for the current list). If you would like to contribute to our efforts please feel free to get in touch with us or visit our [donations page](https://www.bouncycastle.org/donate), sponsor some specific work, or purchase a support contract through [Crypto Workshop](http://www.cryptoworkshop.com).

The package is organised so that it contains a light-weight API suitable for use in any environment (including the newly released J2ME) with the additional infrastructure to conform the algorithms to the JCE framework.

Except where otherwise stated, this software is distributed under a license based on the MIT X Consortium license. To view the license, [see here](http://www.bouncycastle.org/licence.html). The OpenPGP library also includes a modified BZIP2 library which is licensed under the [Apache Software License, Version 2.0](http://www.apache.org/licenses/).

**Note**: this source tree is not the FIPS version of the APIs - if you are interested in our FIPS version please contact us directly at  [office@bouncycastle.org](mailto:office@bouncycastle.org).

## Code Organisation

The clean room JCE, for use with JDK 1.1 to JDK 1.3 is in the jce/src/main/java directory.

The **core** module provides all the functionality in the ligthweight APIs.

The **prov** module provides all the JCA/JCE provider functionality.

The **pkix** module is the home for code for X.509 certificate generation and the APIs for standards that rely on ASN.1 such
as CMS, TSP, PKCS#12, OCSP, CRMF, and CMP.

The **mail** module provides an S/MIME API built on top of CMS.

The **pg** module is the home for code used to support OpenPGP.

The build scripts that come with the full distribution allow creation of the different releases by using the different source trees while excluding classes that are not appropriate and copying in the required compatibility classes from the directories containing compatibility classes appropriate for the distribution.

If you want to try create a build for yourself, using your own environment, the best way to do it is to start with the build for the distribution you are interested in, make sure that builds, and then modify your build scripts to do the required exclusions and file copies for your setup, otherwise you are likely to get class not found exceptions. The final caveat to this is that as the j2me distribution includes some compatibility classes starting in the java package, you need to use an obfuscator to change the package names before attempting to import a midlet using the BC API.

## Examples and Tests

To view some examples, look at the test programs in the packages:

*   **org.bouncycastle.crypto.test**

*   **org.bouncycastle.jce.provider.test**

*   **org.bouncycastle.cms.test**

*   **org.bouncycastle.mail.smime.test**

*   **org.bouncycastle.openpgp.test**

*   **org.bouncycastle.tsp.test**

There are also some specific example programs for dealing with SMIME and OpenPGP. They can be found in:

*   **org.bouncycastle.mail.smime.examples**

*   **org.bouncycastle.openpgp.examples**

## Mailing Lists

For those who are interested, there are 2 mailing lists for participation in this project. To subscribe use the links below and include the word subscribe in the message body. (To unsubscribe, replace **subscribe** with **unsubscribe** in the message body)

*   [announce-crypto-request@bouncycastle.org](mailto:announce-crypto-request@bouncycastle.org)
    This mailing list is for new release announcements only, general subscribers cannot post to it.
*   [dev-crypto-request@bouncycastle.org](mailto:dev-crypto-request@bouncycastle.org)
    This mailing list is for discussion of development of the package. This includes bugs, comments, requests for enhancements, questions about use or operation.

**NOTE:**You need to be subscribed to send mail to the above mailing list.

## Feedback

If you want to provide feedback directly to the members of **The Legion** then please use [feedback-crypto@bouncycastle.org](mailto:feedback-crypto@bouncycastle.org), if you want to help this project survive please consider [donating](https://www.bouncycastle.org/donate).

For bug reporting/requests you can report issues here on github, via feedback-crypto if required, and we also have a [Jira issue tracker](http://www.bouncycastle.org/jira). We will accept pull requests based on this repository as well.

## Finally

Enjoy!


text:
require 'rails_helper'

RSpec.describe HardCopyPdfGenerators::Aggregated::CaseSummaryWorker do
  it 'should perform correctly' do
    form_answer = build_stubbed(:form_answer)
    expect(FormAnswer).to receive(:find).with(1) {form_answer}
    expect(form_answer).to receive(:generate_case_summary_hard_copy_pdf!)
    described_class.new.perform(1)
  end
end