text:
"""This module provides basic manipulation of a dirsig bin file.

Usage:
    To read a bin file:
        binfile = dirsig.lidarbin.readbin(filename)
    To get the true signals:
        signal = get_signal( binfile )
    To get the range of each time bin for each pulse:
        range = get_bin_range( binfile )

External Dependancies:
    numpy

Author(s):
    Paul Romanczyk      par4249 at rit dot edu

Copyright:
    (c) 2015 Rochester Institute of Technology

References:
    [1] http://www.dirsig.org/docs/new/bin.html (Accessed 2013-02-09).

"""

__author__ = "Paul Romanczyk"
__copyright__ = "Copyright 2015, Rochester Institute of Technology"
__credits__ = []
__license__ = "MIT"
#__version__ = "1.0.1"
__maintainer__ = "Paul Romanczyk"
__email__ = "par4249@rit.edu"
__status__ = "Production"

import numpy

def print_bin_file(data, tab=0):
    """Prints a bin file.

    This prints the contents of a bin file. This is mostly used for debugging.

    Args:
        data (dict): The bin file to print.
        tab (int, optional): the number of tabs to use. The default is 0.

    Returns:
        None

    Warning:
        You may not want to use this on bin files with many pulses as it will
        print alot.

    """

    def print_matrix(matrix, tab):
        """Prints a numpy.matrix with tabs.

        Args:
            matrix (numpy.matrix): The matrix to print.
            tab  (int): the number of tabs to use.

        Returns:
            None

        """

        for i in range(matrix.shape[0]):
            print tab * '\t', matrix[i, :]
        return

    if type(data) is dict:
        keys = data.keys()
        for key in sorted(keys):
            if type(data[key]) is dict:
                print tab * '\t' + key + ':'
                print_bin_file(data[key], tab + 1)
            elif type(data[key]) is list:
                print tab * '\t' + key + ':'
                print_bin_file(data[key], tab + 1)
            elif type(data[key]) is numpy.matrixlib.defmatrix.matrix:
                print tab * '\t' + key + ':'
                print_matrix(data[key], tab + 1)
            elif type(data[key]) is numpy.ndarray:
                print tab * '\t' + key + ':', type(data[key]), 'shape:', \
                    data[key].shape
                #print data[key]
            else:
                print tab * '\t' + key + ':', data[key]
    elif type(data) is list:
        for item in data:
            print_bin_file(item, tab)
    else:
        print type(data)
    return

def get_passive_term(bin_data):
    """Returns the passive term for each pulse of a bin file.

    Args:
        bin_data (dict): The bin file.

    Returns:
        A list containing tasks. Each task is a list containing a numpy.array
        with the passive term.

    """

    output = []
    for task in bin_data['tasks']:
        task_data = []
        for pulse in task['pulses']:
            task_data.append(pulse['data'][:, :, 0])
        output.append(task_data)
    return output

def get_active_term(bin_data):
    """Returns the active term for each pulse of a bin file.

    Args:
        bin_data (dict): The bin file.

    Returns:
        A list containing tasks. Each task is a list containing a numpy.array
        with the active term.

    """
    output = []
    for task in bin_data['tasks']:
        task_data = []
        for pulse in task['pulses']:
            task_data.append(pulse['data'][:, :, 1:])
        output.append(task_data)
    return output

def packed_bin_to_signal(active, passive, time_bin_width):
    """Computes the signal for a waveform.

    Combines the passive and active terms to compute the signal. The units of the
    active term are photons, the passive term are photons/second, and the time
    bin width is in seconds. The singal can be computed using:
        signal = active + passive * time_bin_width

    Args:
        active (numpy.array): The active term (n x m x p). The units are photons.
        passive (numpy.array): The passive term (n x m x 1 numpy.array). The
            units are photons/second.
        time_bin_width (float): The width of a time bin. The units are seconds.

    Returns:
        A numpy.array of size n x m x p (same as the active compontent)
        containing the signal.

    """
    shape = active.shape

    # normalize the passive term by the time bin width in seconds
    passive = numpy.repeat(numpy.reshape(passive, (shape[0], shape[1], 1)), \
        shape[2], axis=2) * time_bin_width

    return active + passive

def get_signal(bin_data):
    """Returns the signal (in photons) for each pulse of a bin file.

    Args:
        bin_data (dict): The bin file.

    Returns:
        A list containing tasks. Each task is a list containing a numpy.array
        with the signal.

    """
    output = []
    for task in bin_data['tasks']:
        task_data = []
        for pulse in task['pulses']:
            time_bin_width = pulse['header']['time gate stop'] - \
                pulse['header']['time gate start']
            task_data.append(packed_bin_to_signal(pulse['data'][:, :, 1:], \
                pulse['data'][:, :, 0], time_bin_width))
        output.append(task_data)
    return output

def get_bin_range(bin_data):
    """Returns the range in meters for each pulse.

    Args:
        bin_data (dict): The bin file.

    Returns:
        A list containing tasks. Each task is a list containing a numpy.array
        of size 1 x 1 x p (same number of time bins as the active part of the
        signal) contating the range in meters to each time bin.

    """

    cd2 = 299792458. / 2.0 # speed of light over 2
    output = []
    for task in bin_data['tasks']:
        task_data = []
        for pulse in task['pulses']:
            task_data.append(numpy.linspace(\
                pulse['header']['time gate start'] * cd2, \
                pulse['header']['time gate stop'] * cd2, \
                pulse['header']['time gate bin count']))

    return output


text:
(function( $ ) {
    $.fn.AutoPagination = function( options ) {

        var opts = $.extend( {}, $.fn.AutoPagination.defaults, options ),
            $this = $( this );

        // Hide the 'nextPageSelector' anchor since it the point of this
        // plugin is that one shouldn't need to click 'Next Page'
        $( opts.nextPageSelector ).hide();

        // scroll event fires repeatedly as the window is scrolled
        $( window ).scroll(function() {
            $( opts.nextPageSelector ).show(); // nextPage has to be visible, else the position will be 0

            // if 'nextPageSelector' anchor href isn't empty and...
            if ( $( opts.nextPageSelector ).attr( 'href' ) &&
                    // ...window scroll is less then 'nextPageBufferPx' pixels away from it
                $( window ).scrollTop() + $( window ).height() >
                $( opts.nextPageSelector).last().offset().top - opts.nextPageBufferPx ) {

                // remember the 'nextPageSelector' anchor href as 'nextPage'
                var nextPage = $( opts.nextPageSelector ).attr( 'href' );

                // maybe use raw link
                if($( opts.nextPageSelector ).data('raw-page-link')) {
                    nextPage = $( opts.nextPageSelector ).data('raw-page-link');
                }

                // set the 'nextPageSelector' anchor href to an empty string
                $( opts.nextPageSelector ).attr( 'href', '' );

                // add loader div to DOM after last panel
                $( '
'+
                (opts.loaderImage ? '' : opts.loaderText)+
                '
' ).insertAfter( $this.find( opts.panelSelector ).last() );

                // use ajax 'GET' to grab the 'nextPage' html
                $.get( nextPage, function(data) {

                    var content = $('
'+data+'
'); // we have to wrap it in another div, because jquery doesn't parse the outer divs somehow...

                    // for each 'panelSelector' element in the loaded data...
                    window.apdata = data;
                    content.find( opts.panelSelector ).each(function( index, el ) {
                        // ...insert it after the last 'panelSelector'
                        $( el ).insertAfter( $this.find( opts.panelSelector ).last() );
                    });

                    // remove loader div from DOM
                    $( '.'+opts.loaderDivClass ).remove();

                    // reset the 'nextPageSelector' anchor href
                    $( opts.nextPageSelector ).attr( 'href', content.find( opts.nextPageSelector ).attr( 'href' ) );
                    $( opts.nextPageSelector ).data( 'raw-page-link', content.find( opts.nextPageSelector ).data( 'raw-page-link' ) );

                }); // closing of ajax 'GET'

            } // closing of if 'nextPageSelector' anchor...
            $( opts.nextPageSelector ).hide(); // hide the nextPage element again
        }); // closing of scroll event
    };

    $.fn.AutoPagination.defaults = {
        nextPageBufferPx: 200,
        nextPageSelector: '.nextPage',
        panelSelector: '.panel',
        loaderDivClass: 'ajax-loader',
        loaderDivStyle: 'text-align:center',
        loaderImage: 'ajax-loader.gif',
        loaderText: 'Loading...'
    };
})(jQuery);

redpajama_set_name: RedPajamaGithub


text:
import {
  minColumnStart,
  maxColumnStart,
  minRowStart,
  maxRowStart,
  minColumnEnd,
  maxColumnEnd,
  minRowEnd,
  maxRowEnd,
} from '../bounds';

import {grid} from '../grid';

test('should return the min column start of the grid', () => {
  const template = `
    ". a a a"
    ". a a a"
    ". . b b"
  `;

  const test = minColumnStart(grid(template));
  const expected = 2;

  expect(test).toBe(expected);
});

test('should return the max column start of the grid', () => {
  const template = `
    ". a a a"
    ". a a a"
    ". . b b"
  `;

  const test = maxColumnStart(grid(template));
  const expected = 3;

  expect(test).toBe(expected);
});

test('should return the min row start of the grid', () => {
  const template = `
    ". . a a"
    "b b a a"
    "b b a a"
  `;

  const test = minRowStart(grid(template));
  const expected = 1;

  expect(test).toBe(expected);
});

test('should return the max row start of the grid', () => {
  const template = `
    ". . a a"
    "b b a a"
    "b b a a"
  `;

  const test = maxRowStart(grid(template));
  const expected = 2;

  expect(test).toBe(expected);
});

test('should return the min column end of the grid', () => {
  const template = `
    "a a a ."
    "a a a ."
    ". . b b"
  `;

  const test = minColumnEnd(grid(template));
  const expected = 4;

  expect(test).toBe(expected);
});

test('should return the max column end of the grid', () => {
  const template = `
    "a a a ."
    "a a a ."
    ". . b b"
  `;

  const test = maxColumnEnd(grid(template));
  const expected = 5;

  expect(test).toBe(expected);
});

test('should return the min row end of the grid', () => {
  const template = `
    "a a b b"
    "a a . ."
    "a a . ."
  `;

  const test = minRowEnd(grid(template));
  const expected = 2;

  expect(test).toBe(expected);
});

test('should return the max row end of the grid', () => {
  const template = `
    "a a b b"
    "a a . ."
    "a a . ."
  `;

  const test = maxRowEnd(grid(template));
  const expected = 4;

  expect(test).toBe(expected);
});


text:
/*
 * $RCSfile: ConvolveDescriptor.java,v $
 *
 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
 *
 * Use is subject to license terms.
 *
 * $Revision: 1.1 $
 * $Date: 2005/02/11 04:57:32 $
 * $State: Exp $
 */
package com.lightcrafts.jai.operator;

import com.lightcrafts.media.jai.util.AreaOpPropertyGenerator;
import java.awt.RenderingHints;
import java.awt.image.RenderedImage;
import com.lightcrafts.mediax.jai.JAI;
import com.lightcrafts.mediax.jai.KernelJAI;
import com.lightcrafts.mediax.jai.OperationDescriptorImpl;
import com.lightcrafts.mediax.jai.ParameterBlockJAI;
import com.lightcrafts.mediax.jai.PropertyGenerator;
import com.lightcrafts.mediax.jai.RenderedOp;
import com.lightcrafts.mediax.jai.registry.RenderedRegistryMode;

/**
 * An OperationDescriptor describing the "Convolve" operation.
 *
 *
 Convolution is a spatial operation that computes each output
 * sample by multiplying elements of a kernel with the samples
 * surrounding a particular source sample.
 *
 *
 For each destination sample, the kernel is rotated 180 degrees
 * and its "key element," or origin, is placed over the source pixel
 * corresponding with the destination pixel.  The kernel elements are
 * multiplied with the source pixels beneath them, and the resulting
 * products are summed together to produce the destination sample
 * value.
 *
 *
 Pseudocode for the convolution operation on a single sample
 * dst[x][y] is as follows, assuming the kernel is of size width x height
 * and has already been rotated through 180 degrees.  The kernel's Origin
 * element is located at position (xOrigin, yOrigin):
 *
 *

 * dst[x][y] = 0;
 * for (int i = -xOrigin; i < -xOrigin + width; i++) {
 *     for (int j = -yOrigin; j < -yOrigin + height; j++) {
 *         dst[x][y] += src[x + i][y + j]*kernel[xOrigin + i][yOrigin + j];
 *     }
 * }
 *

 *
 *
 Convolution, like any neighborhood operation, leaves a band of
 * pixels around the edges undefined.  For example, for a 3x3 kernel
 * only four kernel elements and four source pixels contribute to the
 * convolution pixel at the corners of the source image.  Pixels that
 * do not allow the full kernel to be applied to the source are not
 * included in the destination image.  A "Border" operation may be used
 * to add an appropriate border to the source image in order to avoid
 * shrinkage of the image boundaries.
 *
 *
 The kernel may not be bigger in any dimension than the image data.
 *
 * It should be noted that this operation automatically adds a
 * value of Boolean.TRUE for the
 * JAI.KEY_REPLACE_INDEX_COLOR_MODEL to the given
 * configuration so that the operation is performed
 * on the pixel values instead of being performed on the indices into
 * the color map if the source(s) have an IndexColorModel.
 * This addition will take place only if a value for the
 * JAI.KEY_REPLACE_INDEX_COLOR_MODEL has not already been
 * provided by the user. Note that the configuration Map
 * is cloned before the new hint is added to it. The operation can be
 * smart about the value of the JAI.KEY_REPLACE_INDEX_COLOR_MODEL
 * RenderingHints, i.e. while the default value for the
 * JAI.KEY_REPLACE_INDEX_COLOR_MODEL is
 * Boolean.TRUE, in some cases the operator could set the
 * default.
 *
 *

 *
Resource List

 *
Name	        Value

 *
GlobalName	  Convolve

 *
LocalName	   Convolve

 *
Vendor	      com.lightcrafts.media.jai

 *
Description	 Performs kernel-based convolution
 *                              on an image.

 *
DocURL	      http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/ConvolveDescriptor.html

 *
Version	     1.0

 *
arg0Desc	    The convolution kernel.

 *

 *
 *

 *
Parameter List

 *
Name	   Class Type
 *                     Default Value

 *
kernel	 com.lightcrafts.mediax.jai.KernelJAI
 *                     NO_PARAMETER_DEFAULT
 *

 *
 * @see com.lightcrafts.mediax.jai.OperationDescriptor
 * @see com.lightcrafts.mediax.jai.KernelJAI
 */
public class LCSeparableConvolveDescriptor extends OperationDescriptorImpl {

    /**
     * The resource strings that provide the general documentation and
     * specify the parameter list for a Convolve operation.
     */
    private static final String[][] resources = {
        {"GlobalName",  "LCSeparableConvolve"},
        {"LocalName",   "LCSeparableConvolve"},
        {"Vendor",      "com.lightcrafts.jai"},
        {"Description", "Fast Convolution for Separable Kernels"},
        {"DocURL",      "http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/ConvolveDescriptor.html"},
        {"Version",     "1.0"},
        {"arg0Desc",    "an image..."}
    };

    /** The parameter names for the Convolve operation. */
    private static final String[] paramNames = {
        "kernel"
    };

    /** The parameter class types for the Convolve operation. */
    private static final Class[] paramClasses = {
        com.lightcrafts.mediax.jai.KernelJAI.class
    };

    /** The parameter default values for the Convolve operation. */
    private static final Object[] paramDefaults = {
        NO_PARAMETER_DEFAULT
    };

    /** Constructor. */
    public LCSeparableConvolveDescriptor() {
        super(resources, 1, paramClasses, paramNames, paramDefaults);
    }

    /**
      * Returns an array of PropertyGenerators implementing
      * property inheritance for the "Convolve" operation.
      *
      * @return  An array of property generators.
      */
    public PropertyGenerator[] getPropertyGenerators() {
        PropertyGenerator[] pg = new PropertyGenerator[1];
        pg[0] = new AreaOpPropertyGenerator();
        return pg;
    }

    /**
     * Performs kernel-based convolution on an image.
     *
     *
Creates a ParameterBlockJAI from all
     * supplied arguments except hints and invokes
     * {@link JAI#create(String,java.awt.image.renderable.ParameterBlock,RenderingHints)}.
     *
     * @see JAI
     * @see ParameterBlockJAI
     * @see RenderedOp
     *
     * @param source0 RenderedImage source 0.
     * @param kernel The convolution kernel.
     * @param hints The RenderingHints to use.
     * May be null.
     * @return The RenderedOp destination.
     * @throws IllegalArgumentException if source0 is null.
     * @throws IllegalArgumentException if kernel is null.
     */
    public static RenderedOp create(RenderedImage source0,
                                    KernelJAI kernel,
                                    RenderingHints hints)  {
        ParameterBlockJAI pb =
            new ParameterBlockJAI("LCSeparableConvolve",
                                  RenderedRegistryMode.MODE_NAME);

        pb.setSource("source0", source0);

        pb.setParameter("kernel", kernel);

        return JAI.create("LCSeparableConvolve", pb, hints);
    }
}


text:
using System;
using System.Collections;
using System.Net.Configuration;
using System.Reflection;
using System.Text;
using CacheByAttribute.Core.Extensions;

namespace CacheByAttribute.Core.KeyResolvers
{
    public static class KeyResolver
    {
        /// <summary>
        /// Generates a cache key based on the parameters passed to the method.
        /// </summary>
        /// <param name="methodBase"></param>
        /// <returns></returns>
        public static string ResolveKey(string keyPrefix, MethodBase methodBase, object[] paramValues)
        {
            Throw.IfNull(methodBase, "methodInfo");
            Throw.IfNull(paramValues, "paramValues");

            StringBuilder keyBuilder = new StringBuilder();

            keyBuilder.Append(string.IsNullOrEmpty(keyPrefix)
                                  ? BuildKeyPrefix(methodBase)
                                  : keyPrefix);

            keyBuilder.Append("(");
            keyBuilder.Append(BuildParamSignature(methodBase, paramValues));
            keyBuilder.Append(")");

            return keyBuilder.ToString();
        }

        private static string BuildParamSignature(MethodBase methodBase, object[] paramValues)
        {

            // Format a list with argument names and values.
            ParameterInfo[] paramInfos = methodBase.GetParameters();
            StringBuilder paramBuilder = new StringBuilder();
            bool hasItem = false;

            if (paramInfos.Length == paramValues.Length)
            {
                for (int paramIndex = 0; paramIndex < paramInfos.Length; paramIndex++)
                {
                    ParameterInfo paramInfo = paramInfos[paramIndex];

                    string value = GetParamValue(paramInfo, paramValues[paramIndex]) ?? "";

                    if (hasItem)
                        paramBuilder.Append(",");

                    if (paramInfos[paramIndex].IsOptional)
                    {
                        paramBuilder.Append(paramInfo.Name);
                        paramBuilder.Append(":");
                    }

                    hasItem = true;
                    paramBuilder.Append(value);

                }
            }

            return paramBuilder.ToString();

        }

        private static string BuildKeyPrefix(MethodBase methodBase)
        {
            StringBuilder sb=  new StringBuilder();
            sb.Append( methodBase.DeclaringType == null
                                ? ""
                                : string.Format("{0}.", methodBase.DeclaringType.FullName));

            sb.Append( methodBase.Name);

            return sb.ToString();
        }

        private static string GetParamValue(ParameterInfo paramInfo, object paramValue)
        {
            if (paramValue == null)
                return null;

            //If the param has a CacheKeyAttribute, use that to look up the key from the object.
            CacheKeyAttribute cacheKeyAttribute = paramInfo.GetCustomAttribute<CacheKeyAttribute>();
            if (cacheKeyAttribute != null)
                return GetPropertyFromObject(cacheKeyAttribute.PropertyName, paramValue);

            //If the parameter value is an object that implements IHasCacheKeyProperty then we use that value.
            if (paramValue is IHasCacheKey)
                return ((IHasCacheKey) paramValue).CacheKey;

            if (paramValue is IEnumerable && ! (paramValue is String) )
            {
                StringBuilder concatKeyBuilder= new StringBuilder();
                foreach (var item in (IEnumerable)paramValue)
                {
                    concatKeyBuilder.Append(string.Format("{0},", item.ToString()));
                }
                return concatKeyBuilder.ToString();
            }
            else
            {
                return  paramValue.ToString();
            }

        }

        private static string GetPropertyFromObject(string propertyName, object paramValue)
        {
            PropertyInfo property = paramValue.GetType().GetProperty(propertyName);
            if (property == null)
                return null;

            return property.GetValue(paramValue) == null
                       ? null
                       : property.GetValue(paramValue).ToString();
        }

    }
}


text:
package org.acaro.crowdgenerator.indexing;

public class Interval {
  public int low;
  public int high;

  public Interval(int min, int max) {
    this.low = min;
    this.high = max;
  }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Namespace Juhta.Net.WebApi.Exceptions.ServerErrors
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Namespace Juhta.Net.WebApi.Exceptions.ServerErrors
   ">
    <meta name="generator" content="docfx 2.28.2.0">

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

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

              </button>

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

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

              </form>

          Show / Hide Table of Contents

Namespace Juhta.Net.WebApi.Exceptions.ServerErrors

Classes

BadGatewayException

Defines an exception class for the HTTP error Bad Gateway.

GatewayTimeoutException

Defines an exception class for the HTTP error Gateway Timeout.

HttpVersionNotSupportedException

Defines an exception class for the HTTP error HTTP Version Not Supported.

InternalServerErrorException

Defines an exception class for the HTTP error Internal Server Error.

NotImplementedException

Defines an exception class for the HTTP error Not Implemented.

ServiceUnavailableException

Defines an exception class for the HTTP error Service Unavailable.

              Back to top

            Copyright © 2017-2019 Juha Lähteenmäki
Generated by DocFX


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.YearMonth = void 0;

var _filterExpressions = require("@looker/filter-expressions");

var _padStart = _interopRequireDefault(require("lodash/padStart"));

var _react = _interopRequireDefault(require("react"));

var _utils = require("../../../../../../../utils");

var _option_utils = require("../../../../../../utils/option_utils");

var _GroupSelect = require("../../../GroupSelect");

var _GroupInput = require("../../../GroupInput");

var YearMonth = function YearMonth(_ref) {
  var _ref$item = _ref.item,
      id = _ref$item.id,
      month = _ref$item.month,
      year = _ref$item.year,
      onChange = _ref.onChange;

  var _useTranslation = (0, _utils.useTranslation)('get_months'),
      t = _useTranslation.t;

  var months = (0, _filterExpressions.getMonths)(t);
  var monthNumber = Number.parseInt(month, 10) - 1;
  var monthString = months[monthNumber];

  var yearChange = function yearChange(e) {
    onChange(id, {
      year: e.target.value
    });
  };

  var monthChange = function monthChange(value) {
    var monthValue = (0, _padStart["default"])(String(months.indexOf(value) + 1), 2, '0');
    onChange(id, {
      month: monthValue
    });
  };

  return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_GroupSelect.GroupSelect, {
    value: monthString,
    options: (0, _option_utils.createOptions)(months),
    onChange: monthChange,
    placement: "middle"
  }), _react["default"].createElement(_GroupInput.GroupInput, {
    onChange: yearChange,
    value: year,
    placement: "right"
  }));
};

exports.YearMonth = YearMonth;
//# sourceMappingURL=YearMonth.js.map


text:
package de.tudarmstadt.ukp.experiments.argumentation.sequence.significance;

import org.apache.commons.math3.special.Beta;

/**
 * Java implementation of the Liddel's Exact Test. Based on the following Matlab code.
 *

 * {@code http://www.mathworks.com/matlabcentral/fileexchange/22024-liddell-s-exact-test}
 *

 * {@code http://www.jstor.org/stable/2988087}
 *

 * {@code http://code.metager.de/source/xref/gnu/octave/scripts/statistics/distributions/fcdf.m}
 *

 * {@code http://octave.sourceforge.net/octave/function/betainc.html}
 *

 * {@code http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/special/Beta.html#regularizedBeta%28double,%20double,%20double%29}
 *
 * @author Ivan Habernal
 */
public class LiddellsExactTest
{
    public static double pValue(int b, int d)
    {
        double r = Math.max(b, d);
        double s = Math.min(b, d);

        double f = r / (s + 1);

        double mm = 2 * (s + 1);
        double nn = 2 * r;

        double betaPar1 = 1.0 / (1 + mm * f / nn);
        double betaPar2 = nn / 2;
        double betaPar3 = mm / 2;

        double beta = Beta.regularizedBeta(betaPar1, betaPar2, betaPar3);

        double pValue = 2 * (1 - (1 - beta));

        //        if (pValue < 0.1) {
        //            System.out.println(r);
        //            System.out.println(s);
        //        }

        return pValue;
    }
}


text:
<!doctype html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="theme-color" content="#E91E63">
    <link rel="manifest" href="%PUBLIC_URL%/manifest.json">

    <title>Cashier</title>

    You need to enable JavaScript to run this app.


text:
import click

from globus_cli.login_manager import LoginManager
from globus_cli.parsing import IdentityType, ParsedIdentity, command
from globus_cli.termio import Field, TextMode, display

APPROVED_USER_FIELDS = [
    Field("Group ID", "group_id"),
    Field("Approved User ID", "identity_id"),
    Field("Approved User Username", "username"),
]

@command("approve", short_help="Approve a member to join a group")
@click.argument("group_id", type=click.UUID)
@click.argument("user", type=IdentityType())
@LoginManager.requires_login(LoginManager.GROUPS_RS)
def member_approve(group_id: str, user: ParsedIdentity, login_manager):
    """
    Approve a pending member to join a group, changing their status from 'invited'
    to 'active'.

    The USER argument may be an identity ID or username (whereas the group must be
    specified with an ID).
    """
    auth_client = login_manager.get_auth_client()
    groups_client = login_manager.get_groups_client()
    identity_id = auth_client.maybe_lookup_identity_id(user.value)
    if not identity_id:
        raise click.UsageError(f"Couldn't determine identity from user value: {user}")
    actions = {"approve": [{"identity_id": identity_id}]}
    response = groups_client.batch_membership_action(group_id, actions)
    if not response.get("approve", None):
        try:
            raise ValueError(response["errors"]["approve"][0]["detail"])
        except (IndexError, KeyError):
            raise ValueError("Could not approve the user to join the group")
    display(
        response,
        text_mode=TextMode.text_record,
        fields=APPROVED_USER_FIELDS,
        response_key=lambda data: data["approve"][0],
    )


text:
static NSString *const DEFAULT_KEYWORD = @"ytdl";
static NSString *const UPLOAD_PLAYLIST = @"test_playlist";

static NSString *const kClientID = @"453667159707-rttvli5a8pko643ip3nipc0b7ne6s87v.apps.googleusercontent.com";
static NSString *const kClientSecret = @"5ZmnqSh566ot5CeKq-z4KTir";

static NSString *const kKeychainItemName = @"YouTube Direct Lite";

@interface Utils : NSObject

+ (UIAlertView*)showWaitIndicator:(NSString *)title;
+ (void)showAlert:(NSString *)title message:(NSString *)message;
+ (NSString *)humanReadableFromYouTubeTime:(NSString *)youTubeTimeFormat;

@end


text:
<?php

namespace Application\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * NmtInventoryItemPurchasing
 *
 * @ORM\Table(name="nmt_inventory_item_purchasing", indexes={@ORM\Index(name="nmt_inventory_item_purchasing_FK3_idx", columns={"currency_id"}), @ORM\Index(name="nmt_inventory_item_purchasing_FK4_idx", columns={"created_by"}), @ORM\Index(name="nmt_inventory_item_purchasing_FK2_idx", columns={"vendor_id"}), @ORM\Index(name="nmt_inventory_item_purchasing_FK5_idx", columns={"pmt_term_id"}), @ORM\Index(name="nmt_inventory_item_purchasing_FK6_idx", columns={"pmt_method_id"}), @ORM\Index(name="nmt_inventory_item_purchasing_FK7_idx", columns={"last_change_by"}), @ORM\Index(name="nmt_inventory_item_purchasing_FK8_idx", columns={"item_id"})})
 * @ORM\Entity
 */
class NmtInventoryItemPurchasing
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="token", type="string", length=50, nullable=true)
     */
    private $token;

    /**
     * @var string
     *
     * @ORM\Column(name="checksum", type="string", length=50, nullable=true)
     */
    private $checksum;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_preferred_vendor", type="boolean", nullable=true)
     */
    private $isPreferredVendor;

    /**
     * @var string
     *
     * @ORM\Column(name="vendor_item_code", type="string", length=45, nullable=false)
     */
    private $vendorItemCode;

    /**
     * @var string
     *
     * @ORM\Column(name="vendor_item_unit", type="string", length=45, nullable=false)
     */
    private $vendorItemUnit;

    /**
     * @var string
     *
     * @ORM\Column(name="conversion_factor", type="decimal", precision=10, scale=4, nullable=false)
     */
    private $conversionFactor;

    /**
     * @var string
     *
     * @ORM\Column(name="conversion_text", type="string", length=45, nullable=true)
     */
    private $conversionText;

    /**
     * @var string
     *
     * @ORM\Column(name="vendor_unit_price", type="decimal", precision=15, scale=4, nullable=false)
     */
    private $vendorUnitPrice;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="price_valid_from", type="datetime", nullable=true)
     */
    private $priceValidFrom;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="price_valid_to", type="datetime", nullable=true)
     */
    private $priceValidTo;

    /**
     * @var string
     *
     * @ORM\Column(name="delivery_term_id", type="string", length=45, nullable=true)
     */
    private $deliveryTermId;

    /**
     * @var string
     *
     * @ORM\Column(name="lead_time", type="string", length=50, nullable=true)
     */
    private $leadTime;

    /**
     * @var string
     *
     * @ORM\Column(name="remarks", type="string", length=45, nullable=true)
     */
    private $remarks;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_active", type="boolean", nullable=true)
     */
    private $isActive;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created_on", type="datetime", nullable=true)
     */
    private $createdOn;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="last_change_on", type="datetime", nullable=true)
     */
    private $lastChangeOn;

    /**
     * @var \Application\Entity\NmtBpVendor
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtBpVendor")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="vendor_id", referencedColumnName="id")
     * })
     */
    private $vendor;

    /**
     * @var \Application\Entity\NmtApplicationCurrency
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtApplicationCurrency")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="currency_id", referencedColumnName="id")
     * })
     */
    private $currency;

    /**
     * @var \Application\Entity\MlaUsers
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\MlaUsers")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="created_by", referencedColumnName="id")
     * })
     */
    private $createdBy;

    /**
     * @var \Application\Entity\NmtApplicationPmtTerm
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtApplicationPmtTerm")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="pmt_term_id", referencedColumnName="id")
     * })
     */
    private $pmtTerm;

    /**
     * @var \Application\Entity\NmtApplicationPmtMethod
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtApplicationPmtMethod")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="pmt_method_id", referencedColumnName="id")
     * })
     */
    private $pmtMethod;

    /**
     * @var \Application\Entity\MlaUsers
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\MlaUsers")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="last_change_by", referencedColumnName="id")
     * })
     */
    private $lastChangeBy;

    /**
     * @var \Application\Entity\NmtInventoryItem
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\NmtInventoryItem")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="item_id", referencedColumnName="id")
     * })
     */
    private $item;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set token
     *
     * @param string $token
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setToken($token)
    {
        $this->token = $token;

        return $this;
    }

    /**
     * Get token
     *
     * @return string
     */
    public function getToken()
    {
        return $this->token;
    }

    /**
     * Set checksum
     *
     * @param string $checksum
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setChecksum($checksum)
    {
        $this->checksum = $checksum;

        return $this;
    }

    /**
     * Get checksum
     *
     * @return string
     */
    public function getChecksum()
    {
        return $this->checksum;
    }

    /**
     * Set isPreferredVendor
     *
     * @param boolean $isPreferredVendor
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setIsPreferredVendor($isPreferredVendor)
    {
        $this->isPreferredVendor = $isPreferredVendor;

        return $this;
    }

    /**
     * Get isPreferredVendor
     *
     * @return boolean
     */
    public function getIsPreferredVendor()
    {
        return $this->isPreferredVendor;
    }

    /**
     * Set vendorItemCode
     *
     * @param string $vendorItemCode
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setVendorItemCode($vendorItemCode)
    {
        $this->vendorItemCode = $vendorItemCode;

        return $this;
    }

    /**
     * Get vendorItemCode
     *
     * @return string
     */
    public function getVendorItemCode()
    {
        return $this->vendorItemCode;
    }

    /**
     * Set vendorItemUnit
     *
     * @param string $vendorItemUnit
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setVendorItemUnit($vendorItemUnit)
    {
        $this->vendorItemUnit = $vendorItemUnit;

        return $this;
    }

    /**
     * Get vendorItemUnit
     *
     * @return string
     */
    public function getVendorItemUnit()
    {
        return $this->vendorItemUnit;
    }

    /**
     * Set conversionFactor
     *
     * @param string $conversionFactor
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setConversionFactor($conversionFactor)
    {
        $this->conversionFactor = $conversionFactor;

        return $this;
    }

    /**
     * Get conversionFactor
     *
     * @return string
     */
    public function getConversionFactor()
    {
        return $this->conversionFactor;
    }

    /**
     * Set conversionText
     *
     * @param string $conversionText
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setConversionText($conversionText)
    {
        $this->conversionText = $conversionText;

        return $this;
    }

    /**
     * Get conversionText
     *
     * @return string
     */
    public function getConversionText()
    {
        return $this->conversionText;
    }

    /**
     * Set vendorUnitPrice
     *
     * @param string $vendorUnitPrice
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setVendorUnitPrice($vendorUnitPrice)
    {
        $this->vendorUnitPrice = $vendorUnitPrice;

        return $this;
    }

    /**
     * Get vendorUnitPrice
     *
     * @return string
     */
    public function getVendorUnitPrice()
    {
        return $this->vendorUnitPrice;
    }

    /**
     * Set priceValidFrom
     *
     * @param \DateTime $priceValidFrom
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setPriceValidFrom($priceValidFrom)
    {
        $this->priceValidFrom = $priceValidFrom;

        return $this;
    }

    /**
     * Get priceValidFrom
     *
     * @return \DateTime
     */
    public function getPriceValidFrom()
    {
        return $this->priceValidFrom;
    }

    /**
     * Set priceValidTo
     *
     * @param \DateTime $priceValidTo
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setPriceValidTo($priceValidTo)
    {
        $this->priceValidTo = $priceValidTo;

        return $this;
    }

    /**
     * Get priceValidTo
     *
     * @return \DateTime
     */
    public function getPriceValidTo()
    {
        return $this->priceValidTo;
    }

    /**
     * Set deliveryTermId
     *
     * @param string $deliveryTermId
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setDeliveryTermId($deliveryTermId)
    {
        $this->deliveryTermId = $deliveryTermId;

        return $this;
    }

    /**
     * Get deliveryTermId
     *
     * @return string
     */
    public function getDeliveryTermId()
    {
        return $this->deliveryTermId;
    }

    /**
     * Set leadTime
     *
     * @param string $leadTime
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setLeadTime($leadTime)
    {
        $this->leadTime = $leadTime;

        return $this;
    }

    /**
     * Get leadTime
     *
     * @return string
     */
    public function getLeadTime()
    {
        return $this->leadTime;
    }

    /**
     * Set remarks
     *
     * @param string $remarks
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setRemarks($remarks)
    {
        $this->remarks = $remarks;

        return $this;
    }

    /**
     * Get remarks
     *
     * @return string
     */
    public function getRemarks()
    {
        return $this->remarks;
    }

    /**
     * Set isActive
     *
     * @param boolean $isActive
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setIsActive($isActive)
    {
        $this->isActive = $isActive;

        return $this;
    }

    /**
     * Get isActive
     *
     * @return boolean
     */
    public function getIsActive()
    {
        return $this->isActive;
    }

    /**
     * Set createdOn
     *
     * @param \DateTime $createdOn
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setCreatedOn($createdOn)
    {
        $this->createdOn = $createdOn;

        return $this;
    }

    /**
     * Get createdOn
     *
     * @return \DateTime
     */
    public function getCreatedOn()
    {
        return $this->createdOn;
    }

    /**
     * Set lastChangeOn
     *
     * @param \DateTime $lastChangeOn
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setLastChangeOn($lastChangeOn)
    {
        $this->lastChangeOn = $lastChangeOn;

        return $this;
    }

    /**
     * Get lastChangeOn
     *
     * @return \DateTime
     */
    public function getLastChangeOn()
    {
        return $this->lastChangeOn;
    }

    /**
     * Set vendor
     *
     * @param \Application\Entity\NmtBpVendor $vendor
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setVendor(\Application\Entity\NmtBpVendor $vendor = null)
    {
        $this->vendor = $vendor;

        return $this;
    }

    /**
     * Get vendor
     *
     * @return \Application\Entity\NmtBpVendor
     */
    public function getVendor()
    {
        return $this->vendor;
    }

    /**
     * Set currency
     *
     * @param \Application\Entity\NmtApplicationCurrency $currency
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setCurrency(\Application\Entity\NmtApplicationCurrency $currency = null)
    {
        $this->currency = $currency;

        return $this;
    }

    /**
     * Get currency
     *
     * @return \Application\Entity\NmtApplicationCurrency
     */
    public function getCurrency()
    {
        return $this->currency;
    }

    /**
     * Set createdBy
     *
     * @param \Application\Entity\MlaUsers $createdBy
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setCreatedBy(\Application\Entity\MlaUsers $createdBy = null)
    {
        $this->createdBy = $createdBy;

        return $this;
    }

    /**
     * Get createdBy
     *
     * @return \Application\Entity\MlaUsers
     */
    public function getCreatedBy()
    {
        return $this->createdBy;
    }

    /**
     * Set pmtTerm
     *
     * @param \Application\Entity\NmtApplicationPmtTerm $pmtTerm
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setPmtTerm(\Application\Entity\NmtApplicationPmtTerm $pmtTerm = null)
    {
        $this->pmtTerm = $pmtTerm;

        return $this;
    }

    /**
     * Get pmtTerm
     *
     * @return \Application\Entity\NmtApplicationPmtTerm
     */
    public function getPmtTerm()
    {
        return $this->pmtTerm;
    }

    /**
     * Set pmtMethod
     *
     * @param \Application\Entity\NmtApplicationPmtMethod $pmtMethod
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setPmtMethod(\Application\Entity\NmtApplicationPmtMethod $pmtMethod = null)
    {
        $this->pmtMethod = $pmtMethod;

        return $this;
    }

    /**
     * Get pmtMethod
     *
     * @return \Application\Entity\NmtApplicationPmtMethod
     */
    public function getPmtMethod()
    {
        return $this->pmtMethod;
    }

    /**
     * Set lastChangeBy
     *
     * @param \Application\Entity\MlaUsers $lastChangeBy
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setLastChangeBy(\Application\Entity\MlaUsers $lastChangeBy = null)
    {
        $this->lastChangeBy = $lastChangeBy;

        return $this;
    }

    /**
     * Get lastChangeBy
     *
     * @return \Application\Entity\MlaUsers
     */
    public function getLastChangeBy()
    {
        return $this->lastChangeBy;
    }

    /**
     * Set item
     *
     * @param \Application\Entity\NmtInventoryItem $item
     *
     * @return NmtInventoryItemPurchasing
     */
    public function setItem(\Application\Entity\NmtInventoryItem $item = null)
    {
        $this->item = $item;

        return $this;
    }

    /**
     * Get item
     *
     * @return \Application\Entity\NmtInventoryItem
     */
    public function getItem()
    {
        return $this->item;
    }
}


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

namespace Naveego.Json
{
    public class JsonSerializerFactory
    {

        public static JsonSerializer CreateSerializer()
        {
            var serializer = new JsonSerializer();
            serializer.ContractResolver = new NaveegoJsonContractResolver();
            serializer.Formatting = Formatting.None;
            serializer.DateFormatHandling = DateFormatHandling.IsoDateFormat;
            serializer.DateTimeZoneHandling = DateTimeZoneHandling.Utc;
            return serializer;
        }

    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.saivikas.c1timetable"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="18" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.saivikas.c1timetable.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name = "com.saivikas.c1timetable.Second" />
    </application>

</manifest>


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

<recipeml version="0.5">
  <recipe>
    <head>
      <title>Beans with Thyme and Cashew Nuts</title>
      <categories>
        <cat>Vegetables</cat>
        <cat>Side dish</cat></categories>
      <yield>4</yield></head>
    <ingredients>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>pound</unit></amt>
        <item>Green beans</item></ing>
      <ing>
        <amt>
          <qty>3</qty>
          <unit>tablespoons</unit></amt>
        <item>Sunflower oil</item></ing>
      <ing>
        <amt>
          <qty>3</qty>
          <unit>ounces</unit></amt>
        <item>Cashew nuts</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit/></amt>
        <item>Garlic clove, chopped</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>tablespoon</unit></amt>
        <item>Chopped thyme</item></ing></ingredients>
    <directions>
      <step>  Slice beans.  Boil them in lightly salted water until they are just tender.
  Drain them.

  Heat oil in a skillet over medium heat.  Put in the cashew nuts & stir
  until they are golden brown. Remove from the skillet. Increase the heat.
  Put in the beans & garlic. Stir until the garlic begins to brown. Mix in
  the nuts & thyme & remove the pan from the heat.

  Gail Duff, "A Book of Herbs & Spices"

  From Gemini's MASSIVE MealMaster collection at www.synapse.com/~gemini

</step></directions></recipe></recipeml>


text:
package org.apache.geode.modules.session.catalina;

import java.io.IOException;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.LifecycleState;
import org.apache.catalina.session.StandardSession;

public class Tomcat7DeltaSessionManager extends DeltaSessionManager<Tomcat7CommitSessionValve> {

  /**
   * The LifecycleSupport for this component.
   */
  @SuppressWarnings("deprecation")
  protected org.apache.catalina.util.LifecycleSupport lifecycle =
      new org.apache.catalina.util.LifecycleSupport(this);

  /**
   * Prepare for the beginning of active use of the public methods of this component. This method
   * should be called after configure(), and before any of the public methods of the
   * component are utilized.
   *
   * @throws LifecycleException if this component detects a fatal error that prevents this component
   *         from being used
   */
  @Override
  public void startInternal() throws LifecycleException {
    startInternalBase();
    if (getLogger().isDebugEnabled()) {
      getLogger().debug(this + ": Starting");
    }
    if (started.get()) {
      return;
    }

    lifecycle.fireLifecycleEvent(START_EVENT, null);

    // Register our various valves
    registerJvmRouteBinderValve();

    if (isCommitValveEnabled()) {
      registerCommitSessionValve();
    }

    // Initialize the appropriate session cache interface
    initializeSessionCache();

    try {
      load();
    } catch (ClassNotFoundException | IOException e) {
      throw new LifecycleException("Exception starting manager", e);
    }

    // Create the timer and schedule tasks
    scheduleTimerTasks();

    started.set(true);
    setLifecycleState(LifecycleState.STARTING);
  }

  void setLifecycleState(LifecycleState newState) throws LifecycleException {
    setState(newState);
  }

  void startInternalBase() throws LifecycleException {
    super.startInternal();
  }

  /**
   * Gracefully terminate the active use of the public methods of this component. This method should
   * be the last one called on a given instance of this component.
   *
   * @throws LifecycleException if this component detects a fatal error that needs to be reported
   */
  @Override
  public void stopInternal() throws LifecycleException {
    stopInternalBase();
    if (getLogger().isDebugEnabled()) {
      getLogger().debug(this + ": Stopping");
    }

    try {
      unload();
    } catch (IOException e) {
      getLogger().error("Unable to unload sessions", e);
    }

    started.set(false);
    lifecycle.fireLifecycleEvent(STOP_EVENT, null);

    // StandardManager expires all Sessions here.
    // All Sessions are not known by this Manager.

    super.destroyInternal();

    // Clear any sessions to be touched
    getSessionsToTouch().clear();

    // Cancel the timer
    cancelTimer();

    // Unregister the JVM route valve
    unregisterJvmRouteBinderValve();

    if (isCommitValveEnabled()) {
      unregisterCommitSessionValve();
    }

    setLifecycleState(LifecycleState.STOPPING);
  }

  void stopInternalBase() throws LifecycleException {
    super.stopInternal();
  }

  void destroyInternalBase() throws LifecycleException {
    super.destroyInternal();
  }

  /**
   * Add a lifecycle event listener to this component.
   *
   * @param listener The listener to add
   */
  @Override
  public void addLifecycleListener(LifecycleListener listener) {
    lifecycle.addLifecycleListener(listener);
  }

  /**
   * Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners
   * registered, a zero-length array is returned.
   */
  @Override
  public LifecycleListener[] findLifecycleListeners() {
    return lifecycle.findLifecycleListeners();
  }

  /**
   * Remove a lifecycle event listener from this component.
   *
   * @param listener The listener to remove
   */
  @Override
  public void removeLifecycleListener(LifecycleListener listener) {
    lifecycle.removeLifecycleListener(listener);
  }

  @Override
  protected StandardSession getNewSession() {
    return new DeltaSession7(this);
  }

  @Override
  protected Tomcat7CommitSessionValve createCommitSessionValve() {
    return new Tomcat7CommitSessionValve();
  }

}


text:
:JSON
{
  "item": {
    "id": "560c37c1a7c8465c4a71d99a",
    "structuredContent": {
      "variants": [
        {"attributes": { "fit": "loose", "color": "blue" }},
        {"attributes": { "fit": "slim", "color": "red" }}
      ],
      "variantOptionOrdering": ["fit", "color"]
    }
  }
}

:TEMPLATE
{item|variants-select}

:OUTPUT

fit:

      <select aria-label="Select fit" data-variant-option-name="fit">
        <option value="">Select fit</option>
        <option value="loose">loose</option><option value="slim">slim</option>
      </select>

      <input type="radio" class="variant-radiobtn" value="loose" name="variant-option-fit" id="variant-option-fit-loose"/>
      loose
      <input type="radio" class="variant-radiobtn" value="slim" name="variant-option-fit" id="variant-option-fit-slim"/>
      slim

color:

      <select aria-label="Select color" data-variant-option-name="color">
        <option value="">Select color</option>
        <option value="blue">blue</option><option value="red">red</option>
      </select>

      <input type="radio" class="variant-radiobtn" value="blue" name="variant-option-color" id="variant-option-color-blue"/>
      blue
      <input type="radio" class="variant-radiobtn" value="red" name="variant-option-color" id="variant-option-color-red"/>
      red


text:
const { assert, skip, test, module: describe, only } = require('qunit');
const { GPU } = require('../../../../../../src');

describe('feature: to-string single precision arguments HTMLImage');

function testArgument(mode, done) {
  loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg'])
    .then(([image1, image2]) => {
      const gpu = new GPU({mode});
      const originalKernel = gpu.createKernel(function (a) {
        const pixel = a[0][0];
        return pixel.b * 255;
      }, {
        output: [1],
        precision: 'single',
        argumentTypes: ['HTMLImage'],
      });
      const canvas = originalKernel.canvas;
      const context = originalKernel.context;
      assert.deepEqual(originalKernel(image1)[0], 253);
      const kernelString = originalKernel.toString(image1);
      const newKernel = new Function('return ' + kernelString)()({context, canvas});
      assert.deepEqual(newKernel(image1)[0], 253);
      assert.deepEqual(newKernel(image2)[0], 255);
      gpu.destroy();
      done();
    });
}

(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', t => {
  testArgument('webgl', t.async());
});

(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', t => {
  testArgument('webgl2', t.async());
});


text:
cask :v1 => 'bearychat' do
  version :latest
  sha256 :no_check

  url 'https://bearychat.com/apps/mac'
  name 'BearyChat'
  homepage 'https://bearychat.com'
  license :gratis

  app 'BearyChat.app'

  zap :delete => [
    '~/Preferences/com.node-webkit-builder.bearychat.plist',
    '~/Library/Application Support/BearyChat',
  ]
end


text:
package galaxyspace.systems.SolarSystem.moons.enceladus.blocks;

import java.util.Random;

import micdoodle8.mods.galacticraft.api.block.IDetectableResource;
import micdoodle8.mods.galacticraft.core.blocks.ISortableBlock;
import micdoodle8.mods.galacticraft.core.util.EnumSortCategoryBlock;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class EnceladusBlocks extends Block implements IDetectableResource, ISortableBlock{

	public static final PropertyEnum<EnumEnceladusBlocks> BASIC_TYPE = PropertyEnum.create("type", EnumEnceladusBlocks.class);

	public EnceladusBlocks()
    {
        super(Material.ROCK);
        this.setUnlocalizedName("enceladusblocks");
        this.setSoundType(SoundType.STONE);
        this.setHarvestLevel("shovel", 1, this.getDefaultState().withProperty(BASIC_TYPE, EnumEnceladusBlocks.ENCELADUS_SNOW));
        this.setHarvestLevel("pickaxe", 2, this.getDefaultState().withProperty(BASIC_TYPE, EnumEnceladusBlocks.ENCELADUS_GRUNT));
        this.setHarvestLevel("pickaxe", 2, this.getDefaultState().withProperty(BASIC_TYPE, EnumEnceladusBlocks.ENCELADUS_COAL_ORE));
    }

	@Override
	public float getBlockHardness(IBlockState state, World worldIn, BlockPos pos)
    {

		EnumEnceladusBlocks type = ((EnumEnceladusBlocks) state.getValue(BASIC_TYPE));

		switch (type)
        {
			case ENCELADUS_SNOW: return 0.2F;
			default: return this.blockHardness;
        }
    }

	@SideOnly(Side.CLIENT)
    @Override
    public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list)
    {
        for (EnumEnceladusBlocks blockBasic : EnumEnceladusBlocks.values())
        {
            list.add(new ItemStack(this, 1, blockBasic.getMeta()));
        }
    }

	@Override
	public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
		return new ItemStack(Item.getItemFromBlock(this), 1, this.getMetaFromState(state));
	}

	@Override
	public int damageDropped(IBlockState state)
	{
		return this.getMetaFromState(state);
	}

	@Override
	public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state,	int fortune) {
		Random rand = world instanceof World ? ((World) world).rand : RANDOM;

		int count = quantityDropped(state, fortune, rand);
		for (int i = 0; i < count; i++) {
			Item item = this.getItemDropped(state, rand, fortune);
			if (item != Items.AIR) {
				EnumEnceladusBlocks type = ((EnumEnceladusBlocks) state.getValue(BASIC_TYPE));

				switch(type)
				{
					case ENCELADUS_COAL_ORE:
						drops.add(new ItemStack(Items.COAL, 1, 0));
						break;
					default:
						drops.add(new ItemStack(item, 1, damageDropped(state)));
						break;
				}
			}
		}
	}

	@Override
	public int quantityDropped(IBlockState state, int fortune, Random random)
    {
		EnumEnceladusBlocks type = ((EnumEnceladusBlocks) state.getValue(BASIC_TYPE));

		switch(type)
		{
			case ENCELADUS_COAL_ORE:
				return 5 + random.nextInt(2);
			default:
				return 1;
		}
    }

	@Override
	public EnumSortCategoryBlock getCategory(int meta) {
		return EnumSortCategoryBlock.GENERAL;
	}

	@Override
	public boolean isValueable(IBlockState state) {
		return true;
	}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	public enum EnumEnceladusBlocks implements IStringSerializable
	{
		ENCELADUS_SNOW(0, "enceladus_snow"),
		ENCELADUS_GRUNT(1, "enceladus_grunt"),
		ENCELADUS_COAL_ORE(2, "enceladus_coal_ore");

		private final int meta;
		private final String name;

		private EnumEnceladusBlocks(int meta, String name)
		{
			this.meta = meta;
			this.name = name;
		}

		public int getMeta() { return this.meta; }

		private final static EnumEnceladusBlocks[] values = values();
		public static EnumEnceladusBlocks byMetadata(int meta) { return values[meta % values.length]; }

		@Override
		public String getName() { return this.name; }

	}

	@Override
	public IBlockState getStateFromMeta(int meta)
	{
		return this.getDefaultState().withProperty(BASIC_TYPE, EnumEnceladusBlocks.byMetadata(meta));
	}

	@Override
	public int getMetaFromState(IBlockState state) {
		return ((EnumEnceladusBlocks) state.getValue(BASIC_TYPE)).getMeta();
	}

	@Override
	protected BlockStateContainer createBlockState()
	{
		return new BlockStateContainer(this, BASIC_TYPE);
	}

}


text:
from penchy.compat import unittest
from penchy.jobs import hooks

class ExecuteHookTest(unittest.TestCase):
    def test_termination(self):
        hook = hooks.ExecuteHook('python')
        hook.setup()
        self.assertIsNone(hook.proc.returncode)
        hook.teardown()
        self.assertEqual(hook.proc.returncode, -15)


text:
import { Component, OnInit } from '@angular/core';
import { AF } from '../../providers/af';
import { AngularFireDatabase, FirebaseListObservable } from "angularfire2/database";
import * as firebase from 'firebase';
import { Router } from '@angular/router';

@Component({
  selector: 'app-organization-form',
  templateUrl: './organization-form.component.html',
  styleUrls: ['./organization-form.component.css']
})
export class OrganizationFormComponent implements OnInit {

  public organization : organization;
  targetRef:any;
  storageRef:any;

  constructor(public afService : AF, private router: Router) {
      this.storageRef = firebase.storage().ref();
  }

  ngOnInit() {
    this.organization = { name: "", contact : "" ,phone : "" };
  }

  //add organization to database
  addOrganization(){
    if(this.organization.name == "" || this.organization.contact == "")
      alert("Organization's name and contact required");

    else
    {
      this.afService.addOrganization(this.organization);
      this.router.navigate(['Organization-List']);
    }
  }

  //reset the form except the name
  resetForm(){
    if(confirm("Are You sure you want to reset the form?"))
    {
      this.organization.name = "";
      this.organization.contact = "";
      this.organization.phone = "";
    }
  }
}

//item struct
export class organization{
  name : String;
  contact: String;
  phone: String;
}


text:
namespace JSONAPI.EntityFramework.Tests.Models
{
    using System;
    using System.Collections.Generic;

    public partial class Comment
    {
        public int Id { get; set; }
        public string Body { get; set; }

        public virtual Post Post { get; set; }
    }
}


text:
namespace NS1 { }
using namespace NS1;


text:
<?php
/**
 * Active Record Database Connection
 */
class Connection {
	public static $conn;
}

?>


text:
	<meta charset="UTF-8"/>
	<meta itemprop='identifier' content='11669'/>
	<meta itemprop='datePublished' content='2012-07-23'/>
	<meta itemprop='datePublished-pubid' content='86'/>

DESPACHO DO SECRETÁRIO

Expediente de 19/07/2012

PROCESSO: 16/001.851/2011

               –

              Tornar sem efeito a publicação autorizando

a contração do presente objeto a empresa Concremat Engenharia e Tecnologia S/A., na forma prevista do Art. 24, Inciso IV da Lei Federal 8.666/93 e alterações, bem como aprovação do Termo de Referência conforme disposto no art. 7º, parágrafo 2º, Inciso I da Lei Federal 8.666/93 e alterações.

*Publicado no DORIO de 30/11/2011 – pag.26 – 1ª Coluna*


text:
package com.mkl.websuites.internal.command.impl.click;

import org.assertj.core.api.StringAssert;

import com.mkl.websuites.command.CommandDescriptor;
import com.mkl.websuites.internal.command.impl.check.CheckAttributeValueContainingCommand;

@CommandDescriptor(name = "clickAttributeValueContaining", argumentTypes = {String.class})
public class ClickAttributeValueContainingCommand extends CheckAttributeValueContainingCommand {

    public ClickAttributeValueContainingCommand(String attribute) {
        super(attribute);
    }

    @Override
    protected void runSingleStringAssertion(StringAssert assertion, String string) {
        super.runSingleStringAssertion(assertion, string);

        elementWithAttribute.click();
    }
}


text:
package edu.mecc.race2ged.navigation;

import android.R;
import android.app.ActionBar;
import android.app.Activity;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import java.lang.reflect.Method;

/**
 * This class encapsulates some awful hacks.
 *
 * Before JB-MR2 (API 18) it was not possible to change the home-as-up indicator glyph
 * in an action bar without some really gross hacks. Since the MR2 SDK is not published as of
 * this writing, the new API is accessed via reflection here if available.
 */
class ActionBarDrawerToggleHoneycomb {
    private static final String TAG = "ActionBarDrawerToggleHoneycomb";

    private static final int[] THEME_ATTRS = new int[] {
            R.attr.homeAsUpIndicator
    };

    public static Object setActionBarUpIndicator(Object info, Activity activity,
            Drawable drawable, int contentDescRes) {
        if (info == null) {
            info = new SetIndicatorInfo(activity);
        }
        final SetIndicatorInfo sii = (SetIndicatorInfo) info;
        if (sii.setHomeAsUpIndicator != null) {
            try {
                final ActionBar actionBar = activity.getActionBar();
                sii.setHomeAsUpIndicator.invoke(actionBar, drawable);
                sii.setHomeActionContentDescription.invoke(actionBar, contentDescRes);
            } catch (Exception e) {
                Log.w(TAG, "Couldn't set home-as-up indicator via JB-MR2 API", e);
            }
        } else if (sii.upIndicatorView != null) {
            sii.upIndicatorView.setImageDrawable(drawable);
        } else {
            Log.w(TAG, "Couldn't set home-as-up indicator");
        }
        return info;
    }

    public static Object setActionBarDescription(Object info, Activity activity,
            int contentDescRes) {
        if (info == null) {
            info = new SetIndicatorInfo(activity);
        }
        final SetIndicatorInfo sii = (SetIndicatorInfo) info;
        if (sii.setHomeAsUpIndicator != null) {
            try {
                final ActionBar actionBar = activity.getActionBar();
                sii.setHomeActionContentDescription.invoke(actionBar, contentDescRes);
            } catch (Exception e) {
                Log.w(TAG, "Couldn't set content description via JB-MR2 API", e);
            }
        }
        return info;
    }

    public static Drawable getThemeUpIndicator(Activity activity) {
        final TypedArray a = activity.obtainStyledAttributes(THEME_ATTRS);
        final Drawable result = a.getDrawable(0);
        a.recycle();
        return result;
    }

    private static class SetIndicatorInfo {
        public Method setHomeAsUpIndicator;
        public Method setHomeActionContentDescription;
        public ImageView upIndicatorView;

        SetIndicatorInfo(Activity activity) {
            try {
                setHomeAsUpIndicator = ActionBar.class.getDeclaredMethod("setHomeAsUpIndicator",
                        Drawable.class);
                setHomeActionContentDescription = ActionBar.class.getDeclaredMethod(
                        "setHomeActionContentDescription", Integer.TYPE);

                // If we got the method we won't need the stuff below.
                return;
            } catch (NoSuchMethodException e) {
                // Oh well. We'll use the other mechanism below instead.
            }

            final View home = activity.findViewById(R.id.home);
            if (home == null) {
                // Action bar doesn't have a known configuration, an OEM messed with things.
                return;
            }

            final ViewGroup parent = (ViewGroup) home.getParent();
            final int childCount = parent.getChildCount();
            if (childCount != 2) {
                // No idea which one will be the right one, an OEM messed with things.
                return;
            }

            final View first = parent.getChildAt(0);
            final View second = parent.getChildAt(1);
            final View up = first.getId() == R.id.home ? second : first;

            if (up instanceof ImageView) {
                // Jackpot! (Probably...)
                upIndicatorView = (ImageView) up;
            }
        }
    }
}


text:
local attachment = {}

local callbacks = {
	"draw", "errhand", "focus", "keypressed", "keyreleased",
	"load", "mousefocus", "mousemoved", "mousepressed", "mousereleased",
	"quit", "resize", "run", "textinput", "threaderror", "update",
	"visible", "gamepadaxis", "gamepadpressed", "gamepadreleased",
	"joystickadded", "joystickaxis", "joystickhat", "joystickpressed",
	"joystickreleased", "joystickremoved",
}

function attachment.new(env)
	assert(env ~= attachment, "Cannot call 'new' with colon operator")
  env = env or require("love")

  local a = setmetatable({}, { __index = attachment })
  a.attachments = {}

  for i, callback in ipairs(callbacks) do
    if env[callback] then a:attach(callback, env[callback]) end
    env[callback] = function(...) a:call(callback, ...) end
  end

  return a
end

function attachment:attach(ev,func)
  assert(ev ~= nil, "bad argument #1 to 'attach' (got nil)")
  assert(type(func) == "function", "bad argument #2 to 'attach' (function expected, got " .. type(func) .. ")")
  if not self.attachments[ev] then self.attachments[ev] = {} end
  table.insert(self.attachments[ev], func)
  return func
end

function attachment:detach(ev, func)
  assert(ev ~= nil, "bad argument #1 to 'unattach' (got nil)")
	assert(type(func) == "function", "bad argument #2 to 'detach' (function expected, got " .. type(func) .. ")")
  if self.attachments[ev] then
    for i, f in ipairs(self.attachments[ev]) do
      if f == func then
        table.remove(self.attachments[ev], i)
        break
      end
    end
  end
end

function attachment:attachObject(obj)
  for i, callback in ipairs(callbacks) do
    if obj[callback] then self:attach(callback, obj[callback]) end
  end
end

function attachment:call(ev, ...)
  if self.attachments[ev] then
    for id, f in ipairs(self.attachments[ev]) do
      f(...)
    end
  end
end

return setmetatable(attachment, { __call = attachment.new })


text:
"""
This is a skeleton file that can serve as a starting point for a Python
console script. To run this script uncomment the following line in the
entry_points section in setup.cfg:

    console_scripts =
     fibonacci = siftsite.skeleton:run

Then run `python setup.py install` which will install the command `fibonacci`
inside your current environment.
Besides console scripts, the header (i.e. until _logger...) of this file can
also be used as template for Python modules.

Note: This skeleton file can be safely removed if not needed!
"""
from __future__ import division, print_function, absolute_import

import argparse
import sys
import os
import logging
import requests

from siftsite import __version__

__author__ = "Sam Beck"
__copyright__ = "Sam Beck"
__license__ = "mit"

_logger = logging.getLogger(__name__)

def upload_dir(filepath, label, source):
    '''upload whole directory (calls upload on all .png)'''
    base_dir = os.path.expanduser(os.path.dirname(filepath))
    files = os.listdir(base_dir)
    input('will upload {} files, continue or ctrl-c'.format(len(files)))
    for f in files:
        print(f[-4:])
        if f[-4:] == '.png':
            upload(os.path.join(base_dir, f), label, source)

def upload(filepath, label, source):
    '''POST request to your API with "files" key in requests data dict'''

    base_dir = os.path.expanduser(os.path.dirname(filepath))
    # url = 'http://localhost:8000/api/'
    url = 'https://still-taiga-56301.herokuapp.com/api/'
    file_name = os.path.basename(filepath)
    with open(os.path.join(base_dir, file_name), 'rb') as fin:
        print('file:', base_dir, '/', file_name)
        POST_data = {'correct_label': label, 'source': source,
                     'filename': file_name}
        files = {'filename': (file_name, fin), 'file': file_name}
        resp = requests.post(url, data=POST_data, files=files)
        print(resp)

def setup_logging(loglevel):
    """Setup basic logging

    Args:
      loglevel (int): minimum loglevel for emitting messages
    """
    logformat = "[%(asctime)s] %(levelname)s:%(name)s:%(message)s"
    logging.basicConfig(level=loglevel, stream=sys.stdout,
                        format=logformat, datefmt="%Y-%m-%d %H:%M:%S")

def parse_args(args):
    """Parse command line parameters
    Args:
      args ([str]): command line parameters as list of strings
    Returns:
      :obj:`argparse.Namespace`: command line parameters namespace
    """
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--version',
        action='version',
        version='siftsite {ver}'.format(ver=__version__))
    parser.add_argument(
        '--upload',
        dest="upload",
        help="Path to image file for upload to labler API",
        type=str)
    parser.add_argument(
        '-v',
        '--verbose',
        dest="loglevel",
        help="set loglevel to INFO",
        action='store_const',
        const=logging.INFO)
    parser.add_argument(
        '-vv',
        '--very-verbose',
        dest="loglevel",
        help="set loglevel to DEBUG",
        action='store_const',
        const=logging.DEBUG)
    return parser.parse_known_args(args)

def main(args):
    """Main entry point allowing external calls

    Args:
      args ([str]): command line parameter list
    """
    args, unknown = parse_args(args)
    if args.upload:
        upload(args.upload)
    else:
        print('yeah cool sure')

def run():
    """Entry point for console_scripts
    """
    main(sys.argv[1:])

if __name__ == "__main__":
    run()


text:
#include "sleep_api.h"
#include "cmsis.h"
#include "mbed_interface.h"

void hal_sleep(void) {
    // ensure debug is disconnected
    #if DEVICE_SEMIHOST
    mbed_interface_disconnect();
    #endif

    // PCON[PD] set to sleep
    LPC_PMU->PCON = 0x0;

    // SRC[SLEEPDEEP] set to 0 = sleep
    SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;

    // wait for interrupt
    __WFI();
}

/*
* The mbed lpc1768 does not support the deepsleep mode
* as a debugger is connected to it (the mbed interface).
*
* As mentionned in an application note from NXP:
*
*       http://www.po-star.com/public/uploads/20120319123122_141.pdf
*
*       {{{
*       The user should be aware of certain limitations during debugging.
*       The most important is that, due to limitations of the Cortex-M3
*       integration, the LPC17xx cannot wake up in the usual manner from
*       Deep Sleep and Power-down modes. It is recommended not to use these
*       modes during debug. Once an application is downloaded via JTAG/SWD
*       interface, the USB to SWD/JTAG debug adapter (Keil ULINK2 for example)
*       should be removed from the target board, and thereafter, power cycle
*       the LPC17xx to allow wake-up from deep sleep and power-down modes
*       }}}
*
*       As the interface firmware does not reset the target when a
*       mbed_interface_disconnect() semihosting call is made, the
*       core cannot wake-up from deepsleep.
*
*       We treat a deepsleep() as a normal sleep().
*/

void hal_deepsleep(void) {
    // ensure debug is disconnected
    #if DEVICE_SEMIHOST
    mbed_interface_disconnect();
    #endif

    // PCON[PD] set to deepsleep
    LPC_PMU->PCON = 0x1;

    // SRC[SLEEPDEEP] set to 1 = deep sleep
    SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;

    // Power up everything after powerdown
    LPC_SYSCON->PDAWAKECFG &= 0xFFFFF800;

    // wait for interrupt
    __WFI();
}


text:
require 'serverspec'
require 'pathname'
require 'rspec/mocks/standalone'

require 'coveralls'
Coveralls.wear_merged!

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

PROJECT_ROOT = (Pathname.new(File.dirname(__FILE__)) + '..').expand_path

Dir[PROJECT_ROOT.join("spec/support/**/*.rb")].each { |file| require(file) }

module Serverspec
  module Backend
    module TestCommandRunner
      def do_run cmd
        if @example
          @example.metadata[:subject].set_command(cmd)
        end

        if cmd =~ /invalid/
          {
            :stdout      => ::Serverspec.configuration.stdout,
            :stderr      => ::Serverspec.configuration.stderr,
            :exit_status => 1,
            :exit_signal => nil
          }
        else
          {
            :stdout      => ::Serverspec.configuration.stdout,
            :stderr      => ::Serverspec.configuration.stderr,
            :exit_status => 0,
            :exit_signal => nil
          }
        end
      end
    end
    [Exec, Ssh].each do |clz|
      clz.class_eval do
        include TestCommandRunner
        def run_command(cmd)
          cmd = build_command(cmd)
          cmd = add_pre_command(cmd)
          do_run cmd
        end
      end
    end
    [Cmd, WinRM].each do |clz|
      clz.class_eval do
        include TestCommandRunner
        def run_command(cmd)
          cmd = build_command(cmd.script)
          cmd = add_pre_command(cmd)
          do_run cmd
        end
      end
    end
  end

  module Type
    class Base
      def set_command(command)
        @command = command
      end
      def command
        @command
      end
    end
  end
end


text:
package org.apache.karaf.shell.console;

import org.osgi.service.blueprint.container.BlueprintContainer;

@Deprecated
public interface BlueprintContainerAware {

    void setBlueprintContainer(BlueprintContainer blueprintContainer);

}


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <title>{% if page.title %}{{ page.title }}{% endif %}</title>
  <meta name="description" content="Font Awesome, the iconic font designed for use with Bootstrap">
  <meta name="author" content="Dave Gandy">

  <link rel="stylesheet" href="{{ page.relative_path }}assets/css/site.css">
  <link rel="stylesheet" href="{{ page.relative_path }}assets/css/pygments.css">
  <link rel="stylesheet" href="{{ page.relative_path }}assets/font-awesome/css/font-awesome.min.css">

  <link rel="shortcut icon" href="{{ page.relative_path }}assets/ico/favicon.ico">

  {% include navbar.html %}

  {{ content }}

{% include footer.html %}


text:
module HspInterpreter (module HspInterpreter) where
-- for converting text into phones
import Data.Text (pack, unpack, splitOn)
import Data.Char (toLower)
import HspTypes(PhonemeRule, AliasRule, Rule(..), Alias(..))

readHspFile :: String
            -> IO [(String, String)]
readHspFile path = do
  fileCont <- readFile path
  let rawLines = filter (/= "") $ lines fileCont
  let parsedLines = filter (/= "") $ map (\line -> despace $ head $ splitStr "#" line) rawLines
  return $ map (\line -> (splitStr "->" line !!0 , splitStr "->" line !! 1)) parsedLines

-- |List of phonemeRules found in .hsp file of language with given ID
phonemeRules :: String -- ^ ID of language - for example "pol"
   -> IO [PhonemeRule]
phonemeRules lang = fmap sortRules $ fmap  (map tupleToPhonemeRule) rulesTupleList
    where
        rulesTupleList =  readHspFile ("lang/" ++ lang ++ "/" ++ lang ++ "_phones.hsp")

tupleToPhonemeRule :: (String, String)
                            -> PhonemeRule
tupleToPhonemeRule (regex, phonesInStr) = MkRule regex (splitStr "," phonesInStr)

-- |Just like embedded 'lines' method, but omitting empty lines
lines' :: String -- ^ String containing newLine characters
        -> [String]
lines' s = filter (/= "") $ lines s

-- |Splitting String into a list based on a regex
splitStr :: String -- ^ String to split
            -> String -- ^ Regular expression to check for and split on
            -> [String]
splitStr regex input = map unpack $ splitOn (pack regex) $ pack input

-- |Filters all spaces out of a given String
despace :: String  -- ^ String to filter
            -> String
despace = filter (/= ' ')

-- |Sorts a list rules based on the length of their regexes
sortRules :: Ord r  => [Rule r x] -- ^ List of rules to sort
                    -> [Rule r x]
sortRules [] = []
sortRules xl = rl ++ ml ++ ll
    where
        piv = head xl
        ll = sortRules [l | l <- xl, length (regex l) < length (regex piv)]
        ml = [m | m <- xl, length (regex m) == length (regex piv)]
        rl = sortRules [r | r <- xl, length (regex r) > length (regex piv)]

-- |Makes an alias out of a String from .hsp file
tupleToAlias:: (String, String) -- ^ String containing an Alias - for example "<vow> -> a,ą,e,ę,i,o,ó,u,y"
            -> Alias
tupleToAlias (alias, matchesStr) = MkAlias alias (splitStr "," matchesStr)

-- |List of aliases from given language (.hsp file)
aliases :: String -- ^ ID of language - for exaple "pol"
        -> IO [Alias]
aliases lang = fmap  (map tupleToAlias) aliasesTupleList
    where
        aliasesTupleList = readHspFile ("lang/" ++ lang ++ "/" ++ lang ++ "_alias.hsp")

-- |List of aliasRules from given language (.hsp file)
aliasRulesAliased :: String -- ^ ID of language - for exaple "pol"
            -> IO [AliasRule]
aliasRulesAliased lang = fmap  (map tupleToAliasRule) rulesTupleList
    where
        rulesTupleList = readHspFile ("lang/" ++ lang ++ "/" ++ lang ++ "_aliasrules.hsp")
-- |Makes an aliasRule out of a String from .hsp file
tupleToAliasRule :: (String, String) -- ^ String containing an aliasRule - for example "<hardcon>,i,<vow> -> $0,j,$1"
            -> AliasRule
tupleToAliasRule (regexStr, outputStr) = MkRule (splitStr "," regexStr) (splitStr "," outputStr)

-- |Generates a list of aliasRules from the given unaliased aliasRule:
-- example:
--
-- @
--
-- unAliasRule [{alias="vovel"}, matches=["a,e,i,o,u,y"]] {regex=[<vovel>,"i"], output=["$0","j"]}
--
-- would produce:
--
-- [{regex=["a","i"], output=["a","j"]},
--
-- {regex=["e","i"], output=["e","j"]},
--
-- {regex=["i","i"], output=["i","j"]},
--
-- {regex=["o","i"], output=["o","j"]},
--
-- {regex=["u","i"], output=["u","j"]},
--
-- {regex=["y","i"], output=["y","j"]}]
--
-- @
unAliasRule :: [Alias] -- ^ List of aliases to consider
            -> AliasRule -- ^ aliasRule to unAlias
            -> [AliasRule]
unAliasRule alslist rule = aliasRuleMaker alslist [] (regex rule) (output rule) 0
    where
        aliasRuleMaker als doneRegex toDoRegex output aliasNo
            | toDoRegex == [] = [MkRule doneRegex output]
            | head (head toDoRegex) == '<' = let
                        alias = head toDoRegex
                        mapStuff = map (\phn -> aliasRuleMaker als (doneRegex++[phn]) (tail toDoRegex) (replaceOccurences ("$" ++ show aliasNo) [phn] output) (aliasNo+1)) (matches (matchAlias als alias))
                        in
                        concat mapStuff
            | otherwise = aliasRuleMaker als (doneRegex++[head toDoRegex]) (tail toDoRegex) output aliasNo
        matchAlias als alsname =
            head [x | x<-als, alias x ==alsname]

-- |Returns a list of unaliased rules from given language (.hsp file)
aliasRules :: String  -- ^ ID of language - for exaple "pol"
           -> IO [AliasRule]
aliasRules lang = do
                rlz <- aliasRulesAliased lang
                als <- aliases lang
                return $ sortRules $ concatMap (unAliasRule als) rlz

-- |Replaces all of occurences of an element of a list with a list of other elements
replaceOccurences :: Eq a => a  -- ^ Element of list to replace
                    -> [a]  -- ^ List to replace regex with
                    -> [a]  -- ^ List to make replacements in
                    -> [a]
replaceOccurences _ _ [] = []
replaceOccurences regex replacer (x:xs)
                    | x==regex = replacer ++ replaceOccurences regex replacer xs
                    | otherwise = x : replaceOccurences regex replacer xs


text:
ARG SF_DOCKER_CI_FROM
FROM ${SF_DOCKER_CI_FROM}

ARG SF_DOCKER_CI_IMAGE_NAME
ARG SF_DOCKER_CI_IMAGE_TAG
ARG SF_CI_BREW_INSTALL

SHELL ["/bin/bash", "-c"]

ADD . /support-firecloud
RUN SF_DOCKER_CI_IMAGE_NAME=${SF_DOCKER_CI_IMAGE_NAME} \
    SF_DOCKER_CI_IMAGE_TAG=${SF_DOCKER_CI_IMAGE_TAG} \
    SF_CI_BREW_INSTALL=${SF_CI_BREW_INSTALL} \
    /support-firecloud/dockerfiles/$(source /etc/os-release && echo "sf-${ID}-${VERSION_CODENAME}")/script.sh


text:
package vspk

import "github.com/nuagenetworks/go-bambou/bambou"

// KeyServerNotificationIdentity represents the Identity of the object
var KeyServerNotificationIdentity = bambou.Identity{
	Name:     "keyservernotification",
	Category: "keyservernotifications",
}

// KeyServerNotificationsList represents a list of KeyServerNotifications
type KeyServerNotificationsList []*KeyServerNotification

// KeyServerNotificationsAncestor is the interface of an ancestor of a KeyServerNotification must implement.
type KeyServerNotificationsAncestor interface {
	KeyServerNotifications(*bambou.FetchingInfo) (KeyServerNotificationsList, *bambou.Error)
	CreateKeyServerNotifications(*KeyServerNotification) *bambou.Error
}

// KeyServerNotification represents the model of a keyservernotification
type KeyServerNotification struct {
	ID               string      `json:"ID,omitempty"`
	ParentID         string      `json:"parentID,omitempty"`
	ParentType       string      `json:"parentType,omitempty"`
	Owner            string      `json:"owner,omitempty"`
	Base64JSONString string      `json:"base64JSONString,omitempty"`
	Message          interface{} `json:"message,omitempty"`
	EntityScope      string      `json:"entityScope,omitempty"`
	NotificationType string      `json:"notificationType,omitempty"`
	ExternalID       string      `json:"externalID,omitempty"`
}

// NewKeyServerNotification returns a new *KeyServerNotification
func NewKeyServerNotification() *KeyServerNotification {

	return &KeyServerNotification{}
}

// Identity returns the Identity of the object.
func (o *KeyServerNotification) Identity() bambou.Identity {

	return KeyServerNotificationIdentity
}

// Identifier returns the value of the object's unique identifier.
func (o *KeyServerNotification) Identifier() string {

	return o.ID
}

// SetIdentifier sets the value of the object's unique identifier.
func (o *KeyServerNotification) SetIdentifier(ID string) {

	o.ID = ID
}

// Fetch retrieves the KeyServerNotification from the server
func (o *KeyServerNotification) Fetch() *bambou.Error {

	return bambou.CurrentSession().FetchEntity(o)
}

// Save saves the KeyServerNotification into the server
func (o *KeyServerNotification) Save() *bambou.Error {

	return bambou.CurrentSession().SaveEntity(o)
}

// Delete deletes the KeyServerNotification from the server
func (o *KeyServerNotification) Delete() *bambou.Error {

	return bambou.CurrentSession().DeleteEntity(o)
}

// Metadatas retrieves the list of child Metadatas of the KeyServerNotification
func (o *KeyServerNotification) Metadatas(info *bambou.FetchingInfo) (MetadatasList, *bambou.Error) {

	var list MetadatasList
	err := bambou.CurrentSession().FetchChildren(o, MetadataIdentity, &list, info)
	return list, err
}

// CreateMetadata creates a new child Metadata under the KeyServerNotification
func (o *KeyServerNotification) CreateMetadata(child *Metadata) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}

// GlobalMetadatas retrieves the list of child GlobalMetadatas of the KeyServerNotification
func (o *KeyServerNotification) GlobalMetadatas(info *bambou.FetchingInfo) (GlobalMetadatasList, *bambou.Error) {

	var list GlobalMetadatasList
	err := bambou.CurrentSession().FetchChildren(o, GlobalMetadataIdentity, &list, info)
	return list, err
}

// CreateGlobalMetadata creates a new child GlobalMetadata under the KeyServerNotification
func (o *KeyServerNotification) CreateGlobalMetadata(child *GlobalMetadata) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}