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

#include "afx/arcaneFX.h"

#include "afx/afxEffectWrapper.h"
#include "afx/afxChoreographer.h"
#include "afx/xm/afxXM_WaveBase.h"

//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// WAVE COLOR INTERPOLATORS

class afxXM_WaveInterp_Color : public afxXM_WaveInterp
{
protected:
  LinearColorF   mA_set, mB_set;
  LinearColorF   mA_var, mB_var;
  LinearColorF   mA, mB;
  bool     mSync_var;

public:
  afxXM_WaveInterp_Color();

  void set(LinearColorF& a, LinearColorF& b, LinearColorF& a_var, LinearColorF& b_var, bool sync_var);

  virtual void interpolate(F32 t, afxXM_Params& params)=0;
  virtual void pulse();
};

afxXM_WaveInterp_Color::afxXM_WaveInterp_Color()
{
  mA_set.set(0.0f, 0.0f, 0.0f, 0.0f);
  mB_set.set(1.0f, 1.0f, 1.0f, 1.0f);
  mA_var.set(0.0f, 0.0f, 0.0f, 0.0f);
  mB_var.set(0.0f, 0.0f, 0.0f, 0.0f);
  mSync_var = false;
  mA.set(0.0f, 0.0f, 0.0f, 0.0f);
  mB.set(1.0f, 1.0f, 1.0f, 1.0f);
}

void afxXM_WaveInterp_Color::set(LinearColorF& a, LinearColorF& b, LinearColorF& a_var, LinearColorF& b_var, bool sync_var)
{
  mA_set = a;
  mB_set = b;
  mA_var = a_var;
  mB_var = b_var;
  mSync_var = sync_var;
  mA = a;
  mB = b;
}

inline void afxXM_WaveInterp_Color::pulse()
{
  LinearColorF temp_color;
  F32 rand_t = gRandGen.randF()*2.0f;
  temp_color.interpolate(-mA_var, mA_var, rand_t);
  mA = mA_set + temp_color;
  if (!mSync_var)
    rand_t = gRandGen.randF()*2.0f;
  temp_color.interpolate(-mB_var, mB_var, rand_t);
  mB = mB_set + temp_color;
}

//~~~~~~~~~~~~~~~~~~~~//

class afxXM_WaveInterp_Color_Add : public afxXM_WaveInterp_Color
{
public:
  virtual void interpolate(F32 t, afxXM_Params& params)
  {
    LinearColorF temp_color;
    temp_color.interpolate(mA, mB, t);
    params.color += temp_color;
  }
};

//~~~~~~~~~~~~~~~~~~~~//

class afxXM_WaveInterp_Color_Mul : public afxXM_WaveInterp_Color
{
public:
  virtual void interpolate(F32 t, afxXM_Params& params)
  {
    LinearColorF temp_color;
    temp_color.interpolate(mA, mB, t);
    params.color *= temp_color;
  }
};

//~~~~~~~~~~~~~~~~~~~~//

class afxXM_WaveInterp_Color_Rep : public afxXM_WaveInterp_Color
{
public:
  virtual void interpolate(F32 t, afxXM_Params& params)
  {
    params.color.interpolate(mA, mB, t);
  }
};

//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// WAVE SCALAR BASE DATABLOCK

class afxXM_WaveColorData_Common : public virtual afxXM_Defs
{
protected:
  static afxXM_WaveInterp_Color* createInterp(U32 op, afxXM_BaseData*);
};

//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

afxXM_WaveInterp_Color*
afxXM_WaveColorData_Common::createInterp(U32 op, afxXM_BaseData* db)
{
  afxXM_WaveInterp_Color* interpolator = 0;

  switch (op)
  {
  case afxXM_WaveBaseData::OP_ADD:
    interpolator = new afxXM_WaveInterp_Color_Add();
    return 0;
  case afxXM_WaveBaseData::OP_MULTIPLY:
    interpolator = new afxXM_WaveInterp_Color_Mul();
    break;
  case afxXM_WaveBaseData::OP_REPLACE:
    interpolator = new afxXM_WaveInterp_Color_Rep();
    break;
  }

  if (!interpolator)
    Con::errorf("%s::%s -- failed to allocate wave color interpolator.", db->getClassName(), db->getName());

  return interpolator;
}

//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// WAVE COLOR DATABLOCK

class afxXM_WaveColorData : public afxXM_WaveBaseData, afxXM_WaveColorData_Common
{
  typedef afxXM_WaveBaseData Parent;

public:
  LinearColorF        a, b;
  LinearColorF        a_var, b_var;
  bool          sync_var;

public:
  /*C*/         afxXM_WaveColorData();
  /*C*/         afxXM_WaveColorData(const afxXM_WaveColorData&, bool = false);

  void          packData(BitStream* stream);
  void          unpackData(BitStream* stream);

  virtual bool  allowSubstitutions() const { return true; }

  static void   initPersistFields();

  afxXM_Base*   create(afxEffectWrapper* fx, bool on_server);

  DECLARE_CONOBJECT(afxXM_WaveColorData);
  DECLARE_CATEGORY("AFX");
};

//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

IMPLEMENT_CO_DATABLOCK_V1(afxXM_WaveColorData);

ConsoleDocClass( afxXM_WaveColorData,
   "@brief An xmod datablock.\n\n"

   "@ingroup afxXMods\n"
   "@ingroup AFX\n"
   "@ingroup Datablocks\n"
);

afxXM_WaveColorData::afxXM_WaveColorData()
{
  a.set(0.0f, 0.0f, 0.0f, 0.0f);
  b.set(1.0f, 1.0f, 1.0f, 1.0f);
  a_var.set(0.0f, 0.0f, 0.0f, 0.0f);
  b_var.set(0.0f, 0.0f, 0.0f, 0.0f);
  sync_var = false;
}

afxXM_WaveColorData::afxXM_WaveColorData(const afxXM_WaveColorData& other, bool temp_clone) : afxXM_WaveBaseData(other, temp_clone)
{
  a = other.a;
  b = other.b;
  a_var = other.a_var;
  b_var = other.b_var;
  sync_var = other.sync_var;
}

void afxXM_WaveColorData::initPersistFields()
{
  addField("a",               TypeColorF,      Offset(a, afxXM_WaveColorData),
    "...");
  addField("b",               TypeColorF,      Offset(b, afxXM_WaveColorData),
    "...");
  addField("aVariance",       TypeColorF,      Offset(a_var, afxXM_WaveColorData),
    "...");
  addField("bVariance",       TypeColorF,      Offset(b_var, afxXM_WaveColorData),
    "...");
  addField("syncVariances",   TypeBool,        Offset(sync_var, afxXM_WaveColorData),
    "...");

  Parent::initPersistFields();
}

void afxXM_WaveColorData::packData(BitStream* stream)
{
  Parent::packData(stream);
  stream->write(a);
  stream->write(b);
  stream->write(a_var);
  stream->write(b_var);
  stream->writeFlag(sync_var);
}

void afxXM_WaveColorData::unpackData(BitStream* stream)
{
  Parent::unpackData(stream);
  stream->read(&a);
  stream->read(&b);
  stream->read(&a_var);
  stream->read(&b_var);
  sync_var = stream->readFlag();
}

afxXM_Base* afxXM_WaveColorData::create(afxEffectWrapper* fx, bool on_server)
{
  afxXM_WaveColorData* dblock = this;

  if (getSubstitutionCount() > 0)
  {
    dblock = new afxXM_WaveColorData(*this, true);
    this->performSubstitutions(dblock, fx->getChoreographer(), fx->getGroupIndex());
  }

  afxXM_WaveInterp_Color* interp;
  interp = createInterp(dblock->op, dblock);
  if (!interp)
    return 0;

  interp->set(dblock->a, dblock->b, dblock->a_var, dblock->b_var, dblock->sync_var);

  return new afxXM_WaveBase(dblock, fx, interp);
}

//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// WAVE RIDER COLOR DATABLOCK

class afxXM_WaveRiderColorData : public afxXM_WaveRiderBaseData, afxXM_WaveColorData_Common
{
  typedef afxXM_WaveRiderBaseData Parent;

public:
  LinearColorF        a, b;
  LinearColorF        a_var, b_var;
  bool          sync_var;

public:
  /*C*/         afxXM_WaveRiderColorData();
  /*C*/         afxXM_WaveRiderColorData(const afxXM_WaveRiderColorData&, bool = false);

  void          packData(BitStream* stream);
  void          unpackData(BitStream* stream);

  virtual bool  allowSubstitutions() const { return true; }

  static void   initPersistFields();

  afxXM_Base*   create(afxEffectWrapper* fx, bool on_server);

  DECLARE_CONOBJECT(afxXM_WaveRiderColorData);
  DECLARE_CATEGORY("AFX");
};

//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

IMPLEMENT_CO_DATABLOCK_V1(afxXM_WaveRiderColorData);

ConsoleDocClass( afxXM_WaveRiderColorData,
   "@brief An xmod datablock.\n\n"

   "@ingroup afxXMods\n"
   "@ingroup AFX\n"
   "@ingroup Datablocks\n"
);

afxXM_WaveRiderColorData::afxXM_WaveRiderColorData()
{
  a.set(0.0f, 0.0f, 0.0f, 0.0f);
  b.set(1.0f, 1.0f, 1.0f, 1.0f);
  a_var.set(0.0f, 0.0f, 0.0f, 0.0f);
  b_var.set(0.0f, 0.0f, 0.0f, 0.0f);
  sync_var = false;
}

afxXM_WaveRiderColorData::afxXM_WaveRiderColorData(const afxXM_WaveRiderColorData& other, bool temp_clone) : afxXM_WaveRiderBaseData(other, temp_clone)
{
  a = other.a;
  b = other.b;
  a_var = other.a_var;
  b_var = other.b_var;
  sync_var = other.sync_var;
}

void afxXM_WaveRiderColorData::initPersistFields()
{
  addField("a",               TypeColorF,      Offset(a, afxXM_WaveRiderColorData),
    "...");
  addField("b",               TypeColorF,      Offset(b, afxXM_WaveRiderColorData),
    "...");
  addField("aVariance",       TypeColorF,      Offset(a_var, afxXM_WaveRiderColorData),
    "...");
  addField("bVariance",       TypeColorF,      Offset(b_var, afxXM_WaveRiderColorData),
    "...");
  addField("syncVariances",   TypeBool,        Offset(sync_var, afxXM_WaveRiderColorData),
    "...");

  Parent::initPersistFields();
}

void afxXM_WaveRiderColorData::packData(BitStream* stream)
{
  Parent::packData(stream);
  stream->write(a);
  stream->write(b);
  stream->write(a_var);
  stream->write(b_var);
  stream->writeFlag(sync_var);
}

void afxXM_WaveRiderColorData::unpackData(BitStream* stream)
{
  Parent::unpackData(stream);
  stream->read(&a);
  stream->read(&b);
  stream->read(&a_var);
  stream->read(&b_var);
  sync_var = stream->readFlag();
}

afxXM_Base* afxXM_WaveRiderColorData::create(afxEffectWrapper* fx, bool on_server)
{
  afxXM_WaveRiderColorData* dblock = this;

  if (getSubstitutionCount() > 0)
  {
    dblock = new afxXM_WaveRiderColorData(*this, true);
    this->performSubstitutions(dblock, fx->getChoreographer(), fx->getGroupIndex());
  }

  afxXM_WaveInterp_Color* interp;
  interp = createInterp(dblock->op, dblock);
  if (!interp)
    return 0;

  interp->set(dblock->a, dblock->b, dblock->a_var, dblock->b_var, dblock->sync_var);

  return new afxXM_WaveRiderBase(dblock, fx, interp);
}

//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//


text:
categories: [Layouts]
css-extra: false
layout: cards
resource: true
title: Cards
full-page: true
url-js-extra: ['https://cdnjs.cloudflare.com/ajax/libs/jquery.matchHeight/0.7.2/jquery.matchHeight-min.js', 'https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.11/c3.min.js', 'https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js']
weight: 8
---
{% include widgets/layouts/navbar-primary.html %}
    <div class="container-fluid container-cards-pf">
{% include widgets/layouts/cards.html %}
    </div><!-- /container -->
    <script>
      $(function() {
        // matchHeight the contents of each .card-pf and then the .card-pf itself
        $(".row-cards-pf > [class*='col'] > .card-pf .card-pf-title").matchHeight();
        $(".row-cards-pf > [class*='col'] > .card-pf > .card-pf-body").matchHeight();
        $(".row-cards-pf > [class*='col'] > .card-pf > .card-pf-footer").matchHeight();
        $(".row-cards-pf > [class*='col'] > .card-pf").matchHeight();
        // initialize tooltips
        $('[data-toggle="tooltip"]').tooltip();
      });
    </script>

redpajama_set_name: RedPajamaGithub


text:
% extends 'base.html'
% block header

Gubernator Admin Config Page

% endblock
% block content
<form method="post">

These values come from the OAuth Apps Tab on GitHub.

New apps should be registered with "Homepage URL" set to https://{{hostname}} and "Authorization callback URL" set to https://{{hostname}}/github_auth.

GitHub OAuth Client Id: <input type="text" name="github_id">

GitHub OAuth Client Secret: <input type="text" name="github_secret">

Alternate OAuth Host (optional, for custom domains, like "g8r.k8s.io:443"): <input type="text" name="github_client_host">

This value must match whatever is entered on GitHub when registering hooks to receive.

GitHub Webhook Secret: <input type="text" name="github_webhook_secret">

This Token is used to periodically synchronize PR status stored in the database with GitHub.

This prevents dropped hooks and other bugs from causing stale PRs to linger in users' dashboards.

GitHub Token: <input type="text" name="github_token">

<input type="submit" value="Submit">
</form>
% if oauth_set

OAuth secrets set!

% endif
% if webhook_set

GitHub Webhook secret set!

% endif
% if token_set

GitHub Token set!

% endif
% endblock


text:
package com.amber.random.datapoliceuk.di.component;

import com.amber.random.datapoliceuk.di.module.NetworkModule;
import com.amber.random.datapoliceuk.di.module.PresenterModule;
import com.amber.random.datapoliceuk.di.module.RestApiModule;
import com.amber.random.datapoliceuk.ui.fragments.ForcesListFragment;

import javax.inject.Singleton;

import dagger.Component;

@Singleton
@Component(modules = {NetworkModule.class, RestApiModule.class, PresenterModule.class})
public interface AppComponent {
    void inject(ForcesListFragment forcesListFragment);
}


text:
<?php defined('SYSPATH') OR die('No direct script access.');

class View_Admin_User_Search extends View_Admin {
	public $header = 'Users';
	public $icon = 'fa fa-user';

	public $users = [];

	public function users()
	{
		$out = [];

		foreach($this->users as $user)
		{
			$out[] = [
				'id' => $user->id,
				'username' => $user->username,
				'email' => $user->email
			];
		}
	}
}


text:
package com.agilerenovation.conference.resource.integration;

import java.io.InputStream;

import org.junit.Test;

import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;

public class ResourceTest {
   private static final String CLASSPATH_RESOURCE = "classpath:ConferenceSubmissions.xml";
   private static final String FILE_SYSTEM_RESOURCE = "file:../integration-tests/src/test/resources/ConferenceSubmissions.xml";

   @Test public void create_whenClasspathSpecified_instantiatesClasspathResource(){
      assertThat( Resource.create( CLASSPATH_RESOURCE ), instanceOf( ClasspathResource.class ));
   }

   @Test public void create_whenFileSpecified_instantiatesFileResource(){
      assertThat( Resource.create( FILE_SYSTEM_RESOURCE ), instanceOf( FileSystemResource.class ));
   }

   @Test public void getInputStream_whenFileSpecified_handlesRelativePath(){
      Resource resource = Resource.create( FILE_SYSTEM_RESOURCE );

      assertThat( resource.getInputStream(), instanceOf( InputStream.class ));
   }
}


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated 22/11/2014 09:20:02 by Hibernate Tools 3.6.0 -->
<hibernate-mapping>
    <class name="farmaciaweb.Models.Fornecedores" table="Fornecedores" schema="dbo" catalog="farmaciaweb">
        <id name="codigo" type="int">
            <column name="codigo" />
            <generator class="identity" />
        </id>
        <property name="nome" type="string">
            <column name="nome" length="100" />
        </property>
        <property name="cidade" type="string">
            <column name="cidade" length="50" />
        </property>
        <property name="bairro" type="string">
            <column name="bairro" length="50" />
        </property>
        <property name="rua" type="string">
            <column name="rua" length="50" />
        </property>
        <property name="numero" type="java.lang.Integer">
            <column name="numero" />
        </property>
        <property name="telefone" type="string">
            <column name="telefone" length="10" />
        </property>
        <set name="produtoses" table="Produtos" inverse="true" lazy="true" fetch="select">
            <key>
                <column name="codigo_fornecedor" />
            </key>
            <one-to-many class="farmaciaweb.Models.Produtos" />
        </set>
    </class>
</hibernate-mapping>


text:
import buble from 'rollup-plugin-buble';
import butternut from 'rollup-plugin-butternut';

export default {
  plugins: [
    buble(),
    butternut()
  ]
};


text:
var request     = require('request')
  , async       = require('async')
  , querystring = require('querystring')
  , stream      = require('stream')
  , path        = require('path')
  ;

/******************************************************************************
 *
 *
 * @param request_args
 *        The arguments to feed to request
 *
 * @param query_args (optional)
 *        An object containing the arguments to be passes in the request uri.
 *
 * @param body_args (optional)
 *        An object containing the arguments to be passed in the request body.
 *
 * @param callback
 *        A function of the form function(error, response, body_object)
 *        It is called with the same arguments as if it was passed directly to
 *        request but the body is parsed and checked for errors as well.
 *
 * @returns the request object (as returned by mikeal's request function)
 */
function do_request() {

  var args          = Array.prototype.slice(arguments)

    , request_args  = args.shift()

    , pathname      = args.shift()

    , callback      = args.pop()

    , query_args    = (   request_args.method.toUpperCase() === 'GET'
                      ||  args.length == 2
                      ?   args.shift() : undefined
                      )

    , body_args     = (   request_args.method.toUpperCase() !== 'GET'
                      ||  args.length == 2
                      ?   args.shift() : undefined
                      )

    , headers       = { 'Authorization': this.auth }

    , query_string  = (query_args ? querystring.stringify(query_args) : undefined)
    , body_string   = (body_args ? querystring.stringify(body_args) : undefined)
    , r
    ;

    if(request_args.headers) {
      request_args.headers = oo.extend(request_args.headers, headers);
    } else {
      request_args.headers = headers;
    }

    request_args.uri = [ this.host
                  , this.port
                  , this.pathname
                  ].join('');

    if(query_string) {
      request-args.uri +=  [ '?'
                      , path.join('/', query_string)
                      ].join('');
    }

    if(body_string) {
      request_args.body = new Buffer(query_string);
    }

    r = request(request_args, function(err, response, body) {
      var body_object
        ;

      if(err) { callback(err); return r; }

      body_object = JSON.parse(body);

      if(body_object.error) {
        callback(body_object);
        return r;
      }

      callback(null, response, body_object);
    });

    return r;
}

/******************************************************************************
 * CouchDBConnection's Constructor function
 *
 * Possible parameters:
 *  **host**
 *    The host name or IP address of the database server.
 *
 *    Default: localhost
 *
 *  **port**
 *    The port on which the target database server is running.
 *
 *    Default: 5984
 *
 *  **options**
 *    The options object.
 *
 *    Possible options:
 *      **cache**
 *        Enables caching.
 *      **auth**
 *        An auth object consisting of `username`and `password`
 *
 * @param params {object}
 *        The parameter object
 *
 * @param callback {function}
 *        A function of the form function(err, connection)Êthat
 *        is called on error or if the CouchDBConnector successfully connected
 *        to the database.
 *
 */
function CouchDBConnection(params, callback) {
  var host    = params.host
    , port    = params.port
    , options = params.options
    , req
    ;

  this.host = host || 'localhost';
  this.port = port || 5984;
  this.options = options || {};

  if(this.options.auth) {
    this.Authorization  = 'Basic '
                        + new Buffer
                        ( [ this.options.auth.username
                          , this.options.auth.password
                          ].join(':')
                        ).toString('base64')
  }

}
exports.Connection = CouchDBConnection;


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.github.bckfnn.reactstreams.test;

import io.github.bckfnn.reactstreams.BaseProcessor;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.junit.Assert;

/**
 * A helper subscriber that tracks the output and events from a publisher.
 * @param <T> type of value to keep.
 */
public class Keep<T> extends BaseProcessor<T, T> {
    enum State {
        NEXT, COMPLETED, ERROR,
    }

    State state = State.NEXT;

    List<T> list;
    Throwable error;

    /**
     * Contructor.
     */
    public Keep() {
        list = new ArrayList<T>();
    }

    @Override
    public void doNext(T value) {
        if (state != State.NEXT) {
            new IllegalStateException("onNext in state " + state);
        }
        list.add(value);
        sendRequest();
    }

    @Override
    public void onComplete() {
        if (state != State.NEXT) {
            new IllegalStateException("onCompleted in state " + state);
        }
        state = State.COMPLETED;
    }

    @Override
    public void onError(Throwable error) {
        if (state != State.NEXT) {
            new IllegalStateException("onCompleted in state " + state);
        }
        this.state = State.ERROR;
        this.error = error;
    }

    /**
     * Assert that the publisher called onComplete();
     * @return self.
     */
    public Keep<T> assertSuccess() {
        Assert.assertTrue(state == State.COMPLETED);
        return this;
    }

    /**
     * Assert that the publisher emitted the values and then emitted the exc exception.
     * @param exc the expected exception.
     * @param values the expected values.
     * @return self.
     */
    @SuppressWarnings("unchecked")
    public Keep<T> assertException(Exception exc, T... values) {
        Assert.assertTrue(state == State.ERROR);
        Assert.assertEquals(true, error != null);
        Assert.assertEquals(exc.getMessage(), error.getMessage());
        Assert.assertEquals(exc.getClass(), error.getClass());
        Assert.assertEquals(values.length, list.size());
        Assert.assertEquals(Arrays.asList(values), list);
        return this;
    }

    /**
     * Assert that the publisher emitted the values and then emitted onComplete.
     * @param values the expected values.
     * @return self.
     */
	@SuppressWarnings("unchecked")
    public Keep<T> assertEquals(T... values) {
        assertSuccess();
        Assert.assertEquals(values.length, list.size());
        Assert.assertEquals(Arrays.asList(values), list);
        return this;
    }

    public String toString() {
        return "Keep[" + state + " " + list + " " + error + "]";
    }
}


text:
var book = {name: 'Practical Node.js',
  publisher: 'Apress',
  keywords: 'node.js express.js mongodb websocket oauth',
  discount: 'PNJS15'
}
var express = require('express'),
  path = require('path');

var app = express();

console.log(app.get('env'));

app.set('view cache', true);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.set('port', process.env.PORT || 3000);

app.set('trust proxy', true);
app.set('jsonp callback name', 'cb');
app.set('json replacer', function(key, value){
  if (key === 'discount')
    return undefined;
  else
    return value;
});
app.set('json spaces', 4);

app.set('case sensitive routing', true);
app.set('strict routing', true);
// app.set('x-powered-by', false);
app.set('subdomain offset', 3);
// app.disable('etag')
// app.set('query parser', false);

app.get('/jsonp', function(request, response){
  response.jsonp(book);
})
app.get('/json', function(request, response){
  response.send(book);
})
app.get('/users', function(request, response){
  response.send('users');
})
app.get('/users/', function(request, response){
  response.send('users/');
})
app.get('*', function(request, response){
  response.send('Pro Express.js Configurations');
})

if (app.get('env') === 'development') {
    app.use(function(err, req, res, next) {
        res.status(err.status || 500);
        res.render('error', {
            message: err.message,
            error: err
        });
    });
}
var server = app.listen(app.get('port'), function() {
  console.log('Express server listening on port ' + server.address().port);
});


text:
Ruby Wrapper Library for [Teleportd](http://teleportd.com)
[API](http://teleportd.com/api)

Currently, this wrapper only supports the basic search functionality.

## Installation

Add this line to your application's Gemfile:

    gem 'teleportd'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install teleportd

## Usage

NOTE: You must set an ENV variable 'TELEPORTD_API_KEY' for your Teleportd API key

    $ export TELEPORTD_API_KEY=$APIKEY

Create an instance of a Teleportd::Search with optional filters.  The
Search returns an enumerable collection of Teleportd::SearchResult
objects

Query With Locations:

    $ options = {}
    $ options[:location] = {}
    $ options[:location][:latitude] = 34.19
    $ options[:location][:longitude] = -119.49
    $ options[:location][:vertical] = 5.0
    $ options[:location][:horizontal] = 5.0
    $ search = Teleportd::Search.new(options)

Query With Textual Search:

    $ options = {}
    $ options[:textual_search] = 'foo bar baz'
    $ search = Teleportd::Search.new(options)

Query With Time Period (start/end)

    $ options = {}
    $ options[:time_period] = {}
    $ options[:time_period][:start_time] = 5.days.ago
    $ options[:time_period][:end_time] = 2.days.ago
    $ search = Teleportd::Search.new(options)

Query With Sort (relevance/recency)

    $ options = {}
    $ options[:sort] = 'relevance'
    $ search = Teleportd::Search.new(options)

Options can be combined, of course:

    $ options = {}
    $ options[:location] = {}
    $ options[:location][:latitude] = 34.19
    $ options[:location][:longitude] = -119.49
    $ options[:location][:vertical] = 5.0
    $ options[:location][:horizontal] = 5.0
    $ options[:time_period] = {}
    $ options[:time_period][:start_time] = 5.days.ago
    $ options[:time_period][:end_time] = 2.days.ago
    $ options[:textual_search] = 'foo bar baz'
    $ search = Teleportd::Search.new(options)

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
package org.apache.hadoop.hive.ql.udf.generic;

import java.util.ArrayList;

import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException;
import org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException;
import org.apache.hadoop.hive.ql.exec.Description;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;

@Description(name = "named_struct",
    value = "_FUNC_(name1, val1, name2, val2, ...) - Creates a struct with the given " +
            "field names and values")
public class GenericUDFNamedStruct extends GenericUDF {
  private transient Object[] ret;

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments)
      throws UDFArgumentException {

    int numFields = arguments.length;
    if (numFields % 2 == 1) {
      throw new UDFArgumentLengthException(
          "NAMED_STRUCT expects an even number of arguments.");
    }
    ret = new Object[numFields / 2];

    ArrayList<String> fname = new ArrayList<String>(numFields / 2);
    ArrayList<ObjectInspector> retOIs = new ArrayList<ObjectInspector>(numFields / 2);
    for (int f = 0; f < numFields; f+=2) {
      if (!(arguments[f] instanceof ConstantObjectInspector)) {
        throw new UDFArgumentTypeException(f, "Even arguments" +
            " to NAMED_STRUCT must be a constant STRING." + arguments[f].toString());
      }
      ConstantObjectInspector constantOI =
        (ConstantObjectInspector)arguments[f];
      fname.add(constantOI.getWritableConstantValue().toString());
      retOIs.add(arguments[f + 1]);
    }
    StructObjectInspector soi =
      ObjectInspectorFactory.getStandardStructObjectInspector(fname, retOIs);
    return soi;
  }

  @Override
  public Object evaluate(DeferredObject[] arguments) throws HiveException {
    for (int i = 0; i < arguments.length / 2; i++) {
      ret[i] = arguments[2 * i + 1].get();
    }
    return ret;
  }

  @Override
  public String getDisplayString(String[] children) {
    return getStandardDisplayString("named_struct", children, ",");
  }
}


text:
package org.springframework.boot.autoconfigure.web.reactive.function.client;

import java.util.function.Function;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.reactive.ClientHttpConnector;
import org.springframework.http.client.reactive.JettyClientHttpConnector;
import org.springframework.http.client.reactive.JettyResourceFactory;
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
import org.springframework.http.client.reactive.ReactorResourceFactory;

/**
 * Configuration classes for WebClient client connectors.
 * <p>
 * Those should be {@code @Import} in a regular auto-configuration class to guarantee
 * their order of execution.
 *
 * @author Brian Clozel
 */
@Configuration
class ClientHttpConnectorConfiguration {

	@Configuration
	@ConditionalOnClass(reactor.netty.http.client.HttpClient.class)
	@ConditionalOnMissingBean(ClientHttpConnector.class)
	public static class ReactorNetty {

		@Bean
		@ConditionalOnMissingBean
		public ReactorResourceFactory reactorResourceFactory() {
			return new ReactorResourceFactory();
		}

		@Bean
		public ReactorClientHttpConnector reactorClientHttpConnector(
				ReactorResourceFactory reactorResourceFactory) {
			return new ReactorClientHttpConnector(reactorResourceFactory,
					Function.identity());
		}

	}

	@Configuration
	@ConditionalOnClass(org.eclipse.jetty.reactive.client.ReactiveRequest.class)
	@ConditionalOnMissingBean(ClientHttpConnector.class)
	public static class JettyClient {

		@Bean
		@ConditionalOnMissingBean
		public JettyResourceFactory jettyResourceFactory() {
			return new JettyResourceFactory();
		}

		@Bean
		public JettyClientHttpConnector jettyClientHttpConnector(
				JettyResourceFactory jettyResourceFactory) {
			return new JettyClientHttpConnector(jettyResourceFactory, (httpClient) -> {
			});
		}

	}

}


text:
package org.apache.commons.math4.distribution;

import org.apache.commons.math4.exception.NotStrictlyPositiveException;
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.rng.UniformRandomProvider;

/**
 * Base class for multivariate probability distributions.
 *
 * @since 3.1
 */
public abstract class AbstractMultivariateRealDistribution
    implements MultivariateRealDistribution {
    /** The number of dimensions or columns in the multivariate distribution. */
    private final int dimension;

    /**
     * @param n Number of dimensions.
     */
    protected AbstractMultivariateRealDistribution(int n) {
        dimension = n;
    }

    /** {@inheritDoc} */
    @Override
    public int getDimension() {
        return dimension;
    }

    /** {@inheritDoc} */
    @Override
    public abstract Sampler createSampler(UniformRandomProvider rng);

    /**
     * Utility function for creating {@code n} vectors generated by the
     * given {@code sampler}.
     *
     * @param n Number of samples.
     * @param sampler Sampler.
     * @return an array of size {@code n} whose elements are random vectors
     * sampled from this distribution.
     */
    public static double[][] sample(int n,
                                    MultivariateRealDistribution.Sampler sampler) {
        if (n <= 0) {
            throw new NotStrictlyPositiveException(LocalizedFormats.NUMBER_OF_SAMPLES,
                                                   n);
        }

        final double[][] samples = new double[n][];
        for (int i = 0; i < n; i++) {
            samples[i] = sampler.sample();
        }
        return samples;
    }
}


text: <?php get_template_part('templates/content-single', 'medicina-prepagada'); ?>


text:
Bayesian website classifier for the ZPR course at the EiTI faculty of Warsaw University of Technology.

If needed single files can be compiled with something similar to:
```
g++ tidy.cpp -o tidy -ltidy `pkg-config --cflags --libs libxml++-2.6 libcurl` -std=c++11
```

CMakeLists info:

Since neither libtidy nor libxml++ have official CMake Modules added and found FindTidy.cmake isn't working it is recommended to add new libs with global path.
Compilation may require exporting:
    export CONFIGURE_ENV=LDFLAGS="${LDFLAGS}"
    export LDFLAGS=-L/usr/local/lib

On Unix:
    to find the path use:   `dpkg -L yourlibname`
    preferrably .so should be use, f.e. : `target_link_libraries(targetname /usr/lib/yourlibname.so)`

File installation:

Currently all files are to be installed via ${CATKIN_PACKAGE_LIB_DESTINATION} which places everything neatly in catkin_ws/install/lib/bayesian_webclass/.
Current installation folders and rules:
    files from bayesian_webclass/txt/ matching pattern "*.txt"
    files from bayesian_webclass/xml/ matching pattern "*.xml"

Executables:

`src/test.cpp` - opens csv/dns.csv file, saves its content to map: id -> domain_name  and checks wheather all these links can be opened. Valid links saves to file `valid_domains.csv` (no checks only 30, comment for loop and uncomment another version to download all)

Libraries:

`http_downloader.cpp` => Currently in progress, could not work properly

`csv.cpp`  one method to tokenize csv file, take wanted columns and save to map.


text:
var sceneModels = [];
var receivedFirstScene = false;
var currentScene = {};

function renderInBody() {
	document.body.innerHTML = "";
	renderer.setPixelRatio(window.devicePixelRatio);
	createBaseScene(window.innerWidth,window.innerHeight);
	document.body.appendChild(renderer.domElement);
}

function renderInPanel(width,height) {
	var panel = document.getElementById("3dscene");
	renderer.setPixelRatio(window.devicePixelRatio);
	createBaseScene(width,height);
	panel.appendChild(renderer.domElement);
}

function receiveSceneData(data) {
	console.log("receive scene data");
	console.log(data);
	if(receivedFirstScene == false) {
		receivedFirstScene = true;
		buildInitialScene(data);
	} else {
		updateScene(data);
	}
}

function updateScene(data) {
	placeModels(data.models);
	if(currentScene.skybox != data.skybox || currentScene.skyboxSize != data.skyboxSize || currentScene.skyboxPos != data.skyboxPos) {
		setSkyboxStage(scene,data.skybox,data.skyboxSize,data.skyboxPos);
	}
	currentScene = data;
}

function buildInitialScene(data) {
	currentScene = data;
	setSkyboxStage(scene,data.skybox,data.skyboxSize,data.skyboxPos);
	var models = data.models;
	placeModels(models);
	startInteraction();
	//testReticulum();
}

function findModelInScene(path) {
	console.log("scene models");
	console.log(sceneModels);
	for(var i=0;i<sceneModels.length;i++) {
		var model = sceneModels[i];
		if(model.id === path) {
			return model.scene;
		}
	}
	return null;
}

function placeModels(models) {
	models.forEach(function(model) {
		var modelInScene = findModelInScene(model.path);
		if(modelInScene != null) {
			console.log("model already in scene");
			//update parameters, already in scene
			modelInScene.position.x = model.posx;
			modelInScene.position.y = model.posy;
			modelInScene.position.z = model.posz;
			modelInScene.rotation.x = model.rotx;
			modelInScene.rotation.y = model.roty;
			modelInScene.rotation.z = model.rotz;
			stopSpin(modelInScene);
			if(model.spin == 'true') {
				if(model.spinaxis.toUpperCase() == 'X') {
					startSpin(modelInScene,1,0,0);
				} else if(model.spinaxis.toUpperCase() == 'Y') {
					startSpin(modelInScene,0,1,0);
				} else if(model.spinaxis.toUpperCase() == 'Z') {
					startSpin(modelInScene,0,0,1);
				}
			}
			scaleModel(modelInScene,model.scale);
		} else {
			loadDAE(getModelPathFromServer(model.path),function(result) {
				if(model.posx == 0 && model.posy == 0 && model.posz == 0) {
					placeModelInFrontOfCamera(result.scene);
				} else {
					result.scene.position.x = model.posx;
					result.scene.position.y = model.posy;
					result.scene.position.z = model.posz;
				}
				result.scene.rotation.x = model.rotx;
				result.scene.rotation.y = model.roty;
				result.scene.rotation.z = model.rotz;
				console.log("scene uuid: " + result.scene.uuid);
				stopSpin(result.scene);
				if(model.spin == 'true') {
					if(model.spinaxis.toUpperCase() == 'X') {
						startSpin(result.scene,1,0,0);
					} else if(model.spinaxis.toUpperCase() == 'Y') {
						startSpin(result.scene,0,1,0);
					} else if(model.spinaxis.toUpperCase() == 'Z') {
						startSpin(result.scene,0,0,1);
					}
				}
				scaleModel(result.scene,model.scale);
				console.log("Result scene:");
				console.log(result.scene);
				sceneModels.push({scene: result.scene, id: model.path, originalScale: result.scene.scal});
				scene.add(result.scene);
			});
		}
	});
}


text:
import numpy as np

from . import ctoast as ctoast
from . import timing as timing

def ang2vec(theta, phi):
    autotimer = timing.auto_timer()
    n = len(theta)
    if len(phi) != n:
        raise RuntimeError("theta / phi vectors must have the same length")
    vec = ctoast.healpix_ang2vec(n, theta.flatten().astype(np.float64, copy=False), phi.flatten().astype(np.float64, copy=False))
    if n == 1:
        return vec
    else:
        return vec.reshape((-1,3))

def vec2ang(vec):
    autotimer = timing.auto_timer()
    n = None
    if vec.ndim == 1:
        n = 1
    else:
        n = vec.shape[0]
    (theta, phi) = ctoast.healpix_vec2ang(n, vec.flatten().astype(np.float64, copy=False))
    if n == 1:
        return (theta[0], phi[0])
    else:
        return (theta, phi)

def vecs2angpa(vec):
    autotimer = timing.auto_timer()
    n = None
    if vec.ndim == 1:
        n = 1
    else:
        n = vec.shape[0]
    (theta, phi, pa) = ctoast.healpix_vecs2angpa(n, vec.flatten().astype(np.float64, copy=False))
    if n == 1:
        return (theta[0], phi[0], pa[0])
    else:
        return (theta, phi, pa)

class Pixels(object):
    """
    Class for HEALPix pixel operations at a fixed NSIDE.

    This class wraps the underlying toast::healpix::pixels class.

    Args:
        nside (int): the map NSIDE.
    """
    def __init__(self, nside=0):
        self.nside = nside
        self.hpix = None
        if self.nside > 0:
            self.hpix = ctoast.healpix_pixels_alloc(self.nside)

    def __del__(self):
        if self.hpix is not None:
            ctoast.healpix_pixels_free(self.hpix)

    def reset(self, nside):
        """
        Reset the class instance to use a new NSIDE value.

        Args:
            nside (int): the map NSIDE.
        """
        self.nside = nside

        if self.nside == 0:
            # free the hpix structure
            if self.hpix is not None:
                ctoast.healpix_pixels_free(self.hpix)
            self.hpix = None
        else:
            if self.hpix is None:
                self.hpix = ctoast.healpix_pixels_alloc(self.nside)
            else:
                ctoast.healpix_pixels_reset(self.hpix, nside)
        return

    def vec2zphi(self, vec):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = None
        if vec.ndim == 1:
            n = 1
        else:
            n = vec.shape[0]
        ctoast.healpix_pixels_vec2zphi(self.hpix, n,
            vec.flatten().astype(np.float64, copy=False))
        return (phi, region, z, rtz)

    def theta2z(self, theta):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = len(theta)
        (region, z, rtz) = ctoast.healpix_pixels_theta2z(self.hpix, n,
                            theta.flatten().astype(np.float64, copy=False))
        return (region, z, rtz)

    def zphi2nest(self, phi, region, z, rtz):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = len(phi)
        if len(region) != n:
            raise RuntimeError("All inputs must be the same length")
        if len(z) != n:
            raise RuntimeError("All inputs must be the same length")
        if len(rtz) != n:
            raise RuntimeError("All inputs must be the same length")
        pix = ctoast.healpix_pixels_zphi2nest(self.hpix, n,
                    phi.flatten().astype(np.float64, copy=False),
                    region.flatten().astype(np.int32, copy=False),
                    z.flatten().astype(np.float64, copy=False),
                    rtz.flatten().astype(np.float64, copy=False))
        return pix

    def zphi2ring(self, phi, region, z, rtz):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = len(phi)
        if len(region) != n:
            raise RuntimeError("All inputs must be the same length")
        if len(z) != n:
            raise RuntimeError("All inputs must be the same length")
        if len(rtz) != n:
            raise RuntimeError("All inputs must be the same length")
        pix = ctoast.healpix_pixels_zphi2nest(self.hpix, n,
                    phi.flatten().astype(np.float64, copy=False),
                    region.flatten().astype(np.int32, copy=False),
                    z.flatten().astype(np.float64, copy=False),
                    rtz.flatten().astype(np.float64, copy=False))
        return pix

    def ang2nest(self, theta, phi):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = len(theta)
        if len(phi) != n:
            raise RuntimeError("All inputs must be the same length")
        pix = ctoast.healpix_pixels_ang2nest(self.hpix, n,
                    theta.flatten().astype(np.float64, copy=False),
                    phi.flatten().astype(np.float64, copy=False))
        return pix

    def ang2ring(self, theta, phi):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = len(theta)
        if len(phi) != n:
            raise RuntimeError("All inputs must be the same length")
        pix = ctoast.healpix_pixels_ang2ring(self.hpix, n,
                    theta.flatten().astype(np.float64, copy=False),
                    phi.flatten().astype(np.float64, copy=False))
        return pix

    def vec2nest(self, vec):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = None
        if vec.ndim == 1:
            n = 1
        else:
            n = vec.shape[0]
        pix = ctoast.healpix_pixels_vec2nest(self.hpix, n,
                    vec.flatten().astype(np.float64, copy=False))
        return pix

    def vec2ring(self, vec):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = None
        if vec.ndim == 1:
            n = 1
        else:
            n = vec.shape[0]
        pix = ctoast.healpix_pixels_vec2ring(self.hpix, n,
                    vec.flatten().astype(np.float64, copy=False))
        return pix

    def ring2nest(self, ringpix):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = len(ringpix)
        nestpix = ctoast.healpix_pixels_ring2nest(self.hpix, n,
                        ringpix.flatten().astype(np.int64, copy=False))
        return nestpix

    def nest2ring(self, nestpix):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = len(nestpix)
        ringpix = ctoast.healpix_pixels_nest2ring(self.hpix, n,
                        nestpix.flatten().astype(np.int64, copy=False))
        return ringpix

    def degrade_ring(self, factor, inpix):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = len(inpix)
        outpix = ctoast.healpix_pixels_degrade_ring(self.hpix, factor, n,
                        inpix.flatten().astype(np.int64, copy=False))
        return outpix

    def degrade_nest(self, factor, inpix):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = len(inpix)
        outpix = ctoast.healpix_pixels_degrade_nest(self.hpix, factor, n,
                        inpix.flatten().astype(np.int64, copy=False))
        return outpix

    def upgrade_ring(self, factor, inpix):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = len(inpix)
        outpix = ctoast.healpix_pixels_upgrade_ring(self.hpix, factor, n,
                        inpix.flatten().astype(np.int64, copy=False))
        return outpix

    def upgrade_nest(self, factor, inpix):
        if self.hpix is None:
            raise RuntimeError("healpix Pixels class must be initialized with an NSIDE value")
        autotimer = timing.auto_timer(type(self).__name__)
        n = len(inpix)
        outpix = ctoast.healpix_pixels_upgrade_nest(self.hpix, factor, n,
                        inpix.flatten().astype(np.int64, copy=False))
        return outpix


text:
PKG_NAME = libzen
PKG_VERS = 0.4.29
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)_$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = http://downloads.sourceforge.net/project/zenlib/ZenLib%20-%20Sources/$(PKG_VERS)
PKG_DIR = ZenLib/Project/GNU/Library

DEPENDS =

HOMEPAGE = http://sourceforge.net/projects/zenlib/
COMMENT  = Small C++ derivate class to have a simpler life.
LICENSE  =

PRE_CONFIGURE_TARGET = myPreConfigure
GNU_CONFIGURE = 1

CONFIGURE_ARGS = --enable-shared

include ../../mk/spksrc.cross-cc.mk

myPreConfigure:
	$(RUN) ; ./autogen


text:
using Assets.Classes;
using System.Collections;
using System.Xml;
using System.Xml.Serialization;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class NetworkManagerHUD : MonoBehaviour
{
    public Canvas joinGameHUD;
    Canvas i_joinGameHUD;

    NetworkManager networkManager;

    // Use this for initialization
    void Start ()
    {
        networkManager = GetComponent<NetworkManager>();

        int currLevel = SceneManager.GetActiveScene().buildIndex;
        if (currLevel == 0)
        {
            XmlSerializer ser = new XmlSerializer(typeof(DreamloXML));
            DreamloXML dreamlo;
            using (XmlReader reader = XmlReader.Create("http://dreamlo.com/lb/5981cc49b0b05c1ad46cb6fb/xml"))
            {
                dreamlo = (DreamloXML)ser.Deserialize(reader);
            }
            InputField inputField = joinGameHUD.GetComponentInChildren<InputField>();
            if (dreamlo.leaderboard.entry == null)
                inputField.text = "localhost";
            else
                inputField.text = dreamlo.leaderboard.entry.text;
            i_joinGameHUD = Instantiate(joinGameHUD);

            GameObject.Find("Join Game Button").GetComponent<Button>().onClick.RemoveAllListeners();
            GameObject.Find("Join Game Button").GetComponent<Button>().onClick.AddListener(JoinGame);
            GameObject.Find("Host Game Button").GetComponent<Button>().onClick.RemoveAllListeners();
            GameObject.Find("Host Game Button").GetComponent<Button>().onClick.AddListener(StartupHost);
        }
        else
        {

        }
    }

    void StartupHost()
    {
        WWW www = new WWW("http://dreamlo.com/lb/hVcx7OXEN0GpUy2MKE8gnA3dG0FT2Lw06U69yjm-BnEg/delete/PublicIP");
        while (!www.isDone);
        www = new WWW("http://dreamlo.com/lb/hVcx7OXEN0GpUy2MKE8gnA3dG0FT2Lw06U69yjm-BnEg/add/PublicIP/0/0/" + GameManager.GetExternal_IP());
        while (!www.isDone);
        networkManager.StartHost();
        Destroy(i_joinGameHUD.gameObject);
    }

    void JoinGame()
    {
        networkManager.networkAddress = joinGameHUD.GetComponentInChildren<InputField>().text;
        networkManager.StartClient();
        Destroy(i_joinGameHUD.gameObject);
    }
}


text:
package com.rvcode.ydiagram;

import com.intellij.diagram.DiagramVfsResolver;
import com.intellij.ide.highlighter.XmlFileType;
import com.intellij.openapi.fileTypes.FileTypeFactory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiManager;
import com.intellij.psi.xml.XmlDocument;
import com.intellij.psi.xml.XmlFile;
import org.jetbrains.annotations.Nullable;

import java.io.File;

public class YDiagramResolver implements DiagramVfsResolver<XmlDocument>{

    @Override
    public String getQualifiedName(XmlDocument xmlDocument) {
        return xmlDocument.getContainingFile().getName();
    }

    @Nullable
    @Override
    public XmlDocument resolveElementByFQN(String path, Project project) {
        final VirtualFile file =  LocalFileSystem.getInstance().findFileByIoFile(new File(path));

        if (file.getFileType().equals(XmlFileType.INSTANCE)){
            final XmlFile xml = (XmlFile) PsiManager.getInstance(project).findFile(file);
            return xml.getDocument();
        } else {
            return null;
        }
    }
}


text:
export as namespace ZipCodes;

export interface ZipCode {
    zip: string;
    latitude: number;
    longitude: number;
    city: string;
    state: string;
    country: string;
}

export function lookup(zip: string | number): ZipCode | undefined;

export function lookupByName(city: string, state: string): ZipCode[];

export function lookupByState(state: string): ZipCode[];

export function distance(zipA: string | number, zipB: string | number): number | null;

export function radius(zip: string | number, miles: number, full: boolean): string[] | ZipCode[];

export function toMiles(kilos: number): number;

export function toKilometers(miles: number): number;

export function lookupByCoords(lat: number, lon: number): string | null;

export function random(): ZipCode;


text:
package gcewing.sg;

import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL12.*;
import net.minecraft.client.renderer.*;
import net.minecraft.util.*;

import gcewing.sg.BaseModClient.*;

public class BaseGLRenderTarget extends BaseRenderTarget {

    public static boolean debugGL = false;

    protected boolean usingLightmap;
    protected int glMode;
    protected int emissiveMode;
    protected int texturedMode;

    public BaseGLRenderTarget() {
        super(0, 0, 0, null);
    }

    public void start(boolean usingLightmap) {
        this.usingLightmap = usingLightmap;
        if (debugGL) System.out.printf("BaseGLRenderTarget: glPushAttrib()\n");
        glPushAttrib(GL_LIGHTING_BIT | GL_TEXTURE_BIT | GL_TRANSFORM_BIT);
        if (debugGL) System.out.printf("BaseGLRenderTarget: glEnable(GL_RESCALE_NORMAL)\n");
        glEnable(GL_RESCALE_NORMAL);
        glShadeModel(GL_SMOOTH);
        glMode = 0;
        emissiveMode = -1;
        texturedMode = -1;
        texture = null;
    }

    @Override
    public void setTexture(ITexture tex) {
        if (texture != tex) {
            super.setTexture(tex);
            ResourceLocation loc = tex.location();
            if (loc != null) {
                setGLMode(0);
                if (debugGL) System.out.printf("BaseGLRenderTarget: bindTexture(%s)\n", loc);
                BaseModClient.bindTexture(loc);
            }
            setTexturedMode(!tex.isSolid());
            setEmissiveMode(tex.isEmissive());
        }
    }

    protected void setEmissiveMode(boolean state) {
        int mode = state ? 1 : 0;
        if (emissiveMode != mode) {
            if (debugGL) System.out.printf("BaseGLRenderTarget: glSetEnabled(GL_LIGHTING, %s)\n", !state);
            glSetEnabled(GL_LIGHTING, !state);
            if (usingLightmap)
                setLightmapEnabled(!state);
            emissiveMode = mode;
        }
    }

    protected void setTexturedMode(boolean state) {
        int mode = state ? 1 : 0;
        if (texturedMode != mode) {
            //System.out.printf("BaseGLRenderTarget.setTexturedMode: %s\n", state);
            setGLMode(0);
            if (debugGL) System.out.printf("BaseGLRenderTarget: glSetEnabled(GL_TEXTURE_2D, %s)\n", state);
            glSetEnabled(GL_TEXTURE_2D, state);
            texturedMode = mode;
        }
    }

    protected void setLightmapEnabled(boolean state) {
        OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
        glSetEnabled(GL_TEXTURE_2D, state);
        OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
    }

    protected void glSetEnabled(int mode, boolean state) {
        if (state)
            glEnable(mode);
        else
            glDisable(mode);
    }

    @Override
    protected void rawAddVertex(Vector3 p, double u, double v) {
        if (debugGL)
            System.out.printf(
                "BaseGLRenderTarget: rawAddVertex: %s %s normal %s rgba (%.2f,%.2f.%.2f,%.2f) uv (%.4f,%.4f)\n",
                vertexCount, p, normal, r(), g(), b(), a(), u, v);
        setGLMode(verticesPerFace);
        glColor4f(r(), g(), b(), a());
        glNormal3d(normal.x, normal.y, normal.z);
        glTexCoord2d(u, v);
        glVertex3d(p.x, p.y, p.z);
    }

    protected void setGLMode(int mode) {
        if (glMode != mode) {
            if (glMode != 0) {
                if (debugGL) System.out.printf("BaseGLRenderTarget: glEnd()\n");
                glEnd();
            }
            glMode = mode;
            switch (glMode) {
                case 0:
                    break;
                case 3:
                    if (debugGL) System.out.printf("BaseGLRenderTarget: glBegin(GL_TRIANGLES)\n");
                    glBegin(GL_TRIANGLES);
                    break;
                case 4:
                    if (debugGL) System.out.printf("BaseGLRenderTarget: glBegin(GL_QUADS)\n");
                    glBegin(GL_QUADS);
                    break;
                default:
                    throw new IllegalStateException(String.format("Invalid glMode %s", glMode));
            }
        }
    }

    @Override
    public void finish() {
        setGLMode(0);
        setEmissiveMode(false);
        setTexturedMode(true);
        if (debugGL) System.out.printf("BaseGLRenderTarget: glPopAttrib()\n");
        glPopAttrib();
        super.finish();
    }

}


text:
/*
 * Antonin Bas (antonin@barefootnetworks.com)
 *
 */

#include "_assert.h"

#include <cstdlib>
#include <iostream>

namespace fmt {

void _assert(const char* expr, const char* file, int line) {
  std::cerr << "Assertion '" << expr << "' failed, file '" << file
            << "' line '" << line << "'.\n";
  std::abort();
}

}  // namespace fmt


text:
<!DOCTYPE HTML>

        <title>DJ N.Gattuso - Gallery</title>
        <meta charset="utf-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <meta name="author" content="Christopher McArthur"/>
        <meta name="description" content="Specialized DJ/VDJ for weddings, corporate and, many more private events. View pictures of events I have DJ at to get a feel for the experience and excellence I'll bring to your event. Montreal DJ N.Gattuso dj mtl."/>
        <meta name="keywords" content="Montreal DJ N.Gattuso dj mtl weddings wedding corporate private events"/>
        <link rel="alternate" hreflang="fr" href="../fr/gallery.html">

        <link rel="shortcut icon" href="../images/music-note.png"/>

        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

        <link rel="stylesheet" href="../assets/css/common.css"/>
        <link rel="stylesheet" href="../assets/css/gallery.css"/>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto"/>

                        DJ N.Gattuso

FR

Home

Information

Gallery

Samples

Contact

Facebook

Soundcloud

YouTube

Gallery

                                <video class="carosel-item" autoplay muted loop plays-inline poster="../images/gallery/IMG_2717.jpg" style="vertical-align: middle;">
                                    <source src="../images/gallery/VID_6398.webm" type="video/webm" alt='Specialized DJ/VDJ for weddings, corporate and, many more private events.Montreal DJ N.Gattuso dj mtl'>
                                    <source src="../images/gallery/VID_6398.ogv"  type="video/ogg"  alt='Specialized DJ/VDJ for weddings, corporate and, many more private events.Montreal DJ N.Gattuso dj mtl'>
                                    <source src="../images/gallery/VID_6398.mp4"  type="video/mp4"  alt='Specialized DJ/VDJ for weddings, corporate and, many more private events.Montreal DJ N.Gattuso dj mtl'>
                                </video>

                Facebook

                SoundCloud

                YouTube

© All Rights Resvered. Images: Nicholas Gattuso.


text:
Gamepad::Gamepad(const int index)
{
	this->index = index;
	if (this->isConnected(this->index))
	{
		cout << "Gamepad connected\n" << endl;
		cout << getID() << endl;
		active = true;
		buttons = getButtonCount(this->index);
		hasZ = hasAxis(this->index, Z);
	}
	else
	{
		cout << "Gamepad disconnected\n" << endl;
		active = false;
	}
}

Gamepad::~Gamepad()
{
}

string Gamepad::getID()
{
	Identification id = getIdentification(this->index);
	return
		"\n\tVendor ID: " + to_string(id.vendorId) +
		"\n\tJoystick use: " + id.name.toAnsiString() +
		"\n\tProduct ID: " + to_string(id.productId) +
		"\n\tButton count: " + to_string(buttons) +
		"\n\tHas z-axis: " + to_string(hasZ);
}

int Gamepad::getButtonPressed()
{
	for (int i = 0; i < buttons; i++)
		if (isButtonPressed(index, i))
			return i;
}


text:
We would love for you to contribute to `ngx-bootstrap` and help make it even better than it is
today! As a contributor, here are the guidelines we would like you to follow:

 - [Code of Conduct](#coc)
 - [Question or Problem?](#question)
 - [Issues and Bugs](#issue)
 - [Feature Requests](#feature)
 - [Submission Guidelines](#submit)
 - [Coding Rules](#rules)
 - [Commit Message Guidelines](#commit)

##  Code of Conduct
Please read and follow our [Code of Conduct][coc].

##  Got a Question or Problem?

Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on [Stack Overflow](https://stackoverflow.com/questions/tagged/ngx-bootstrap) where the questions should be tagged with tag `ngx-bootstrap`, or you can join to our [slack] channel.

Stack Overflow is a much better place to ask questions since:

- there are thousands of people willing to help on Stack Overflow
- questions and answers stay available for public viewing so your question / answer might help someone else
- Stack Overflow's voting system assures that the best answers are prominently visible.

To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow.

If you would like to chat about the question in real-time, you can reach out via [our slack channel][slack].

##  Found a Bug?
If you find a bug in the source code, you can help us by
[submitting an issue][submit-issue] to our [GitHub Repository][github]. Even better, you can
[submit a Pull Request][submit-pr] with a fix.

##  Missing a Feature?
You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub
Repository. If you would like to *implement* a new feature, please submit an issue with
a proposal for your work first, to be sure that we can use it.
Please consider what kind of change it is:

* For a **Major Feature**, first open an issue and outline your proposal so that it can be
discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,
and help you to craft the change so that it is successfully accepted into the project.
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).

##  Submission Guidelines

###  Submitting an Issue

Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.

We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. In order to reproduce bugs we will systematically ask you to provide a minimal reproduction scenario using [plunker]. Having a live, reproducible scenario gives us wealth of important information without going back & forth to you with additional questions like:

- version of Angular used
- version on ngx-bootstrap used
- build system: angular cli, system.js, starter seed used
- and most importantly - a use-case that fails

A minimal reproduce scenario using [plunker] allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem. If plunker is not a suitable way to demonstrate the problem (for example for issues related to our npm packaging), please create a standalone git repository demonstrating the problem.

We will be insisting on a minimal reproduce scenario in order to save maintainers time and ultimately be able to fix more bugs. Interestingly, from our experience users often find coding problems themselves while preparing a minimal plunk. We understand that sometimes it might be hard to extract essentials bits of code from a larger code-base but we really need to isolate the problem before we can fix it.

Unfortunately we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you we are going to close an issue that don't have enough info to be reproduced.

You can file new issues by filling out our [new issue form](https://github.com/valor-software/ngx-bootstrap/issues/new).

###  Submitting a Pull Request (PR)
Before you submit your Pull Request (PR) consider the following guidelines:

* Search [GitHub](https://github.com/valor-software/ngx-bootstrap/pulls) for an open or closed PR
  that relates to your submission. You don't want to duplicate effort.
* To build lib for development, follow [this manual](https://github.com/valor-software/ngx-bootstrap#how-to-build-lib-for-development)
* Make your changes in a new git branch:

     ```shell
     git checkout -b my-fix-branch development
     ```

* Create your patch, **including appropriate test cases**.
* Follow our [Coding Rules](#rules).
* Run `npm run test` and ensure that all tests pass.
* Commit your changes using a descriptive commit message that follows our
  [commit message conventions](#commit). Adherence to these conventions
  is necessary because release notes are automatically generated from these messages.

     ```shell
     git commit -a
     ```
  Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.

* Push your branch to GitHub:

    ```shell
    git push origin my-fix-branch
    ```

* In GitHub, send a pull request to `development` branch.
* If we suggest changes then:
  * Make the required updates.
  * Re-run `npm run test` to ensure tests are still passing.
  * Push to your GitHub repository (this will update your Pull Request):

That's it! Thank you for your contribution!

#### After your pull request is merged

After your pull request is merged, you can safely delete your branch and pull the changes
from the main (upstream) repository:

* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:

    ```shell
    git push origin --delete my-fix-branch
    ```

* Check out the development branch:

    ```shell
    git checkout development -f
    ```

* Delete the local branch:

    ```shell
    git branch -D my-fix-branch
    ```

* Update your development with the latest upstream version:

    ```shell
    git pull --ff upstream development
    ```

##  Coding Rules
To ensure consistency throughout the source code, keep these rules in mind as you are working:

* All features or bug fixes **must be tested** by one or more specs (unit-tests).
* All public API methods **must be documented**. (Details TBC).
* We follow [Google's JavaScript Style Guide][js-style-guide].

##  Commit Message Guidelines

We have very precise rules over how our git commit messages can be formatted.  This leads to **more
readable messages** that are easy to follow when looking through the **project history**.  But also,
we use the git commit messages to **generate the ngx-bootstrap change log**.

### Commit Message Format
Each commit message consists of a **header**, a **body** and a **footer**.  The header has a special
format that includes a **type**, a **scope** and a **subject**:

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory and the **scope** of the header is optional.

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
to read on GitHub as well as in various git tools.

Footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.

Samples: (even more [samples](https://github.com/valor-software/ngx-bootstrap/commits/development))

```
docs(changelog): update change log to beta.5
```
```
fix(release): need to depend on latest rxjs and zone.js

The version in our package.json gets copied to the one we publish, and users need the latest of these.
```

### Revert
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.

### Type
Must be one of the following:

* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, SauceLabs)
* **docs**: Documentation only changes
* **feat**: A new feature
* **fix**: A bug fix
* **perf**: A code change that improves performance
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* **test**: Adding missing tests or correcting existing tests

### Scope
The scope should be the name of the npm package affected (as perceived by person reading changelog generated from commit messages.

The following is the list of supported scopes:

* **accordion**
* **alerts**
* **buttons**
* **carousel**
* **collapse**
* **datepicker**
* **dropdown**
* **modal**
* **pagination**
* **popover**
* **progressbar**
* **rating**
* **sortable**
* **tabs**
* **timepicker**
* **tooltip**
* **typeahead**

### Subject
The subject contains succinct description of the change:

* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize first letter
* no dot (.) at the end

### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

### Footer
The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.

A detailed explanation can be found in this [document][commit-message-format].

## Attribution

This `CONTRIBUTING.md` is adapted from the Angular's `CONTRIBUTING.md`, available at https://github.com/angular/angular/blob/master/CONTRIBUTING.md

[coc]: https://github.com/valor-software/ngx-bootstrap/blob/development/CODE_OF_CONDUCT.md
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
[github]: https://github.com/valor-software/ngx-bootstrap
[slack]: https://ngx-slack.herokuapp.com
[js-style-guide]: https://google.github.io/styleguide/jsguide.html
[plunker]: http://plnkr.co/edit
[stackoverflow]: http://stackoverflow.com/questions/tagged/ngx-bootstrap
[submit-issue]: https://github.com/valor-software/ngx-bootstrap/issues/new
[submit-pr]: https://github.com/valor-software/ngx-bootstrap/compare


text:
package org.apache.eagle.security.auditlog;

import backtype.storm.task.OutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseRichBolt;
import backtype.storm.tuple.Fields;
import backtype.storm.tuple.Tuple;
import org.apache.eagle.security.hdfs.MAPRFSAuditLogObject;
import org.apache.eagle.security.hdfs.MAPRFSAuditLogParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;
import java.util.Map;
import java.util.TreeMap;

/**
 * Since 8/11/16.
 */
public class MapRFSAuditLogParserBolt extends BaseRichBolt {
    private static Logger LOG = LoggerFactory.getLogger(MapRFSAuditLogParserBolt.class);
    private OutputCollector collector;

    @Override
    public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
        this.collector = collector;
    }

    @Override
    public void execute(Tuple input) {
        String logLine = input.getString(0);

        MAPRFSAuditLogParser parser = new MAPRFSAuditLogParser();
        MAPRFSAuditLogObject entity = null;
        try {
            entity = parser.parse(logLine);
            Map<String, Object> map = new TreeMap<String, Object>();
            map.put("src", entity.src);
            map.put("dst", entity.dst);
            map.put("host", entity.host);
            map.put("timestamp", entity.timestamp);
            map.put("status", entity.status);
            map.put("user", entity.user);
            map.put("cmd", entity.cmd);
            map.put("volume", entity.volume);
            collector.emit(Arrays.asList(map));
        } catch (Exception ex) {
            LOG.error("Failing parse audit log message", ex);
        }
    }

    @Override
    public void declareOutputFields(OutputFieldsDeclarer declarer) {
        declarer.declare(new Fields("f1"));
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:orientation="vertical"
  android:background="#ffffcc"
  android:layout_height="fill_parent">
    <FrameLayout
    android:layout_width="fill_parent"
    android:layout_height="40dip"
    android:background="@drawable/title">
    <TextView
    	android:text="列车查询系统"
    	android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		android:layout_marginTop="0dip"
		android:layout_marginBottom="0dip"
		android:layout_marginLeft="0dip"
		android:textSize="20dip"
		android:textColor="#FFFFFF"
		android:textStyle="bold"
		android:gravity="center">
    </TextView>
     </FrameLayout>

<LinearLayout
    	android:orientation="horizontal"
    	android:layout_width="fill_parent"
    	android:layout_height="wrap_content"
    	android:layout_marginLeft="15dip"
    	android:layout_marginRight="15dip"
    	android:layout_marginTop="4dip"
    	android:layout_marginBottom="4dip"
    	android:gravity="center"
    	android:background="@drawable/navigator"
    >
    <TextView
    	android:text="列车信息"
    	android:gravity="center"
    	android:textSize="18dip"
    	android:layout_width="100dip"
		android:layout_height="wrap_content"
		android:layout_marginLeft="10dip"
		android:textColor="#FFFFFF"
		android:textStyle="bold">
	</TextView>
    <TextView
    	android:text="途经车站"
    	android:gravity="center"
    	android:textSize="18dip"
    	android:layout_width="100dip"
		android:layout_height="wrap_content"
		android:layout_marginLeft="10dip"
		android:textColor="#FFFFFF"
		android:textStyle="bold"
		android:background="@drawable/hilight">
	</TextView>
    </LinearLayout>

    <LinearLayout
	   android:orientation="horizontal"
	   android:layout_width="fill_parent"
	   android:layout_height="wrap_content"
	   android:background="#ffcc99">
		   <TextView
		   android:id="@+id/listview_pass01"
		   android:text="车站"
		   android:textSize="15sp"
		   android:textColor="@color/red"
		   android:layout_marginLeft="65dp"
		   android:layout_width="wrap_content"
		   android:layout_height="wrap_content">
	   	   </TextView>
	   	   <TextView
		   android:id="@+id/listview_pass02"
		   android:text="到时"
		   android:textColor="@color/red"
		   android:textSize="15sp"
		   android:layout_marginLeft="120dp"
		   android:layout_width="wrap_content"
		   android:layout_height="wrap_content">
	   	   </TextView>
	   	   <TextView
		   android:id="@+id/listview_pass03"
		   android:text="发时"
		   android:textColor="@color/red"
		   android:textSize="15sp"
		   android:layout_marginLeft="117dp"
		   android:layout_width="wrap_content"
		   android:layout_height="wrap_content">
	   	   </TextView>
    </LinearLayout>

       <ListView
	      android:id="@+id/ListView_passstation"
	      android:layout_width="fill_parent"
	      android:layout_height="wrap_content"
	      android:choiceMode="singleChoice"
	      android:background="#ffcc66"
	      android:cacheColorHint="#00000000" >
	   </ListView>
</LinearLayout>


text:
alias search='grep -r -i --binary-files=without-match'
alias agt="ag --ignore=third_party --ignore=tags --ignore='*_test.*'"
alias ag='ag --ignore=third_party --ignore=tags --ignore=dist --ignore="*min.js" --ignore=junit.xml --ignore="*.min.css" --ignore=stats --ignore=lcov.info --ignore lcov-report'
alias agp="ag --ignore=third_party --ignore=tags --ignore=third_party --ignore='*.(js)(jsx)(html)(less)(css)'"

# alias ydl="youtube-dl -f 'bestvideo[height<=720][fps<=30]+bestaudio/best'"
alias ydl="youtube-dl -f 'best[height<=720][fps<=?30]'"
alias ydl480="youtube-dl -f 'bestvideo[height<=480][fps<=?30]+bestaudio/best'"
alias tdl="youtube-dl -f 720p"
alias tdl480="youtube-dl -f 480p"
alias yy='url=$(pbpaste); echo $url; until ydl $url; do sleep 1; done'
alias y='cd ~/Videos; url=$(pbpaste); echo $url; until ydl $url; do sleep 1; done'

# alias workoff='deactivate'
alias tmux='tmux -2'
alias j=z
# alias v='vagrant'
# alias vs='vagrant status | grep -v -e "Current VM" -e "This environment" -e "above with" -e "VM, run" | sed "/^$/d" | sort'
# alias vss="vs | grep -v 'not created'"
# alias vsshh="ssh -q -F ./.ssh_config"
# alias vu='vagrant up'
# alias vd='vagrant destroy'
alias dc='docker-compose'
# alias updatedb='sudo /usr/libexec/locate.updatedb'
# alias t='./tools/runtests.py'
# alias tsat='./tools/runtests.py api.internal.test.sat_test sat'

alias gs=''

alias g='git'
alias gr="GIT_EDITOR=\"vim -c \\\"1,'}-1s/\n/\rx git diff origin\/master | pep8 --diff --count --exclude \\\"__init__.py\\\"\r/g | nohlsearch \\\"\" git rebase -i"
alias grecent="git --no-pager log --pretty=format:'%C(yellow)%h %Creset%s %C(dim)%ar%Creset' --all --since=2.weeks.ago --author=Sergei"

alias mfiles='git diff master --name-only --diff-filter=ACMR'
alias dlint='(mfiles | grep -v "^tests/" | grep ".py$" | xargs bin/pylint); (mfiles | grep "^tests/" | grep ".py$" | xargs bin/pylint | grep 'Unused')'
alias dpep8='mfiles | grep ".py$" | xargs bin/pep8 -r'
alias dint='make integration-coverage 2>&1 | egrep `mfiles | sed "s/\//\./g" | sed "s/\.py$//g" | xargs | sed "s/ /|/g"` | grep -v "100%"'
alias dcov='make coverage 2>&1 | egrep `mfiles | sed "s/\//\./g" | sed "s/\.py$//g" | xargs | sed "s/ /|/g"` | grep -v "100%"'
alias num_lines='git diff master | grep -E "^[+-]([^+-]|$)" | wc -l'

alias resolutionl='cp ~/Documents/movewindows/resolutionLaptop ~/Documents/movewindows/resolution'
alias resolutione='cp ~/Documents/movewindows/resolutionExternal ~/Documents/movewindows/resolution'

alias webshare='python -m SimpleHTTPServer'

# alias -g G='| grep'

alias mi='make integration-test'
alias mtdd='make tdd 2>&1| lolcat'
alias mt='make test'
alias mu='make unit-test'


text:
import type {AnyNativeEvent} from 'legacy-events/PluginModuleType';
import type {Container, SuspenseInstance} from '../client/ReactDOMHostConfig';
import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes';
import type {EventSystemFlags} from 'legacy-events/EventSystemFlags';
import type {FiberRoot} from 'react-reconciler/src/ReactFiberRoot';

import {
  enableFlareAPI,
  enableSelectiveHydration,
} from 'shared/ReactFeatureFlags';
import {
  unstable_runWithPriority as runWithPriority,
  unstable_scheduleCallback as scheduleCallback,
  unstable_NormalPriority as NormalPriority,
  unstable_getCurrentPriorityLevel as getCurrentPriorityLevel,
} from 'scheduler';
import {
  getNearestMountedFiber,
  getContainerFromFiber,
  getSuspenseInstanceFromFiber,
} from 'react-reconciler/reflection';
import {
  attemptToDispatchEvent,
  addResponderEventSystemEvent,
} from './ReactDOMEventListener';
import {
  getListenerMapForElement,
  listenToTopLevel,
} from './ReactBrowserEventEmitter';
import {
  getInstanceFromNode,
  getClosestInstanceFromNode,
} from '../client/ReactDOMComponentTree';
import {unsafeCastDOMTopLevelTypeToString} from 'legacy-events/TopLevelEventTypes';
import {HostRoot, SuspenseComponent} from 'shared/ReactWorkTags';

let attemptSynchronousHydration: (fiber: Object) => void;

export function setAttemptSynchronousHydration(fn: (fiber: Object) => void) {
  attemptSynchronousHydration = fn;
}

let attemptUserBlockingHydration: (fiber: Object) => void;

export function setAttemptUserBlockingHydration(fn: (fiber: Object) => void) {
  attemptUserBlockingHydration = fn;
}

let attemptContinuousHydration: (fiber: Object) => void;

export function setAttemptContinuousHydration(fn: (fiber: Object) => void) {
  attemptContinuousHydration = fn;
}

let attemptHydrationAtCurrentPriority: (fiber: Object) => void;

export function setAttemptHydrationAtCurrentPriority(
  fn: (fiber: Object) => void,
) {
  attemptHydrationAtCurrentPriority = fn;
}

// TODO: Upgrade this definition once we're on a newer version of Flow that
// has this definition built-in.
type PointerEvent = Event & {
  pointerId: number,
  relatedTarget: EventTarget | null,
};

import {
  TOP_MOUSE_DOWN,
  TOP_MOUSE_UP,
  TOP_TOUCH_CANCEL,
  TOP_TOUCH_END,
  TOP_TOUCH_START,
  TOP_AUX_CLICK,
  TOP_DOUBLE_CLICK,
  TOP_POINTER_CANCEL,
  TOP_POINTER_DOWN,
  TOP_POINTER_UP,
  TOP_DRAG_END,
  TOP_DRAG_START,
  TOP_DROP,
  TOP_COMPOSITION_END,
  TOP_COMPOSITION_START,
  TOP_KEY_DOWN,
  TOP_KEY_PRESS,
  TOP_KEY_UP,
  TOP_INPUT,
  TOP_TEXT_INPUT,
  TOP_CLOSE,
  TOP_CANCEL,
  TOP_COPY,
  TOP_CUT,
  TOP_PASTE,
  TOP_CLICK,
  TOP_CHANGE,
  TOP_CONTEXT_MENU,
  TOP_RESET,
  TOP_SUBMIT,
  TOP_DRAG_ENTER,
  TOP_DRAG_LEAVE,
  TOP_MOUSE_OVER,
  TOP_MOUSE_OUT,
  TOP_POINTER_OVER,
  TOP_POINTER_OUT,
  TOP_GOT_POINTER_CAPTURE,
  TOP_LOST_POINTER_CAPTURE,
  TOP_FOCUS,
  TOP_BLUR,
} from './DOMTopLevelEventTypes';
import {IS_REPLAYED} from 'legacy-events/EventSystemFlags';

type QueuedReplayableEvent = {|
  blockedOn: null | Container | SuspenseInstance,
  topLevelType: DOMTopLevelEventType,
  eventSystemFlags: EventSystemFlags,
  nativeEvent: AnyNativeEvent,
|};

let hasScheduledReplayAttempt = false;

// The queue of discrete events to be replayed.
let queuedDiscreteEvents: Array<QueuedReplayableEvent> = [];

// Indicates if any continuous event targets are non-null for early bailout.
let hasAnyQueuedContinuousEvents: boolean = false;
// The last of each continuous event type. We only need to replay the last one
// if the last target was dehydrated.
let queuedFocus: null | QueuedReplayableEvent = null;
let queuedDrag: null | QueuedReplayableEvent = null;
let queuedMouse: null | QueuedReplayableEvent = null;
// For pointer events there can be one latest event per pointerId.
let queuedPointers: Map<number, QueuedReplayableEvent> = new Map();
let queuedPointerCaptures: Map<number, QueuedReplayableEvent> = new Map();
// We could consider replaying selectionchange and touchmoves too.

type QueuedHydrationTarget = {|
  blockedOn: null | Container | SuspenseInstance,
  target: Node,
  priority: number,
|};
let queuedExplicitHydrationTargets: Array<QueuedHydrationTarget> = [];

export function hasQueuedDiscreteEvents(): boolean {
  return queuedDiscreteEvents.length > 0;
}

export function hasQueuedContinuousEvents(): boolean {
  return hasAnyQueuedContinuousEvents;
}

const discreteReplayableEvents = [
  TOP_MOUSE_DOWN,
  TOP_MOUSE_UP,
  TOP_TOUCH_CANCEL,
  TOP_TOUCH_END,
  TOP_TOUCH_START,
  TOP_AUX_CLICK,
  TOP_DOUBLE_CLICK,
  TOP_POINTER_CANCEL,
  TOP_POINTER_DOWN,
  TOP_POINTER_UP,
  TOP_DRAG_END,
  TOP_DRAG_START,
  TOP_DROP,
  TOP_COMPOSITION_END,
  TOP_COMPOSITION_START,
  TOP_KEY_DOWN,
  TOP_KEY_PRESS,
  TOP_KEY_UP,
  TOP_INPUT,
  TOP_TEXT_INPUT,
  TOP_CLOSE,
  TOP_CANCEL,
  TOP_COPY,
  TOP_CUT,
  TOP_PASTE,
  TOP_CLICK,
  TOP_CHANGE,
  TOP_CONTEXT_MENU,
  TOP_RESET,
  TOP_SUBMIT,
];

const continuousReplayableEvents = [
  TOP_FOCUS,
  TOP_BLUR,
  TOP_DRAG_ENTER,
  TOP_DRAG_LEAVE,
  TOP_MOUSE_OVER,
  TOP_MOUSE_OUT,
  TOP_POINTER_OVER,
  TOP_POINTER_OUT,
  TOP_GOT_POINTER_CAPTURE,
  TOP_LOST_POINTER_CAPTURE,
];

export function isReplayableDiscreteEvent(
  eventType: DOMTopLevelEventType,
): boolean {
  return discreteReplayableEvents.indexOf(eventType) > -1;
}

function trapReplayableEvent(
  topLevelType: DOMTopLevelEventType,
  document: Document,
  listenerMap: Map<DOMTopLevelEventType | string, null | (any => void)>,
) {
  listenToTopLevel(topLevelType, document, listenerMap);
  if (enableFlareAPI) {
    // Trap events for the responder system.
    const topLevelTypeString = unsafeCastDOMTopLevelTypeToString(topLevelType);
    const passiveEventKey = topLevelTypeString + '_passive';
    if (!listenerMap.has(passiveEventKey)) {
      const listener = addResponderEventSystemEvent(
        document,
        topLevelTypeString,
        true,
      );
      listenerMap.set(passiveEventKey, listener);
    }
  }
}

export function eagerlyTrapReplayableEvents(document: Document) {
  const listenerMap = getListenerMapForElement(document);
  // Discrete
  discreteReplayableEvents.forEach(topLevelType => {
    trapReplayableEvent(topLevelType, document, listenerMap);
  });
  // Continuous
  continuousReplayableEvents.forEach(topLevelType => {
    trapReplayableEvent(topLevelType, document, listenerMap);
  });
}

function createQueuedReplayableEvent(
  blockedOn: null | Container | SuspenseInstance,
  topLevelType: DOMTopLevelEventType,
  eventSystemFlags: EventSystemFlags,
  nativeEvent: AnyNativeEvent,
): QueuedReplayableEvent {
  return {
    blockedOn,
    topLevelType,
    eventSystemFlags: eventSystemFlags | IS_REPLAYED,
    nativeEvent,
  };
}

export function queueDiscreteEvent(
  blockedOn: null | Container | SuspenseInstance,
  topLevelType: DOMTopLevelEventType,
  eventSystemFlags: EventSystemFlags,
  nativeEvent: AnyNativeEvent,
): void {
  const queuedEvent = createQueuedReplayableEvent(
    blockedOn,
    topLevelType,
    eventSystemFlags,
    nativeEvent,
  );
  queuedDiscreteEvents.push(queuedEvent);
  if (enableSelectiveHydration) {
    if (queuedDiscreteEvents.length === 1) {
      // If this was the first discrete event, we might be able to
      // synchronously unblock it so that preventDefault still works.
      while (queuedEvent.blockedOn !== null) {
        let fiber = getInstanceFromNode(queuedEvent.blockedOn);
        if (fiber === null) {
          break;
        }
        attemptSynchronousHydration(fiber);
        if (queuedEvent.blockedOn === null) {
          // We got unblocked by hydration. Let's try again.
          replayUnblockedEvents();
          // If we're reblocked, on an inner boundary, we might need
          // to attempt hydrating that one.
          continue;
        } else {
          // We're still blocked from hydation, we have to give up
          // and replay later.
          break;
        }
      }
    }
  }
}

// Resets the replaying for this type of continuous event to no event.
export function clearIfContinuousEvent(
  topLevelType: DOMTopLevelEventType,
  nativeEvent: AnyNativeEvent,
): void {
  switch (topLevelType) {
    case TOP_FOCUS:
    case TOP_BLUR:
      queuedFocus = null;
      break;
    case TOP_DRAG_ENTER:
    case TOP_DRAG_LEAVE:
      queuedDrag = null;
      break;
    case TOP_MOUSE_OVER:
    case TOP_MOUSE_OUT:
      queuedMouse = null;
      break;
    case TOP_POINTER_OVER:
    case TOP_POINTER_OUT: {
      let pointerId = ((nativeEvent: any): PointerEvent).pointerId;
      queuedPointers.delete(pointerId);
      break;
    }
    case TOP_GOT_POINTER_CAPTURE:
    case TOP_LOST_POINTER_CAPTURE: {
      let pointerId = ((nativeEvent: any): PointerEvent).pointerId;
      queuedPointerCaptures.delete(pointerId);
      break;
    }
  }
}

function accumulateOrCreateContinuousQueuedReplayableEvent(
  existingQueuedEvent: null | QueuedReplayableEvent,
  blockedOn: null | Container | SuspenseInstance,
  topLevelType: DOMTopLevelEventType,
  eventSystemFlags: EventSystemFlags,
  nativeEvent: AnyNativeEvent,
): QueuedReplayableEvent {
  if (
    existingQueuedEvent === null ||
    existingQueuedEvent.nativeEvent !== nativeEvent
  ) {
    let queuedEvent = createQueuedReplayableEvent(
      blockedOn,
      topLevelType,
      eventSystemFlags,
      nativeEvent,
    );
    if (blockedOn !== null) {
      let fiber = getInstanceFromNode(blockedOn);
      if (fiber !== null) {
        // Attempt to increase the priority of this target.
        attemptContinuousHydration(fiber);
      }
    }
    return queuedEvent;
  }
  // If we have already queued this exact event, then it's because
  // the different event systems have different DOM event listeners.
  // We can accumulate the flags and store a single event to be
  // replayed.
  existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
  return existingQueuedEvent;
}

export function queueIfContinuousEvent(
  blockedOn: null | Container | SuspenseInstance,
  topLevelType: DOMTopLevelEventType,
  eventSystemFlags: EventSystemFlags,
  nativeEvent: AnyNativeEvent,
): boolean {
  // These set relatedTarget to null because the replayed event will be treated as if we
  // moved from outside the window (no target) onto the target once it hydrates.
  // Instead of mutating we could clone the event.
  switch (topLevelType) {
    case TOP_FOCUS: {
      const focusEvent = ((nativeEvent: any): FocusEvent);
      queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(
        queuedFocus,
        blockedOn,
        topLevelType,
        eventSystemFlags,
        focusEvent,
      );
      return true;
    }
    case TOP_DRAG_ENTER: {
      const dragEvent = ((nativeEvent: any): DragEvent);
      queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(
        queuedDrag,
        blockedOn,
        topLevelType,
        eventSystemFlags,
        dragEvent,
      );
      return true;
    }
    case TOP_MOUSE_OVER: {
      const mouseEvent = ((nativeEvent: any): MouseEvent);
      queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(
        queuedMouse,
        blockedOn,
        topLevelType,
        eventSystemFlags,
        mouseEvent,
      );
      return true;
    }
    case TOP_POINTER_OVER: {
      const pointerEvent = ((nativeEvent: any): PointerEvent);
      const pointerId = pointerEvent.pointerId;
      queuedPointers.set(
        pointerId,
        accumulateOrCreateContinuousQueuedReplayableEvent(
          queuedPointers.get(pointerId) || null,
          blockedOn,
          topLevelType,
          eventSystemFlags,
          pointerEvent,
        ),
      );
      return true;
    }
    case TOP_GOT_POINTER_CAPTURE: {
      const pointerEvent = ((nativeEvent: any): PointerEvent);
      const pointerId = pointerEvent.pointerId;
      queuedPointerCaptures.set(
        pointerId,
        accumulateOrCreateContinuousQueuedReplayableEvent(
          queuedPointerCaptures.get(pointerId) || null,
          blockedOn,
          topLevelType,
          eventSystemFlags,
          pointerEvent,
        ),
      );
      return true;
    }
  }
  return false;
}

// Check if this target is unblocked. Returns true if it's unblocked.
function attemptExplicitHydrationTarget(
  queuedTarget: QueuedHydrationTarget,
): void {
  // TODO: This function shares a lot of logic with attemptToDispatchEvent.
  // Try to unify them. It's a bit tricky since it would require two return
  // values.
  let targetInst = getClosestInstanceFromNode(queuedTarget.target);
  if (targetInst !== null) {
    let nearestMounted = getNearestMountedFiber(targetInst);
    if (nearestMounted !== null) {
      const tag = nearestMounted.tag;
      if (tag === SuspenseComponent) {
        let instance = getSuspenseInstanceFromFiber(nearestMounted);
        if (instance !== null) {
          // We're blocked on hydrating this boundary.
          // Increase its priority.
          queuedTarget.blockedOn = instance;
          runWithPriority(queuedTarget.priority, () => {
            attemptHydrationAtCurrentPriority(nearestMounted);
          });
          return;
        }
      } else if (tag === HostRoot) {
        const root: FiberRoot = nearestMounted.stateNode;
        if (root.hydrate) {
          queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
          // We don't currently have a way to increase the priority of
          // a root other than sync.
          return;
        }
      }
    }
  }
  queuedTarget.blockedOn = null;
}

export function queueExplicitHydrationTarget(target: Node): void {
  if (enableSelectiveHydration) {
    let priority = getCurrentPriorityLevel();
    const queuedTarget: QueuedHydrationTarget = {
      blockedOn: null,
      target: target,
      priority: priority,
    };
    let i = 0;
    for (; i < queuedExplicitHydrationTargets.length; i++) {
      if (priority <= queuedExplicitHydrationTargets[i].priority) {
        break;
      }
    }
    queuedExplicitHydrationTargets.splice(i, 0, queuedTarget);
    if (i === 0) {
      attemptExplicitHydrationTarget(queuedTarget);
    }
  }
}

function attemptReplayContinuousQueuedEvent(
  queuedEvent: QueuedReplayableEvent,
): boolean {
  if (queuedEvent.blockedOn !== null) {
    return false;
  }
  let nextBlockedOn = attemptToDispatchEvent(
    queuedEvent.topLevelType,
    queuedEvent.eventSystemFlags,
    queuedEvent.nativeEvent,
  );
  if (nextBlockedOn !== null) {
    // We're still blocked. Try again later.
    let fiber = getInstanceFromNode(nextBlockedOn);
    if (fiber !== null) {
      attemptContinuousHydration(fiber);
    }
    queuedEvent.blockedOn = nextBlockedOn;
    return false;
  }
  return true;
}

function attemptReplayContinuousQueuedEventInMap(
  queuedEvent: QueuedReplayableEvent,
  key: number,
  map: Map<number, QueuedReplayableEvent>,
): void {
  if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
    map.delete(key);
  }
}

function replayUnblockedEvents() {
  hasScheduledReplayAttempt = false;
  // First replay discrete events.
  while (queuedDiscreteEvents.length > 0) {
    let nextDiscreteEvent = queuedDiscreteEvents[0];
    if (nextDiscreteEvent.blockedOn !== null) {
      // We're still blocked.
      // Increase the priority of this boundary to unblock
      // the next discrete event.
      let fiber = getInstanceFromNode(nextDiscreteEvent.blockedOn);
      if (fiber !== null) {
        attemptUserBlockingHydration(fiber);
      }
      break;
    }
    let nextBlockedOn = attemptToDispatchEvent(
      nextDiscreteEvent.topLevelType,
      nextDiscreteEvent.eventSystemFlags,
      nextDiscreteEvent.nativeEvent,
    );
    if (nextBlockedOn !== null) {
      // We're still blocked. Try again later.
      nextDiscreteEvent.blockedOn = nextBlockedOn;
    } else {
      // We've successfully replayed the first event. Let's try the next one.
      queuedDiscreteEvents.shift();
    }
  }
  // Next replay any continuous events.
  if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
    queuedFocus = null;
  }
  if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
    queuedDrag = null;
  }
  if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
    queuedMouse = null;
  }
  queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
  queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
}

function scheduleCallbackIfUnblocked(
  queuedEvent: QueuedReplayableEvent,
  unblocked: Container | SuspenseInstance,
) {
  if (queuedEvent.blockedOn === unblocked) {
    queuedEvent.blockedOn = null;
    if (!hasScheduledReplayAttempt) {
      hasScheduledReplayAttempt = true;
      // Schedule a callback to attempt replaying as many events as are
      // now unblocked. This first might not actually be unblocked yet.
      // We could check it early to avoid scheduling an unnecessary callback.
      scheduleCallback(NormalPriority, replayUnblockedEvents);
    }
  }
}

export function retryIfBlockedOn(
  unblocked: Container | SuspenseInstance,
): void {
  // Mark anything that was blocked on this as no longer blocked
  // and eligible for a replay.
  if (queuedDiscreteEvents.length > 0) {
    scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
    // This is a exponential search for each boundary that commits. I think it's
    // worth it because we expect very few discrete events to queue up and once
    // we are actually fully unblocked it will be fast to replay them.
    for (let i = 1; i < queuedDiscreteEvents.length; i++) {
      let queuedEvent = queuedDiscreteEvents[i];
      if (queuedEvent.blockedOn === unblocked) {
        queuedEvent.blockedOn = null;
      }
    }
  }

  if (queuedFocus !== null) {
    scheduleCallbackIfUnblocked(queuedFocus, unblocked);
  }
  if (queuedDrag !== null) {
    scheduleCallbackIfUnblocked(queuedDrag, unblocked);
  }
  if (queuedMouse !== null) {
    scheduleCallbackIfUnblocked(queuedMouse, unblocked);
  }
  const unblock = queuedEvent =>
    scheduleCallbackIfUnblocked(queuedEvent, unblocked);
  queuedPointers.forEach(unblock);
  queuedPointerCaptures.forEach(unblock);

  for (let i = 0; i < queuedExplicitHydrationTargets.length; i++) {
    let queuedTarget = queuedExplicitHydrationTargets[i];
    if (queuedTarget.blockedOn === unblocked) {
      queuedTarget.blockedOn = null;
    }
  }

  while (queuedExplicitHydrationTargets.length > 0) {
    let nextExplicitTarget = queuedExplicitHydrationTargets[0];
    if (nextExplicitTarget.blockedOn !== null) {
      // We're still blocked.
      break;
    } else {
      attemptExplicitHydrationTarget(nextExplicitTarget);
      if (nextExplicitTarget.blockedOn === null) {
        // We're unblocked.
        queuedExplicitHydrationTargets.shift();
      }
    }
  }
}


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

-->

<Keyboard
    xmlns:latin="http://schemas.android.com/apk/res-auto"
>
    <include
        latin:keyboardLayout="@xml/key_styles_common" />

    <switch>
        <case latin:showNumberRow="true">
            <include latin:keyboardLayout="@xml/rowkeys_qwerty0" />

            <include
                latin:keyboardLayout="@xml/rows_swiss"
                latin:rowHeight="21.25%p" />
        </case>
        <default>
            <include latin:keyboardLayout="@xml/rows_swiss" />
        </default>
    </switch>
</Keyboard>


text:
<!DOCTYPE html>

    <title></title>