text:
var testUtils = require('../../util/testUtils');
testUtils.setupLocale('calc');

var TestResults = require(testUtils.buildPath('constants.js')).TestResults;
var blockUtils = require(testUtils.buildPath('block_utils'));
var studioApp = require(testUtils.buildPath('StudioApp')).singleton;
var Calc = require(testUtils.buildPath('calc/calc.js'));
var EquationSet = require(testUtils.buildPath('calc/equationSet.js'));
var Equation = require(testUtils.buildPath('/calc/equation.js'));
var ExpressionNode = require(testUtils.buildPath('calc/expressionNode.js'));

/**
 * This is another example of me taking advantage of the fact that our level
 * tests have a full Blockly environment. This allows me to more easily test
 * things like DOM manipulations
 */

var displayComplexUserExpressions = Calc.__testonly__.displayComplexUserExpressions;

module.exports = {
  app: "calc",
  skinId: 'calc',
  levelDefinition: {
    solutionBlocks: '',
    requiredBlocks: '',
    freePlay: true
  },
  tests: [
    {
      description: "displayGoal",
      expected: {
        result: false,
        testResult: TestResults.EMPTY_FUNCTIONAL_BLOCK
      },
      // Run all validation in a single test to avoid the overhead of new node
      // processes
      customValidator: customValidator,
      xml: ''
    }
  ]
};

function setEquationSets(targetSet, userSet) {
  Calc.__testonly__.appState.targetSet = targetSet;
  Calc.__testonly__.appState.userSet = userSet;
}

/**
 * Run all our custom validation. Pulled out to reduce nesting.
 */
function customValidator(assert) {
  var userExpression = document.getElementById('userExpression');
  assert(userExpression);

  var validateTextElement = function (element, textContent, className) {
    assert.equal(element.textContent, textContent);
    assert.equal(element.getAttribute('class'), className);
  };

  // compute: age_in_months
  // age = 17
  // age_in_months = age * 12
  var targetSet = new EquationSet();
  targetSet.addEquation_(new Equation(null, [], new ExpressionNode('age_in_months')));
  targetSet.addEquation_(new Equation('age', [], new ExpressionNode(17)));
  targetSet.addEquation_(new Equation('age_in_months', [],
    new ExpressionNode('*', ['age', 12])));

  displayComplexUserExpressionTest(assert, 'correct answer', function () {
    var userSet = targetSet.clone();
    setEquationSets(targetSet, userSet);

    displayComplexUserExpressions();

    assert.equal(userExpression.children.length, 3);

    // line 1: age = 17
    var g = userExpression.children[0];
    validateTextElement(g.children[0], 'age = ', null);
    validateTextElement(g.children[1], '17', null);

    // line 2: age_in_months = (age * 12)
    g = userExpression.children[1];
    validateTextElement(g.children[0], 'age_in_months = ', null);
    validateTextElement(g.children[1], '(', null);
    validateTextElement(g.children[2], 'age', null);
    validateTextElement(g.children[3], ' * ', null);
    validateTextElement(g.children[4], '12', null);
    validateTextElement(g.children[5], ')', null);

    // line 3: age_in_months = 194
    g = userExpression.children[2];
    validateTextElement(g.children[0], 'age_in_months', null);
    validateTextElement(g.children[1], ' = ', null);
    validateTextElement(g.children[2], '204', null);
  });

  displayComplexUserExpressionTest(assert, 'correct answer with different age', function () {
    // compute: age_in_months
    // age = 10
    // age_in_months = age * 12
    var userSet = new EquationSet();
    userSet.addEquation_(new Equation(null, [], new ExpressionNode('age_in_months')));
    userSet.addEquation_(new Equation('age', [], new ExpressionNode(10)));
    userSet.addEquation_(new Equation('age_in_months', [],
      new ExpressionNode('*', ['age', 12])));
    setEquationSets(targetSet, userSet);

    displayComplexUserExpressions();

    assert.equal(userExpression.children.length, 3);

    // line 1: age = 10
    var g = userExpression.children[0];
    validateTextElement(g.children[0], 'age = ', null);
    validateTextElement(g.children[1], '10', null);

    // line 2: age_in_months = (age * 12)
    g = userExpression.children[1];
    validateTextElement(g.children[0], 'age_in_months = ', null);
    validateTextElement(g.children[1], '(', null);
    validateTextElement(g.children[2], 'age', null);
    validateTextElement(g.children[3], ' * ', null);
    validateTextElement(g.children[4], '12', null);
    validateTextElement(g.children[5], ')', null);

    // line 3: age_in_months = 120
    g = userExpression.children[2];
    validateTextElement(g.children[0], 'age_in_months', null);
    validateTextElement(g.children[1], ' = ', null);
    validateTextElement(g.children[2], '120', null);
  });

  displayComplexUserExpressionTest(assert, 'age hard coded', function () {
    // compute: age_in_months
    // age = 17
    // age_in_months = 17 * 12
    var userSet = new EquationSet();
    userSet.addEquation_(new Equation(null, [], new ExpressionNode('age_in_months')));
    userSet.addEquation_(new Equation('age', [], new ExpressionNode(17)));
    userSet.addEquation_(new Equation('age_in_months', [],
      new ExpressionNode('*', [17, 12])));
    setEquationSets(targetSet, userSet);

    displayComplexUserExpressions();

    assert.equal(userExpression.children.length, 3);

    // line 1: age = 17
    var g = userExpression.children[0];
    validateTextElement(g.children[0], 'age = ', null);
    validateTextElement(g.children[1], '17', null);

    // line 2: age_in_months = (17 * 12)
    g = userExpression.children[1];
    validateTextElement(g.children[0], 'age_in_months = ', null);
    validateTextElement(g.children[1], '(', null);
    validateTextElement(g.children[2], '17', null);
    validateTextElement(g.children[3], ' * ', null);
    validateTextElement(g.children[4], '12', null);
    validateTextElement(g.children[5], ')', null);

    // line 3: age_in_months = 120
    g = userExpression.children[2];
    validateTextElement(g.children[0], 'age_in_months', null);
    validateTextElement(g.children[1], ' = ', null);
    validateTextElement(g.children[2], '204', null);
  });

  displayComplexUserExpressionTest(assert, 'wrong variable name', function () {
    // compute: age_in_months2
    // age = 17
    // age_in_months2 = age * 12
    var userSet = new EquationSet();
    userSet.addEquation_(new Equation(null, [], new ExpressionNode('age_in_months2')));
    userSet.addEquation_(new Equation('age', [], new ExpressionNode(17)));
    userSet.addEquation_(new Equation('age_in_months2', [],
      new ExpressionNode('*', ['age', 12])));
    setEquationSets(targetSet, userSet);

    displayComplexUserExpressions();

    assert.equal(userExpression.children.length, 3);

    // line 1: age = 10
    var g = userExpression.children[0];
    validateTextElement(g.children[0], 'age = ', null);
    validateTextElement(g.children[1], '17', null);

    // line 2: age_in_months = (age * 12)
    g = userExpression.children[1];
    validateTextElement(g.children[0], 'age_in_months2 = ', null);
    validateTextElement(g.children[1], '(', null);
    validateTextElement(g.children[2], 'age', null);
    validateTextElement(g.children[3], ' * ', null);
    validateTextElement(g.children[4], '12', null);
    validateTextElement(g.children[5], ')', null);

    // line 3: age_in_months = 120
    g = userExpression.children[2];
    validateTextElement(g.children[0], 'age_in_months2', 'errorToken');
    validateTextElement(g.children[1], ' = ', null);
    validateTextElement(g.children[2], '204', null);
  });

  displayComplexUserExpressionTest(assert, 'divide by zero error', function () {
    // compute: f(10)
    // f(i) = (4 / (4 - 4))
    var userSet = new EquationSet();
    userSet.addEquation_(new Equation(null, [], new ExpressionNode('f', [10])));
    userSet.addEquation_(new Equation('f', ['i'], new ExpressionNode('/', [
      new ExpressionNode(4),
      new ExpressionNode('-', [4, 4])
    ])));

    // target is similar, but no div 0
    // compute: f(10)
    // f(i) = (4 / (5 - 4))
    var targetSet = new EquationSet();
    targetSet.addEquation_(new Equation(null, [], new ExpressionNode('f', [10])));
    targetSet.addEquation_(new Equation('f', ['i'], new ExpressionNode('/', [
      new ExpressionNode(4),
      new ExpressionNode('-', [4, 4])
    ])));

    setEquationSets(targetSet, userSet);

    displayComplexUserExpressions();

    assert.equal(userExpression.children.length, 2);

    // line 1: f(i) = (4 / (4 - 4))
    var g = userExpression.children[0];
    validateTextElement(g.children[0], 'f(i) = ', null);
    validateTextElement(g.children[1], '(', null);
    validateTextElement(g.children[2], '4', null);
    validateTextElement(g.children[3], ' / ', null);
    validateTextElement(g.children[4], '(', null);
    validateTextElement(g.children[5], '4', null);
    validateTextElement(g.children[6], ' - ', null);
    validateTextElement(g.children[7], '4', null);
    validateTextElement(g.children[8], ')', null);
    validateTextElement(g.children[9], ')', null);
    validateTextElement(g.children[9], ')', null);

    // line 2: f(10)
    // Note that there's no = (result), because we have a divide by zero error
    g = userExpression.children[1];
    validateTextElement(g.children[0], 'f', null);
    validateTextElement(g.children[1], '(', null);
    validateTextElement(g.children[2], '10', null);
    validateTextElement(g.children[3], ')', null);
  });

  displayComplexUserExpressionTest(assert, 'divide by zero error during freeplay', function () {
    // same thing as previous test, but no targetSet
    // compute: f(10)
    // f(i) = (4 / (4 - 4))
    var userSet = new EquationSet();
    userSet.addEquation_(new Equation(null, [], new ExpressionNode('f', [10])));
    userSet.addEquation_(new Equation('f', ['i'], new ExpressionNode('/', [
      new ExpressionNode(4),
      new ExpressionNode('-', [4, 4])
    ])));
    var targetSet = new EquationSet(); // simulate free play
    setEquationSets(targetSet, userSet);

    displayComplexUserExpressions();

    assert.equal(userExpression.children.length, 2);

    // line 1: f(i) = (4 / (4 - 4))
    var g = userExpression.children[0];
    validateTextElement(g.children[0], 'f(i) = ', null);
    validateTextElement(g.children[1], '(', null);
    validateTextElement(g.children[2], '4', null);
    validateTextElement(g.children[3], ' / ', null);
    validateTextElement(g.children[4], '(', null);
    validateTextElement(g.children[5], '4', null);
    validateTextElement(g.children[6], ' - ', null);
    validateTextElement(g.children[7], '4', null);
    validateTextElement(g.children[8], ')', null);
    validateTextElement(g.children[9], ')', null);
    assert.equal(g.children.length, 10);

    // line 2: f(10)
    // Note that there's no = (result), because we have a divide by zero error
    g = userExpression.children[1];
    validateTextElement(g.children[0], 'f', null);
    validateTextElement(g.children[1], '(', null);
    validateTextElement(g.children[2], '10', null);
    validateTextElement(g.children[3], ')', null);
    assert.equal(g.children.length, 4);
  });

  displayComplexUserExpressionTest(assert, 'divide by zero error with simple target', function () {
    // compute: (4 / (4 - 4))
    var userSet = new EquationSet();
    userSet.addEquation_(new Equation(null, [], new ExpressionNode('/', [
      new ExpressionNode(4),
      new ExpressionNode('-', [4, 4])
    ])));

    // target has no functions
    // compute: 1 + 2
    var targetSet = new EquationSet();
    targetSet.addEquation_(new Equation(null, [], new ExpressionNode('+', [1, 2])));

    setEquationSets(targetSet, userSet);

    displayComplexUserExpressions();

    assert.equal(userExpression.children.length, 1);

    // line 1: (4 / (4 - 4))
    var g = userExpression.children[0];
    validateTextElement(g.children[0], '(', 'errorToken');
    validateTextElement(g.children[1], '4', 'errorToken');
    validateTextElement(g.children[2], ' / ', 'errorToken');
    validateTextElement(g.children[3], '(', 'errorToken');
    validateTextElement(g.children[4], '4', 'errorToken');
    validateTextElement(g.children[5], ' - ', 'errorToken');
    validateTextElement(g.children[6], '4', 'errorToken');
    validateTextElement(g.children[7], ')', 'errorToken');
    validateTextElement(g.children[8], ')', 'errorToken');
    assert.equal(g.children.length, 9);
  });

  return true;
}

/**
 * Run a single test, initially clearing contents of answerExpression. Done
 * mostly to clearly delineate between test cases.
 * @param {Function} assert Assert object passed through from executor
 * @param {string} description Describe this test. Used just for readability
 * @param {Function} fn Code to run
 */
function displayComplexUserExpressionTest(assert, description, fn) {
  var userExpression = document.getElementById('userExpression');
  userExpression.innerHTML = ''; // clear children

  fn();
}


text:
var fs = require('fs'),
  modules = [],
  dir = './src/app/storymaps/';

if ( process.argv.length != 4 ) {
  console.error("Need two arguments: filepath with the list of source file ; output file");
  return;
}

var modulesPath = fs.readFileSync(process.argv[2]).toString().split("\n");
for(modulePath in modulesPath) {
  //console.log(modulesPath[modulePath]);
  if ( modulesPath[modulePath].match(/text!/) )
    continue;

  var lines = fs.readFileSync(modulesPath[modulePath]).toString().split("\n");
  for(l in lines) {
  //console.log(lines[l]);
    if ( lines[l].match(/(\'|\")(esri|dojo|dijit|dgrid|put\-selector)\//) ) {
      //console.log(lines[l]);
      var requireStrSplit = lines[l].trim().match(/(\'|\")([a-zA-Z0-9\_\/\-]+)(\'|\")/);
      if ( requireStrSplit && requireStrSplit.length == 4 ) {
        modules.push(requireStrSplit[2]);
        //console.log( requireStrSplit[1] );
      }
    }
  }
}

//console.log(modules.length);
modules = modules.filter(function (value, index, self) {
  return self.indexOf(value) === index;
});

//console.log(modules.length);
//console.log(modules.join('\r\n'));

fs.writeFile(process.argv[3], modules.join('\r\n'), function(err) {
  if(err) console.log(err);
});

redpajama_set_name: RedPajamaGithub


text:
ledbanner
=========

Display server for 80x8 pixel RGB ledbanner


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

  <meta name="description" content="Javadoc API documentation for Fresco." />

<link rel="shortcut icon" type="image/x-icon" href="../../../../favicon.ico" />
<title>

  BitmapCounter - Fresco API

| Fresco

</title>
<link href="../../../../../assets/doclava-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../../../../../assets/customizations.css" rel="stylesheet" type="text/css" />

      Fresco

          <form accept-charset="utf-8" class="gsc-search-box"
                onsubmit="return submit_search()">

                    <input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off"
                      title="search developer docs" name="q"
                      value="search developer docs"
                      onFocus="search_focus_changed(this, true)"
                      onBlur="search_focus_changed(this, false)"
                      onkeydown="return search_changed(event, true, '../../../../')"
                      onkeyup="return search_changed(event, false, '../../../../')" />

          </form>

                Packages |
                Classes

  com.facebook.animated.gif

  com.facebook.animated.webp

  com.facebook.binaryresource

  com.facebook.cache.common

  com.facebook.cache.disk

  com.facebook.common.activitylistener

  com.facebook.common.disk

  com.facebook.common.executors

  com.facebook.common.file

  com.facebook.common.internal

  com.facebook.common.lifecycle

  com.facebook.common.logging

  com.facebook.common.media

  com.facebook.common.memory

  com.facebook.common.references

  com.facebook.common.soloader

  com.facebook.common.statfs

  com.facebook.common.streams

  com.facebook.common.time

  com.facebook.common.util

  com.facebook.common.webp

  com.facebook.datasource

  com.facebook.drawable.base

  com.facebook.drawee.backends.pipeline

  com.facebook.drawee.backends.volley

  com.facebook.drawee.components

  com.facebook.drawee.controller

  com.facebook.drawee.debug

  com.facebook.drawee.drawable

  com.facebook.drawee.generic

  com.facebook.drawee.gestures

  com.facebook.drawee.interfaces

  com.facebook.drawee.span

  com.facebook.drawee.view

  com.facebook.fresco.animation.backend

  com.facebook.fresco.animation.bitmap

  com.facebook.fresco.animation.bitmap.cache

  com.facebook.fresco.animation.bitmap.preparation

  com.facebook.fresco.animation.bitmap.wrapper

  com.facebook.fresco.animation.drawable

  com.facebook.fresco.animation.drawable.animator

  com.facebook.fresco.animation.factory

  com.facebook.fresco.animation.frame

  com.facebook.imageformat

  com.facebook.imagepipeline.animated.base

  com.facebook.imagepipeline.animated.factory

  com.facebook.imagepipeline.animated.impl

  com.facebook.imagepipeline.animated.util

  com.facebook.imagepipeline.backends.okhttp3

  com.facebook.imagepipeline.backends.volley

  com.facebook.imagepipeline.bitmaps

  com.facebook.imagepipeline.cache

  com.facebook.imagepipeline.common

  com.facebook.imagepipeline.core

  com.facebook.imagepipeline.datasource

  com.facebook.imagepipeline.decoder

  com.facebook.imagepipeline.drawable

  com.facebook.imagepipeline.image

  com.facebook.imagepipeline.listener

  com.facebook.imagepipeline.memory

  com.facebook.imagepipeline.nativecode

  com.facebook.imagepipeline.platform

  com.facebook.imagepipeline.postprocessors

  com.facebook.imagepipeline.producers

  com.facebook.imagepipeline.request

  com.facebook.imageutils

  com.facebook.webpsupport

  com.facebook.widget.text.span

Interfaces

PoolStatsTracker

Classes

BasePool<V>

BitmapCounter

BitmapCounterProvider

BitmapPool

DefaultBitmapPoolParams

DefaultByteArrayPoolParams

DefaultFlexByteArrayPoolParams

DefaultNativeMemoryChunkPoolParams

FlexByteArrayPool

GenericByteArrayPool

NativeMemoryChunk

NativeMemoryChunkPool

NativePooledByteBuffer

NativePooledByteBufferFactory

NativePooledByteBufferOutputStream

NoOpPoolStatsTracker

PoolConfig

PoolConfig.Builder

PoolFactory

PoolParams

SharedByteArray

Exceptions

BasePool.InvalidSizeException

BasePool.InvalidValueException

BasePool.PoolSizeViolationException

BasePool.SizeTooLargeException

NativePooledByteBufferOutputStream.InvalidStreamException

            Packages |
            Classes

Summary:

  Ctors

  | Methods

  | Inherited Methods

| [Expand All]

    public

    class

BitmapCounter

    extends Object

        java.lang.Object

               ↳

        com.facebook.imagepipeline.memory.BitmapCounter

Class Overview

Counts bitmaps - keeps track of both, count and total size in bytes.

Summary

Public Constructors

        BitmapCounter(int maxCount, int maxSize)

Public Methods

            List<CloseableReference<Bitmap>>

        <a href="../../../../com/facebook/imagepipeline/memory/BitmapCounter.html#associateBitmapsWithBitmapCounter(java.util.List<android.graphics.Bitmap>)">associateBitmapsWithBitmapCounter(List<Bitmap> bitmaps)

Associates bitmaps with the bitmap counter.

            synchronized

            void

        decrease(Bitmap bitmap)

Excludes given bitmap from the count.

            synchronized

            int

        getCount()

            synchronized

            int

        getMaxCount()

            synchronized

            int

        getMaxSize()

            ResourceReleaser<Bitmap>

        getReleaser()

            synchronized

            long

        getSize()

            synchronized

            boolean

        increase(Bitmap bitmap)

Includes given bitmap in the bitmap count.

  [Expand]

Inherited Methods

From class

  java.lang.Object

            Object

        clone()

            boolean

        equals(Object arg0)

            void

        finalize()

            final

            Class<?>

        getClass()

            int

        hashCode()

            final

            void

        notify()

            final

            void

        notifyAll()

            String

        toString()

            final

            void

        wait(long arg0, int arg1)

            final

            void

        wait(long arg0)

            final

            void

        wait()

Public Constructors

        public

      BitmapCounter
      (int maxCount, int maxSize)

Public Methods

<a id="associateBitmapsWithBitmapCounter(java.util.List<android.graphics.Bitmap>)">

        public

        List<CloseableReference<Bitmap>>

      associateBitmapsWithBitmapCounter
      (List<Bitmap> bitmaps)

Associates bitmaps with the bitmap counter.

If this method throws
 TooManyBitmapsException, the code will have called recycle() on the
 bitmaps.

Parameters

          bitmaps
          the bitmaps to associate

Returns

the references to the bitmaps that are now tied to the bitmap pool

Throws

            TooManyBitmapsException
            if the pool is full

        public

        synchronized
        void

      decrease
      (Bitmap bitmap)

Excludes given bitmap from the count.

Parameters

          bitmap
          to be excluded from the count

        public

        synchronized
        int

      getCount
      ()

Returns

number of counted bitmaps

        public

        synchronized
        int

      getMaxCount
      ()

        public

        synchronized
        int

      getMaxSize
      ()

        public

        ResourceReleaser<Bitmap>

      getReleaser
      ()

        public

        synchronized
        long

      getSize
      ()

Returns

total size in bytes of counted bitmaps

        public

        synchronized
        boolean

      increase
      (Bitmap bitmap)

Includes given bitmap in the bitmap count. The bitmap is included only if doing so
 does not violate configured limit

Parameters

          bitmap
          to include in the count

Returns

true if and only if bitmap is successfully included in the count

 +Generated by Doclava.
 +


text:
import { test } from 'ember-qunit';
import moduleFor from 'open-event-frontend/tests/helpers/unit-helper';

moduleFor('route:events/view/tickets/access-codes/create', 'Unit | Route | events/view/tickets/access codes/create', []);

test('it exists', function(assert) {
  let route = this.subject();
  assert.ok(route);
});


text:
var tableName = 'users';

module.exports = {

  title: 'create deleted in ' + tableName,

  up: function(limby) {

    return limby.schema.table(tableName, function(table) {
      table.boolean('deleted');
    })
    .then(function(){
      console.log(('created deleted in ' + tableName).green);
    });

  },

  down: function(limby) {

    return limby.schema.table(tableName, function(table) {
      table.dropColumn('deleted');
    })
    .then(function(){
      console.log(('dropped deleted from ' + tableName).red);
    });

  },

};


text:
import vue from 'vue'
import goodsReturn from './goods-return.vue'

let vm = new vue({
	el: '#goods-return',
	components: {
		'goods-return': goodsReturn,
	},
})


text:
<bill session="115" type="h" number="2615" updated="2017-09-13T22:15:19Z">
  <state datetime="2017-07-26">REPORTED</state>
  <status>
    <unknown datetime="2017-07-26"/>
  </status>
  <introduced datetime="2017-05-23"/>
  <titles>
    <title type="short" as="introduced">Gulf Islands National Seashore Land Exchange Act of 2017</title>
    <title type="short" as="introduced">Gulf Islands National Seashore Land Exchange Act of 2017</title>
    <title type="short" as="reported to house">Gulf Islands National Seashore Land Exchange Act of 2017</title>
    <title type="short" as="reported to house">Gulf Islands National Seashore Land Exchange Act of 2017</title>
    <title type="official" as="introduced">To authorize the exchange of certain land located in Gulf Islands National Seashore, Jackson County, Mississippi, between the National Park Service and the Veterans of Foreign Wars, and for other purposes.</title>
    <title type="display">Gulf Islands National Seashore Land Exchange Act of 2017</title>
  </titles>
  <sponsor bioguide_id="P000601"/>
  <cosponsors/>
  <actions>
    <action datetime="2017-05-23">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-05-23" state="REFERRED">
      <text>Referred to the House Committee on Natural Resources.</text>
    </action>
    <action datetime="2017-06-07">
      <text>Referred to the Subcommittee on Federal Lands.</text>
    </action>
    <action datetime="2017-07-26">
      <text>Committee Consideration and Mark-up Session Held.</text>
    </action>
    <calendar datetime="2017-07-26" state="REPORTED">
      <text>Ordered to be Reported by Unanimous Consent.</text>
    </calendar>
    <action datetime="2017-09-11">
      <text>Reported by the Committee on Natural Resources. H. Rept. 115-302.</text>
    </action>
    <calendar datetime="2017-09-11" calendar="Union" number="216">
      <text>Placed on the Union Calendar, Calendar No. 216.</text>
    </calendar>
  </actions>
  <committees>
    <committee subcommittee="" code="HSII" name="House Natural Resources" activity="Reporting, Markup, Referral"/>
    <committee subcommittee="Federal Lands" code="HSII10" name="House Natural Resources" activity="Referral"/>
  </committees>
  <relatedbills/>
  <subjects>
    <term name="Public lands and natural resources"/>
  </subjects>
  <amendments/>
  <summary date="2017-05-23T04:00:00Z" status="Introduced in House">Gulf Islands National Seashore Land Exchange Act of 2017

 This bill authorizes the National Park Service (NPS) to convey to the Veterans of Foreign Wars Post 5699 approximately 1.542 acres of real property located within the Gulf Islands National Seashore in Jackson County, Mississippi, in exchange for a parcel of 2.161 acres.

The NPS shall require the Post to pay the costs incurred by the NPS to carry out such exchange.

Land and interests acquired by the United States under this bill shall be administered as part of the Gulf Islands National Seashore.</summary>
  <committee-reports>
    <report>H. Rept. 115-302</report>
  </committee-reports>
</bill>


text:
module REXML
  # If you add a method, keep in mind two things:
  # (1) the first argument will always be a list of nodes from which to
  # filter.  In the case of context methods (such as position), the function
  # should return an array with a value for each child in the array.
  # (2) all method calls from XML will have "-" replaced with "_".
  # Therefore, in XML, "local-name()" is identical (and actually becomes)
  # "local_name()"
  module Functions
    @@available_functions = {}
    @@context = nil
    @@namespace_context = {}
    @@variables = {}

    INTERNAL_METHODS = [
      :namespace_context,
      :namespace_context=,
      :variables,
      :variables=,
      :context=,
      :get_namespace,
      :send,
    ]
    class << self
      def singleton_method_added(name)
        unless INTERNAL_METHODS.include?(name)
          @@available_functions[name] = true
        end
      end
    end

    def Functions::namespace_context=(x) ; @@namespace_context=x ; end
    def Functions::variables=(x) ; @@variables=x ; end
    def Functions::namespace_context ; @@namespace_context ; end
    def Functions::variables ; @@variables ; end

    def Functions::context=(value); @@context = value; end

    def Functions::text( )
      if @@context[:node].node_type == :element
        return @@context[:node].find_all{|n| n.node_type == :text}.collect{|n| n.value}
      elsif @@context[:node].node_type == :text
        return @@context[:node].value
      else
        return false
      end
    end

    # Returns the last node of the given list of nodes.
    def Functions::last( )
      @@context[:size]
    end

    def Functions::position( )
      @@context[:index]
    end

    # Returns the size of the given list of nodes.
    def Functions::count( node_set )
      node_set.size
    end

    # Since REXML is non-validating, this method is not implemented as it
    # requires a DTD
    def Functions::id( object )
    end

    def Functions::local_name(node_set=nil)
      get_namespace(node_set) do |node|
        return node.local_name
      end
      ""
    end

    def Functions::namespace_uri( node_set=nil )
      get_namespace( node_set ) {|node| node.namespace}
    end

    def Functions::name( node_set=nil )
      get_namespace( node_set ) do |node|
        node.expanded_name
      end
    end

    # Helper method.
    def Functions::get_namespace( node_set = nil )
      if node_set == nil
        yield @@context[:node] if @@context[:node].respond_to?(:namespace)
      else
        if node_set.respond_to? :each
          result = []
          node_set.each do |node|
            result << yield(node) if node.respond_to?(:namespace)
          end
          result
        elsif node_set.respond_to? :namespace
          yield node_set
        end
      end
    end

    # A node-set is converted to a string by returning the string-value of the
    # node in the node-set that is first in document order. If the node-set is
    # empty, an empty string is returned.
    #
    # A number is converted to a string as follows
    #
    # NaN is converted to the string NaN
    #
    # positive zero is converted to the string 0
    #
    # negative zero is converted to the string 0
    #
    # positive infinity is converted to the string Infinity
    #
    # negative infinity is converted to the string -Infinity
    #
    # if the number is an integer, the number is represented in decimal form
    # as a Number with no decimal point and no leading zeros, preceded by a
    # minus sign (-) if the number is negative
    #
    # otherwise, the number is represented in decimal form as a Number
    # including a decimal point with at least one digit before the decimal
    # point and at least one digit after the decimal point, preceded by a
    # minus sign (-) if the number is negative; there must be no leading zeros
    # before the decimal point apart possibly from the one required digit
    # immediately before the decimal point; beyond the one required digit
    # after the decimal point there must be as many, but only as many, more
    # digits as are needed to uniquely distinguish the number from all other
    # IEEE 754 numeric values.
    #
    # The boolean false value is converted to the string false. The boolean
    # true value is converted to the string true.
    #
    # An object of a type other than the four basic types is converted to a
    # string in a way that is dependent on that type.
    def Functions::string( object=@@context[:node] )
      if object.respond_to?(:node_type)
        case object.node_type
        when :attribute
          object.value
        when :element
          string_value(object)
        when :document
          string_value(object.root)
        when :processing_instruction
          object.content
        else
          object.to_s
        end
      else
        case object
        when Array
          string(object[0])
        when Float
          if object.nan?
            "NaN"
          else
            integer = object.to_i
            if object == integer
              "%d" % integer
            else
              object.to_s
            end
          end
        else
          object.to_s
        end
      end
    end

    # A node-set is converted to a string by
    # returning the concatenation of the string-value
    # of each of the children of the node in the
    # node-set that is first in document order.
    # If the node-set is empty, an empty string is returned.
    def Functions::string_value( o )
      rv = ""
      o.children.each { |e|
        if e.node_type == :text
          rv << e.to_s
        elsif e.node_type == :element
          rv << string_value( e )
        end
      }
      rv
    end

    def Functions::concat( *objects )
      concatenated = ""
      objects.each do |object|
        concatenated << string(object)
      end
      concatenated
    end

    # Fixed by Mike Stok
    def Functions::starts_with( string, test )
      string(string).index(string(test)) == 0
    end

    # Fixed by Mike Stok
    def Functions::contains( string, test )
      string(string).include?(string(test))
    end

    # Kouhei fixed this
    def Functions::substring_before( string, test )
      ruby_string = string(string)
      ruby_index = ruby_string.index(string(test))
      if ruby_index.nil?
        ""
      else
        ruby_string[ 0...ruby_index ]
      end
    end

    # Kouhei fixed this too
    def Functions::substring_after( string, test )
      ruby_string = string(string)
      return $1 if ruby_string =~ /#{test}(.*)/
      ""
    end

    # Take equal portions of Mike Stok and Sean Russell; mix
    # vigorously, and pour into a tall, chilled glass.  Serves 10,000.
    def Functions::substring( string, start, length=nil )
      ruby_string = string(string)
      ruby_length = if length.nil?
                      ruby_string.length.to_f
                    else
                      number(length)
                    end
      ruby_start = number(start)

      # Handle the special cases
      return '' if (
        ruby_length.nan? or
        ruby_start.nan? or
        ruby_start.infinite?
      )

      infinite_length = ruby_length.infinite? == 1
      ruby_length = ruby_string.length if infinite_length

      # Now, get the bounds.  The XPath bounds are 1..length; the ruby bounds
      # are 0..length.  Therefore, we have to offset the bounds by one.
      ruby_start = round(ruby_start) - 1
      ruby_length = round(ruby_length)

      if ruby_start < 0
       ruby_length += ruby_start unless infinite_length
       ruby_start = 0
      end
      return '' if ruby_length <= 0
      ruby_string[ruby_start,ruby_length]
    end

    # UNTESTED
    def Functions::string_length( string )
      string(string).length
    end

    # UNTESTED
    def Functions::normalize_space( string=nil )
      string = string(@@context[:node]) if string.nil?
      if string.kind_of? Array
        string.collect{|x| string.to_s.strip.gsub(/\s+/um, ' ') if string}
      else
        string.to_s.strip.gsub(/\s+/um, ' ')
      end
    end

    # This is entirely Mike Stok's beast
    def Functions::translate( string, tr1, tr2 )
      from = string(tr1)
      to = string(tr2)

      # the map is our translation table.
      #
      # if a character occurs more than once in the
      # from string then we ignore the second &
      # subsequent mappings
      #
      # if a character maps to nil then we delete it
      # in the output.  This happens if the from
      # string is longer than the to string
      #
      # there's nothing about - or ^ being special in
      # http://www.w3.org/TR/xpath#function-translate
      # so we don't build ranges or negated classes

      map = Hash.new
      0.upto(from.length - 1) { |pos|
        from_char = from[pos]
        unless map.has_key? from_char
          map[from_char] =
          if pos < to.length
            to[pos]
          else
            nil
          end
        end
      }

      if ''.respond_to? :chars
        string(string).chars.collect { |c|
          if map.has_key? c then map[c] else c end
        }.compact.join
      else
        string(string).unpack('U*').collect { |c|
          if map.has_key? c then map[c] else c end
        }.compact.pack('U*')
      end
    end

    def Functions::boolean(object=@@context[:node])
      case object
      when true, false
        object
      when Float
        return false if object.zero?
        return false if object.nan?
        true
      when Numeric
        not object.zero?
      when String
        not object.empty?
      when Array
        not object.empty?
      else
        object ? true : false
      end
    end

    # UNTESTED
    def Functions::not( object )
      not boolean( object )
    end

    # UNTESTED
    def Functions::true( )
      true
    end

    # UNTESTED
    def Functions::false(  )
      false
    end

    # UNTESTED
    def Functions::lang( language )
      lang = false
      node = @@context[:node]
      attr = nil
      until node.nil?
        if node.node_type == :element
          attr = node.attributes["xml:lang"]
          unless attr.nil?
            lang = compare_language(string(language), attr)
            break
          else
          end
        end
        node = node.parent
      end
      lang
    end

    def Functions::compare_language lang1, lang2
      lang2.downcase.index(lang1.downcase) == 0
    end

    # a string that consists of optional whitespace followed by an optional
    # minus sign followed by a Number followed by whitespace is converted to
    # the IEEE 754 number that is nearest (according to the IEEE 754
    # round-to-nearest rule) to the mathematical value represented by the
    # string; any other string is converted to NaN
    #
    # boolean true is converted to 1; boolean false is converted to 0
    #
    # a node-set is first converted to a string as if by a call to the string
    # function and then converted in the same way as a string argument
    #
    # an object of a type other than the four basic types is converted to a
    # number in a way that is dependent on that type
    def Functions::number(object=@@context[:node])
      case object
      when true
        Float(1)
      when false
        Float(0)
      when Array
        number(string(object))
      when Numeric
        object.to_f
      else
        str = string(object)
        case str.strip
        when /\A\s*(-?(?:\d+(?:\.\d*)?|\.\d+))\s*\z/
          $1.to_f
        else
          Float::NAN
        end
      end
    end

    def Functions::sum( nodes )
      nodes = [nodes] unless nodes.kind_of? Array
      nodes.inject(0) { |r,n| r + number(string(n)) }
    end

    def Functions::floor( number )
      number(number).floor
    end

    def Functions::ceiling( number )
      number(number).ceil
    end

    def Functions::round( number )
      number = number(number)
      begin
        neg = number.negative?
        number = number.abs.round
        neg ? -number : number
      rescue FloatDomainError
        number
      end
    end

    def Functions::processing_instruction( node )
      node.node_type == :processing_instruction
    end

    def Functions::send(name, *args)
      if @@available_functions[name.to_sym]
        super
      else
        # TODO: Maybe, this is not XPath spec behavior.
        # This behavior must be reconsidered.
        XPath.match(@@context[:node], name.to_s)
      end
    end
  end
end


text:
package com.faforever.client.patch;

import com.faforever.client.api.dto.FeaturedModFile;
import com.faforever.client.io.DownloadService;
import com.faforever.client.mod.FeaturedMod;
import com.faforever.client.preferences.PreferencesService;
import com.faforever.client.remote.FafService;
import com.faforever.client.task.CompletableTask;
import com.google.common.hash.Hashing;
import org.apache.maven.artifact.versioning.ComparableVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

import java.lang.invoke.MethodHandles;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;

@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class SimpleHttpFeaturedModUpdaterTask extends CompletableTask<PatchResult> {

  private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

  private final FafService fafService;
  private final PreferencesService preferencesService;
  private final DownloadService downloadService;

  private FeaturedMod featuredMod;
  private Integer version;

  public SimpleHttpFeaturedModUpdaterTask(FafService fafService, PreferencesService preferencesService, DownloadService downloadService) {
    super(Priority.HIGH);

    this.fafService = fafService;
    this.preferencesService = preferencesService;
    this.downloadService = downloadService;
  }

  @Override
  protected PatchResult call() throws Exception {
    String initFileName = "init_" + featuredMod.getTechnicalName() + ".lua";

    List<FeaturedModFile> featuredModFiles = fafService.getFeaturedModFiles(featuredMod, version).get();

    Path initFile = null;
    for (FeaturedModFile featuredModFile : featuredModFiles) {
      Path targetPath = preferencesService.getFafDataDirectory()
          .resolve(featuredModFile.getGroup())
          .resolve(featuredModFile.getName());

      if (Files.exists(targetPath)
          && featuredModFile.getMd5().equals(com.google.common.io.Files.hash(targetPath.toFile(), Hashing.md5()).toString())) {
        logger.debug("Already up to date: {}", targetPath);
      } else {
        Files.createDirectories(targetPath.getParent());
        downloadService.downloadFile(new URL(featuredModFile.getUrl()), targetPath, this::updateProgress);
      }

      if ("bin".equals(featuredModFile.getGroup()) && initFileName.equalsIgnoreCase(featuredModFile.getName())) {
        initFile = targetPath;
      }
    }

    Assert.isTrue(initFile != null && Files.exists(initFile), "'" + initFileName + "' could be found.");

    int maxVersion = featuredModFiles.stream()
        .mapToInt(mod -> Integer.parseInt(mod.getVersion()))
        .max()
        .orElseThrow(() -> new IllegalStateException("No version found"));

    return PatchResult.withLegacyInitFile(new ComparableVersion(String.valueOf(maxVersion)), initFile);
  }

  public void setFeaturedMod(FeaturedMod featuredMod) {
    this.featuredMod = featuredMod;
  }

  public void setVersion(Integer version) {
    this.version = version;
  }
}


text:
package com.lympid.core.behaviorstatemachines;

import com.lympid.core.basicbehaviors.Constraint;
import com.lympid.core.basicbehaviors.Event;
import java.util.function.BiPredicate;

/**
 * Represents a transition constraint (guard) that accepts an event and a
 * context argument. This operation must NOT operate via side-effects.
 *
 * In a behavioral state machine, a {@code BiTransitionConstraint} can be used
 * as a guard for any transitions outgoing a state. For transition guards
 * outgoing pseudo states, see {@link TransitionConstraint}.
 *
 * @param <E> the event
 * @param <C> the state machine context
 *
 * @see java.util.function.BiPredicate
 * @author Fabien Renaud
 */
public interface BiTransitionConstraint<E extends Event, C> extends Constraint, BiPredicate<E, C> {

}


text:
#include "libjoynr/joynr-messaging/dispatcher/ReceivedMessageRunnable.h"

#include <cassert>

#include "joynr/CallContextStorage.h"
#include "joynr/Dispatcher.h"
#include "joynr/Message.h"
#include "joynr/ImmutableMessage.h"

namespace joynr
{

INIT_LOGGER(ReceivedMessageRunnable);

ReceivedMessageRunnable::ReceivedMessageRunnable(std::shared_ptr<ImmutableMessage> message,
                                                 Dispatcher& dispatcher)
        : Runnable(true),
          ObjectWithDecayTime(message->getExpiryDate()),
          message(std::move(message)),
          dispatcher(dispatcher)
{
    JOYNR_LOG_TRACE(logger,
                    "Creating ReceivedMessageRunnable for message: {}",
                    this->message->toLogMessage());
}

void ReceivedMessageRunnable::shutdown()
{
}

void ReceivedMessageRunnable::run()
{
    const std::string& messageType = message->getType();

    JOYNR_LOG_TRACE(logger,
                    "Running ReceivedMessageRunnable for message type: {}, msg ID: {}",
                    messageType,
                    message->getId());
    if (isExpired()) {
        JOYNR_LOG_DEBUG(
                logger, "Dropping ReceivedMessageRunnable message, because it is expired: ");
        return;
    }

    CallContext callContext;
    callContext.setPrincipal(message->getCreator());

    CallContextStorage::set(std::move(callContext));

    if (messageType == Message::VALUE_MESSAGE_TYPE_REQUEST()) {
        dispatcher.handleRequestReceived(*message);
    } else if (messageType == Message::VALUE_MESSAGE_TYPE_REPLY()) {
        dispatcher.handleReplyReceived(*message);
    } else if (messageType == Message::VALUE_MESSAGE_TYPE_ONE_WAY()) {
        dispatcher.handleOneWayRequestReceived(*message);
    } else if (messageType == Message::VALUE_MESSAGE_TYPE_SUBSCRIPTION_REQUEST()) {
        dispatcher.handleSubscriptionRequestReceived(*message);
    } else if (messageType == Message::VALUE_MESSAGE_TYPE_BROADCAST_SUBSCRIPTION_REQUEST()) {
        dispatcher.handleBroadcastSubscriptionRequestReceived(*message);
    } else if (messageType == Message::VALUE_MESSAGE_TYPE_MULTICAST_SUBSCRIPTION_REQUEST()) {
        dispatcher.handleMulticastSubscriptionRequestReceived(*message);
    } else if (messageType == Message::VALUE_MESSAGE_TYPE_SUBSCRIPTION_REPLY()) {
        dispatcher.handleSubscriptionReplyReceived(*message);
    } else if (messageType == Message::VALUE_MESSAGE_TYPE_MULTICAST()) {
        dispatcher.handleMulticastReceived(*message);
    } else if (messageType == Message::VALUE_MESSAGE_TYPE_PUBLICATION()) {
        dispatcher.handlePublicationReceived(*message);
    } else if (messageType == Message::VALUE_MESSAGE_TYPE_SUBSCRIPTION_STOP()) {
        dispatcher.handleSubscriptionStopReceived(*message);
    } else {
        JOYNR_LOG_ERROR(logger, "unknown message type: {}", messageType);
    }

    CallContextStorage::invalidate();
}

} // namespace joynr


text:
package com.chrisrebert.lmvtfy.github

import scala.util.{Try,Failure,Success}
import com.jcabi.github.Coordinates.{Simple=>RepoId}
import com.chrisrebert.lmvtfy.{MarkdownAboutHtml, MarkdownAboutBootstrap, Markdown, ValidationResult}
import com.chrisrebert.lmvtfy.live_examples.{LiveExampleMention, LiveExample}
import com.chrisrebert.lmvtfy.github.implicits._
import com.chrisrebert.lmvtfy.server.{ActorWithLogging, Settings}

class GitHubIssueCommenter extends ActorWithLogging {
  val settings = Settings(context.system)

  private val client = settings.github()

  private def tryToCommentOn(repo: RepoId, issue: IssueNumber, commentMarkdown: String) = {
    Try { client.repos.get(repo).issues.get(issue.number).comments.post(commentMarkdown) }
  }

  private def introFor(markdown: Markdown): String = {
    markdown match {
      case _:MarkdownAboutHtml => "However, according to [the HTML5 validator](http://html5.validator.nu), **your example has some validation errors**"
      case _:MarkdownAboutBootstrap => "However, according to [Bootlint](https://github.com/twbs/bootlint), **your example has some Bootstrap usage errors**"
    }
  }

  override def receive = {
    case ValidationResult(messagesMarkdown, mention@LiveExampleMention(example: LiveExample, GitHubUser(username), GitHubIssue(repo, issue))) => {
      val exampleUrl = example.displayUrl
      val intro = introFor(messagesMarkdown)
      val commentMarkdown = s"""
        |Hi @${username}!
        |
        |You appear to have posted a live example (${exampleUrl}), which is always a good first step. ${intro}, which might potentially be causing your issue:
        |${messagesMarkdown.markdown}
        |
        |You'll need to **fix these errors** and post a revised example before we can proceed further.
        |Thanks!
        |
        |(*Please note that this is a [fully automated](https://github.com/cvrebert/lmvtfy) comment.*)
      """.stripMargin

      tryToCommentOn(repo.id, issue, commentMarkdown) match {
        case Success(comment) => log.info(s"Successfully posted comment ${comment.smart.url} for ${mention}")
        case Failure(exc) => log.error(exc, s"Error posting comment for ${mention}")
      }
    }
  }
}


text:
/* global $ */

$(function (){
  'use strict';

  var $content = $('#content');

  var animateScroll = function ($orgBrowser){
    var visibles = $orgBrowser.find('.visible');
    var offset = visibles.length * visibles.width();

    $orgBrowser.animate({ scrollLeft: offset }, 400);
  };

  var revealSubteam = function ( $orgBrowser, $target, $subteam ){
    $target.parents('li').addClass('expanded');
    $orgBrowser.find('.team').removeClass('visible');
    $subteam.children().parents('.team').addClass('visible');
  };

  if( $('.org-browser.has-form').length > 0 ){
    var $checked = $('.org-browser.has-form').find('input:checked');
    if( $checked.length > 0 ){
      $checked.parents('.team').addClass('visible');
    }
  }

  $content.on('click', '.show-editable-fields', function (e){
    var $orgBrowser = $(e.target)
                        .closest('.editable-summary')
                        .siblings('.editable-fields')
                        .find('.org-browser');
    setTimeout(function (){ animateScroll($orgBrowser); }, 0);
  });

  // title link
  $content.on('click', '.org-browser .team-link', function (e){
    var $target = $(e.target);
    var $orgBrowser = $(e.target).closest('.org-browser');

    // if it's a form
    if( $orgBrowser.hasClass('has-form') ){
        e.preventDefault();
        e.stopPropagation();

        $target.closest('h3').children('input').prop('checked', 'checked');
    }
  });

  $content.on('click', '.org-browser .subteam-link', function(e){
    var $target = $(e.target);
    var $orgBrowser = $(e.target).closest('.org-browser');

    if( $target.closest('li').hasClass('has-subteams') === false ){
      if( $orgBrowser.hasClass('has-form') ){
        // if we're in a form, the link click should select it's radio button
        e.preventDefault();
        e.stopPropagation();

        $target.closest('p').children('input').prop('checked', 'checked');
      }

      // if this is a leaf-node, we let the link work as it normally would
      return;
    }

    e.preventDefault();
    e.stopPropagation();

    var $subteam = $target.closest('p').siblings('.team');
    revealSubteam($orgBrowser, $target, $subteam);

    animateScroll($orgBrowser);
  });
});


text:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">

<chapter>

    <copyright>
      <year>2002</year><year>2013</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      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.

    </legalnotice>

    <title>OMG IDL</title>
    <prepared></prepared>
    <docno></docno>
    <date>2002-07-15</date>
    <rev></rev>
    <file>ch_basic_idl.xml</file>

    <title>OMG IDL - Overview</title>

The purpose of OMG IDL, Interface Definition Language, mapping
      is to act as translator between platforms and languages. An IDL
      specification is supposed to describe data types, object types etc.

Since the <c>C</c> and <c>Java</c> IC backends only supports a subset of the
      IDL types supported by the other backends, the mapping is divided into
      different parts. For more information about IDL to Erlang mapping,
      i.e., <c>CORBA</c>, plain Erlang and generic Erlang Server, see the Orber
      User's Guide. How to use the plain Erlang and generic Erlang Server is
      found in this User's Guide.

      <title>Reserved Compiler Names and Keywords</title>

The use of some names is  strongly discouraged due to
        ambiguities. However, the use of some names is prohibited
        when using the Erlang mapping , as they are strictly reserved for IC.

IC reserves all identifiers starting with <c>OE_</c> and <c>oe_</c>
        for internal use.

Note also, that an identifier in IDL can  contain alphabetic,
        digits and underscore characters, but the first character
        must be alphabetic.

Using underscores in IDL names can lead to ambiguities
        due to the name mapping described above. It is advisable to
        avoid the use of underscores in identifiers.

The OMG defines a set of reserved words, shown below, for use as keywords.
        These may not be used as, for example, identifiers.

        <row>
          <cell align="left" valign="middle">abstract</cell>
          <cell align="left" valign="middle">double</cell>
          <cell align="left" valign="middle">local</cell>
          <cell align="left" valign="middle">raises</cell>
          <cell align="left" valign="middle">typedef</cell>
        </row>
        <row>
          <cell align="left" valign="middle">any</cell>
          <cell align="left" valign="middle">exception</cell>
          <cell align="left" valign="middle">long</cell>
          <cell align="left" valign="middle">readonly</cell>
          <cell align="left" valign="middle">unsigned</cell>
        </row>
        <row>
          <cell align="left" valign="middle">attribute</cell>
          <cell align="left" valign="middle">enum</cell>
          <cell align="left" valign="middle">module</cell>
          <cell align="left" valign="middle">sequence</cell>
          <cell align="left" valign="middle">union</cell>
        </row>
        <row>
          <cell align="left" valign="middle">boolean</cell>
          <cell align="left" valign="middle">factory</cell>
          <cell align="left" valign="middle">native</cell>
          <cell align="left" valign="middle">short</cell>
          <cell align="left" valign="middle">ValueBase</cell>
        </row>
        <row>
          <cell align="left" valign="middle">case</cell>
          <cell align="left" valign="middle">FALSE</cell>
          <cell align="left" valign="middle">Object</cell>
          <cell align="left" valign="middle">string</cell>
          <cell align="left" valign="middle">valuetype</cell>
        </row>
        <row>
          <cell align="left" valign="middle">char</cell>
          <cell align="left" valign="middle">fixed</cell>
          <cell align="left" valign="middle">octet</cell>
          <cell align="left" valign="middle">struct</cell>
          <cell align="left" valign="middle">void</cell>
        </row>
        <row>
          <cell align="left" valign="middle">const</cell>
          <cell align="left" valign="middle">float</cell>
          <cell align="left" valign="middle">oneway</cell>
          <cell align="left" valign="middle">supports</cell>
          <cell align="left" valign="middle">wchar</cell>
        </row>
        <row>
          <cell align="left" valign="middle">context</cell>
          <cell align="left" valign="middle">in</cell>
          <cell align="left" valign="middle">out</cell>
          <cell align="left" valign="middle">switch</cell>
          <cell align="left" valign="middle">wstring</cell>
        </row>
        <row>
          <cell align="left" valign="middle">custom</cell>
          <cell align="left" valign="middle">inout</cell>
          <cell align="left" valign="middle">private</cell>
          <cell align="left" valign="middle">TRUE</cell>
          <cell align="left" valign="middle"></cell>
        </row>
        <row>
          <cell align="left" valign="middle">default</cell>
          <cell align="left" valign="middle">interface</cell>
          <cell align="left" valign="middle">public</cell>
          <cell align="left" valign="middle">truncatable</cell>
          <cell align="left" valign="middle"></cell>
        </row>
        <tcaption>OMG IDL keywords</tcaption>

The keywords listed above must be written exactly as shown. Any usage
        of identifiers that collide with a keyword is illegal. For example,
        long is a valid keyword; Long and LONG are
        illegal as keywords and identifiers. But, since the OMG must be able
        to expand the IDL grammar, it is possible to use Escaped  Identifiers. For example, it is not unlikely that <c>native</c>
        have been used in IDL-specifications as identifiers. One option is to
        change all occurrences to <c>myNative</c>. Usually, it is necessary
        to change programming language code that depends upon that IDL as well.
        Since Escaped Identifiers just disable type checking (i.e. if it is a reserved
        word or not) and leaves everything else unchanged, it is only necessary to
        update the IDL-specification. To escape an identifier, simply prefix it
        with <c>_</c>. The following IDL-code is illegal:

typedef string native;
interface i {
   void foo(in native Arg);
   };
};

With Escaped Identifiers the code will look like:

typedef string _native;
interface i {
   void foo(in _native Arg);
   };
};

</chapter>


text:
module InputText (
  Codepoint
, InputText
, toCodepoints
, charToCodepoint
)

where

import qualified Data.ByteString as B
import Data.Traversable (traverse)
import Data.Char (ord)
import Data.Word (Word8)
import Data.List (intercalate)

import Utils

type Codepoint = Word8

type InputText = B.ByteString

toCodepoints :: [String] -> Maybe InputText
toCodepoints = fmap (B.pack . intercalate [fromInteger stringSeparationCP])
             . traverse (traverse charToCodepoint)

validCodepoint :: Char -> Bool
validCodepoint x = (x >= '\x20') && (x < '\xa0')

charToCodepoint :: Char -> Maybe Codepoint
charToCodepoint x | validCodepoint x = Just . fromIntegral $ ord x
                  | otherwise = Nothing

stringToCodepoint :: String -> Maybe [Codepoint]
stringToCodepoint xs =
  fmap (++[0]) $ traverse charToCodepoint xs


text:
import djs from './djs/d.js';

if (typeof exports === 'object' && typeof module !== 'undefined') {
  module.exports = djs;
} else if (typeof define === 'function' && define.amd) {
  define([], () => djs);
}

let _global;

if (typeof window !== 'undefined') {
  _global = window;
} else if (typeof global !== 'undefined') {
  _global = global;
} else if (typeof self !== 'undefined') {
  _global = self;
} else {
  _global = this;
}

_global.djs = djs;


text:
layout: default
---

Tweet

      Follow @getfries

      Vote on Hacker News

Credits

Author

Ratchet

Contributors

Attribution

Author

About the author

Fries is deep-fried and made crispy by Jaune Sarmiento. He is a software engineer at Proudcloud and loves coffee so much. If you love what he does, buy him a beer, or drop an email to hawnecarlo@gmail.com.

      Follow @jaunesarmiento

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"  onSubmit="_gaq.push(['_trackEvent', 'PayPal', 'Click', 'Donate']);">
      <input type="hidden" name="cmd" value="_s-xclick">
      <input type="hidden" name="hosted_button_id" value="3N3QAYKXZR8G6">
      <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

    </form>

Ratchet

The inspiration

Ratchet was the inspiration behind Fries. Same as Fries, Ratchet is a prototyping framework using HTML, CSS, and JavaScript but for iPhone apps. Kudos to the Ratchet team for being an inspiration.

Contributors

Others who made it worthwhile

The author would like to thank everyone who has been furiously reporting bugs (and fixing them), and have been suggesting features to Fries.

Attribution

Special thanks

Official Android Icons and some content

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Android Action Bar Icon Pack

By Tobias Bieniek also under Creative Commons 2.5 License.


text:
//
//  MDMFetchedResultsCollectionDataSource.h
//
//  Copyright (c) 2014 Matthew Morey.
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>

@class MDMFetchedResultsCollectionDataSource;

/**
 A delegate of a `MDMFetchedResultsCollectionDataSource` object must adopt the
 `MDMFetchedResultsCollectionDataSource` protocol.
 */
@protocol MDMFetchedResultsCollectionDataSourceDelegate <NSObject>

@required
/**
 Tells the delegate to configure the collection cell with the given object.

 @param cell The UICollectionViewCell to be configured by the delegate.
 @param object The object to be used to configure the cell.
 */
- (void)dataSource:(MDMFetchedResultsCollectionDataSource *)dataSource configureCell:(id)cell withObject:(id)object;

/**
 Asks the delegate to delete the specified object.

 @param object The object to be deleted by the delegate.
 @param indexPath The indexPath of the cell representing the object.
 */
- (void)dataSource:(MDMFetchedResultsCollectionDataSource *)dataSource deleteObject:(id)object atIndexPath:(NSIndexPath *)indexPath;

@optional
/**
 Asks the delegate for a reuse identifier to be used to dequeue a cell. This method will only get called if the `reuseIdentifier` property is nil. Use this method when you want to make use of different kinds of cells.

 @param object The object that will be eventually used to configure the dequeued cell.
 @param indexPath The index path for the cell to be dequeued.
 */
- (NSString *)dataSource:(MDMFetchedResultsCollectionDataSource *)dataSource reuseIdentifierForObject:(id)object atIndexPath:(NSIndexPath *)indexPath;

/**
 Asks the delegate for a reuse identifier to be used to dequeue a supplementary view. This method will only get called if the `headerReuseIdentifier` and/or `footerReuseIdentifier` properties are nil. Use this method when you want to make use of different kinds of supplementary views for a given kind.

 @param kind The kind of UICollectionReusableView (UICollectionElementKindSectionHeader or UICollectionElementKindSectionFooter).
 @param indexPath The index path for the supplementary view to be dequeued.
 */
- (NSString *)dataSource:(MDMFetchedResultsCollectionDataSource *)dataSource reuseIdentifierForSupplementaryViewOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;

/**
 Tells the delegate to configure the supplementary view.

 @param view The UICollectionReusableView to be configured by the delegate.
 @param kind The kind of UICollectionReusableView (UICollectionElementKindSectionHeader or UICollectionElementKindSectionFooter).
 @param indexPath The index path for the supplementary view to be dequeued.
 */
- (void)dataSource:(MDMFetchedResultsCollectionDataSource *)dataSource configureSupplementaryView:(id)view ofKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;

@end

@interface MDMFetchedResultsCollectionDataSource : NSObject <UICollectionViewDataSource, NSFetchedResultsControllerDelegate>

/**
 The `NSFetchedResultsController` to be used by the data source.
 */
@property(nonatomic, strong) NSFetchedResultsController *fetchedResultsController;

/**
 The reuse identifier of the cell being modified by the data source. If you prefer to use multiple identifiers, do not set this property and implement the `dataSource:reuseIdentifierForObject:atIndexPath:` delegate method instead.
 */
@property(nonatomic, copy) NSString *reuseIdentifier;

/**
 The reuse identifier of the header being modified by the data source. If you prefer to use multiple identifiers, do not set this property and implement the `dataSource:reuseIdentifierForSupplementaryViewOfKind:atIndexPath:` delegate method instead.
 */
@property(nonatomic, copy) NSString *headerReuseIdentifier;

/**
 The reuse identifier of the footer being modified by the data source. If you prefer to use multiple identifiers, do not set this property and implement the `dataSource:reuseIdentifierForSupplementaryViewOfKind:atIndexPath:` delegate method instead.
 */
@property(nonatomic, copy) NSString *footerReuseIdentifier;

/**
 A Boolean value that determines whether the receiver will update automatically when the model changes.
 */
@property(nonatomic) BOOL paused;

/**
 The object that acts as the delegate of the receiving data source.
 */
@property(nonatomic, weak) id <MDMFetchedResultsCollectionDataSourceDelegate> delegate;

/**
 Returns a fetched results collectionView data source initialized with the given arguments.

 @param collectionView The collectionView view using this data source.
 @param fetchedResultsController The fetched results controller the data source should use.

 @return The newly-initialized collectionView data source.
 */
- (id)initWithCollectionView:(UICollectionView *)collectionView fetchedResultsController:(NSFetchedResultsController *)fetchedResultsController;

/**
 Returns the currently selected item from the collectionView.

 @return The selected item. If multiple items are selected it returns the first item.
 */
- (id)selectedItem;

/**
 Asks the data source to return the number of rows in the section.

 @param section An index number identifying a section for the internally managed collectionView view.

 @return The number of rows in `section`. If section doesn't exist returns 0.
 */
- (NSUInteger)numberOfRowsInSection:(NSUInteger)section;

/**
 Asks the data source to return the total number of rows in all sections.

 @return Total number of rows.
 */
- (NSUInteger)numberOfRowsInAllSections;

/**
 Returns the item object at the specified index path.

 @param path The index path that specifies the section and row of the cell.

 @return The item object at the corresponding index path or `nil` if the index path is out of range.
 */
- (id)itemAtIndexPath:(NSIndexPath *)path;

/**
 Returns the index path of a given object.

 @param object An object in the receiver's fetch results.

 @return The index path of `object` in the receiver's fetch results, or nil if `object` could not be found.
 */
- (NSIndexPath *)indexPathForObject:(id)object;

@end


text:
package org.jetbrains.idea.svn.dialogs.browser;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.api.Url;
import org.jetbrains.idea.svn.dialogs.RepositoryBrowserComponent;
import org.jetbrains.idea.svn.dialogs.RepositoryTreeNode;
import org.jetbrains.idea.svn.dialogs.browserCache.Expander;
import org.jetbrains.idea.svn.dialogs.browserCache.KeepingExpandedExpander;

import javax.swing.tree.TreeNode;
import java.util.Enumeration;

public abstract class AbstractOpeningExpander implements Expander {
  private final RepositoryBrowserComponent myBrowser;
  private final KeepingExpandedExpander myKeepingExpander;
  @NotNull private final Url mySelectionPath;

  protected AbstractOpeningExpander(final RepositoryBrowserComponent browser, @NotNull Url selectionPath) {
    myBrowser = browser;
    myKeepingExpander = new KeepingExpandedExpander(browser);
    mySelectionPath = selectionPath;
  }

  @Override
  public void onBeforeRefresh(final RepositoryTreeNode node) {
    myKeepingExpander.onBeforeRefresh(node);
  }

  protected enum ExpandVariants {
    DO_NOTHING,
    EXPAND_AND_EXIT,
    EXPAND_CONTINUE
  }

  protected abstract ExpandVariants expandNode(@NotNull Url url);

  protected abstract boolean checkChild(@NotNull Url childUrl);

  @Override
  public void onAfterRefresh(final RepositoryTreeNode node) {
    myKeepingExpander.onAfterRefresh(node);

    if (node.isLeaf()) {
      return;
    }

    final ExpandVariants expandVariant = expandNode(node.getURL());

    if (ExpandVariants.DO_NOTHING.equals(expandVariant)) {
      return;
    }

    // then expanded
    myBrowser.expandNode(node);

    if (!ExpandVariants.EXPAND_AND_EXIT.equals(expandVariant)) {
      final Enumeration children = node.children();
      while (children.hasMoreElements()) {
        final TreeNode treeNode = (TreeNode)children.nextElement();
        if (treeNode instanceof RepositoryTreeNode) {
          final RepositoryTreeNode repositoryTreeNode = (RepositoryTreeNode)treeNode;
          Url childUrl = repositoryTreeNode.getURL();
          if (checkChild(childUrl)) {
            if (mySelectionPath.equals(childUrl)) {
              myBrowser.setSelectedNode(repositoryTreeNode);
            }
            repositoryTreeNode.reload(this, false);
            return;
          }
        }
      }
    }
    removeSelf();
  }

  private void removeSelf() {
    myBrowser.setLazyLoadingExpander(new KeepingExpandedExpander.Factory());
  }
}


text:
'use strict';

/**
 * @ngdoc service
 * @name descentCampaignTrackerApp.desCampaign
 * @description
 * # desCampaign
 * Campaign API.
 */
angular.module('descentCampaignTrackerApp')
  .factory('desCampaign',
    ['$translate', 'desCamaignCons',
    function ($translate, desCamaignCons) {

    return {
      divineFavor:          divineFavor,
      totalCampaignTockens: totalCampaignTockens,
      campaignLevel:        campaignLevel
    };

    function divineFavor(overlord, heroParty){
      /*
      For every full 25 conquest tokens the heroes' conquest total
      is below the overlord's total, each hero's conquest value is
      reduced by 1, to a minimum of 0

      On the other hand, for every full 25 conquest tokens the
      heroes' total is above the overlord's total, the overlord's
      conquest value is increased by 1
      */
      var overLordTockens = (overlord.conquestTockens || 0);
      var heroesTockens = (heroParty.conquestTockens || 0 );
      var difference = Math.abs(overLordTockens - heroesTockens);
      var sign=1;
      if(overLordTockens>heroesTockens){
        sign=-1;
      }
      var df = Math.floor(difference/desCamaignCons.DIVINE_FACTOR_DIFFERENCE)*sign;
      return df;
    }

    function totalCampaignTockens(overlord, heroParty){
      var heroPartyConquestTockens = (heroParty.conquestTockens || 0 );
      var overLordTockens=(overlord.conquestTockens || 0);
      return heroPartyConquestTockens + overLordTockens;
    }

    function campaignLevel(overlord, heroParty){
      var level='LEVEL_CUPPER';
      var totalTockens = totalCampaignTockens(overlord, heroParty);
      if(totalTockens>=desCamaignCons.SILVER_THRESHOLD){
        level='LEVEL_SILVER';
      }else if(totalTockens>=desCamaignCons.GOLD_THRESHOLD){
        level='LEVEL_GOLD';
      }else if(totalTockens>=desCamaignCons.FINAL_BATTLE_THRESHOLD){
        level='LEVEL_GOLD_FINAL_BATTLE';
      }
      return $translate.instant(level);
    }
  }]);


text:
<?php

namespace WatchTower\Event;

use WatchTower\Identity\Identity;

/**
 * Identify event
 *
 * Handles the process of identifying an identity
 *
 * @package WatchTower\Event
 */
class Identify
	extends AbstractEvent
{
	/**
	 * Validates the Identity
	 *
	 * @param Identity $identity
	 */
	public function __construct(Identity $identity)
	{
		$this->identity = $identity;
	}
}


text:
package telegram

import (
	"github.com/tchap/steemwatch/errs"
	"github.com/tchap/steemwatch/notifications/events"
	"github.com/tchap/steemwatch/server/routes/api/notifiers/telegram"

	tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
	"github.com/pkg/errors"
	"gopkg.in/mgo.v2/bson"
)

const DefaultMaxConcurrentRequests = 1000

//
// Notifier
//

type Notifier struct {
	bot                   *tgbotapi.BotAPI
	maxConcurrentRequests uint
	requestSemaphore      chan struct{}
	termCh                chan struct{}
}

func NewNotifier(bot *tgbotapi.BotAPI, opts ...NotifierOption) *Notifier {
	notifier := &Notifier{
		bot: bot,
		maxConcurrentRequests: DefaultMaxConcurrentRequests,
		termCh:                make(chan struct{}),
	}

	for _, opt := range opts {
		opt(notifier)
	}

	notifier.requestSemaphore = make(chan struct{}, notifier.maxConcurrentRequests)

	return notifier
}

type NotifierOption func(*Notifier)

func SetMaxConcurrentRequests(maxConcurrentRequests uint) NotifierOption {
	return func(notifier *Notifier) {
		notifier.maxConcurrentRequests = maxConcurrentRequests
	}
}

func (notifier *Notifier) DispatchAccountUpdatedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.AccountUpdated,
) error {
	return notifier.dispatch(userId, userSettings, func() string {
		return renderAccountUpdatedEvent(event)
	})
}

func (notifier *Notifier) DispatchAccountWitnessVotedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.AccountWitnessVoted,
) error {
	return notifier.dispatch(userId, userSettings, func() string {
		return renderAccountWitnessVotedEvent(event)
	})
}

func (notifier *Notifier) DispatchTransferMadeEvent(
	userId string,
	userSettings bson.Raw,
	event *events.TransferMade,
) error {
	return notifier.dispatch(userId, userSettings, func() string {
		return renderTransferMadeEvent(event)
	})
}

func (notifier *Notifier) DispatchUserMentionedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.UserMentioned,
) error {
	return notifier.dispatch(userId, userSettings, func() string {
		return renderUserMentionedEvent(event)
	})
}

func (notifier *Notifier) DispatchUserFollowStatusChangedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.UserFollowStatusChanged,
) error {
	return notifier.dispatch(userId, userSettings, func() string {
		return renderUserFollowStatusChangedEvent(event)
	})
}

func (notifier *Notifier) DispatchStoryPublishedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.StoryPublished,
) error {
	return notifier.dispatch(userId, userSettings, func() string {
		return renderStoryPublishedEvent(event)
	})
}

func (notifier *Notifier) DispatchStoryVotedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.StoryVoted,
) error {
	return notifier.dispatch(userId, userSettings, func() string {
		return renderStoryVotedEvent(event)
	})
}

func (notifier *Notifier) DispatchCommentPublishedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.CommentPublished,
) error {
	return notifier.dispatch(userId, userSettings, func() string {
		return renderCommentPublishedEvent(event)
	})
}

func (notifier *Notifier) DispatchCommentVotedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.CommentVoted,
) error {
	return notifier.dispatch(userId, userSettings, func() string {
		return renderCommentVotedEvent(event)
	})
}

func (notifier *Notifier) dispatch(
	userId string,
	userSettings bson.Raw,
	render func() string,
) error {
	var settings telegram.Settings
	if err := userSettings.Unmarshal(&settings); err != nil {
		return errors.Wrap(err, "failed to unmarshal user settings")
	}

	return notifier.send(&settings, render())
}

func (notifier *Notifier) send(settings *telegram.Settings, text string) error {
	// Acquire a request slot.
	select {
	case notifier.requestSemaphore <- struct{}{}:
		defer func() {
			<-notifier.requestSemaphore
		}()
	case <-notifier.termCh:
		return errs.ErrClosing
	}

	// Send the message.
	msg := tgbotapi.NewMessage(settings.ChatID, text)
	msg.ParseMode = "Markdown"
	_, err := notifier.bot.Send(msg)
	return errors.Wrap(err, "failed to send message to Telegram")
}

func (notifier *Notifier) Close() error {
	select {
	case <-notifier.termCh:
		return errs.ErrClosing
	default:
		close(notifier.termCh)
		return nil
	}
}


text:
package com.amazonaws.services.kafkaconnect.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * Details about delivering logs to Amazon S3.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class S3LogDelivery implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The name of the S3 bucket that is the destination for log delivery.
     *

     */
    private String bucket;
    /**
     *

     * Specifies whether connector logs get sent to the specified Amazon S3 destination.
     *

     */
    private Boolean enabled;
    /**
     *

     * The S3 prefix that is the destination for log delivery.
     *

     */
    private String prefix;

    /**
     *

     * The name of the S3 bucket that is the destination for log delivery.
     *

     *
     * @param bucket
     *        The name of the S3 bucket that is the destination for log delivery.
     */

    public void setBucket(String bucket) {
        this.bucket = bucket;
    }

    /**
     *

     * The name of the S3 bucket that is the destination for log delivery.
     *

     *
     * @return The name of the S3 bucket that is the destination for log delivery.
     */

    public String getBucket() {
        return this.bucket;
    }

    /**
     *

     * The name of the S3 bucket that is the destination for log delivery.
     *

     *
     * @param bucket
     *        The name of the S3 bucket that is the destination for log delivery.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public S3LogDelivery withBucket(String bucket) {
        setBucket(bucket);
        return this;
    }

    /**
     *

     * Specifies whether connector logs get sent to the specified Amazon S3 destination.
     *

     *
     * @param enabled
     *        Specifies whether connector logs get sent to the specified Amazon S3 destination.
     */

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    /**
     *

     * Specifies whether connector logs get sent to the specified Amazon S3 destination.
     *

     *
     * @return Specifies whether connector logs get sent to the specified Amazon S3 destination.
     */

    public Boolean getEnabled() {
        return this.enabled;
    }

    /**
     *

     * Specifies whether connector logs get sent to the specified Amazon S3 destination.
     *

     *
     * @param enabled
     *        Specifies whether connector logs get sent to the specified Amazon S3 destination.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public S3LogDelivery withEnabled(Boolean enabled) {
        setEnabled(enabled);
        return this;
    }

    /**
     *

     * Specifies whether connector logs get sent to the specified Amazon S3 destination.
     *

     *
     * @return Specifies whether connector logs get sent to the specified Amazon S3 destination.
     */

    public Boolean isEnabled() {
        return this.enabled;
    }

    /**
     *

     * The S3 prefix that is the destination for log delivery.
     *

     *
     * @param prefix
     *        The S3 prefix that is the destination for log delivery.
     */

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    /**
     *

     * The S3 prefix that is the destination for log delivery.
     *

     *
     * @return The S3 prefix that is the destination for log delivery.
     */

    public String getPrefix() {
        return this.prefix;
    }

    /**
     *

     * The S3 prefix that is the destination for log delivery.
     *

     *
     * @param prefix
     *        The S3 prefix that is the destination for log delivery.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public S3LogDelivery withPrefix(String prefix) {
        setPrefix(prefix);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getBucket() != null)
            sb.append("Bucket: ").append(getBucket()).append(",");
        if (getEnabled() != null)
            sb.append("Enabled: ").append(getEnabled()).append(",");
        if (getPrefix() != null)
            sb.append("Prefix: ").append(getPrefix());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof S3LogDelivery == false)
            return false;
        S3LogDelivery other = (S3LogDelivery) obj;
        if (other.getBucket() == null ^ this.getBucket() == null)
            return false;
        if (other.getBucket() != null && other.getBucket().equals(this.getBucket()) == false)
            return false;
        if (other.getEnabled() == null ^ this.getEnabled() == null)
            return false;
        if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false)
            return false;
        if (other.getPrefix() == null ^ this.getPrefix() == null)
            return false;
        if (other.getPrefix() != null && other.getPrefix().equals(this.getPrefix()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getBucket() == null) ? 0 : getBucket().hashCode());
        hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode());
        hashCode = prime * hashCode + ((getPrefix() == null) ? 0 : getPrefix().hashCode());
        return hashCode;
    }

    @Override
    public S3LogDelivery clone() {
        try {
            return (S3LogDelivery) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.kafkaconnect.model.transform.S3LogDeliveryMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
package uk.gov.gds.ier.transaction.crown.statement

import uk.gov.gds.ier.test.ControllerTestSuite

class StatementStepTests extends ControllerTestSuite {

  behavior of "StatementStep.get"

  it should "display the page" in {
    running(FakeApplication()) {
      val Some(result) = route(
        FakeRequest(GET, "/register-to-vote/crown/statement")
          .withIerSession()
      )

      status(result) should be(OK)
      contentType(result) should be(Some("text/html"))
      contentAsString(result) should include(
        "Which of these statements applies to you?"
      )
    }
  }

  behavior of "StatementStep.post"
  it should "bind and redirect to the address step (crownServant)" in {
    running(FakeApplication()) {
      val Some(result) = route(
        FakeRequest(POST, "/register-to-vote/crown/statement")
          .withIerSession()
          .withFormUrlEncodedBody("statement.crownServant" -> "true")
      )

      status(result) should be(SEE_OTHER)
      redirectLocation(result) should be(Some("/register-to-vote/crown/address/first"))
    }
  }

  it should "bind and redirect to the address step (crownPartner)" in {
    running(FakeApplication()) {
      val Some(result) = route(
        FakeRequest(POST, "/register-to-vote/crown/statement")
          .withIerSession()
          .withFormUrlEncodedBody("statement.crownPartner" -> "true")
      )

      status(result) should be(SEE_OTHER)
      redirectLocation(result) should be(Some("/register-to-vote/crown/address/first"))
    }
  }

  it should "bind and redirect to the address step (councilEmployee)" in {
    running(FakeApplication()) {
      val Some(result) = route(
        FakeRequest(POST, "/register-to-vote/crown/statement")
          .withIerSession()
          .withFormUrlEncodedBody("statement.councilEmployee" -> "true")
      )

      status(result) should be(SEE_OTHER)
      redirectLocation(result) should be(Some("/register-to-vote/crown/address/first"))
    }
  }

  it should "bind and redirect to the address step (councilPartner)" in {
    running(FakeApplication()) {
      val Some(result) = route(
        FakeRequest(POST, "/register-to-vote/crown/statement")
          .withIerSession()
          .withFormUrlEncodedBody("statement.councilPartner" -> "true")
      )

      status(result) should be(SEE_OTHER)
      redirectLocation(result) should be(Some("/register-to-vote/crown/address/first"))
    }
  }

  it should "error because no answer given" in {
    running(FakeApplication()) {
      val Some(result) = route(
        FakeRequest(POST, "/register-to-vote/crown/statement")
          .withIerSession()
      )

      status(result) should be(OK)
      contentAsString(result) should include("Please answer this question")
    }
  }

  it should "error on two me answers (councilEmployee and crownServant)" in {
    running(FakeApplication()) {
      val Some(result) = route(
        FakeRequest(POST, "/register-to-vote/crown/statement")
          .withIerSession()
          .withFormUrlEncodedBody(
            "statement.councilEmployee" -> "true",
            "statement.crownServant" -> "true"
          )
      )

      status(result) should be(OK)
      contentAsString(result) should include(
        "Please select only one of these answers"
      )
    }
  }
  it should "error on two partner answers (councilPartner and crownPartner)" in {
    running(FakeApplication()) {
      val Some(result) = route(
        FakeRequest(POST, "/register-to-vote/crown/statement")
          .withIerSession()
          .withFormUrlEncodedBody(
            "statement.councilPartner" -> "true",
            "statement.crownPartner" -> "true"
          )
      )

      status(result) should be(OK)
      contentAsString(result) should include(
        "Please select only one of these answers"
      )
    }
  }

  it should "bind successfully and redirect to the confirmation step with a complete application" in {
    running(FakeApplication()) {
      val Some(result) = route(
        FakeRequest(POST, "/register-to-vote/crown/statement")
          .withIerSession()
          .withApplication(completeCrownApplication)
          .withFormUrlEncodedBody(
            "statement.crownServant" -> "true"
          )
      )

      status(result) should be(SEE_OTHER)
      redirectLocation(result) should be(Some("/register-to-vote/crown/confirmation"))
    }
  }
}


text:
package org.xbib.elasticsearch.action.plugin.jdbc.state.delete;

import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.TransportMasterNodeOperationAction;
import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ack.ClusterStateUpdateResponse;
import org.elasticsearch.cluster.block.ClusterBlockException;
import org.elasticsearch.cluster.block.ClusterBlockLevel;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.Injector;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import org.xbib.elasticsearch.plugin.jdbc.state.RiverStateService;

public class TransportDeleteRiverStateAction extends TransportMasterNodeOperationAction<DeleteRiverStateRequest, DeleteRiverStateResponse> {

    private final Injector injector;

    @Inject
    public TransportDeleteRiverStateAction(Settings settings, ThreadPool threadPool,
                                           ClusterService clusterService, TransportService transportService,
                                           ActionFilters actionFilters,
                                           Injector injector) {
        super(settings, DeleteRiverStateAction.NAME, transportService, clusterService, threadPool, actionFilters);
        this.injector = injector;
    }

    @Override
    protected String executor() {
        return ThreadPool.Names.MANAGEMENT;
    }

    @Override
    protected DeleteRiverStateRequest newRequest() {
        return new DeleteRiverStateRequest();
    }

    @Override
    protected DeleteRiverStateResponse newResponse() {
        return new DeleteRiverStateResponse();
    }

    @Override
    protected ClusterBlockException checkBlock(DeleteRiverStateRequest request, ClusterState state) {
        return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA, "");
    }

    @Override
    protected void masterOperation(DeleteRiverStateRequest request, ClusterState state, final ActionListener<DeleteRiverStateResponse> listener) throws ElasticsearchException {
        RiverStateService riverStateService = injector.getInstance(RiverStateService.class);
        riverStateService.deleteRiverState(new RiverStateService.DeleteRiverStateRequest("delete_river_state[" + request.getRiverName() + "/" + request.getRiverType() + "]", request.getRiverName(), request.getRiverType())
                .masterNodeTimeout(request.masterNodeTimeout())
                .ackTimeout(request.ackTimeout()), new ActionListener<ClusterStateUpdateResponse>() {
            @Override
            public void onResponse(ClusterStateUpdateResponse clusterStateUpdateResponse) {
                listener.onResponse(new DeleteRiverStateResponse(clusterStateUpdateResponse.isAcknowledged()));
            }

            @Override
            public void onFailure(Throwable e) {
                listener.onFailure(e);
            }
        });
    }

}


text:
$HOME/.xfunky/statusbar/bar.sh &> /dev/null
$HOME/.local/bin/xfunky


text:
.. _train-examples:

Ray Train Examples
==================

.. Example .rst files should be organized in the same manner as the
   .py files in ray/python/ray/train/examples.

Below are examples for using Ray Train with a variety of models, frameworks,
and use cases.

General Examples
----------------

PyTorch
~~~~~~~

* :doc:`/train/examples/pytorch/torch_fashion_mnist_example`:
  End-to-end example for PyTorch.

* :doc:`/train/examples/transformers/transformers_example`:
  End-to-end example for HuggingFace Transformers (PyTorch).

TensorFlow
~~~~~~~~~~

* :doc:`/train/examples/tf/tensorflow_mnist_example`:
  End-to-end example for TensorFlow

Horovod
~~~~~~~

* :doc:`/train/examples/horovod/horovod_example`:
  End-to-end example for Horovod (with PyTorch)

Logger/Callback Examples
------------------------
* :doc:`/train/examples/mlflow_fashion_mnist_example`:
  Example for logging training to MLflow via the ``MLflowLoggerCallback``

Ray Tune Integration Examples
-----------------------------

* :doc:`/train/examples/tf/tune_tensorflow_mnist_example`:
  End-to-end example for tuning a TensorFlow model.

* :doc:`/train/examples/pytorch/tune_cifar_torch_pbt_example`:
  End-to-end example for tuning a PyTorch model with PBT.

..
    TODO implement these examples!

    Features
    --------

    * Example for using a custom callback
    * End-to-end example for running on an elastic cluster (elastic training)

    Models
    ------

    * Example training on Vision model.

Benchmarks
----------

* :doc:`/train/examples/pytorch/torch_data_prefetch_benchmark/benchmark_example`:
  Benchmark example for the PyTorch data transfer auto pipeline.


text:
class HttpError extends Error {
    constructor(status = 500, message = 'Unknown error') {
        super();
        this.status = status;
        this.message = message;
    }

    get json() {
        return {
            message: this.message
        };
    }
}

module.exports = HttpError;


text:
Imports System
Imports System.Net
Imports Independentsoft.Exchange

Namespace Sample
    Class Module1
        Shared Sub Main(ByVal args As String())

            Dim credential As New NetworkCredential("username", "passsword")
            Dim service As New Service("https://myserver/ews/Exchange.asmx", credential)

            Try

                Dim mailbox As New Mailbox("John@mydomain.com")

                Dim delegateUser As New DelegateUser("Mark@mydomain.com")
                delegateUser.CalendarFolderPermissionLevel = DelegateFolderPermissionLevel.Author

                Dim response As DelegateUserResponse = service.AddDelegate(mailbox, delegateUser)

            Catch ex As ServiceRequestException
                Console.WriteLine("Error: " + ex.Message)
                Console.WriteLine("Error: " + ex.XmlMessage)
                Console.Read()
            Catch ex As WebException
                Console.WriteLine("Error: " + ex.Message)
                Console.Read()
            End Try

        End Sub
    End Class
End Namespace


text:
@interface BookInfo : NSObject
@property long long lastOffset;

@end


text:
package com.azure.cosmos;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import static org.assertj.core.api.Assertions.assertThat;

public class ConsistencyLevelTest {

    @Test(groups = { "unit" }, dataProvider = "expectedSerializationProvider")
    public void consistencyEnumToServiceExpectedFormat(ConsistencyLevel level, String expectedOverWireAsString) {
        assertThat(level.toString()).isEqualTo(expectedOverWireAsString);
    }

    @Test(groups = { "unit" }, dataProvider = "expectedSerializationProvider")
    public void consistencyEnumFromServiceExpectedFormat(ConsistencyLevel expectedConsistencyLevel, String overWireAsString) {
        assertThat(ConsistencyLevel.fromServiceSerializedFormat(overWireAsString)).isEqualTo(expectedConsistencyLevel);
    }

    @Test(groups = { "unit" })
    public void consistencyEnumFromUnknownString() {
        assertThat(ConsistencyLevel.fromServiceSerializedFormat(null)).isNull();
        assertThat(ConsistencyLevel.fromServiceSerializedFormat("xyz")).isNull();
        assertThat(ConsistencyLevel.fromServiceSerializedFormat("session")).isNull();
    }

    @DataProvider(name = "expectedSerializationProvider")
    private Object[][] expectedSerializationProvider() {
        return new Object[][]{

            {
                ConsistencyLevel.SESSION, "Session"
            },

            {
                ConsistencyLevel.STRONG, "Strong"
            },

            {
                ConsistencyLevel.EVENTUAL, "Eventual"
            },

            {
                ConsistencyLevel.CONSISTENT_PREFIX, "ConsistentPrefix"
            },

            {
                ConsistencyLevel.BOUNDED_STALENESS, "BoundedStaleness"
            },
        };
    }
}


text:
import * as React from 'react';
import MuiError from '@mui/utils/macros/MuiError.macro';
import {
  MuiPickersAdapterContext,
  MuiPickersAdapterContextValue,
} from '../../../LocalizationProvider';

// Required for babel https://github.com/vercel/next.js/issues/7882. Replace with `export type` in future
export type MuiPickersAdapter<TDate = unknown> =
  import('../../../LocalizationProvider').MuiPickersAdapter<TDate>;

function useLocalizationContext<T>() {
  const localization = React.useContext(MuiPickersAdapterContext);
  if (localization === null) {
    throw new MuiError(
      'Can not find utils in context. It looks like you forgot to wrap your component in LocalizationProvider, or pass dateAdapter prop directly.',
    );
  }

  return localization as MuiPickersAdapterContextValue<T>;
}

export function useUtils<T = unknown>() {
  return useLocalizationContext<T>().utils;
}

export function useDefaultDates<T>() {
  return useLocalizationContext<T>().defaultDates;
}

export function useNow<TDate = unknown>(): TDate {
  const utils = useUtils<TDate>();
  const now = React.useRef(utils.date());

  return now.current!;
}