text:
@import url('https://fonts.googleapis.com/css?family=Nunito');

.game-container{
  font-family: 'Nunito', sans-serif;
  display: flex;
  -ms-flex-flow: column wrap;
  flex-flow: column wrap;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  background-color: #f2f2f2;
  color: #444444;

}

body {
  background-image: none;
}

.background-overlay{
  background-color: #f2f2f2;

}

.next {
  outline: 1px solid transparent;
  margin-top: 10px;
  color: #444444;
  border-radius: 4px;
  font-size: smaller;
  background-color: white;

}

.p {
  color: #444444;
  font-family: 'Nunito', sans-serif;
  margin: auto;
  text-align: center;
}


text:
<!DOCTYPE html>

    <title>Bootstrap-Combobox - PatternFly</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="../../dist/img/favicon.ico">

    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../dist/img/apple-touch-icon-precomposed-152.png">

    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../dist/img/apple-touch-icon-precomposed-144.png">

    <link rel="apple-touch-icon-precomposed" sizes="76x76" href="../../dist/img/apple-touch-icon-precomposed-76.png">

    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../dist/img/apple-touch-icon-precomposed-72.png">

    <link rel="apple-touch-icon-precomposed" sizes="120x120" href="../../dist/img/apple-touch-icon-precomposed-180.png">

    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../dist/img/apple-touch-icon-precomposed-114.png">

    <link rel="apple-touch-icon-precomposed" sizes="57x57" href="../../dist/img/apple-touch-icon-precomposed-57.png">
    <link rel="stylesheet" href="../../dist/css/patternfly.min.css" >
    <link rel="stylesheet" href="../../dist/css/patternfly-additions.min.css" >
      <link href="tests.css" rel="stylesheet" media="screen, print">

Bootstrap-Combobox

        These examples are included for development testing purposes.  For official documentation, see https://www.patternfly.org, http://getbootstrap.com, and https://github.com/danielfarrell/bootstrap-combobox.

        State
        <select class="combobox form-control">
          <option value="" selected="selected">Select a State</option>
          <option value="AL">Alabama</option>
          <option value="AK">Alaska</option>
          <option value="AZ">Arizona</option>
          <option value="AR">Arkansas</option>
          <option value="CA">California</option>
          <option value="CO">Colorado</option>
          <option value="CT">Connecticut</option>
          <option value="DE">Delaware</option>
          <option value="DC">District Of Columbia</option>
          <option value="FL">Florida</option>
          <option value="GA">Georgia</option>
          <option value="HI">Hawaii</option>
          <option value="ID">Idaho</option>
          <option value="IL">Illinois</option>
          <option value="IN">Indiana</option>
          <option value="IA">Iowa</option>
          <option value="KS">Kansas</option>
          <option value="KY">Kentucky</option>
          <option value="LA">Louisiana</option>
          <option value="ME">Maine</option>
          <option value="MD">Maryland</option>
          <option value="MA">Massachusetts</option>
          <option value="MI">Michigan</option>
          <option value="MN">Minnesota</option>
          <option value="MS">Mississippi</option>
          <option value="MO">Missouri</option>
          <option value="MT">Montana</option>
          <option value="NE">Nebraska</option>
          <option value="NV">Nevada</option>
          <option value="NH">New Hampshire</option>
          <option value="NJ">New Jersey</option>
          <option value="NM">New Mexico</option>
          <option value="NY">New York</option>
          <option value="NC">North Carolina</option>
          <option value="ND">North Dakota</option>
          <option value="OH">Ohio</option>
          <option value="OK">Oklahoma</option>
          <option value="OR">Oregon</option>
          <option value="PA">Pennsylvania</option>
          <option value="RI">Rhode Island</option>
          <option value="SC">South Carolina</option>
          <option value="SD">South Dakota</option>
          <option value="TN">Tennessee</option>
          <option value="TX">Texas</option>
          <option value="UT">Utah</option>
          <option value="VT">Vermont</option>
          <option value="VA">Virginia</option>
          <option value="WA">Washington</option>
          <option value="WV">West Virginia</option>
          <option value="WI">Wisconsin</option>
          <option value="WY">Wyoming</option>
        </select>

Sizes

        State
        <select class="combobox form-control input-lg">
          <option value="" selected="selected">Select a State</option>
          <option value="AL">Alabama</option>
          <option value="AK">Alaska</option>
          <option value="AZ">Arizona</option>
          <option value="AR">Arkansas</option>
          <option value="CA">California</option>
          <option value="CO">Colorado</option>
          <option value="CT">Connecticut</option>
          <option value="DE">Delaware</option>
          <option value="DC">District Of Columbia</option>
          <option value="FL">Florida</option>
          <option value="GA">Georgia</option>
          <option value="HI">Hawaii</option>
          <option value="ID">Idaho</option>
          <option value="IL">Illinois</option>
          <option value="IN">Indiana</option>
          <option value="IA">Iowa</option>
          <option value="KS">Kansas</option>
          <option value="KY">Kentucky</option>
          <option value="LA">Louisiana</option>
          <option value="ME">Maine</option>
          <option value="MD">Maryland</option>
          <option value="MA">Massachusetts</option>
          <option value="MI">Michigan</option>
          <option value="MN">Minnesota</option>
          <option value="MS">Mississippi</option>
          <option value="MO">Missouri</option>
          <option value="MT">Montana</option>
          <option value="NE">Nebraska</option>
          <option value="NV">Nevada</option>
          <option value="NH">New Hampshire</option>
          <option value="NJ">New Jersey</option>
          <option value="NM">New Mexico</option>
          <option value="NY">New York</option>
          <option value="NC">North Carolina</option>
          <option value="ND">North Dakota</option>
          <option value="OH">Ohio</option>
          <option value="OK">Oklahoma</option>
          <option value="OR">Oregon</option>
          <option value="PA">Pennsylvania</option>
          <option value="RI">Rhode Island</option>
          <option value="SC">South Carolina</option>
          <option value="SD">South Dakota</option>
          <option value="TN">Tennessee</option>
          <option value="TX">Texas</option>
          <option value="UT">Utah</option>
          <option value="VT">Vermont</option>
          <option value="VA">Virginia</option>
          <option value="WA">Washington</option>
          <option value="WV">West Virginia</option>
          <option value="WI">Wisconsin</option>
          <option value="WY">Wyoming</option>
        </select>

        State
        <select class="combobox form-control input-sm">
          <option value="" selected="selected">Select a State</option>
          <option value="AL">Alabama</option>
          <option value="AK">Alaska</option>
          <option value="AZ">Arizona</option>
          <option value="AR">Arkansas</option>
          <option value="CA">California</option>
          <option value="CO">Colorado</option>
          <option value="CT">Connecticut</option>
          <option value="DE">Delaware</option>
          <option value="DC">District Of Columbia</option>
          <option value="FL">Florida</option>
          <option value="GA">Georgia</option>
          <option value="HI">Hawaii</option>
          <option value="ID">Idaho</option>
          <option value="IL">Illinois</option>
          <option value="IN">Indiana</option>
          <option value="IA">Iowa</option>
          <option value="KS">Kansas</option>
          <option value="KY">Kentucky</option>
          <option value="LA">Louisiana</option>
          <option value="ME">Maine</option>
          <option value="MD">Maryland</option>
          <option value="MA">Massachusetts</option>
          <option value="MI">Michigan</option>
          <option value="MN">Minnesota</option>
          <option value="MS">Mississippi</option>
          <option value="MO">Missouri</option>
          <option value="MT">Montana</option>
          <option value="NE">Nebraska</option>
          <option value="NV">Nevada</option>
          <option value="NH">New Hampshire</option>
          <option value="NJ">New Jersey</option>
          <option value="NM">New Mexico</option>
          <option value="NY">New York</option>
          <option value="NC">North Carolina</option>
          <option value="ND">North Dakota</option>
          <option value="OH">Ohio</option>
          <option value="OK">Oklahoma</option>
          <option value="OR">Oregon</option>
          <option value="PA">Pennsylvania</option>
          <option value="RI">Rhode Island</option>
          <option value="SC">South Carolina</option>
          <option value="SD">South Dakota</option>
          <option value="TN">Tennessee</option>
          <option value="TX">Texas</option>
          <option value="UT">Utah</option>
          <option value="VT">Vermont</option>
          <option value="VA">Virginia</option>
          <option value="WA">Washington</option>
          <option value="WV">West Virginia</option>
          <option value="WI">Wisconsin</option>
          <option value="WY">Wyoming</option>
        </select>

Horizontal Form

      <form class="form-horizontal">

          State

            <select class="combobox form-control" name="horizontal" required="required">
              <option value="" selected="selected">Select a State</option>
              <option value="AL">Alabama</option>
              <option value="AK">Alaska</option>
              <option value="AZ">Arizona</option>
              <option value="AR">Arkansas</option>
              <option value="CA">California</option>
              <option value="CO">Colorado</option>
              <option value="CT">Connecticut</option>
              <option value="DE">Delaware</option>
              <option value="DC">District Of Columbia</option>
              <option value="FL">Florida</option>
              <option value="GA">Georgia</option>
              <option value="HI">Hawaii</option>
              <option value="ID">Idaho</option>
              <option value="IL">Illinois</option>
              <option value="IN">Indiana</option>
              <option value="IA">Iowa</option>
              <option value="KS">Kansas</option>
              <option value="KY">Kentucky</option>
              <option value="LA">Louisiana</option>
              <option value="ME">Maine</option>
              <option value="MD">Maryland</option>
              <option value="MA">Massachusetts</option>
              <option value="MI">Michigan</option>
              <option value="MN">Minnesota</option>
              <option value="MS">Mississippi</option>
              <option value="MO">Missouri</option>
              <option value="MT">Montana</option>
              <option value="NE">Nebraska</option>
              <option value="NV">Nevada</option>
              <option value="NH">New Hampshire</option>
              <option value="NJ">New Jersey</option>
              <option value="NM">New Mexico</option>
              <option value="NY">New York</option>
              <option value="NC">North Carolina</option>
              <option value="ND">North Dakota</option>
              <option value="OH">Ohio</option>
              <option value="OK">Oklahoma</option>
              <option value="OR">Oregon</option>
              <option value="PA">Pennsylvania</option>
              <option value="RI">Rhode Island</option>
              <option value="SC">South Carolina</option>
              <option value="SD">South Dakota</option>
              <option value="TN">Tennessee</option>
              <option value="TX">Texas</option>
              <option value="UT">Utah</option>
              <option value="VT">Vermont</option>
              <option value="VA">Virginia</option>
              <option value="WA">Washington</option>
              <option value="WV">West Virginia</option>
              <option value="WI">Wisconsin</option>
              <option value="WY">Wyoming</option>
            </select>

      </form>

Inline Form

      <form class="form-inline">

          <select class="combobox form-control" name="inline">
            <option value="" selected="selected">Select a State</option>
            <option value="AL">Alabama</option>
            <option value="AK">Alaska</option>
            <option value="AZ">Arizona</option>
            <option value="AR">Arkansas</option>
            <option value="CA">California</option>
            <option value="CO">Colorado</option>
            <option value="CT">Connecticut</option>
            <option value="DE">Delaware</option>
            <option value="DC">District Of Columbia</option>
            <option value="FL">Florida</option>
            <option value="GA">Georgia</option>
            <option value="HI">Hawaii</option>
            <option value="ID">Idaho</option>
            <option value="IL">Illinois</option>
            <option value="IN">Indiana</option>
            <option value="IA">Iowa</option>
            <option value="KS">Kansas</option>
            <option value="KY">Kentucky</option>
            <option value="LA">Louisiana</option>
            <option value="ME">Maine</option>
            <option value="MD">Maryland</option>
            <option value="MA">Massachusetts</option>
            <option value="MI">Michigan</option>
            <option value="MN">Minnesota</option>
            <option value="MS">Mississippi</option>
            <option value="MO">Missouri</option>
            <option value="MT">Montana</option>
            <option value="NE">Nebraska</option>
            <option value="NV">Nevada</option>
            <option value="NH">New Hampshire</option>
            <option value="NJ">New Jersey</option>
            <option value="NM">New Mexico</option>
            <option value="NY">New York</option>
            <option value="NC">North Carolina</option>
            <option value="ND">North Dakota</option>
            <option value="OH">Ohio</option>
            <option value="OK">Oklahoma</option>
            <option value="OR">Oregon</option>
            <option value="PA">Pennsylvania</option>
            <option value="RI">Rhode Island</option>
            <option value="SC">South Carolina</option>
            <option value="SD">South Dakota</option>
            <option value="TN">Tennessee</option>
            <option value="TX">Texas</option>
            <option value="UT">Utah</option>
            <option value="VT">Vermont</option>
            <option value="VA">Virginia</option>
            <option value="WA">Washington</option>
            <option value="WV">West Virginia</option>
            <option value="WI">Wisconsin</option>
            <option value="WY">Wyoming</option>
          </select>

      </form>

redpajama_set_name: RedPajamaGithub


text:
function [fileName, foundTarget] = extractFile(dirInfo, targetName)
    [fileName, foundTarget] = extractField(dirInfo, 'm', targetName);
    if ~foundTarget
        [fileName, foundTarget] = extractField(dirInfo, 'p', targetName);
    end
end

function [fileName, foundTarget] = extractField(dirInfo, field, targetName)
    fileIndex = strcmpi(dirInfo.(field), [targetName '.' field]);
    foundTarget = any(fileIndex);
    if foundTarget
        fileName = dirInfo.(field){fileIndex}(1:end-2);
    else
        fileName = '';
    end
end

%   Copyright 2008 The MathWorks, Inc.
%   $Revision: 1.1.6.1 $  $Date: 2009/03/30 23:40:20 $


text:
import numpy as np

from landlab import Component, RasterModelGrid, CLOSED_BOUNDARY
from landlab import BAD_INDEX_VALUE, FIXED_VALUE_BOUNDARY, FIXED_LINK
from landlab import FIXED_GRADIENT_BOUNDARY
from ...utils.decorators import use_file_name_or_kwds

class KinematicWaveRengers(Component):
    """
    This code is based on an overland flow model by Francis Rengers and
    colleagues, after Julien et al., 1995. It uses an explicit face-centered
    solution to a depth-varying Manning's equation, broadly following, e.g.,
    Mugler et al., 2011.
    It was implemented in Landlab by DEJH, March '16. Please cite
    Rengers et al., 2016, Model Predictions of Water Runoff in Steep
    Catchments after Wildfire, WRR.

    Note: You will not have a good day if you have pits present in your topo
    before routing flow with this component. Fill pits before instantiating
    the component (or call :func:`update_topographic_params` once you have
    filled after instantiation).

    Note this module assumes that the topography DOES NOT change during the
    run. If it does, call :func:`update_topographic_params` to update the
    component to the new topo.

    Boundary condition control can be... interesting with this component.
    Be sure to close boundaries you do not wish water to leave - or enter! -
    through. To allow free water discharge from the grid edge it is
    recommended to use fixed gradient boundary conditions at the open edges.
    The component will then set the fixed gradient as equal to the underlying
    topographic gradient throughout the run.

    It is also possible to fix the water depth at the open edge, but this
    is not really recommended.

    Construction::

        KinematicWaveRengers(grid, mannings_n=0.03, critical_flow_depth=0.003,
                             mannings_epsilon=0.33333333, dt_max=0.3,
                             max_courant=0.2, min_surface_water_depth=1.e-8)

    Parameters
    ----------
    grid : RasterModelGrid
        A grid.
    mannings_n : float
        A value to use for Manning's n in the Manning discharge equation.
    critical_flow_depth : float (m)
        An index flow depth for the depth-varying Manning's equation,
        controlling the depth at which the effective Manning's n begins to
        increase.
    mannings_epsilon : float
        An exponent for the depth-varying Manning's equation, controlling the
        rate of increase of effective Manning's n at small flow depths.
    dt_max : float or None (s)
        The largest permitted internal timestep for the component. If the
        Courant criterion produces a more restrictive condition, that will be
        used instead.
    max_courant : float
        The maximum permitted Courant number for the courant stability
        criterion.
    min_surface_water_depth : float (m)
        A water depth below which surface water thickness may never fall, to
        ensure model stabilty.

    Examples
    --------
    >>> from landlab import RasterModelGrid
    >>> from landlab import CLOSED_BOUNDARY, FIXED_GRADIENT_BOUNDARY
    >>> mg = RasterModelGrid((5, 10), spacing=10.)
    >>> mg.status_at_node[mg.nodes_at_left_edge] = FIXED_GRADIENT_BOUNDARY
    >>> mg.status_at_node[mg.nodes_at_top_edge] = CLOSED_BOUNDARY
    >>> mg.status_at_node[mg.nodes_at_bottom_edge] = CLOSED_BOUNDARY
    >>> mg.status_at_node[mg.nodes_at_right_edge] = CLOSED_BOUNDARY
    >>> _ = mg.add_field('node', 'topographic__elevation', 0.05*mg.node_x)
    >>> _ = mg.add_empty('node', 'surface_water__depth')
    >>> mg.at_node['surface_water__depth'].fill(1.e-8)
    >>> dt = 60.  # 1 min intervals
    >>> rain_intensities = (1.e-5, 1.e-5, 1.e-5, 1.e-5, 1.e-5)
    >>> kw = KinematicWaveRengers(mg)
    >>> for i in rain_intensities:
    ...     kw.run_one_step(dt, rainfall_intensity=i)
    >>> mg.at_node['surface_water__depth']
    array([  1.00000000e-08,   1.00000000e-08,   1.00000000e-08,
             1.00000000e-08,   1.00000000e-08,   1.00000000e-08,
             1.00000000e-08,   1.00000000e-08,   1.00000000e-08,
             1.00000000e-08,   2.95578314e-03,   2.95578314e-03,
             2.90945761e-03,   2.82912876e-03,   2.70127141e-03,
             2.51202011e-03,   2.24617193e-03,   1.88032853e-03,
             1.35451064e-03,   1.00000000e-08,   2.95578314e-03,
             2.95578314e-03,   2.90945761e-03,   2.82912876e-03,
             2.70127141e-03,   2.51202011e-03,   2.24617193e-03,
             1.88032853e-03,   1.35451064e-03,   1.00000000e-08,
             2.95578314e-03,   2.95578314e-03,   2.90945761e-03,
             2.82912876e-03,   2.70127141e-03,   2.51202011e-03,
             2.24617193e-03,   1.88032853e-03,   1.35451064e-03,
             1.00000000e-08,   1.00000000e-08,   1.00000000e-08,
             1.00000000e-08,   1.00000000e-08,   1.00000000e-08,
             1.00000000e-08,   1.00000000e-08,   1.00000000e-08,
             1.00000000e-08,   1.00000000e-08])
    """

    _name = 'KinematicWaveRengers'

    _input_var_names = (
        'topographic__elevation',
        'surface_water__depth',
    )

    _output_var_names = (
        'surface_water__depth',
        'surface_water__discharge',
        'surface_water__velocity'
    )

    _var_units = {
        'topographic__elevation': 'm',
        'surface_water__depth': 'm',
        'surface_water__discharge': 'm**3/s',
        'surface_water__velocity': 'm/s'
    }

    _var_mapping = {
        'topographic__elevation': 'node',
        'surface_water__depth': 'node',
        'surface_water__discharge': 'node',
        'surface_water__velocity': 'node'
    }

    _var_doc = {
        'topographic__elevation': 'Land surface topographic elevation',
        'surface_water__depth': 'Depth of water above the surface',
        'surface_water__discharge': ('Magnitude of discharge of water above ' +
                                     'the surface'),
        'surface_water__velocity': 'Speed of water flow above the surface'
    }

    @use_file_name_or_kwds
    def __init__(self, grid, mannings_n=0.03, critical_flow_depth=0.003,
                 mannings_epsilon=0.33333333, dt_max=0.3, max_courant=0.2,
                 min_surface_water_depth=1.e-8, **kwds):
        """Initialize the kinematic wave approximation overland flow component.
        """

        assert isinstance(grid, RasterModelGrid), 'grid must be regular'
        self._grid = grid
        try:
            self.set_new_fields_for_component()
        except AttributeError:
            self.grid.add_empty('node', 'surface_water__velocity')
            self.grid.add_empty('node', 'surface_water__discharge')
        active = np.where(self.grid.status_at_node != CLOSED_BOUNDARY)[0]
        self._h = self.grid.at_node['surface_water__depth']
        self._active = active
        self._hc = critical_flow_depth
        self._n = mannings_n
        self._negepsilon = -mannings_epsilon
        assert not np.isclose(dt_max, 0.)
        self.dt_max = dt_max
        self.min_surface_water_depth = min_surface_water_depth
        self._active_depths = self.grid.at_node[
            'surface_water__depth'][active]
        all_grads = self.grid.calc_grad_at_link('topographic__elevation')
        hoz_grads = self.grid.map_mean_of_horizontal_active_links_to_node(
            all_grads)
        vert_grads = self.grid.map_mean_of_vertical_active_links_to_node(
            all_grads)
        self.hozslopept5 = np.fabs(hoz_grads[active])**0.5
        self.vertslopept5 = np.fabs(vert_grads[active])**0.5
        self.velx = self.grid.zeros('node', dtype=float)
        self.vely = self.grid.zeros('node', dtype=float)
        self.qy = np.zeros(grid.number_of_nodes+1, dtype=float)
        self.qx = np.zeros(grid.number_of_nodes+1, dtype=float)
        self.poshozgrads = hoz_grads > 0.
        self.posvertgrads = vert_grads > 0.
        if np.isclose(self.grid.dx, self.grid.dy):
            self.equaldims = True
            self.courant_prefactor = max_courant*self.grid.dx
        else:
            self.equaldims = False
            self.courant_prefactor = max_courant*self.grid.dx*self.grid.dy
        self._neighbors = self.grid.neighbors_at_node.copy()
        self._neighbors[self._neighbors == BAD_INDEX_VALUE] = -1
        self._water_balance = []
        self.actives_BCs = (self.grid.status_at_node[active] ==
                            FIXED_VALUE_BOUNDARY)
        self.actives_BCs_water_depth = self._h[active][self.actives_BCs]
        fixed_grad_nodes = self.grid.fixed_gradient_boundary_nodes
        fixed_grad_anchors = \
            self.grid.fixed_gradient_boundary_node_anchor_node
        # ^add this value to the anchor nodes to update the BCs
        # these also need to be mapped to active_IDs:
        blank_nodes = self.grid.zeros('node', dtype=bool)
        blank_nodes[fixed_grad_nodes] = True
        self.fixed_grad_nodes_active = np.where(blank_nodes[active])[0]
        blank_nodes.fill(False)
        blank_nodes[fixed_grad_anchors] = True
        self.fixed_grad_anchors_active = np.where(blank_nodes[active])[0]

    def run_one_step(self, dt, rainfall_intensity=0.00001,
                            update_topography=False, track_min_depth=False):
        """Update fields with current hydrologic conditions.

        Parameters
        ----------
        rain_intensity : float or array (m/s)
            The rainfall intensity across the grid (water input rate at each
            node).
        update_topography : bool
            Set to true if the topography of the grid evolves during the run.
        track_min_depth : bool
            At *very* low rainfall inputs, there is a possibility this
            component could allow creation of small amounts of water mass.
            Set to true to track this mass, and use the :func:`water_balance`
            property to investigate its evolution through time.
        """
        elapsed_time_in_dt = 0.  # this is only since the start of the timestep
        active = self._active
        self.hnew = self._h[active]
        hnew = self.hnew
        if update_topography:
            self.update_topographic_params()
        while elapsed_time_in_dt < dt:
            internal_dt = self.calc_grads_and_timesteps(
                update_topography, track_min_depth)
            remaining_dt = dt - elapsed_time_in_dt
            # now reduce timestep is needed if limited by total tstep length
            internal_dt = min(internal_dt, remaining_dt).clip(0.)
            # this section uses our final-array-val-is-zero trick
            qx_left = self.qx[self._neighbors[:, 2]].clip(min=0.)
            qx_right = self.qx[self._neighbors[:, 0]].clip(max=0.)
            qy_top = self.qy[self._neighbors[:, 1]].clip(min=0.)
            qy_bottom = self.qy[self._neighbors[:, 3]].clip(max=0.)
            # FR's rainfall handling was here. We're going to assume that the
            # component is being driven by a "LL style" rainfall record, where
            # the provided rainfall_intensity is constant across the provide
            # dt. If it's not, it needs to be handled outside the component.

            # now add the rainfall input
            if type(rainfall_intensity) is not np.ndarray:
                hnew += internal_dt * rainfall_intensity
            else:
                hnew += internal_dt * rainfall_intensity[active]
            # set the BCs
            hnew[self.actives_BCs] = self.actives_BCs_water_depth
            # flux it round
            hnew -= internal_dt/self.grid.dx*np.fabs(self.qy[active])
            hnew -= internal_dt/self.grid.dy*np.fabs(self.qx[active])
            hnew += internal_dt/self.grid.dx*(qy_top - qy_bottom)[active]
            hnew += internal_dt/self.grid.dy*(qx_left - qx_right)[active]
            hnew[self.fixed_grad_nodes_active] = hnew[
                self.fixed_grad_anchors_active]
            # update the internal clock
            elapsed_time_in_dt += internal_dt

        # update the actual fields
        self._h[active] = hnew
        self.grid.at_node['surface_water__velocity'][:] = np.sqrt(
            np.square(self.velx) + np.square(self.vely))
        self.grid.at_node['surface_water__discharge'][:] = np.sqrt(
            np.square(self.qx[:-1]) + np.square(self.qy[:-1]))

    def calc_grads_and_timesteps(self, update_topography, track_min_depth):
        """
        Perform the first part of the calculation for the main run, mainly
        velocities and fluxes. The main objective of this part of the
        calculation is to derive the stable timestep for the run.

        Parameters
        ----------
        update_topography : bool
            If False, the underlying surface topography is assumed unchanged
            since the last run.
        track_min_depth : bool
            If True, the internal list _water_balance will be appended with
            the volumetric fractional change in mass balance during the run.

        Returns
        -------
        internal_dt : float
            The internally stable timestep that will be used on this loop.
        """
        active = self._active
        hnew = self.hnew
        if update_topography:
            self.update_topographic_params()
        # assert the minimum water depth - this could introduce an element of
        # mass gain, but should remain minor
        hnew.clip(self.min_surface_water_depth, out=hnew)
        if track_min_depth:
            self._water_balance.append(
                (hnew-self._h[active]).sum()/self._h[active].sum())
        n = self._n * (hnew/self._hc)**self._negepsilon
        twothirdshnewbyn = hnew**0.66666666 / n
        self.vely[active] = twothirdshnewbyn * self.vertslopept5
        self.velx[active] = twothirdshnewbyn * self.hozslopept5
        self.vely[self.posvertgrads] *= -1.
        self.velx[self.poshozgrads] *= -1.
        self.qy[active] = self.vely[active] * hnew  # m**2/s
        self.qx[active] = self.velx[active] * hnew  # m**2/s
        maxvely = np.fabs(self.vely).max()
        maxvelx = np.fabs(self.velx).max()
        if self.equaldims:
            courant_dt = self.courant_prefactor/(maxvelx + maxvely)
        else:
            # note prefactor is NOT THE SAME as above in this case
            courant_dt = self.courant_prefactor/(self.grid.dy*maxvelx +
                                                 self.grid.dx*maxvely)
        if self.dt_max is not None:
            internal_dt = np.min((self.dt_max, courant_dt))
        else:
            internal_dt = courant_dt
        self._internal_dt = internal_dt

        return internal_dt

    def update_topographic_params(self):
        """
        If the topo changes during the run, change the held params used by
        :func:`run_one_step`.
        """
        active = np.where(self.grid.status_at_node != CLOSED_BOUNDARY)[0]
        all_grads = self.grid.calculate_gradients_at_links(
            'topographic__elevation')
        hoz_grads = self.grid.map_mean_of_horizontal_active_links_to_node(
            all_grads)
        vert_grads = self.grid.map_mean_of_vertical_active_links_to_node(
            all_grads)
        self.hozslopept5 = np.fabs(hoz_grads[active])**0.5
        self.vertslopept5 = np.fabs(vert_grads[active])**0.5
        self.poshozgrads = hoz_grads > 0.
        self.posvertgrads = vert_grads > 0.
        fixed_grad_nodes = self.grid.fixed_gradient_boundary_nodes
        fixed_grad_anchors = \
            self.grid.fixed_gradient_boundary_node_anchor_node
        # ^add this value to the anchor nodes to update the BCs
        # these also need to be mapped to active_IDs:
        blank_nodes = self.grid.zeros('node', dtype=bool)
        blank_nodes[fixed_grad_nodes] = True
        self.fixed_grad_nodes_active = np.where(blank_nodes[active])[0]
        blank_nodes.fill(False)
        blank_nodes[fixed_grad_anchors] = True
        self.fixed_grad_anchors_active = np.where(blank_nodes[active])[0]
        # check is the grid topology has changed...
        if not np.all(np.equal(self._active, active)):
            self._active = active
            self.velx.fill(0.)
            self.vely.fill(0.)
            self.qy.fill(0.)
            self.qx.fill(0.)
            self._neighbors = self.grid.neighbors_at_node.copy()
            self._neighbors[self._neighbors == BAD_INDEX_VALUE] = -1
            self.actives_BCs = (self.grid.status_at_node[active] ==
                                FIXED_VALUE_BOUNDARY)
            self.actives_BCs_water_depth = self._h[self.actives_BCs]

    @property
    def water_balance(self):
        """
        Return a list of the fractional gain/loss of water mass during the
        run, if it was tracked using the track_min_depth flag.
        """
        if self._water_balance == []:
            raise ValueError('No record of water balance was found!')
        else:
            return self._water_balance

    @property
    def internal_timestep(self):
        """
        Return the internal timestep last used by the kinematic wave component.
        """
        try:
            return self._internal_dt
        except AttributeError:
            # the component hasn't started running yet
            _ = self.calc_grads_and_timesteps(False, False)
            return self._internal_dt


text:
--TEST--
client pipelining
--SKIPIF--
<?php
include "skipif.inc";
skip_client_test();
?>
--FILE--
<?php

include "helper/server.inc";

echo "Test\n";

server("pipeline.inc", function($port, $stdin, $stdout, $stderr) {
	/* tell the server we're about to send 3 pipelined messages */
	fputs($stdin, "3\n");

	$client = new http\Client(null);
	$client->configure(array("pipelining" => true, "max_host_connections" => 0));

	/* this is just to let curl know the server may be capable of pipelining */
	$client->enqueue(new http\Client\Request("GET", "http://localhost:$port"));
	$client->send();

	$client->enqueue(new http\Client\Request("GET", "http://localhost:$port/1"));
	$client->enqueue(new http\Client\Request("GET", "http://localhost:$port/2"));
	$client->enqueue(new http\Client\Request("GET", "http://localhost:$port/3"));
	$client->send();

	while (($response = $client->getResponse())) {
		echo $response;
	}
});

?>
===DONE===
--EXPECT--
Test
HTTP/1.1 200 OK
X-Req: /3
Etag: ""
X-Original-Transfer-Encoding: chunked
HTTP/1.1 200 OK
X-Req: /2
Etag: ""
X-Original-Transfer-Encoding: chunked
HTTP/1.1 200 OK
X-Req: /1
Etag: ""
X-Original-Transfer-Encoding: chunked
HTTP/1.1 200 OK
X-Req: /
Etag: ""
X-Original-Transfer-Encoding: chunked
===DONE===


text:
<?php //-->

namespace Eden\Elastic;

/**
 * Query Builder Class
 *
 * @vendor   Eden
 * @package  Elastic
 * @author   Charles Zamora <czamora@openovate.com>
 * @standard PSR-2
 */
class Query extends Base
{
    /**
     * Query set.
     *
     * @var array
     */
    protected $query = array();

    /**
     * Set / Add a key to the query set,
     * nested key's is separated by
     * comma, value of the key can
     * be anything.
     *
     * @param   string | array | null
     * @param   *mixed
     * @return  $this
     */
    public function setTree($key = null, $value = null)
    {
        // Argument test
        Argument::i()
            ->test(1, 'string', 'array', 'null');

        // if key is not set
        if(is_null($key)) {
            return $this;
        }

        // if key is an array
        if(is_array($key)) {
            // just add it on our query body
            $this->query = array_merge($this->query, $key);

            return $this;
        }

        // create key path
        $keys = $this->createKey($key);

        // get the original set of query
        $original  = $this->query;
        // maximum depth
        $max       = count($keys);

        // if we have only one key
        if($max == 1) {
            // set that key on root instead
            $this->query[array_pop($keys)] = $value;

            return $this;
        }

        // recursively add keys to the query
        $query = $this->recurse($original, $value, $keys, 0, $max);

        // set the query to original
        $this->query = $query;

        return $this;
    }

    /**
     * Get's a key and value pair depending
     * on the key that is passed as the first
     * parameter, we could also access nested
     * key's by separating key's by comma.
     *
     * @param   string | null
     * @return  $this
     */
    public function getTree($key = null)
    {
        // Argument test
        Argument::i()->test(1, 'string', 'null');

        // if key is not set
        if(is_null($key)) {
            // return the entire query
            return $this->query;
        }

        // create key path
        $keys = $this->createKey($key);

        // get the original set of query
        $original  = $this->query;
        // maximum depth
        $max       = count($keys);

        // if we only have 1 key
        if($max == 1) {
            // return the key
            return isset($this->query[$keys[0]]) ? $this->query[$keys[0]] : null;
        }

        return $this->scan($this->query, $keys, 0, $max);
    }

    /**
     * Add a value to an array path.
     *
     * @param   string
     * @param   *mixed
     * @param   string | null
     * @return  $this
     */
    public function addTree($key, $value = null, $custom = null)
    {
        // Argument test
        Argument::i()
            ->test(1, 'string')
            ->test(3, 'string', 'null');

        // get the key path
        $current = $this->getTree($key);

        // if it's null
        if(is_null($current)) {
            $current = array();
        }

        // if has custom keys
        if($custom) {
            $current[$custom] = $value;
        } else {
            $current[] = $value;
        }

        // set the tree
        $this->setTree($key, $current);

        return $this;
    }

    /**
     * Get the query array.
     *
     * @return  array
     */
    public function getQuery()
    {
        return $this->query;
    }

    /**
     * Recursively add keys to an array.
     *
     * @param   array | null
     * @param   *mixed
     * @param   array
     * @param   int
     * @param   int
     * @return  array
     */
    private function recurse(&$target, $value,  $keys, $index, $max)
    {
        // are we on the last part?
        if($max == $index) {
            $target = $value;

            return $target;
        }

        // get the current key
        $key = $keys[$index];

        // are we on the first index, does the
        // key already exists or not?
        if(!isset($target[$key])) {
            // put some empty array
            $target[$key] = array();
        }

        // re-iterate process
        $this->recurse($target[$key], $value, $keys, ++$index, $max);

        return $target;
    }

    /**
     * Scans the object tree recursively.
     *
     * @param   array
     * @param   string
     * @param   int
     * @param   int
     * @return  *mixed
     */
    private function scan($target, $keys, $start, $end)
    {
        // get current
        $current = isset($target[$keys[$start]]) ? $target[$keys[$start]] : null;

        // if not found
        if(is_null($current)) {
            return $current;
        }

        // are we on the end?
        if(($end - 1) == $start) {
            return $current;
        }

        // if it's an array
        if(is_array($current)) {
            return $this->scan($current, $keys, ++$start, $end);
        }
    }

    /**
     * Creates a path.
     *
     * @param   string
     * @return  string
     */
    private function createKey($key)
    {
        // Argument test
        Argument::i()->test(1, 'string');

        // replace dot's with >
        $key = str_replace('.', '>', $key);
        // replace all escaped keys
        $key = preg_replace_callback('/(\[[^]]*?)(\>)([^]]*?\])/m', function($matches) {
            // replace back all the > to dots
            return str_replace('>', '.', $matches[0]);
        }, $key);
        // replace all [ ]
        $key = str_replace(array('[', ']'), '', $key);

        // explode keys
        $keys = explode('>', $key);

        return $keys;
    }
}


text:
@echo off
echo ################################# START XAMPP TEST SECTION #################################
echo:
echo:
echo [XAMPP]: FIRST TEST - Searching for an installed Microsoft Visual C++ 2008 runtime package in the registry ...

set runtime8_a=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4}
set runtime8_b=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{350AA351-21FA-3270-8B7A-835434E766AD}
set runtime8_c=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2B547B43-DB50-3139-9EBE-37D419E0F5FA}
set runtime8_d=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9A25302D-30C0-39D9-BD6F-21E6EC160475}
set runtime8_e=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8220EEFE-38CD-377E-8595-13398D740ACE}
set runtime8_f=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5827ECE1-AEB0-328E-B813-6FC68622C1F9}
set runtime8_g=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1F1C2DFC-2D24-3E06-BCB8-725134ADF989}
set runtime8_h=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1F1C2DFC-2D24-3E06-BCB8-725134ADF989}
set runtime8_i=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4B6C7001-C7D6-3710-913E-5BC23FCE91E6}
set runtime8_j=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{977AD349-C2A8-39DD-9273-285C08987C7B}

reg query "%runtime8_a%" /v DisplayVersion
if %ERRORLEVEL% EQU 0 (
    goto runtime_success
)
reg query "%runtime8_b%" /v DisplayVersion
if %ERRORLEVEL% EQU 0 (
    goto runtime_success
)
reg query "%runtime8_c%" /v DisplayVersion
if %ERRORLEVEL% EQU 0 (
    goto runtime_success
)

reg query "%runtime8_d%" /v DisplayVersion
if %ERRORLEVEL% EQU 0 (
    goto runtime_success
)

reg query "%runtime8_e%" /v DisplayVersion
if %ERRORLEVEL% EQU 0 (
    goto runtime_success
)

reg query "%runtime8_f%" /v DisplayVersion
if %ERRORLEVEL% EQU 0 (
    goto runtime_success
)

reg query "%runtime8_g%" /v DisplayVersion
if %ERRORLEVEL% EQU 0 (
    goto runtime_success
)

reg query "%runtime8_e%" /v DisplayVersion
if %ERRORLEVEL% EQU 0 (
    goto runtime_success
)

reg query "%runtime8_h%" /v DisplayVersion
if %ERRORLEVEL% EQU 0 (
    goto runtime_success
)

reg query "%runtime8_i%" /v DisplayVersion
if %ERRORLEVEL% EQU 0 (
    goto runtime_success
)

reg query "%runtime8_j%" /v DisplayVersion
if %ERRORLEVEL% EQU 0 (
    goto runtime_success
)

  echo:
  echo [WARNING]: Microsoft C++ 2008 runtime libraries not found !!!
  echo [WARNING]: Possibly PHP cannot execute without these runtime libraries
  echo [WARNING]: Please install the MS VC++ 2008 Redistributable Package from the Mircrosoft page
  echo [WARNING]: http://www.microsoft.com/en-us/download/details.aspx?id=5582
  goto runtime_end

:runtime_success
echo [SUCCESS]: Microsoft Visual C++ 2008 Redistributable Package found! Good!

:runtime_end
echo:
echo:
echo [XAMPP]: SECOND TEST - Execute php.exe with php\php.exe -n -d output_buffering=0 --version ...
echo:
php\php.exe -n -d output_buffering=0 --version
if %ERRORLEVEL% GTR 0 (
  echo:
  echo [ERROR]: Test php.exe failed !!!
  echo [ERROR]: Perhaps the Microsoft C++ 2008 runtime package is not installed.
  echo [ERROR]: Please install the MS VC++ 2008 Redistributable Package from the Mircrosoft page
  echo:
  echo ################################# END XAMPP TEST SECTION ##################################
  echo:
  pause
  exit 1
)

echo [SUCCESS]: Test for the php.exe successfully passed. Good!
echo:
echo ################################# END XAMPP TEST SECTION ##################################
echo:

pause


text:
namespace Aliencube.ConfigurationEncryptor.ConsoleApp
{
    /// <summary>
    /// This determines the direction for cryption.
    /// </summary>
    internal enum Direction
    {
        /// <summary>
        /// Identifies that no direction is given.
        /// </summary>
        None = 0,

        /// <summary>
        /// Identifies encryption.
        /// </summary>
        Encrypt = 1,

        /// <summary>
        /// Identifies decription.
        /// </summary>
        Decrypt = 2
    }
}


text: Wrapper for the Cognitive Speaker Recognition APIs for UWP


text:
package org.fcrepo.kernel.api.operations;

import org.apache.jena.rdf.model.Model;
import org.fcrepo.kernel.api.RdfStream;

/**
 * Builder for constructing an RdfSourceOperation
 *
 * @author bbpennel
 */
public interface RdfSourceOperationBuilder extends ResourceOperationBuilder {

    @Override
    RdfSourceOperationBuilder userPrincipal(String userPrincipal);

    @Override
    RdfSourceOperation build();

    /**
     * Set the triples for the operation
     *
     * @param triples the resource's triples
     * @return this builder
     */
    RdfSourceOperationBuilder triples(RdfStream triples);

    /**
     * Set the relaxed managed properties for this resource if the server
     * is in relaxed mode.
     *
     * @param model rdf of the resource
     * @return this builder
     */
    RdfSourceOperationBuilder relaxedProperties(Model model);

}


text:
namespace Gek
{
    namespace UI
    {
        namespace Dock
        {
            enum class Location
            {
                Left = 0,
                Right,
                Top,
                Bottom,
                Tab,
                Float,
                None,
            };

            struct Context;

            struct WorkSpace
            {
                WorkSpace(void);
                ~WorkSpace(void);

                void Begin(std::string_view label = "##workspace", ImVec2 const &workspace = ImVec2(0, 0), bool showBorder = false, ImVec2 const &splitterSize = ImVec2(3.0f, 3.0f));
                void End(void);

                void SetNextLocation(Location location);
                bool BeginTab(std::string_view label, bool *opened = NULL, ImGuiWindowFlags extraFlags = 0, ImVec2 const &defaultSize = ImVec2(-1, -1));
                void EndTab(void);

                void SetActive(void);

            private:
                Context *context = nullptr;
            };
        }; // Dock
    }; // namespace UI
}; // namespace Gek


text:
%  ========================================================================
%  Copyright (c) 1985 The University of Washington
%
%  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.
%  ========================================================================
%

% ProQuest (vague) guidelines: http://media2.proquest.com/documents/Preparing+Your+Manuscript+for+Submission+Revised+31jul2015.pdf

% Documentation for University of Washington thesis LaTeX document class
% by Jim Fox
% fox@washington.edu
%
%    Revised for version 2015/03/03 of uwthesis.cls
%    Revised, 2016/11/22, for cleanup of sample copyright and title pages
%
%    This document is contained in a single file ONLY because
%    I wanted to be able to distribute it easily.  A real thesis ought
%    to be contained on many files (e.g., one for each chapter, at least).
%
%    To help you identify the files and sections in this large file
%    I use the string '==========' to identify new files.
%
%    To help you ignore the unusual things I do with this sample document
%    I try to use the notation
%
%    % --- sample stuff only -----
%    special stuff for my document, but you don't need it in your thesis
%    % --- end-of-sample-stuff ---

%    Printed in twoside style now that that's allowed
%

% Packages added by Janet
\documentclass [11pt, proquest] {uwthesis}[2016/11/22]
\usepackage{setspace}  % sometimes single spacing (J)
\usepackage{float} % [H] figure placements   (J)
\usepackage{pdfpages} % necessary for [width=1.0\textwidth] type args (J)
\usepackage{booktabs} % for table \toprule, \midrule, \bottomrule  (J)

\usepackage{mathtools} % mathtools builds on and extends amsmath package  % allow fraction wrapping.

%
% The following line would print the thesis in a postscript font

% \usepackage{natbib}
% \def\bibpreamble{\protect\addcontentsline{toc}{chapter}{Bibliography}}

\setcounter{tocdepth}{1}  % Print the chapter and sections to the toc

% ==========   Local defs and mods
%

%----- Janet additions
\usepackage[colorlinks = true, linkcolor = black, urlcolor  = blue, citecolor = black, anchorcolor = black]{hyperref} % for hyperlinks.
\usepackage{longtable} % for multi-page tables.  Used for glossary. http://stackoverflow.com/questions/2896833/how-to-stretch-a-table-over-multiple-pages
\usepackage{pdflscape} % for 'landscape' environment
\usepackage{caption}
\captionsetup{width=1.0\textwidth}
\usepackage{datatool}  % http://tex.stackexchange.com/questions/242315/using-csvreader-to-read-from-csv-giving-invalid-output
\usepackage{seqsplit} % to wrap AA sequences. See RFP sequence. % http://tex.stackexchange.com/questions/100391/how-to-wrap-a-word-in-line-without-hyphen

\usepackage{palatino} % Erick's favorite font
\usepackage{textgreek} % allows for mu, etc.    $\mu$ is my fav, but there is \textmu \textmugreek
% to get reaction arrows, use mhchem.  From http://tex.stackexchange.com/questions/142865/arrows-chemical-equations
\usepackage[version=3]{mhchem} % http://bay.uchicago.edu/tex-archive/macros/latex/contrib/mhchem/mhchem.pdf
	% Ammonium sulphate is \ce{(NH4)2SO4}

\hyphenpenalty=5000 % from http://sei.pku.edu.cn/~yaoguo/latex.htm
\tolerance=1000 % from http://sei.pku.edu.cn/~yaoguo/latex.htm

\DeclareRobustCommand*{\refchA}{\ref*{chapter:A}}
\DeclareRobustCommand*{\refchB}{\ref*{chapter:B}}
\DeclareRobustCommand*{\refchC}{\ref*{chapter:C}}

\begin{document}

% ==========   Preliminary pages
%
% ( revised 2012 for electronic submission )
%

\prelimpages

%
% ----- copyright and title pages
%
\Title{Genomics, Transcriptomics, and Statistical/Machine Learning to Enhance Understanding of Methanotrophic Microbial Metabolism in Isolates and Communities.}
\Author{Janet Matsen}
\Year{2017}
\Program{Chemical Engineering}

\Chair{Mary Lidstrom}{Professor}{Chemical Engineering, Microbiology}
\Chair{David Beck}{Research Assistant Professor}{Chemical Engineering}
\Signature{David Baker}
\Signature{Fran\c{c}ois Baneyx}

\copyrightpage

\titlepage

%
% ----- signature and quoteslip are gone
%

%
% ----- abstract
%

\setcounter{page}{-1}
\abstract{%

\input{./tex/abstract}

}
%
% ----- contents & etc.
%
\tableofcontents
\listoffigures
\listoftables

%
% ----- glossary
%
\include{./tex/glossary}
%
% ----- acknowledgments
%
\include{./tex/acknowledgements}
%
% ----- dedication
%
\include{./tex/dedication}
%
% end of the preliminary pages

%
% ==========      Text pages
%

\textpages
\raggedbottom\sloppy
\include{./tex/chapter0/intro_glue}

% ========== Chapter 1

\chapter{Global molecular analyses of methane metabolism in methanotrophic alphaproteobacterium, \textit{Methylosinus trichosporium} OB3b. Part I: transcriptomic study}
\label{chapter:A}
\input{./tex/chapter1/pure_culture_omics}

% ========== Chapter 2

\chapter{Microbial Community Analysis: Metagenomics and Metatranscriptomics}
\label{chapter:B}
\input{./tex/chapter2/community_analysis}

 % ========== Chapter 3

\chapter{Statistical/Machine Learning for Metagenomics and Metatranscriptomics}
\label{chapter:C}
\input{./tex/chapter3/ml}

 % ========== Chapter: closing

\chapter{Closing Remarks}
\label{chapter:closing}
\input{./tex/closing}

\printendnotes

%
% ==========   Bibliography
%
%\nocite{*}   % include everything in the uwthesis.bib file
\bibliographystyle{unsrt}
\bibliography{uwthesis,./tex/chapter0/intro_glue.bib,./tex/chapter1/chapter1,./tex/chapter2/chapter2,./tex/chapter3/chapter3}
%
% ==========   Appendices
%
\appendix
\raggedbottom\sloppy

% ========== Appendix A

\input{./tex/chapter1/supplemental}
\input{./tex/chapter2/supplemental}
\input{./tex/chapter3/supplemental}

\end{document}


text:
/**
 * @fileOverview File walker
 * @name walk.js<f/service>
 * @author Kei Funagayama <funagayama_kei@cyberagent.co.jp>
 */

var path = require('path');
var fs = require('fs');
var moment = require('moment');
var bytes = require('bytes');
var beezlib = require('beezlib');

var bootstrap = require('../bootstrap');

var config = bootstrap.config;
var message = require('../message.js');
var errors = message.errors;

var DATE_FORMAT = 'YYYY/MM/DD HH:mm:ss';

var WalkService = function WalkService() {
};

module.exports = new WalkService();

WalkService.prototype.isFile = function isFile(type) {
    return type === 'file';
};

/**
 * get stat infomation.
 * @param {Object} name Directory infomation
 * @param {String} file file name
 * @param {Array} locales langs
 * @returns {Object}
 */
WalkService.prototype.stats = function stats(info, file, locales) {

    var lang = locales[0];
    file = file || '';

    var real = path.normalize(info.stat.abspath + '/' + file);
    var stats = fs.statSync(real);
    var uri = path.normalize(info.uri + '/' + file);

    var type = '';
    // file type
    if (stats.isFile()) {
        type = 'file';
    } else if (stats.isDirectory()) {
        type = 'directory';
    } else if (stats.isBlockDevice()) {
        type = 'block';
    } else if (stats.isCharacterDevice()) {
        type = 'character';
    } else if (stats.isSymbolicLink()) {
        type = 'symlink';
    } else if (stats.isFIFO()) {
        type = 'fifo';
    } else if (stats.isSocket()) {
        type = 'socket';
    } else {
        type = 'other';
    }
    var preview = false;
    // preview check
    if (file.match(/\.png$|\.gif$|\.jpeg$|\.jpg$/))
        preview = true;

    var ret = {
        module: info.stat.name,
        path: {
            root: info.stat.root,
            dir: info.stat.path,
            file: file || info.stat.name,
            real: real,
            uri: uri
        },
        type: type,
        preview: preview,
        atime: moment(stats.atime.getTime()).lang(lang).format(DATE_FORMAT),
        blksize: bytes(stats.blksize),
        blocks: stats.blocks,
        ctime: moment(stats.ctime.getTime()).lang(lang).format(DATE_FORMAT),
        dev: stats.dev,
        gid: stats.gid,
        ino: stats.ino,
        mode: stats.mode,
        mtime: moment(stats.mtime.getTime()).lang(lang).format(DATE_FORMAT),
        nlink: stats.nlink,
        rdev: stats.rdev,
        size: bytes(stats.size),
        uid: stats.uid
    };

    return ret;
};

/**
 * get files infomation
 *
 * @param {Object} name Directory infomation
 * @param {Array} locales langs
 * @param {function} callback
 */
WalkService.prototype.get = function get(info, locales, callback) {
    var ret = [];
    var contents = fs.readdirSync(info.stat.abspath);
    for (var i = 0; i < contents.length; i++) {
        ret.push(this.stats(info, contents[i], locales));
    };

    return callback(null, ret);
};


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Immutable;
using System.Diagnostics;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.CSharp.Symbols
{
    internal sealed class TypeSubstitutedLocalSymbol : LocalSymbol
    {
        private readonly LocalSymbol _originalVariable;
        private readonly TypeWithAnnotations _type;
        private readonly Symbol _containingSymbol;

        public TypeSubstitutedLocalSymbol(LocalSymbol originalVariable, TypeWithAnnotations type, Symbol containingSymbol)
        {
            Debug.Assert(originalVariable != null);
            Debug.Assert(type.HasType);
            Debug.Assert(containingSymbol != null);

            _originalVariable = originalVariable;
            _type = type;
            _containingSymbol = containingSymbol;
        }

        internal override bool IsImportedFromMetadata
        {
            get { return _originalVariable.IsImportedFromMetadata; }
        }

        internal override LocalDeclarationKind DeclarationKind
        {
            get { return _originalVariable.DeclarationKind; }
        }

        internal override SynthesizedLocalKind SynthesizedKind
        {
            get { return _originalVariable.SynthesizedKind; }
        }

        internal override SyntaxNode ScopeDesignatorOpt
        {
            get { return _originalVariable.ScopeDesignatorOpt; }
        }

        public override string Name
        {
            get { return _originalVariable.Name; }
        }

        public override Symbol ContainingSymbol
        {
            get { return _containingSymbol; }
        }

        public override ImmutableArray<SyntaxReference> DeclaringSyntaxReferences
        {
            get { return _originalVariable.DeclaringSyntaxReferences; }
        }

        internal override SyntaxNode GetDeclaratorSyntax()
        {
            return _originalVariable.GetDeclaratorSyntax();
        }

        public override ImmutableArray<Location> Locations
        {
            get { return _originalVariable.Locations; }
        }

        public override TypeWithAnnotations TypeWithAnnotations
        {
            get { return _type; }
        }

        internal override SyntaxToken IdentifierToken
        {
            get { return _originalVariable.IdentifierToken; }
        }

        internal override bool IsCompilerGenerated
        {
            get { return _originalVariable.IsCompilerGenerated; }
        }

        internal override bool IsPinned
        {
            get { return _originalVariable.IsPinned; }
        }

        public override RefKind RefKind
        {
            get { return _originalVariable.RefKind; }
        }

        /// <summary>
        /// Compiler should always be synthesizing locals with correct escape semantics.
        /// Checking escape scopes is not valid here.
        /// </summary>
        internal override uint ValEscapeScope => throw ExceptionUtilities.Unreachable;

        /// <summary>
        /// Compiler should always be synthesizing locals with correct escape semantics.
        /// Checking escape scopes is not valid here.
        /// </summary>
        internal override uint RefEscapeScope => throw ExceptionUtilities.Unreachable;

        internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, DiagnosticBag diagnostics)
        {
            return _originalVariable.GetConstantValue(node, inProgress, diagnostics);
        }

        internal override ImmutableArray<Diagnostic> GetConstantValueDiagnostics(BoundExpression boundInitValue)
        {
            return _originalVariable.GetConstantValueDiagnostics(boundInitValue);
        }

        internal override LocalSymbol WithSynthesizedLocalKindAndSyntax(SynthesizedLocalKind kind, SyntaxNode syntax)
        {
            var origSynthesized = (SynthesizedLocal)_originalVariable;
            return new TypeSubstitutedLocalSymbol(
                    origSynthesized.WithSynthesizedLocalKindAndSyntax(kind, syntax),
                    _type,
                    _containingSymbol
                );
        }
    }
}


text:
namespace ash {

class Shelf;

// ShelfWindowTargeter makes it easier to resize windows with the mouse when the
// window-edge slightly overlaps with the shelf edge. The targeter also makes it
// easier to drag the shelf out with touch while it is hidden.
class ShelfWindowTargeter : public ::wm::EasyResizeWindowTargeter,
                            public aura::WindowObserver,
                            public ShelfObserver {
 public:
  ShelfWindowTargeter(aura::Window* container, Shelf* shelf);
  ~ShelfWindowTargeter() override;

 private:
  // ::wm::EasyResizeWindowTargeter:
  bool ShouldUseExtendedBounds(const aura::Window* window) const override;
  bool GetHitTestRects(aura::Window* target,
                       gfx::Rect* hit_test_rect_mouse,
                       gfx::Rect* hit_test_rect_touch) const override;

  // aura::WindowObserver:
  void OnWindowDestroying(aura::Window* window) override;

  // ShelfObserver:
  void WillChangeVisibilityState(ShelfVisibilityState new_state) override;

  Shelf* shelf_;

  DISALLOW_COPY_AND_ASSIGN(ShelfWindowTargeter);
};

}  // namespace ash

#endif  // ASH_SHELF_SHELF_WINDOW_TARGETER_H_


text:
package org.apache.myfaces.ov2021.view.facelets.tag.composite;

import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.FacesWrapper;
import javax.faces.component.ContextCallback;
import javax.faces.component.UIComponent;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorHolder;
import javax.faces.component.visit.VisitCallback;
import javax.faces.component.visit.VisitContext;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ComponentSystemEvent;
import javax.faces.event.ComponentSystemEventListener;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
import javax.faces.render.Renderer;

/**
 * This class has two usages:
 *
 * 1. On ClientBehaviorAttachedObjectTargetImpl to redirect the incoming sourceEvent
 * to the final targetEvent.
 * 2. On FaceletsViewDeclarationLanguage.retargetAttachedObjects to redirect too, but
 * this time is to allow chain events for nested composite components.
 *
 * This class also implements FacesWrapper interface, to make possible to retrieve the
 * real component if necessary.
 *
 * @author Leonardo Uribe (latest modification by $Author: bommel $)
 * @version $Revision: 1187700 $ $Date: 2011-10-22 14:19:37 +0200 (Sa, 22 Okt 2011) $
 */
public class ClientBehaviorRedirectEventComponentWrapper extends UIComponent
    implements FacesWrapper<UIComponent>, ClientBehaviorHolder
{

    private final UIComponent _delegate;
    private final String _sourceEvent; //cc:clientBehavior "name"
    private final String _targetEvent; //cc:clientBehavior "event"

    public ClientBehaviorRedirectEventComponentWrapper(UIComponent delegate,
            String sourceEvent, String targetEvent)
    {
        super();
        _delegate = delegate;
        _sourceEvent = sourceEvent;
        _targetEvent = targetEvent;
    }

    public UIComponent getWrapped()
    {
        return _delegate;
    }

    public void addClientBehavior(String eventName, ClientBehavior behavior)
    {
        if (_sourceEvent.equals(eventName))
        {
            ((ClientBehaviorHolder)_delegate).addClientBehavior(_targetEvent == null ? ((ClientBehaviorHolder)_delegate).getDefaultEventName(): _targetEvent , behavior);
        }
    }

    public Map<String, List<ClientBehavior>> getClientBehaviors()
    {
        Map<String, List<ClientBehavior>> clientBehaviors = new HashMap<String, List<ClientBehavior>>(1);
        clientBehaviors.put(_sourceEvent, ((ClientBehaviorHolder)_delegate).getClientBehaviors().get(_targetEvent));
        return Collections.unmodifiableMap(clientBehaviors);
    }

    public String getDefaultEventName()
    {
        if (_targetEvent == null )
        {
            // There is no targetEvent assigned, so we need to check if there is
            // a default event name on the delegate, if so return sourceEvent, otherwise
            // there is no default event and we can't resolve the redirection, so
            // return null. Note this usually could cause another exception later
            // (see AjaxHandler code
            if (((ClientBehaviorHolder)_delegate).getDefaultEventName() != null)
            {
                return _sourceEvent;
            }
            else
            {
                return null;
            }
        }
        else
        {
            // We have a target event, so in this case we have to return the sourceEvent,
            // because it is expected the client behavior to be attached has this event name.
            return _sourceEvent;
        }
    }

    public Collection<String> getEventNames()
    {
        return Collections.singletonList(_sourceEvent);
    }

    // UIComponent wrapping. Just delegate.
    public void broadcast(FacesEvent event) throws AbortProcessingException
    {
        _delegate.broadcast(event);
    }

    public void clearInitialState()
    {
        _delegate.clearInitialState();
    }

    public void decode(FacesContext context)
    {
        _delegate.decode(context);
    }

    public void encodeAll(FacesContext context) throws IOException
    {
        _delegate.encodeAll(context);
    }

    public void encodeBegin(FacesContext context) throws IOException
    {
        _delegate.encodeBegin(context);
    }

    public void encodeChildren(FacesContext context) throws IOException
    {
        _delegate.encodeChildren(context);
    }

    public void encodeEnd(FacesContext context) throws IOException
    {
        _delegate.encodeEnd(context);
    }

    public UIComponent findComponent(String expr)
    {
        return _delegate.findComponent(expr);
    }

    public Map<String, Object> getAttributes()
    {
        return _delegate.getAttributes();
    }

    public int getChildCount()
    {
        return _delegate.getChildCount();
    }

    public List<UIComponent> getChildren()
    {
        return _delegate.getChildren();
    }

    public String getClientId()
    {
        return _delegate.getClientId();
    }

    public String getClientId(FacesContext context)
    {
        return _delegate.getClientId(context);
    }

    public String getContainerClientId(FacesContext ctx)
    {
        return _delegate.getContainerClientId(ctx);
    }

    public UIComponent getFacet(String name)
    {
        return _delegate.getFacet(name);
    }

    public int getFacetCount()
    {
        return _delegate.getFacetCount();
    }

    public Map<String, UIComponent> getFacets()
    {
        return _delegate.getFacets();
    }

    public Iterator<UIComponent> getFacetsAndChildren()
    {
        return _delegate.getFacetsAndChildren();
    }

    public String getFamily()
    {
        return _delegate.getFamily();
    }

    public String getId()
    {
        return _delegate.getId();
    }

    public List<SystemEventListener> getListenersForEventClass(
            Class<? extends SystemEvent> eventClass)
    {
        return _delegate.getListenersForEventClass(eventClass);
    }

    public UIComponent getNamingContainer()
    {
        return _delegate.getNamingContainer();
    }

    public UIComponent getParent()
    {
        return _delegate.getParent();
    }

    public String getRendererType()
    {
        return _delegate.getRendererType();
    }

    public boolean getRendersChildren()
    {
        return _delegate.getRendersChildren();
    }

    public Map<String, String> getResourceBundleMap()
    {
        return _delegate.getResourceBundleMap();
    }

    public ValueBinding getValueBinding(String name)
    {
        return _delegate.getValueBinding(name);
    }

    public ValueExpression getValueExpression(String name)
    {
        return _delegate.getValueExpression(name);
    }

    public boolean initialStateMarked()
    {
        return _delegate.initialStateMarked();
    }

    public boolean invokeOnComponent(FacesContext context, String clientId,
            ContextCallback callback) throws FacesException
    {
        return _delegate.invokeOnComponent(context, clientId, callback);
    }

    public boolean isInView()
    {
        return _delegate.isInView();
    }

    public boolean isRendered()
    {
        return _delegate.isRendered();
    }

    public boolean isTransient()
    {
        return _delegate.isTransient();
    }

    public void markInitialState()
    {
        _delegate.markInitialState();
    }

    public void processDecodes(FacesContext context)
    {
        _delegate.processDecodes(context);
    }

    public void processEvent(ComponentSystemEvent event)
            throws AbortProcessingException
    {
        _delegate.processEvent(event);
    }

    public void processRestoreState(FacesContext context, Object state)
    {
        _delegate.processRestoreState(context, state);
    }

    public Object processSaveState(FacesContext context)
    {
        return _delegate.processSaveState(context);
    }

    public void processUpdates(FacesContext context)
    {
        _delegate.processUpdates(context);
    }

    public void processValidators(FacesContext context)
    {
        _delegate.processValidators(context);
    }

    public void queueEvent(FacesEvent event)
    {
        _delegate.queueEvent(event);
    }

    public void restoreState(FacesContext context, Object state)
    {
        _delegate.restoreState(context, state);
    }

    public Object saveState(FacesContext context)
    {
        return _delegate.saveState(context);
    }

    public void setId(String id)
    {
        _delegate.setId(id);
    }

    public void setInView(boolean isInView)
    {
        _delegate.setInView(isInView);
    }

    public void setParent(UIComponent parent)
    {
        _delegate.setParent(parent);
    }

    public void setRendered(boolean rendered)
    {
        _delegate.setRendered(rendered);
    }

    public void setRendererType(String rendererType)
    {
        _delegate.setRendererType(rendererType);
    }

    public void setTransient(boolean newTransientValue)
    {
        _delegate.setTransient(newTransientValue);
    }

    public void setValueBinding(String name, ValueBinding binding)
    {
        _delegate.setValueBinding(name, binding);
    }

    public void setValueExpression(String name, ValueExpression expression)
    {
        _delegate.setValueExpression(name, expression);
    }

    public void subscribeToEvent(Class<? extends SystemEvent> eventClass,
            ComponentSystemEventListener componentListener)
    {
        _delegate.subscribeToEvent(eventClass, componentListener);
    }

    public void unsubscribeFromEvent(Class<? extends SystemEvent> eventClass,
            ComponentSystemEventListener componentListener)
    {
        _delegate.unsubscribeFromEvent(eventClass, componentListener);
    }

    public boolean visitTree(VisitContext context, VisitCallback callback)
    {
        return _delegate.visitTree(context, callback);
    }

    // Some methods of UIComponent are protected, but for the scope of this
    // wrapper are never used, so it is safe to just do nothing or return null.

    @Override
    protected FacesContext getFacesContext()
    {
        return FacesContext.getCurrentInstance();
    }

    @Override
    protected void addFacesListener(FacesListener listener)
    {
    }

    @Override
    protected FacesListener[] getFacesListeners(Class clazz)
    {
        return null;
    }

    @Override
    protected Renderer getRenderer(FacesContext context)
    {
        return null;
    }

    @Override
    protected void removeFacesListener(FacesListener listener)
    {
    }
}


text:
package solutions.deepfield.spark.itcase.core.domain;

public class LoadParams {

	private String groupId;

	private String artifactId;

	private String version;

	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public String getArtifactId() {
		return artifactId;
	}

	public void setArtifactId(String artifactId) {
		this.artifactId = artifactId;
	}

	public String getVersion() {
		return version;
	}

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

	@Override
	public String toString() {
		return "LoadParams [groupId=" + groupId + ", artifactId=" + artifactId
				+ ", version=" + version + "]";
	}

}


text:
import os
import sys
import tempfile

OS = None
if sys.platform.startswith('linux'):
    OS = 'linux'
    import fcntl
elif sys.platform.startswith('win32'):
    OS = 'windows'

class Singleton:
    def __init__(self):
        # Variable para almacenar el file descriptor
        self.fd = None
        # Ruta para el lock file en la carpeta temporal del sistema
        self.filepath = os.path.abspath(os.path.join(tempfile.gettempdir(),
            'myapp.pid'))

        if OS == 'linux':
            # Para el caso de linux usamos el módulo fcntl para crear el archivo
            # y bloquearlo automáticamente. Si la operación falla es porque el
            # archivo ya existe y está bloqueado.
            self.fd = open(self.filepath, 'w')
            try:
                fcntl.lockf(self.fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
            except IOError:
                self.__exit()
        elif OS == 'windows':
            try:
                # Para el caso windows simplemente creamos el archivo "a mano",
                # pero verificamos primero si el archivo existe e intentamos
                # removerlo (para casos en que la ejecución previa haya sido
                # interrumpida)
                if os.path.exists(self.filepath):
                    os.unlink(self.filepath)
                self.fd = os.open(self.filepath, os.O_CREAT|os.O_EXCL|os.O_RDWR)
            except OSError, err:
                if err.errno == 13:
                    self.__exit()

    def __del__(self):
        # Para el caso de windows también debemos destruir el archivo "a mano"
        # al finalizar la ejecución del programa.
        if OS == 'windows':
            if self.fd:
                os.close(self.fd)
                os.unlink(self.filepath)

    def __exit(self):
        print 'Ya hay una instancia en ejecución. Saliendo'
        sys.exit(-1)

class MyApp(Singleton):
    def __init__(self):
        Singleton.__init__(self)
        print 'Ejecutando MyApp'
        # Creamos un bucle infinito solo para mantener la aplicación en
        # ejecución
        while 1:
            continue

if __name__ == '__main__':
    app = MyApp()


text:
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { FormGroup } from '@angular/forms';

import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

import { environment } from '../../../environments/environment';
import { Activity } from './activity.model';

@Injectable({
  providedIn: 'root'
})
export class ActivitiesService {

  count = 0;

  constructor(private http: HttpClient) { }

  index(): Observable<string> {
    return this.http.get<string>(environment.api + 'activities/index').pipe(map(response => response));
  }

  totalCount(): Observable<number> {
    return this.http.get<number>(environment.api + 'activities/count').pipe(map(response => response));
  }

  last(): Observable<Activity> {
    return this.http.get<Activity>(environment.api + 'activities/last').pipe(map(response => response));
  }

  listAndEnrich(params: any): Observable<Activity[]> {
    return this.list(params).pipe(map(response => {
      response.forEach((activity: Activity) => {
        activity.formattedDuration = this.formatTime(activity.duration);
        activity.timePerKm = this.formatTime(this.calcTimePerKm(activity.duration, activity.distance));
        activity.timePer5Km = this.formatTime(this.calcTimePerKm(5 * activity.duration, activity.distance));
        activity.timePer10Km = this.formatTime(this.calcTimePerKm(10 * activity.duration, activity.distance));
      });
      return response;
    }));
  }

  list(params: any): Observable<Activity[]> {
    const activities: Activity[] = [];
    return this.http.get<any>(environment.api + 'activities', { params }).pipe(map(response => {
      this.count = response.totalHits;
      response.searchHits.map((activity: { content: Activity; }) => {
        activities.push(activity.content);
      });
      return activities;
    }));
  }

  /**
   * Convert 71 to '00:01:11'
   */
  private formatTime(seconds: number): string {
    return new Date(seconds * 1000).toISOString().substr(11, 8);
  }

  private calcTimePerKm(time: number, distance: number): number {
    return distance !== 0 ? time / distance : 0;
  }
}


text:
"""Compute whether the number of 1s in a string is even."""

import functools
from typing import Mapping

import jax
import jax.nn as jnn
import jax.numpy as jnp
import jax.random as jrandom

from neural_networks_chomsky_hierarchy.tasks import task

class ParityCheck(task.GeneralizationTask):
  """A task which goal is to count the number of '1' in a string, modulo 2.

  The input is a string, composed of 0s and 1s. If the result is even, the class
  is 0, otherwise it's 1.

  Examples:
    1010100 -> 3 1s (odd) -> class 1
    01111 -> 4 1s (even) -> class 0

  Note that the sampling is jittable so this task is fast.
  """

  @functools.partial(jax.jit, static_argnums=(0, 2, 3))
  def sample_batch(self, rng: jnp.ndarray, batch_size: int,
                   length: int) -> Mapping[str, jnp.ndarray]:
    """Returns a batch of strings and the expected class."""
    strings = jrandom.randint(
        rng, shape=(batch_size, length), minval=0, maxval=2)
    n_b = jnp.sum(strings, axis=1) % 2
    n_b = jnn.one_hot(n_b, num_classes=2)
    one_hot_strings = jnn.one_hot(strings, num_classes=2)
    return {"input": one_hot_strings, "output": n_b}

  @property
  def input_size(self) -> int:
    """Returns the input size for the models."""
    return 2

  @property
  def output_size(self) -> int:
    """Returns the output size for the models."""
    return 2


text:
import { modify } from './modify'

export { modify }


text:
package com.intirix.openmm.server.ui.html.pages;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

import com.intirix.openmm.server.OpenMMServerRuntime;
import com.intirix.openmm.server.api.beans.Show;
import com.intirix.openmm.server.mt.OpenMMMidtierException;
import com.intirix.openmm.server.ui.html.PageBeanFactory;
import com.intirix.openmm.server.ui.html.PageData;

public class ShowsListBeanFactory implements PageBeanFactory
{
	private OpenMMServerRuntime runtime;

	public void setRuntime( OpenMMServerRuntime runtime )
	{
		this.runtime = runtime;
	}

	public PageData createPageBean( HttpServletRequest request, Object actionResult ) throws ServletException
	{
		final ShowsListBean page = new ShowsListBean();

		try
		{
			page.setShows( runtime.getTechnicalLayer().getShowMidtier().listShows().toArray( new Show[]{} ) );
		}
		catch ( OpenMMMidtierException e )
		{
			throw new ServletException( e );
		}

		return page;
	}

}


text:
COMPANY_NAME = "Opscode"

# The Country Name to use for SSL Certificates
SSL_COUNTRY_NAME = "US"

# The State Name to use for SSL Certificates
SSL_STATE_NAME = "Washington"

# The Locality Name for SSL - typically, the city
SSL_LOCALITY_NAME = "Seattle"

# What department?
SSL_ORGANIZATIONAL_UNIT_NAME = "Operations"

# The SSL contact email address
SSL_EMAIL_ADDRESS = "do_not_reply@opscode.com"

# License for new Cookbooks
# Can be :apachev2 or :none
NEW_COOKBOOK_LICENSE = :apachev2

##########################
# Chef Repository Layout #
##########################

supportdir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
tmpdir = File.expand_path(File.join(File.dirname(__FILE__), "..", "tmp"))

# Where to find upstream cookbooks
COOKBOOK_PATH = File.join(supportdir, "cookbooks")

# Where to find site-local modifications to upstream cookbooks
SITE_COOKBOOK_PATH = File.join(supportdir, "site-cookbooks")

# Chef Config Path
CHEF_CONFIG_PATH = File.join(supportdir, "config")

# The location of the Chef Server Config file (on the server)
CHEF_SERVER_CONFIG = File.join(CHEF_CONFIG_PATH, "server.rb")

# The location of the Chef Client Config file (on the client)
CHEF_CLIENT_CONFIG = File.join(CHEF_CONFIG_PATH, "client.rb")

###
# Useful Extras (which you probably don't need to change)
###

# The top of the repository checkout
TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), ".."))

# Where to store certificates generated with ssl_cert
CADIR = File.expand_path(File.join(TOPDIR, "certificates"))


text:
(function(bc) {
  'use strict';
  bc.myStations = function($scope) {
    // List of available bart stations
    $scope.bartStations = null;

    // Used to determine when it's appropriate to show certain error messages
    $scope.isSubmitted = false;

    // Make a local version of myStations by cloning initialized data
    $scope.myStations = JSON.parse(JSON.stringify($scope.app.myStations));

    /**
     * Checks to make sure that all preferred stations are valid and updates the
     * error code on each based on their validity.
     * - Each preferred station has to have data associated with it
     * - Each station selection has to be unique
     * @returns {boolean} - true if form is valid
     */
    $scope.isFormValid = function() {
      var i,
        errorCode,
        stationData,
        locations = {},
        isFormValid = true;

      for (i = 0; i < $scope.myStations.length; i++) {
        errorCode = null;

        stationData = $scope.myStations[i].stationData;
        if (!stationData) {
          // Make sure a station is selected
          errorCode = $scope.STATION_ERROR_NO_DATA;
          isFormValid = false;
        } else {
          // Make sure the station is unique
          if (locations[stationData.abbr]) {
            errorCode = $scope.STATION_ERROR_DUPLICATE_LOCATION;
            isFormValid = false;
          } else {
            // Add this location to the used location hash
            locations[stationData.abbr] = 1;
          }
        }
        $scope.myStations[i].errorCode = errorCode;
      }

      return isFormValid;
    };

    /**
     * Saves the user's preferred stations and takes them to see the commute
     * estimates.
     */
    $scope.setStations = function() {
      $scope.isSubmitted = true;

      if (!$scope.isFormValid()) {
        return;
      }

      bc.user.savePreferredStations($scope.myStations, function() {
        $scope.app.myStations = $scope.myStations;
        $scope.setView($scope.MY_COMMUTE_VIEW);
      });
    };

    /**
     * Aborts the preferred stations update.
     *
     * If the user has preferred stations saved, take them to the commute page.
     * If no preferred stations, take them to trip planner.
     */
    $scope.cancel = function () {
      var havePreferred = $scope.app.myStations && $scope.app.myStations[0]
        && $scope.app.myStations[0].stationData;

      if (havePreferred) {
        $scope.setView($scope.MY_COMMUTE_VIEW);
      } else {
        $scope.setView($scope.TRIP_PLANNER_VIEW);
      }
    };

    // Init the view
    (function() {
      if (!$scope.app.bartStations) {
        bc.bart.getStations(function(stations) {
          $scope.app.bartStations = stations;
          $scope.updateView();
        });
      }
    }());

  };
}(window.bc = window.bc || {}));


text:
package be.viaa.amqp.rabbitmq;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

import be.viaa.amqp.AmqpConsumer;
import be.viaa.amqp.AmqpService;
import java.util.HashMap;
import java.util.Map;

/**
 * RabbitMQ AMQP implementation
 *
 * @author Hannes Lowette
 *
 */
public class RabbitMQService implements AmqpService {

	/**
	 * The connection factory
	 */
	private final ConnectionFactory factory;

	/**
	 * The connection to the RabbitMQ service
	 */
	private final Connection connection;

	/**
	 * @param factory
	 */
	public RabbitMQService(ConnectionFactory factory) throws TimeoutException, IOException {
		this.factory = factory;
		this.connection = factory.newConnection();
	}

	/**
	 * @param host
	 * @param username
	 * @param password
	 * @throws IOException
	 */
	public RabbitMQService(String host, String username, String password) throws TimeoutException, IOException {
		this.factory = new ConnectionFactory();
		this.factory.setHost(host);

		if (username != null && !username.equals("")) {
			this.factory.setUsername(username);
			this.factory.setPassword(password);
		}

		this.connection = factory.newConnection();
	}

	/**
	 * @param host
	 * @throws IOException
	 */
	public RabbitMQService(String host) throws TimeoutException, IOException {
		this.factory = new ConnectionFactory();
		this.factory.setHost(host);
		this.connection = factory.newConnection();
	}

	@Override
	public void createIfNotExists(String name) throws Exception {
		Map<String, Object> args = new HashMap<String, Object>();
    		args.put("x-max-priority", 10);
		this.channel().queueDeclare(name, true, false, false, args);
	}

	@Override
	public void read(String queue, AmqpConsumer consumer) throws IOException, TimeoutException {
		Channel channel = null;

		channel = this.channel();
		channel.basicQos(1);
		channel.basicConsume(queue, false, new RabbitMQConsumer(channel, this, consumer));

	}

	@Override
	public void write(String queue, byte[] data, Channel channel) throws IOException {
		channel.basicPublish("", queue, null, data);
	}

	@Override
	public String toString() {
		return "Rabbit MQ (host: " + this.factory.getHost() + ":" + this.factory.getPort() + ")";
	}

	/**
	 * Gets a new channel from
	 * @return
	 * @throws IOException
	 * @throws TimeoutException
	 */
	private final Channel channel() throws IOException {
		return connection.createChannel();
	}

}


text:
try
{
	Start-AutoRestCodeGeneration -ResourceProvider "iothub/resource-manager" -AutoRestVersion "v2"
}
catch
{
	Write-Error "If you have problems running this script, see the instructions at https://github.com/Azure/adx-documentation-pr/blob/master/engineering/adx_netsdk_process.md#sdk-generation-from-updated-spec"
	Write-Error "If you get an error stating that Start-AutoRestCodeGeneration script is not available, you probably need to run:"
	Write-Host "`t > msbuild ../../../../eng/mgmt.proj /t:Util /p:UtilityName=InstallPsModules"
}


text:
// <copyright file="DBSO.cs" company="DATALINE GmbH & Co. KG">
// Copyright (c) DATALINE GmbH & Co. KG. All rights reserved.
// </copyright>

using System;

using NodaTime;

namespace SocialInsurance.Germany.Messages.Pocos
{
    /// <summary>
    /// Datenbaustein: DBSO - Sofortmeldung
    /// </summary>
    public class DBSO : IDatenbaustein
    {
        /// <summary>
        /// Initialisiert eine neue Instanz der <see cref="DBSO"/> Klasse
        /// </summary>
        public DBSO()
        {
            KE = "DBSO";
        }

        /// <summary>
        /// Holt oder setzt die Kennung
        /// </summary>
        /// <remarks>
        /// Kennung, um welchen Datenbaustein es sich handelt
        /// </remarks>
        public string KE { get; set; }

        /// <summary>
        /// Holt oder setzt das Kennzeichen Stornierung
        /// </summary>
        /// <remarks>
        /// Kennzeichen, Länge 1, Stornierung einer bereits abgegebenen
        /// Sofortmeldung, N = keine Stornierung J = Stornierung, Mussangabe
        /// </remarks>
        public string KENNZSTSO { get; set; }

        /// <summary>
        /// Holt oder setzt den Beginn des Zeitraums
        /// </summary>
        /// <remarks>
        /// Beginn des Zeitraums, Länge 8,  in der Form: jhjjmmtt, Mussangabe
        /// </remarks>
        public LocalDate ZRBGSO { get; set; }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.vsahin.moneycim">

    <uses-feature
        android:name="android.hardware.camera"
        android:required="true" />

    <uses-permission android:name="android.permission.CAMERA" />

    <application
        android:name=".MoneycimApp"
        android:allowBackup="true"
        android:fullBackupContent="true"
        android:icon="@mipmap/logo"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <meta-data
            android:name="com.google.android.gms.vision.DEPENDENCIES"
            android:value="ocr" />

        <activity android:name=".View.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts"/>
        </activity>
        <activity android:name=".View.OCR_Scan_Receipt.OcrCaptureActivity" />
    </application>

</manifest>


text:
class AddUserIdToReplies < ActiveRecord::Migration
  def change
    add_column :replies, :user_id, :integer
  end
end


text:
package com.support.android.designlibdemo.character.specop;

import com.support.android.designlibdemo.R;

/**
 * Created by fabio on 22/10/15.
 *
 * spero di fare una sola classe per tutti i personaggi
 */

public class SpecOp {

    public static int getRandomDrawable() {
        return R.drawable.mockingbird;
    }

    public static final String[] sSpecOpStrings = {
            "Mockingbird", "Emma Frost", "Magik", "Ghost Rider", "Valkyrie", "Havok", "Hank Pym",
            "Vision", "Rescue", "Wonder Man", "Daimon Hellstrom", "Ares", "Black Bolt", "Heimdall",
            "Nico Minoru", "Iceman", "Falcon", "Anti-Venom", "Cannonball", "Star-Lord", "Ka-Zar",
            "Blade", "Crystal", "Beta Ray Bill", "Chase Stein", "Ultimate Spider-Man", "Ant-Man",
            "Silk", "Spitfire", "Jessica Jones"
    };

    public static final String[] sSpecOpBruiser = {
            "Valkyrie", "Wonder Man", "Ares", "Heimdall", "Iceman", "Anti-Venom", "Beta Ray Bill",
            "Jessica Jones"
    };

    public static final String[] sSpecOpBlaster = {
            "Havok", "Vision", "Daimon Hellstrom", "Nico Minoru", "Cannonball", "Crystal"
    };

    public static final String[] sSpecOpScrapper = {
            "Magik", "Ghost Rider", "Ka-Zar", "Blade", "Chase Stein", "Spitfire",
    };

    public static final String[] sSpecOpInfiltrator = {
            "Falcon", "Star-Lord", "Ultimate Spider-Man", "Ant-Man",
    };

    public static final String[] sSpecOpGeneralist = {
            "Mockingbird", "Silk",
    };

    public static final String[] sSpecOpTactical = {
            "Emma Frost", "Hank Pym", "Rescue", "Black Bolt",
    };

}